|
@@ -593,26 +593,33 @@ export default {
|
|
|
return newArr
|
|
|
},
|
|
|
handlerModule(type, data, index) { // 模块处理
|
|
|
- console.log(data)
|
|
|
- this.moduleDialog = true
|
|
|
this.curcentModule = type
|
|
|
this.moduleForm = { bizId: null, moduleNames: [null], parentId: -1, id: null }// 初始化
|
|
|
this.curcentParent = '无'
|
|
|
this.moduleTitle = '新增模块'
|
|
|
if (data && type === 'add') {
|
|
|
+ this.moduleDialog = true
|
|
|
this.moduleTitle = '新增模块'
|
|
|
this.curcentParent = data.moduleName
|
|
|
this.moduleForm.parentId = data.id
|
|
|
} else if (data && type === 'edit') {
|
|
|
+ this.moduleDialog = true
|
|
|
this.moduleTitle = '编辑模块'
|
|
|
this.moduleForm.id = data.id
|
|
|
this.curcentParent = data.parentId === -1 ? '无' : data.parentModuleName
|
|
|
this.moduleForm.parentId = data.parentId
|
|
|
this.moduleForm.moduleNames[0] = data.moduleName
|
|
|
} else if (data && type === 'delete') {
|
|
|
- this.moduleTitle = '删除确认'
|
|
|
- this.moduleForm.id = data.id
|
|
|
- this.moduleForm.moduleNames[0] = data.moduleName
|
|
|
+ if (data.childModules && data.childModules.length > 0) {
|
|
|
+ this.$message({ message: '该模块下存在子模块', type: 'error' })
|
|
|
+ } else {
|
|
|
+ this.moduleDialog = true
|
|
|
+ this.moduleTitle = '删除确认'
|
|
|
+ this.moduleForm.id = data.id
|
|
|
+ this.moduleForm.moduleNames[0] = data.moduleName
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ this.moduleDialog = true
|
|
|
}
|
|
|
},
|
|
|
confirmModule(formName) { // 模块操作确认
|