Browse Source

Merge branch 'http_mock' of git.xiaojukeji.com:jacklijiajia/thoth-frontend into http_mock

reedliuqing_i 5 years ago
parent
commit
4975fde4af
1 changed files with 12 additions and 5 deletions
  1. 12 5
      src/views/ToConfigure/configure.vue

+ 12 - 5
src/views/ToConfigure/configure.vue

@@ -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) { // 模块操作确认