# Conflicts:
#	src/views/market/apitest/index.vue
pull/7/head^2
Aaaaaaaa 2024-09-08 18:59:13 +08:00
commit 1413264068
1 changed files with 36 additions and 14 deletions

View File

@ -285,7 +285,7 @@
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible1 = false"> </el-button> <el-button @click="dialogVisible1 = false"> </el-button>
<el-button type="primary" @click="confirmSelection(row)"> </el-button> <el-button type="primary" @click="dialogVisible1 = false"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -384,10 +384,14 @@ export default {
if (response.code!=200){ if (response.code!=200){
alert(response.msg) alert(response.msg)
}else { }else {
alert(JSON.stringify(myapi)) this.getproduct(myapi)
this.getproductspecification(myapi)
this.dialogVisible1=true this.dialogVisible1=true
this.newapi={
productName: myapi.productName,
productPrice: myapi.productPrice,
productContent: myapi.productContent,
productSpecification: myapi.productSpecification
}
} }
}) })
}, },
@ -413,6 +417,15 @@ export default {
this.tableData=response.data this.tableData=response.data
}) })
}, },
//
handleEdit(row){
this.newapi={
productName:this.myapi.productName,
productSpecification: row.productSpecificationName,
productPrice: row.middlePrice,
productContent:this.myapi.productContent,
}
},
// //
noForm(ruleForm){ noForm(ruleForm){
sendrequest2(ruleForm).then(response=>{ sendrequest2(ruleForm).then(response=>{
@ -450,9 +463,23 @@ export default {
container.appendChild(resultDiv); container.appendChild(resultDiv);
}) })
//-1 //-1
reducetestcount(this.myapi).then(response=>{ reducetestcount(this.myapi).then(response=>{})
}) }, },
//
submitForm(ruleForm){
sendrequest(ruleForm).then(response=>{
const jsonData = response.data;
// 使JSON.stringify()JSON2
const formattedJson = JSON.stringify(jsonData, null, 2);
// <pre>innerHTMLJSON
document.getElementById('json-display').innerHTML = formattedJson;
})
//-1
reducetestcount(this.myapi).then(response=>{
})
},
// //
newsForm(ruleForm) { newsForm(ruleForm) {
if (ruleForm.productName=='新闻头条'){ if (ruleForm.productName=='新闻头条'){
@ -521,10 +548,6 @@ export default {
const jsonData = JSON.parse(jsonData1); const jsonData = JSON.parse(jsonData1);
}); });
}}, }},
handleEdit(row) {
this.selectedRow = row;
console.log(row)
},
confirmSelection(row) { confirmSelection(row) {
this.dialogVisible1=false this.dialogVisible1=false
if (this.selectedRow) { if (this.selectedRow) {
@ -563,12 +586,9 @@ export default {
// div // div
container.appendChild(resultDiv); container.appendChild(resultDiv);
})
} }
//-1 //-1
reducetestcount(this.myapi).then(response=>{}) reducetestcount(this.myapi).then(response=>{})
} }
}, },
// - 访this", // - 访this",
@ -577,6 +597,8 @@ export default {
// -` 访DOM", // -` 访DOM",
mounted() { mounted() {
this.myapi = this.$route.query.myapi this.myapi = this.$route.query.myapi
this.getHeader(this.myapi)
this.getRequest((this.myapi))
if (typeof this.myapi === 'string' && this.myapi.trim() !== '') { if (typeof this.myapi === 'string' && this.myapi.trim() !== '') {
try { try {
this.myapi = JSON.parse(this.myapi); this.myapi = JSON.parse(this.myapi);