|
|
@ -43,6 +43,7 @@ |
|
|
|
:data="menuList" |
|
|
|
:props="{ label: 'name', children: 'children' }" |
|
|
|
node-key="id" |
|
|
|
:default-expanded-keys="['000']" |
|
|
|
ref="menuListTree" |
|
|
|
accordion |
|
|
|
show-checkbox> |
|
|
@ -56,6 +57,7 @@ |
|
|
|
:data="menuListShuju" |
|
|
|
:props="{ label: 'name', children: 'children' }" |
|
|
|
node-key="id" |
|
|
|
:default-expanded-keys="['000']" |
|
|
|
ref="menuListShujuTree" |
|
|
|
accordion |
|
|
|
show-checkbox> |
|
|
@ -111,9 +113,7 @@ export default { |
|
|
|
components: {}, |
|
|
|
async mounted () { |
|
|
|
|
|
|
|
//获取菜单 |
|
|
|
await this.getMenuList() |
|
|
|
await this.getMenuShujuList() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
@ -122,6 +122,9 @@ export default { |
|
|
|
this.startLoading() |
|
|
|
this.customerId = localStorage.getItem("customerId"); |
|
|
|
this.formData.customerId = this.customerId |
|
|
|
//获取菜单 |
|
|
|
await this.getMenuList() |
|
|
|
await this.getMenuShujuList() |
|
|
|
|
|
|
|
this.$refs['ref_form'].resetFields(); |
|
|
|
this.$refs.menuListTree.setCheckedKeys([]) |
|
|
@ -149,7 +152,14 @@ export default { |
|
|
|
const { data, code, msg } = await requestGet(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.menuList = data |
|
|
|
this.menuList = [ |
|
|
|
{ |
|
|
|
id: '000', |
|
|
|
name: '全部菜单', |
|
|
|
children: [...data] |
|
|
|
} |
|
|
|
] |
|
|
|
// this.menuList = data |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
@ -167,7 +177,14 @@ export default { |
|
|
|
const { data, code, msg } = await requestGet(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.menuListShuju = data |
|
|
|
this.menuListShuju = [ |
|
|
|
{ |
|
|
|
id: '000', |
|
|
|
name: '全部菜单', |
|
|
|
children: [...data] |
|
|
|
} |
|
|
|
] |
|
|
|
// this.menuListShuju = data |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
@ -188,6 +205,9 @@ export default { |
|
|
|
|
|
|
|
this.formData.menuIdList.forEach(item => { |
|
|
|
this.$refs.menuListTree.setChecked(item, true) |
|
|
|
|
|
|
|
}) |
|
|
|
this.formData.menuIdList.forEach(item => { |
|
|
|
this.$refs.menuListShujuTree.setChecked(item, true) |
|
|
|
}) |
|
|
|
this.formData.customerId = this.customerId |
|
|
@ -231,6 +251,7 @@ export default { |
|
|
|
...this.$refs.menuListShujuTree.getCheckedKeys(), |
|
|
|
...this.$refs.menuListShujuTree.getHalfCheckedKeys() |
|
|
|
] |
|
|
|
this.formData.menuIdList = this.formData.menuIdList.filter(item => item !== '000') |
|
|
|
|
|
|
|
console.log('menuAll', this.formData) |
|
|
|
|
|
|
|