修改返回结构弹窗

master
ZhiShuo_Lou 2023-12-03 10:00:23 +08:00
parent 92f65e2be7
commit b906cdbe17
1 changed files with 16 additions and 7 deletions

View File

@ -31,7 +31,6 @@
</el-form> </el-form>
<el-button type="success" plain @click="upiInsertDialog" icon="el-icon-check">添加围栏</el-button> <el-button type="success" plain @click="upiInsertDialog" icon="el-icon-check">添加围栏</el-button>
<el-button type="danger" plain @click="deleteFence()" icon="el-icon-check">删除围栏</el-button>
<el-table :data="fenceData" style="width: 500%" @selection-change="handleSelectionChange"> <el-table :data="fenceData" style="width: 500%" @selection-change="handleSelectionChange">
@ -206,10 +205,14 @@ export default {
this.updateFences.fenceLocation = this.mapAddr this.updateFences.fenceLocation = this.mapAddr
console.log(this.updateFences) console.log(this.updateFences)
updateFenceMapAddr(this.updateFences).then(res =>{ updateFenceMapAddr(this.updateFences).then(res =>{
this.dialogVisible=false if(res.code == 200) {
this.getFenceList() alert(res.msg)
this.updateFences = {} this.dialogVisible=false
this.mapAddr = '' this.getFenceList()
this.updateFences = {}
this.mapAddr = ''
}
// location.reload() // location.reload()
}) })
}, },
@ -284,6 +287,9 @@ export default {
// //
deleteFence(id) { deleteFence(id) {
deleteFenceById(id).then(res =>{ deleteFenceById(id).then(res =>{
if (res.code == 200) {
alert(res.msg)
}
this.getFenceList() this.getFenceList()
}) })
}, },
@ -294,8 +300,11 @@ export default {
onSubmit() { onSubmit() {
insertFence(this.insertFences).then(res =>{ insertFence(this.insertFences).then(res =>{
this.dialogVisibleTwo = false this.dialogVisibleTwo = false
this.getFenceList() if (res.code == 200) {
this.insertFences={} alert(res.msg)
this.getFenceList()
this.insertFences={}
}
}) })
}, },
getFenceList() { getFenceList() {