{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\flow\\FlowBranchConditionSet.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\flow\\FlowBranchConditionSet.vue","mtime":1675071991788},{"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\r\nimport flow from '@/api/flow.js'\r\nimport req from '@/request.js'\r\nimport {mapState, mapActions} from 'vuex'\r\n\r\nimport FlowVarSelector from '@/components/flow/FlowVarSelector.vue'\r\nimport FlowConditionBuildDialog from '@/components/flow/FlowConditionBuildDialog.vue'\r\n\r\nexport default {\r\n  components: {FlowVarSelector, FlowConditionBuildDialog},\r\n  data() {\r\n    return {\r\n      dialogVisible: false,\r\n      data: {},\r\n      curEditNodeId: '',\r\n      cmOptions2: {\r\n        value: '',\r\n        mode: 'groovy',\r\n        readOnly: false,\r\n        smartIndent: true,\r\n        tabSize: 1,\r\n        theme: 'base16-light',\r\n        lineNumbers: true,\r\n        line: true,\r\n        lineWrapping: true,\r\n      },\r\n    }\r\n  },\r\n  computed: mapState({\r\n    curNode: (state) => state.flow.defConfigData.curEditNode,\r\n  }),\r\n  methods: {\r\n    showDialog: function (param) {\r\n      if (param == 'close') {\r\n        this.dialogVisible = false\r\n        this.curEditNodeId = ''\r\n        return\r\n      }\r\n      const this_ = this\r\n      this_.$store.dispatch('flow/getCurSelectBranches').then(function (data) {\r\n        if (data && data.outcomeNodes) {\r\n          data.conditions = data.conditions || {}\r\n          for (const node of data.outcomeNodes) {\r\n            if (!data.conditions[node.nodeId]) {\r\n              data.conditions[node.nodeId] = ''\r\n            }\r\n          }\r\n        }\r\n        this_.data = JSON.parse(JSON.stringify(data))\r\n      })\r\n      this.dialogVisible = true\r\n    },\r\n    setCurEditNodeId(nodeId) {\r\n      this.curEditNodeId = nodeId\r\n    },\r\n    conditionDialogConfirm(data) {\r\n      this.data.conditions[this.curEditNodeId] = data\r\n    },\r\n    varTreeOnConfirm(data) {\r\n      this.data.conditions[this.curEditNodeId] =\r\n        this.data.conditions[this.curEditNodeId] + data.pathValue\r\n    },\r\n    showConditionBuild() {\r\n      if (!this.curEditNodeId) {\r\n        this.$message.warning('请先选择要设置表达式的节点')\r\n        return\r\n      }\r\n      this.$refs.flowConditionBuildDialog.showDialog()\r\n    },\r\n    setEditorVal(type, op) {\r\n      var val = ''\r\n      if (type == 1) {\r\n        val =\r\n          op == 1\r\n            ? 'taskCmd.getActionName().equals(\"agree\")'\r\n            : 'taskCmd.getActionName().equals(\"oppose\")'\r\n      } else {\r\n        val =\r\n          op == 1\r\n            ? 'signResult_' + type + '.equals(\"agree\")'\r\n            : 'signResult_' + type + '.equals(\"oppose\")'\r\n      }\r\n      if (!this.data.conditions[this.curEditNodeId]) {\r\n        this.data.conditions[this.curEditNodeId] = ''\r\n      }\r\n      this.data.conditions[this.curEditNodeId] = val\r\n    },\r\n    handleClose: function () {\r\n      let param = {\r\n        defId: this.curNode.defId,\r\n        nodeId: this.curNode.nodeId,\r\n        condition: JSON.stringify(this.data.conditions),\r\n      }\r\n      let this_ = this\r\n      req\r\n        .post('${bpmModel}/flow/node/v1/branchConditionSave', param)\r\n        .then((response) => {\r\n          let data = response.data\r\n          if (data.state) {\r\n            this_.$message.success('分支条件设置成功')\r\n            let obj = {}\r\n            obj['nodeBranches.' + this_.curNode.nodeId + '.conditions'] =\r\n              this_.data.conditions\r\n            this_.$store.dispatch('flow/updateConfig', obj)\r\n            this_.dialogVisible = false\r\n            this.$emit('onConfirm')\r\n          } else {\r\n            this_.$message.fail('分支条件设置失败!' + data.message)\r\n          }\r\n        })\r\n    },\r\n    //关闭分支条件配置对话框\r\n    close() {\r\n      this.dialogVisible = false\r\n    },\r\n    dialogOnConfirm(selection) {\r\n      if (!selection || selection.length == 0) {\r\n        this.$message.error('请至少选择一个用户')\r\n        return\r\n      }\r\n      let names = []\r\n      let ids = []\r\n      for (let user of selection) {\r\n        names.push(user.fullname)\r\n        ids.push(user.id)\r\n      }\r\n      this.curSelectItem.id = ids.join(',')\r\n      this.curSelectItem.name = names.join(',')\r\n      this.$forceUpdate()\r\n    },\r\n  },\r\n}\r\n",null]}