Commit 9a22957b by cwq0219

菜单管理

1 parent a1950f62
...@@ -413,22 +413,27 @@ export default { ...@@ -413,22 +413,27 @@ export default {
fn && fn() fn && fn()
}) })
}, },
isMenuSpecial(flag = true) { isMenuSpecial(isSpecial = true) {
if (!isSpecial) {
this.editForm.ownedCusgroupType = '' this.editForm.ownedCusgroupType = ''
this.editForm.ownedCusgroupValue = [] this.editForm.ownedCusgroupValue = []
this.editForm.ownedMerchant = '' this.editForm.ownedMerchant = ''
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupType')].isHide = !flag }
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isHide = !flag this.baseData.cusGroupList = isSpecial ? this.baseData[this.attrToList[this.editForm.ownedCusgroupType]] : []
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedMerchant')].isHide = !flag this.getOptionsList('editFormData', false)
this.editRule.ownedCusgroupValue[0].required = flag this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupType')].isHide = !isSpecial
this.editRule.ownedCusgroupType[0].required = flag this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isHide = !isSpecial
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedMerchant')].isHide = !isSpecial
this.editRule.ownedCusgroupValue[0].required = isSpecial && (this.editForm.ownedCusgroupType !== 3)
this.editRule.ownedCusgroupType[0].required = isSpecial
}, },
editDisable() { editDisable() {
this.editFormData[this.editFormData.findIndex(item => item.label === '产品')].isDisabled = !!this.editForm.menuCode this.editFormData[this.editFormData.findIndex(item => item.label === '产品')].isDisabled = !!this.editForm.menuCode
this.editFormData[this.editFormData.findIndex(item => item.label === '父级菜单')].isDisabled = !!this.editForm.menuCode this.editFormData[this.editFormData.findIndex(item => item.label === '父级菜单')].isDisabled = !!this.editForm.menuCode
this.editFormData[this.editFormData.findIndex(item => item.name === 'isSpecial')].isDisabled = !!this.editForm.menuCode this.editFormData[this.editFormData.findIndex(item => item.name === 'isSpecial')].isDisabled = !!this.editForm.menuCode
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isDisabled = !!this.editForm.menuCode && !(this.editForm.ownedCusgroupType !== 3)
}, },
handleAdd(isEdit) { handleAdd(isEdit = false) {
this.editVisible = !this.editVisible this.editVisible = !this.editVisible
this.editDisable() this.editDisable()
!isEdit && this.isMenuSpecial(false) !isEdit && this.isMenuSpecial(false)
...@@ -479,10 +484,13 @@ export default { ...@@ -479,10 +484,13 @@ export default {
this.editForm.parentId = ' ' this.editForm.parentId = ' '
this.editForm.parentName = '无(表示顶级菜单)' this.editForm.parentName = '无(表示顶级菜单)'
} }
if (this.editForm.isSpecial) {
this.editForm.ownedCusgroupValue && (this.editForm.ownedCusgroupValue = this.editForm.ownedCusgroupValue.split(',').map(item => +item))
this.isMenuSpecial(true)
}
this.getMenuTree(this.editForm.productId, () => { this.getMenuTree(this.editForm.productId, () => {
this.handleAdd(true) this.handleAdd(true)
}) })
this.editForm.isSpecial && this.isMenuSpecial(true)
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm('是否删除菜单?', '提示', { this.$confirm('是否删除菜单?', '提示', {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!