{"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\\flow\\DefManager.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\flow\\DefManager.vue","mtime":1675071992788},{"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport {mapState} from 'vuex'\r\nimport flow from '@/api/flow.js'\r\nimport BpmEditor from '@/views/flow/BpmEditor.vue'\r\nimport req from '@/request.js'\r\nimport utils from \"@/hotent-ui-util.js\"\r\n\r\nconst htAsideTree = () => import('@/components/common/HtAsideTree.vue')\r\nconst FlowConfig = () => import('@/components/flow/FlowConfig.vue')\r\nconst SubFlowConfig = () => import('@/components/flow/FlowConfig.vue')\r\nconst FlowOtherSetting = () => import('@/components/flow/FlowOtherSetting.vue')\r\nconst FlowVarList = () => import('@/components/flow/FlowVarList.vue')\r\nconst FlowVersionList = () => import('@/components/flow/FlowVersionList.vue')\r\nconst eipSysTypeSelector = () => import('@/components/selector/EipSysTypeSelector.vue')\r\nconst FlowEditBoSetting = () => import('@/components/flow/FlowEditBoSetting.vue')\r\nconst eipSysTypeDialog = () => import('@/components/dialog/EipSysTypeDialog.vue')\r\nconst processSimulation = () => import('@/views/flow/simulation/ProcessSimulation.vue')\r\nconst EipSysTypeSelector = () => import(\"@/components/selector/EipSysTypeSelector.vue\");\r\nconst defAuthorizePageDialog = () => import(\"@/components/dialog/DefAuthorizePageDialog.vue\");\r\n\r\nexport default {\r\n  components: {\r\n    BpmEditor,\r\n    htAsideTree,\r\n    FlowConfig,\r\n    FlowOtherSetting,\r\n    SubFlowConfig,\r\n    FlowVarList,\r\n    FlowVersionList,\r\n    FlowEditBoSetting,\r\n    eipSysTypeSelector,\r\n    eipSysTypeDialog,\r\n    processSimulation,\r\n    EipSysTypeSelector,\r\n    defAuthorizePageDialog\r\n  },\r\n  data() {\r\n    return {\r\n      data: [],\r\n      pageResult: {\r\n        page: 1,\r\n        pageSize: 50,\r\n        total: 0\r\n      },\r\n      dialogVisible: false,\r\n      defEditTabComponent: [{alias: 'defConfig', name: '流程设计'}, {alias: 'defVarList', name: '变量管理'}],\r\n      statusArray: [\r\n        {text: '已发布', value: 'deploy', type: 'info'},\r\n        {text: '未发布', value: 'draft'},\r\n        {text: '禁用', value: 'forbidden', type: 'danger'},\r\n        {text: '禁止实例', value: 'forbidden_instance', type: 'warning'}\r\n      ],\r\n      activeName: 'defConfig',\r\n      curSelectDefId: '',\r\n      // 配置页面是否需要刷新缓存\r\n      flowConfigShouldRefresh: false,\r\n      topDefKey: '',\r\n      subDefId: '',\r\n      isShowSubFlowSet: false,\r\n      isCurDefPublish: false,\r\n      selectTypeIds: '',\r\n      fullscreenLoading: false,\r\n      importDialogVisible: false,\r\n      flowTypeSelectorCatId: '',\r\n      flowTypeSelectorCatName: '',\r\n      startDef: '',\r\n      defNameAndVrsionTitle: '',\r\n      dialogVisible2: false,\r\n      bindData: {},\r\n      dialogSaveCopyVisible: false,\r\n      newFlow: {},\r\n      flowRow: {},\r\n      deleteList:[],\r\n      deleteDialogVisible:false,\r\n      deleteReason:'111',\r\n      defConfComponetKey:''\r\n    }\r\n  },\r\n  computed: mapState({\r\n    isForbidden: function() {\r\n      return [{text: '正常', value: '0', type: 'success'}, {text: '挂起', value: '1', type: 'danger'}]\r\n    },\r\n    deleteUrl: function() {\r\n      return window.context.bpmModel + '/flow/def/v1/removeByDefIds?cascade=true'\r\n    },\r\n    uploadHeaders: function(mapState) {\r\n      return {Authorization: 'Bearer ' + mapState.login.currentUser.token}\r\n    },\r\n    imporCheckUrl: function() {\r\n      return window.context.bpmModel + '/flow/def/v1/importCheck?typeId=' + this.flowTypeSelectorCatId\r\n    },\r\n    account: state => state.login.currentUser.account,\r\n    token: state => state.login.currentUser.token,\r\n    frontUrl: function() {\r\n      return (\r\n        '/agentStart/' + this.startDef + '/0?token=' + this.token+'&showMenu=true'\r\n      )\r\n    }\r\n  }),\r\n  mounted() {\r\n    //数据建模-》查看绑定关系\r\n    if (this.$route.query.bpmId) {\r\n      this.isCurDefPublish = true\r\n      this.curSelectDefId = this.$route.query.bpmId\r\n      this.activeName = 'defConfig'\r\n      this.dialogVisible = true\r\n      this.$router.push('flowDesign#defManager');\r\n      this.handleDefSignSuccess()\r\n    }\r\n  },\r\n  methods: {\r\n    rowClick(row) {\r\n      this.$refs.htTable.$refs.htTable.toggleRowSelection(row)\r\n    },\r\n    handleDefSignSuccess() {\r\n      this.flowConfigShouldRefresh = true\r\n      if (!this.curSelectDefId) {\r\n        return\r\n      }\r\n      let this_ = this\r\n      req.get('${bpmModel}/flow/def/v1/defGet?defId=' + this.curSelectDefId).then(function(resp) {\r\n        let data = resp.data\r\n        if (data) {\r\n          this_.defNameAndVrsionTitle = data.name + '(版本' + data.version + ')'\r\n        }\r\n      })\r\n    },\r\n    handleDefDeploySuccess(id) {\r\n      this.curSelectDefId = id;\r\n      this.isCurDefPublish = true;\r\n      this.defConfComponetKey = new Date().getTime();\r\n      this.activeName = 'defConfig'\r\n      this.handleDefSignSuccess();\r\n    },\r\n    //跳转指定选项卡\r\n    toggleTab(name) {\r\n      this.activeName = name\r\n      this.flowConfigShouldRefresh = true\r\n    },\r\n    //启动流程\r\n    startFlow(id) {\r\n      this.startDef = id\r\n      let routeUrl = window.context.front + '/agentStart/' + this.startDef + '/0?token=' + this.token+'&showMenu=true'\r\n      window.open(routeUrl, '_blank')\r\n    },\r\n    handleUploadResult(response) {\r\n      var height = (document.documentElement.clientHeight || document.body.clientHeight) * 0.85 + 'px'\r\n      this.fullscreenLoading = false\r\n      let this_ = this\r\n      if (response.state) {\r\n        this_.handleImportSuccess()\r\n      } else {\r\n        if (response.message && response.message.indexOf('是否继续为其新增版本') > 0) {\r\n          this.$confirm(\r\n            '<div style=\"overflow-x:hidden;overflow-y:auto ;max-height:' + height + '\">' + response.message + '</div>',\r\n            '提示',\r\n            {\r\n              cancelButtonText: '取消',\r\n              dangerouslyUseHTMLString: true,\r\n              confirmButtonText: '确定',\r\n              type: 'warning',\r\n              closeOnClickModal: false\r\n            }\r\n          )\r\n            .then(() => {\r\n              this_.fullscreenLoading = true\r\n              req\r\n                .post(\r\n                  window.context.bpmModel +\r\n                    '/flow/def/v1/importSave?cacheFileId=' +\r\n                    response.value +\r\n                    '&confirmImport=' +\r\n                    true +\r\n                    '&typeId=' +\r\n                    this.flowTypeSelectorCatId\r\n                )\r\n                .then(function(resp) {\r\n                  this_.fullscreenLoading = false\r\n                  let data = resp.data\r\n                  if (data.state) {\r\n                    this_.handleImportSuccess()\r\n                  } else {\r\n                    this_.$message.error(data.message)\r\n                  }\r\n                })\r\n            })\r\n            .catch(() => {\r\n              req.post(window.context.bpmModel + '/flow/def/v1/importSave?cacheFileId=' + response.value + '&confirmImport=' + false)\r\n              this_.importDialogVisible = false\r\n              this.$refs.upload.clearFiles()\r\n            })\r\n        } else {\r\n          this.$message.error(response.message || '流程导入失败')\r\n        }\r\n      }\r\n    },\r\n    handleImportSuccess() {\r\n      this.$message.success('流程导入成功')\r\n      this.importDialogVisible = false\r\n      this.$refs.htTable.load()\r\n      this.$refs.upload.clearFiles()\r\n    },\r\n    beforeUpload(file) {\r\n      if (!file.name.endsWith('.zip')) {\r\n        this.$message.warning('只能导入zip文件!')\r\n        return false\r\n      }\r\n      this.imporActionUrl = this.imporCheckUrl\r\n      this.fullscreenLoading = true\r\n    },\r\n    onExceed() {\r\n      this.$message.warning('只能选择一个zip文件!')\r\n    },\r\n    submitImport() {\r\n      if (!this.$refs.upload.uploadFiles || this.$refs.upload.uploadFiles.length == 0) {\r\n        this.$message.warning('请选择要导入的流程!')\r\n        return false\r\n      }\r\n      if (!this.flowTypeSelectorCatId) {\r\n        this.$message.warning('请选择要导入的分类!')\r\n        return false\r\n      }\r\n      this.$refs.upload.submit()\r\n    },\r\n    watchBPMNXML() {\r\n      let url = window.context.bpmModel + '/flow/def/v1/bpmnXml?defId=' + this.curSelectDefId\r\n      let tenantId = '-1'\r\n      try {\r\n        if (this.$store.state.login.currentUser.userAttrs.tenantId) {\r\n          tenantId = this.$store.state.login.currentUser.userAttrs.tenantId\r\n        }\r\n      } catch (error) {}\r\n      if (tenantId != '-1') {\r\n        url = url + '&tenantId=' + tenantId\r\n      }\r\n      window.open(url, '_blank')\r\n    },\r\n    beforePanelLeave() {\r\n      if (!this.isCurDefPublish) {\r\n        this.$message.warning('流程还未发布,无法进行配置')\r\n        return false\r\n      }\r\n    },\r\n    handlePaneClick: function(data) {\r\n      if (data.alias) {\r\n        this.currentTabComponent = data.alias\r\n      }\r\n      //流程设计\r\n      if (data.name == 'defConfig') {\r\n        this.flowConfigShouldRefresh = false\r\n      }\r\n    },\r\n    handlePaneRemove: function() {\r\n      this.activeName = 'defConfig'\r\n      this.flowConfigShouldRefresh = true\r\n      this.isShowSubFlowSet = false\r\n    },\r\n    handleNodeClick(node) {\r\n      if (node.id == '6') {\r\n        this.selectTypeIds = ''\r\n      } else {\r\n        this.selectTypeIds = node.id\r\n      }\r\n      this.$refs.htTable.quickSearch()\r\n    },\r\n    check(data, checkObj) {\r\n      this.selectTypeIds = checkObj.checkedKeys.join(',')\r\n      this.$refs.htTable.load()\r\n    },\r\n    handleClose() {\r\n      this.dialogVisible = false\r\n      this.dialogVisible2 = false\r\n      this.$refs.htTable.load(true)\r\n    },\r\n    handleCloseMenuPerm() {\r\n      this.dialogVisibleMenuPerm = false\r\n    },\r\n\r\n    dialogCancel(dialogVisible) {\r\n      this[dialogVisible] = false\r\n    },\r\n    loadData(param, cb) {\r\n      param.querys = param.querys || []\r\n      if (this.selectTypeIds) {\r\n        let hasTypeQuery = false\r\n        for (const query of param.querys) {\r\n          if (query.property == 'typeId') {\r\n            query.value = this.selectTypeIds\r\n            hasTypeQuery = true\r\n            break\r\n          }\r\n        }\r\n        if (!hasTypeQuery) {\r\n          param.querys.push({\r\n            group: 'main',\r\n            operation: 'IN',\r\n            property: 'typeId',\r\n            relation: 'AND',\r\n            value: this.selectTypeIds\r\n          })\r\n        }\r\n      } else {\r\n        param.querys = param.querys.filter(q => {\r\n          return q.property != 'typeId'\r\n        })\r\n      }\r\n      flow\r\n        .getDefPage(param)\r\n        .then(response => {\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        .finally(() => cb())\r\n    },\r\n    handleCommand(params) {\r\n      switch (params.command) {\r\n        case 'edit': //编辑\r\n          this.curSelectDefId = params.row.defId\r\n          this.defNameAndVrsionTitle = params.row.name + '(版本' + params.row.version + ')'\r\n          if (params.row.status == 'draft') {\r\n            this.isCurDefPublish = false\r\n            this.activeName = 'defDesign'\r\n          } else {\r\n            this.isCurDefPublish = true\r\n            this.activeName = 'defConfig'\r\n          }\r\n          this.dialogVisible = true\r\n          break\r\n        case 'add': //新增\r\n          this.curSelectDefId = ''\r\n          this.activeName = 'defDesign'\r\n          this.dialogVisible = true\r\n          this.isCurDefPublish = false\r\n          this.defNameAndVrsionTitle = ''\r\n          break\r\n        case 'restore': //恢复\r\n          break\r\n        case 'isForbidden': //挂起/取消挂起\r\n          this.forbiddenOrUnForbiddenInst(params)\r\n          break\r\n        case 'cleanData':\r\n          this.cleanData(params.row.id)\r\n          break\r\n        case 'startFlow':\r\n          this.startFlow(params.row.id)\r\n          break\r\n        case 'bindRelation':\r\n          this.bindRelation(params.row.defId)\r\n          break\r\n        case 'delete':\r\n        if (params.row.status == 'draft') {\r\n            this.deleteFlow(params.row.defId)\r\n          }else{\r\n            this.batchDelete(params.row)\r\n          }\r\n          break\r\n        case 'processSimulation':\r\n          this.$refs.processSimulation.showProcessSimulation(params.row.defKey)\r\n          break;\r\n        case 'copy':\r\n          this.copy(params.row);\r\n          break;\r\n        case 'auth':\r\n          this.auth(params.row);\r\n          break;\r\n        default:\r\n          break\r\n      }\r\n    },\r\n    auth(row){\r\n      this.$refs.defAuthorizePageDialog.showDialog(row);\r\n    },\r\n    copy(flow){\r\n      this.flowRow = {...flow};\r\n      this.newFlow = {\r\n        defId: this.flowRow.id,\r\n        defKey: \"\",\r\n        name: \"\",\r\n        typeId: \"\"\r\n      }\r\n      this.dialogSaveCopyVisible = true;\r\n    },\r\n    handleCloseSaveCopy() {\r\n      this.dialogSaveCopyVisible = false;\r\n    },\r\n    saveCopy(){\r\n      flow.copy(this.newFlow).then(resp => {\r\n        if(resp.data.state) {\r\n          this.dialogSaveCopyVisible = false;\r\n          this.$message.success(resp.data.message);\r\n          this.$refs.htTable.load();\r\n        }\r\n      });\r\n    },\r\n    bindRelation(defId) {\r\n      this.dialogVisible2 = true\r\n      flow.getBindRelation(defId).then(resp => {\r\n        this.bindData = resp.data\r\n      })\r\n    },\r\n    cleanData(defId) {\r\n      let this_ = this\r\n      this.$confirm('此操作会清除该流程所有的实例任务等数据，是否确认清除？', '提示', {\r\n        cancelButtonText: '取消',\r\n        confirmButtonText: '确定',\r\n        type: 'warning',\r\n        closeOnClickModal: false\r\n      }).then(() => {\r\n        req.post(window.context.bpmModel + '/flow/def/v1/cleanData?defId=' + defId).then(function(response) {\r\n          let data = response.data\r\n          if (data.state) {\r\n            this_.$message.success(data.message)\r\n          } else {\r\n            this_.$message.fail(data.message)\r\n          }\r\n        })\r\n      })\r\n    },\r\n    deleteFlow(defId) {\r\n      let this_ = this\r\n      this.$confirm('删除后不可恢复，是否确定删除?', '提示', {\r\n        cancelButtonText: '取消',\r\n        confirmButtonText: '确定',\r\n        type: 'warning',\r\n        closeOnClickModal: false\r\n      }).then(() => {\r\n        req.remove(this_.deleteUrl + '&ids=' + defId).then(function(response) {\r\n          if (response.data && response.data.state) {\r\n            this_.$message.success('删除成功')\r\n            this_.$refs.htTable.load()\r\n          }\r\n        })\r\n      })\r\n    },\r\n    handExport() {\r\n      let elTable = this.$refs.htTable\r\n      if (this.$refs.htTable.$refs && this.$refs.htTable.$refs.htTable) {\r\n        elTable = this.$refs.htTable.$refs.htTable\r\n      }\r\n      if (elTable && elTable.selection && elTable.selection.length == 0) {\r\n        this.$message.warning('请选择至少一项记录')\r\n        return\r\n      }\r\n\r\n      if (elTable && elTable.selection && elTable.selection.length > 10) {\r\n        this.$message.warning('因流程和表单相关数据较大，单次最多导出10条')\r\n        return\r\n      }\r\n\r\n      let ids = []\r\n\r\n      for (let item of elTable.selection) {\r\n        ids.push(item['id'])\r\n      }\r\n\r\n      if (ids.length == 0) {\r\n        this.$message.warning('请选择至少一项记录')\r\n        return\r\n      }\r\n      let url = `${window.context.bpmModel}/flow/def/v1/exportXml?bpmDefId=${ids}`\r\n      req.download(url)\r\n    },\r\n    batchDelete(def){\r\n\r\n      let selectDefs = [];\r\n      if (!def) {\r\n        let elTable = this.$refs.htTable\r\n        if (this.$refs.htTable.$refs && this.$refs.htTable.$refs.htTable) {\r\n          elTable = this.$refs.htTable.$refs.htTable\r\n        }\r\n        if (elTable && elTable.selection && elTable.selection.length == 0) {\r\n          this.$message.warning('请选择至少一项记录')\r\n          return\r\n        }\r\n        for (let item of elTable.selection) {\r\n          selectDefs.push(item)\r\n        }\r\n      }else{\r\n        selectDefs.push(def);\r\n      }\r\n\r\n      if (selectDefs.length == 0) {\r\n        this.$message.warning('请选择至少一项记录')\r\n        return\r\n      }\r\n      let  defKeys = [];\r\n      for (let item of selectDefs) {\r\n          defKeys.push(item['defKey'])\r\n        }\r\n      let me_ = this;\r\n      this.$http\r\n        .get('${bpmRunTime}/runtime/instance/v1/getInstanceCountByDefKeys?defKeys='+defKeys.join(','))\r\n        .then(function(resp) {\r\n          if ( resp.data) {\r\n            let countMap = {};\r\n            resp.data.forEach(d => {\r\n              countMap[d['PROC_DEF_KEY_']] = d;\r\n            });\r\n            let list = [];\r\n            selectDefs.forEach(s => {\r\n              s = JSON.parse(JSON.stringify(s));\r\n              if (countMap[s.defKey]) {\r\n                s.totalCount = countMap[s.defKey].totalCount;\r\n                s.runningCount = countMap[s.defKey].runningCount;\r\n              }else{\r\n                s.totalCount = 0;\r\n                s.runningCount = 0;\r\n              }\r\n              list.push(s);\r\n            });\r\n            me_.deleteList = list;\r\n            me_.deleteDialogVisible = true;\r\n            me_.deleteReason = '';\r\n            return;\r\n          }\r\n          me_.$message.error(resp.data.message)\r\n        })\r\n    },\r\n    batchDeleteConfirm(){\r\n      if (!this.deleteReason) {\r\n        //this.$message.warning('请输入删除原因');\r\n        //return\r\n      }\r\n      if (!this.deleteList || this.deleteList.length == 0) {\r\n        this.$message.warning('删除的流程不能为空');\r\n        return\r\n      }\r\n      let ids = [];\r\n      this.deleteList.forEach(e => {\r\n        ids.push(e.defId);\r\n      });\r\n      let this_ = this;\r\n      req.remove(this_.deleteUrl + '&ids=' + ids.join(',')).then(function(response) {\r\n          if (response.data && response.data.state) {\r\n            this_.$message.success('删除成功')\r\n            this_.deleteDialogVisible = false;\r\n            this_.$refs.htTable.load()\r\n          }\r\n      })\r\n    },\r\n    //设置分类\r\n    openTypeSetDialog() {\r\n      let elTable = this.$refs.htTable\r\n      if (this.$refs.htTable.$refs && this.$refs.htTable.$refs.htTable) {\r\n        elTable = this.$refs.htTable.$refs.htTable\r\n      }\r\n      if (elTable && elTable.selection && elTable.selection.length == 0) {\r\n        this.$message.warning('请选择至少一项记录')\r\n        return\r\n      }\r\n\r\n      this.$refs.typeSetDialog.showDialog({})\r\n    },\r\n    sysTypeDialogOnConfirm(data) {\r\n      let elTable = this.$refs.htTable\r\n      if (this.$refs.htTable.$refs && this.$refs.htTable.$refs.htTable) {\r\n        elTable = this.$refs.htTable.$refs.htTable\r\n      }\r\n      if (elTable && elTable.selection && elTable.selection.length == 0) {\r\n        this.$message.warning('请选择至少一项记录')\r\n        return\r\n      }\r\n\r\n      let id = []\r\n\r\n      for (let item of elTable.selection) {\r\n        id.push(item['id'])\r\n      }\r\n      let this_ = this\r\n      this.$http\r\n        .post('${bpmModel}/flow/def/v1/defSetCategory', {\r\n          typeName: data.name,\r\n          typeId: data.id,\r\n          defIds: id.join(',')\r\n        })\r\n        .then(function(resp) {\r\n          if (resp.data && resp.data.state) {\r\n            this_.$message({message: resp.data.message, type: 'success'})\r\n            setTimeout(function() {\r\n              this_.$refs.htTable.load()\r\n            }, 3000)\r\n\r\n            return\r\n          }\r\n          this_.$message.error(resp.data.message)\r\n        })\r\n    }\r\n  },\r\n  created() {\r\n    let this_ = this\r\n    this.$root.$on('set-sub-flow', function(data) {\r\n      this_.activeName = ''\r\n      this_.showSubFlowSet = false\r\n      req.get(window.context.bpmModel + '/flow/def/v1/subFlowDetail?defId=' + data.defId + '&nodeId=' + data.nodeId).then(response => {\r\n        let data = response.data\r\n        this_.topDefKey = data.topDefKey\r\n        this_.subDefId = data.defId\r\n        this_.activeName = 'subFlowSet'\r\n        this_.isShowSubFlowSet = true\r\n      })\r\n    })\r\n  }\r\n}\r\n",null]}