{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\uc\\MatrixManager.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\uc\\MatrixManager.vue","mtime":1675071993288},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nconst htAsideTree = () => import(\"@/components/common/HtAsideTree.vue\");\r\nconst EipSysTypeSelector = () => import(\"@/components/selector/EipSysTypeSelector.vue\");\r\nconst eipUserDialog = () => import(\"@/components/dialog/EipUserDialog.vue\");\r\nimport req from \"@/request.js\";\r\nimport uc from \"@/api/uc.js\";\r\nexport default {\r\n  components: { htAsideTree, EipSysTypeSelector, eipUserDialog },\r\n  data() {\r\n    return {\r\n      dialogVisible: false,\r\n      data: [],\r\n      pageResult: {\r\n        page: 1,\r\n        pageSize: 20,\r\n        total: 0\r\n      },\r\n      matrixBlank: {\r\n        code: \"\",\r\n        name: \"\",\r\n        condList: [\r\n          {\r\n            code: \"\",\r\n            name: \"\",\r\n            ctrlType: \"\",\r\n            queryAlias: \"\",\r\n            bindKey: \"\",\r\n            bindValue: \"\"\r\n          }\r\n        ],\r\n        roleList: [{ code: \"\", name: \"\", selectType: 1 }]\r\n      },\r\n      matrix: {},\r\n      treeSidebarData: {},\r\n      tabStatus: \"cond\",\r\n      customQuerys: [],\r\n      customDialogs: [], //对话框列表数据\r\n      isSubmit: true,\r\n      typeId: \"\",\r\n      defaultQuerys: []\r\n    };\r\n  },\r\n  mounted() {\r\n    this.$validator = this.$root.$validator;\r\n  },\r\n  methods: {\r\n    rowClick(row, column, event){\r\n      this.$refs.htTable.$refs.htTable.toggleRowSelection(row);\r\n    },\r\n    handleCommand(param) {\r\n      switch (param.action) {\r\n        case \"toDataList\":\r\n          this.toDataList(param.row);\r\n          break;\r\n        case \"publish\":\r\n          this.publish(param.row.id);\r\n          break;\r\n        case \"setManager\":\r\n          this.setManager(param.row.id);\r\n          break;\r\n      }\r\n    },\r\n    setManager(id) {\r\n      this.curId = id;\r\n      this.$refs.eipUserDialog.showDialog({});\r\n    },\r\n    saveManager(data){\r\n      if(data.length==0||data.length>1){\r\n        this.$message.warning(\"请选择一个用户\");\r\n        return;\r\n      }\r\n      data = data[0];\r\n      let id = this.curId;\r\n      req\r\n        .get(window.context.uc + `/uc/matrix/v1/saveManager?id=${id}&userId=${data.id}&fullname=${data.fullname}`)\r\n        .then(res => {\r\n          if (res.data.state) {\r\n            this.$message.success(res.data.message);\r\n            this.$refs.htTable.load();\r\n          }\r\n        });\r\n    },\r\n    publish(id) {\r\n      req\r\n        .get(window.context.uc + `/uc/matrix/v1/publish?id=${id}`)\r\n        .then(res => {\r\n          if (res.data.state) {\r\n            this.$message.success(res.data.message);\r\n            this.$refs.htTable.load();\r\n          }\r\n        });\r\n    },\r\n    upGo(fieldData, index) {\r\n      if (index != 0) {\r\n        fieldData[index] = fieldData.splice(index - 1, 1, fieldData[index])[0];\r\n      } else {\r\n        fieldData.push(fieldData.shift());\r\n      }\r\n    },\r\n    downGo(fieldData, index) {\r\n      if (index != fieldData.length - 1) {\r\n        fieldData[index] = fieldData.splice(index + 1, 1, fieldData[index])[0];\r\n      } else {\r\n        fieldData.unshift(fieldData.splice(index, 1)[0]);\r\n      }\r\n    },\r\n    chineseFormat(list, chinese, prop, index) {\r\n      //如果保存过的则不允许修改code\r\n      if (list[index].id) {\r\n        return;\r\n      }\r\n      let timer = null;\r\n      if (timer) {\r\n        clearTimeout(timer);\r\n      }\r\n      timer = setTimeout(function() {\r\n        req\r\n          .request({\r\n            url: `${window.context.uc}/base/tools/v1/getPinyin`,\r\n            method: \"GET\",\r\n            params: { chinese: chinese, type: 0 }\r\n          })\r\n          .then(res => {\r\n            if (res.data.state) {\r\n              list[index][prop] = res.data.value;\r\n            }\r\n          });\r\n      }, 500);\r\n    },\r\n    deleteCol(list, index) {\r\n      list.splice(index, 1);\r\n    },\r\n    addCol(list, index) {\r\n      list.push({\r\n        code: \"\",\r\n        name: \"\",\r\n        ctrlType: \"\",\r\n        queryAlias: \"\",\r\n        bindKey: \"\",\r\n        bindValue: \"\",\r\n        selectType:1\r\n      });\r\n    },\r\n    handleNodeClick(item) {\r\n      if(item.parentId != 0){\r\n        this.$set(this.defaultQuerys, 0, {\r\n          property: \"type_id_\",\r\n          value: item.id,\r\n          operation: \"EQUAL\"\r\n        });\r\n      }else{\r\n        //清空旧的查询值\r\n        this.defaultQuerys.splice(0);\r\n      }\r\n      this.$refs.htTable.load();\r\n    },\r\n    treeCheck(item, list) {\r\n      if (list && list.checkedKeys && list.checkedKeys.length > 0) {\r\n        this.$set(this.defaultQuerys, 0, {\r\n          property: \"type_id_\",\r\n          value: list.checkedKeys.join(\",\"),\r\n          operation: \"IN\"\r\n        });\r\n        this.$refs.htTable.load();\r\n      }\r\n    },\r\n    close() {\r\n      this.dialogVisible = false;\r\n    },\r\n    showDialog(id) {\r\n      if (id) {\r\n        this.$http.get(\"${uc}/uc/matrix/v1/getJson?id=\" + `${id}`).then(\r\n          resp => {\r\n            this.matrix = resp.data;\r\n            this.dialogVisible = true;\r\n          },\r\n          error => {\r\n            reject(error);\r\n          }\r\n        );\r\n      } else {\r\n        this.matrix = JSON.parse(JSON.stringify(this.matrixBlank));\r\n        //this.matrix = this.matrixBlank;\r\n        this.dialogVisible = true;\r\n      }\r\n    },\r\n    beforeCloseDialog() {\r\n      this.matrix = JSON.parse(JSON.stringify(this.matrixBlank));\r\n      // this.matrix = this.matrixBlank;\r\n      this.dialogVisible = false;\r\n    },\r\n    loadData(param, cb) {\r\n      param.querys || (param.querys = []);\r\n      param.querys.push({\r\n        property: \"isDele\",\r\n        value: 0,\r\n        operation: \"EQUAL\"\r\n      });\r\n      this.$http\r\n        .post(\"${uc}/uc/matrix/v1/listJson\", param)\r\n        .then(\r\n          resp => {\r\n            let response = resp.data;\r\n            this.data = response.rows;\r\n            this.pageResult = {\r\n              page: response.page,\r\n              pageSize: response.pageSize,\r\n              total: response.total\r\n            };\r\n          }\r\n        )\r\n        .finally(() => cb());\r\n    },\r\n    beforeSaveData() {\r\n      this.isSubmit = true;\r\n      if (!this.matrix.condList || this.matrix.condList.length == 0){\r\n        this.isSubmit = false;\r\n        this.$message.error(\"请填写字段名\");\r\n      }\r\n      if (this.matrix.condList && this.matrix.condList.length > 0) {\r\n        let code = this.checkPropIsRepeat(this.matrix.condList, \"code\");\r\n        if (code) {\r\n          this.isSubmit = false;\r\n          this.tabStatus = \"cond\";\r\n          this.$message.error(`列字段名[${code}]重复`);\r\n        }\r\n      }\r\n      if (!this.matrix.roleList || this.matrix.roleList.length == 0){\r\n        this.isSubmit = false;\r\n        this.$message.error(\"请填写角色字段\");\r\n      }\r\n      if (this.matrix.roleList && this.matrix.roleList.length > 0) {\r\n        let code = this.checkPropIsRepeat(this.matrix.roleList, \"code\");\r\n        if (code) {\r\n          this.isSubmit = false;\r\n          this.tabStatus = \"role\";\r\n          this.$message.error(`角色别名[${code}]重复`);\r\n        }\r\n      }\r\n    },\r\n    checkPropIsRepeat(arr, key) {\r\n      var obj = {};\r\n      for (var i = 0; i < arr.length; i++) {\r\n        let code = arr[i][key].toLowerCase();\r\n        if (obj[code]) {\r\n          return arr[i][key];\r\n        } else {\r\n          obj[code] = arr[i];\r\n        }\r\n      }\r\n      return \"\";\r\n    },\r\n    afterSaveData() {\r\n      setTimeout(() => {\r\n        this.beforeCloseDialog();\r\n        this.$refs.htTable.load();\r\n      }, 500);\r\n    },\r\n    afterCustomQueryLoadData(data) {\r\n      this.customQuerys = data.rows;\r\n    },\r\n    afterCustomDialogLoadData(data) {\r\n      this.customDialogs = data;\r\n    },\r\n    toDataList(param) {\r\n      if (param.status == 0){\r\n        req\r\n            .get(window.context.uc + `/uc/matrix/v1/publish?id=${param.id}`)\r\n            .then(res => {\r\n              if (res.data.state) {\r\n                this.$message.success(res.data.message);\r\n                this.$router.push({ path: `/matrixData/${param.id}` });\r\n                this.$refs.htTable.load();\r\n              }\r\n            });\r\n      }else{\r\n        this.$router.push({ path: `/matrixData/${param.id}` });\r\n      }\r\n    },\r\n    ctrlTypeChange(list, index) {\r\n      list[index].queryAlias && (list[index].queryAlias = \"\");\r\n      list[index].bindKey && (list[index].bindKey = \"\");\r\n      list[index].bindValue && (list[index].bindValue = \"\");\r\n    },\r\n    getResultField(ctrlType, queryAlias) {\r\n      if (ctrlType === \"select\") {\r\n        for (let i = 0; i < this.customQuerys.length; i++) {\r\n          let item = this.customQuerys[i];\r\n          if (item.alias === queryAlias) {\r\n            return JSON.parse(item.resultfield || \"[]\");\r\n          }\r\n        }\r\n      } else if (ctrlType === \"dialog\") {\r\n        for (let i = 0; i < this.customDialogs.length; i++) {\r\n          let item = this.customDialogs[i];\r\n          if (item.alias === queryAlias) {\r\n            return JSON.parse(item.resultfield || \"[]\");\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n};\r\n",null]}