diff --git a/epmet-oper-web/src/views/modules/customer/customize/menu-customer-add-or-update.vue b/epmet-oper-web/src/views/modules/customer/customize/menu-customer-add-or-update.vue index be2a5e0..83e0c50 100644 --- a/epmet-oper-web/src/views/modules/customer/customize/menu-customer-add-or-update.vue +++ b/epmet-oper-web/src/views/modules/customer/customize/menu-customer-add-or-update.vue @@ -49,10 +49,10 @@ export default { iconList: [], iconListVisible: false, dataForm: { - id: '', + id: '', // 菜单id type: 0, name: '', - pid: '0', + pid: '0', // 菜单pid customerId:'', parentName: '', url: '', @@ -91,16 +91,38 @@ export default { }, // 获取信息 - getInfo () { - this.$http.get(`/gov/access/govMenuCustomerRelation/${this.dataForm.id}`).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.dataForm = { - ...this.dataForm, - ...res.data - } - }).catch(() => {}) + async getInfo () { + let {data: epmetRelationResult} = await this.$http.get(`/gov/access/govMenuCustomerRelation/getCustomizedMenuInfo?menuId=${this.dataForm.id}&customerId=${this.dataForm.customerId}`) + + if (epmetRelationResult.code !== 0) { + this.$message.error("网络错误") + return + } + + if (epmetRelationResult.data !== null) { + // 如果有该菜单的自定义信息 + this.dataForm.type = epmetRelationResult.data.type + this.dataForm.name = epmetRelationResult.data.name + this.dataForm.pid = epmetRelationResult.data.pid + this.dataForm.parentName = epmetRelationResult.data.parentName + this.dataForm.url = epmetRelationResult.data.url + this.dataForm.useFlag = epmetRelationResult.data.useFlag + this.dataForm.sort = epmetRelationResult.data.sort + this.dataForm.icon = epmetRelationResult.data.icon + } else { + // 如果没有该菜单的自定义信息, + let { data: epmeMenuResult } = await this.$http.get(`/gov/access/menu/${this.dataForm.id}`) + + this.dataForm.type = epmeMenuResult.data.type + this.dataForm.name = epmeMenuResult.data.name + this.dataForm.pid = epmeMenuResult.data.pid + this.dataForm.parentName = epmeMenuResult.data.parentName + this.dataForm.url = epmeMenuResult.data.url + this.dataForm.useFlag = 1 + this.dataForm.sort = epmeMenuResult.data.sort + this.dataForm.icon = epmeMenuResult.data.icon + } + }, // 图标, 选中 iconListCurrentChangeHandle (icon) { diff --git a/epmet-oper-web/src/views/modules/customer/customize/menuCustomer.vue b/epmet-oper-web/src/views/modules/customer/customize/menuCustomer.vue index fa4c3e1..31dd98f 100644 --- a/epmet-oper-web/src/views/modules/customer/customize/menuCustomer.vue +++ b/epmet-oper-web/src/views/modules/customer/customize/menuCustomer.vue @@ -33,6 +33,7 @@ +