资源管理编辑 删除

This commit is contained in:
shijingjing
2022-10-12 09:22:59 +08:00
parent 2f42c353e4
commit 36f979a67a
3 changed files with 47 additions and 4 deletions

View File

@@ -124,12 +124,13 @@ export default {
created() {
this.areaId = this.user.info.areaId
this.getCategoryList()
this.getDetail()
},
methods: {
cancel() {
// currentPage: resourceManagement
this.$router.push({})
},
getCategoryList() {
this.instance.post(`/app/appresourcecategory/list`,null,{
params: {
@@ -147,16 +148,19 @@ export default {
}
})
},
handleAreaSelect(v) {
if(v.length) {
this.form.areaName = v[0]?.label
}
},
selectMap() {
this.form.lng = this.placeDetail.lng
this.form.lat = this.placeDetail.lat
this.showMap = false
},
getCorpLocation() {
this.instance.post('/app/appdvcpconfig/getCorpLocation').then((res) => {
if (res.code == 0) {
@@ -164,6 +168,7 @@ export default {
}
})
},
initMap({ lng, lat }) {
AMapLoader.load({
key: '54a02a43d9828a8f9cd4f26fe281e74e',
@@ -200,6 +205,7 @@ export default {
})
})
},
movePosition(center) {
if (this.map) {
this.map.clearMap()
@@ -214,6 +220,15 @@ export default {
}
},
getDetail() {
let {id} = this.$route.query
if (!id) return
this.instance.post(`/app/appresourceinfo/queryDetailById?id=${id}`).then(res=> {
if(res?.data) {
this.form = res.data
}
})
},
confirm() {
this.$refs.form.validate((valid) => {
@@ -222,13 +237,16 @@ export default {
...this.form
}).then(res => {
if (res.code == 0) {
this.$message.success('新增成功')
if(this.form.id) {
this.$message.success('修改成功')
} else {
this.$message.success('新增成功')
}
this.cancel()
}
})
}
})
},
},
}