{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!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\\FlowNodeUserCondition.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\flow\\FlowNodeUserCondition.vue","mtime":1675071991850},{"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":["import \"core-js/modules/es7.symbol.async-iterator\";\nimport \"core-js/modules/es6.symbol\";\nimport \"core-js/modules/es6.string.iterator\";\nimport \"core-js/modules/es6.array.from\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.function.name\";\nimport _defineProperty from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.regexp.split\";\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport flow from '@/api/flow.js';\nimport req from '@/request.js';\nimport { mapState, mapActions } from 'vuex';\nimport FlowNodeCusersSelector from '@/components/flow/FlowNodeCusersSelector.vue';\nimport utils from '@/hotent-ui-util.js';\n\nvar eipRoleSelector = function eipRoleSelector() {\n  return import('@/components/selector/EipRoleSelector.vue');\n};\n\nvar eipOrgSelector = function eipOrgSelector() {\n  return import('@/components/selector/EipOrgSelector.vue');\n};\n\nvar eipPostSelector = function eipPostSelector() {\n  return import('@/components/selector/EipPostSelector.vue');\n};\n\nvar eipJobSelector = function eipJobSelector() {\n  return import('@/components/selector/EipJobSelector.vue');\n};\n\nvar FlowHrScriptSelector = function FlowHrScriptSelector() {\n  return import('@/components/flow/FlowHrScriptSelector.vue');\n};\n\nvar FlowCustomScriptSelector = function FlowCustomScriptSelector() {\n  return import('@/components/flow/FlowCustomScriptSelector.vue');\n};\n\nvar FlowNodeUserRuleSelector = function FlowNodeUserRuleSelector() {\n  return import('@/components/flow/FlowNodeUserRuleSelector.vue');\n};\n\nvar FlowCustomQuerySelector = function FlowCustomQuerySelector() {\n  return import('@/components/flow/FlowCustomQuerySelector.vue');\n};\n\nvar FlowMatrixSelector = function FlowMatrixSelector() {\n  return import('@/components/flow/FlowMatrixSelector.vue');\n};\n\nvar FlowNodePositionSelector = function FlowNodePositionSelector() {\n  return import('@/components/flow/FlowNodePositionSelector.vue');\n};\n\nexport default {\n  components: {\n    FlowNodeCusersSelector: FlowNodeCusersSelector,\n    eipRoleSelector: eipRoleSelector,\n    eipOrgSelector: eipOrgSelector,\n    eipJobSelector: eipJobSelector,\n    eipPostSelector: eipPostSelector,\n    FlowHrScriptSelector: FlowHrScriptSelector,\n    FlowCustomScriptSelector: FlowCustomScriptSelector,\n    FlowNodeUserRuleSelector: FlowNodeUserRuleSelector,\n    FlowCustomQuerySelector: FlowCustomQuerySelector,\n    FlowMatrixSelector: FlowMatrixSelector,\n    FlowNodePositionSelector: FlowNodePositionSelector\n  },\n  data: function data() {\n    return {\n      userConditionTab: 'first',\n      dialogVisible: false,\n      title: '节点人员设置',\n      userRule: {\n        calcs: [],\n        nodeType: ''\n      },\n      nodeList: [],\n      conditionList: [],\n      curNode: {},\n      nodeUserPluginList: [],\n      conditionObj: {},\n      conditionName: '',\n      pathList: [],\n      data: {},\n      branchList: [],\n      tabList: [],\n      Tree: [],\n      svgHeight: '400px',\n      defaultCondition: {\n        ruleType: '2',\n        conDesc: ''\n      },\n      Mleft: 50,\n      //初始左边距50\n      Mtop: 20,\n      //初始上边距40\n      XIncase: 100,\n      //x轴递增数值70\n      YIncase: 50,\n      //y轴递增数据50\n      svgHtml: '',\n      curEditTab: {}\n    };\n  },\n  computed: mapState({\n    defConfigData: function defConfigData(state) {\n      return state.flow.defConfigData;\n    }\n  }),\n  methods: {\n    isNotEmpty: function isNotEmpty(val) {\n      if (!val || val.length == 0) {\n        return false;\n      }\n\n      return true;\n    },\n    //根据条件数组构建条件分支界面\n    buildConditionTree: function buildConditionTree(data) {\n      var pathArr = [];\n      var tableArr = [];\n      var branchArr = [];\n      this.buildData(data, pathArr, tableArr, branchArr);\n      this.pathList = pathArr;\n      this.branchList = branchArr;\n      this.tabList = tableArr; //取路径最后一条数据，因为该条数据的高度距离顶部最大\n\n      var lastPath = pathArr[pathArr.length - 1];\n      var lastIndexArr = [];\n      if (lastPath) lastIndexArr = lastPath.split(','); //取最后一个坐标点。终点纵坐标为整个svg中最大的纵坐标\n\n      var lastYIndex = lastIndexArr[lastIndexArr.length - 1]; //设置svg的高度为最大纵坐标+100，从而实现svg页面高度自适应\n\n      if (lastYIndex) {\n        this.svgHeight = parseInt(lastYIndex) + 50 + 'px';\n      }\n\n      this.createSvgHtml(pathArr);\n    },\n    ArrayTool: function ArrayTool(ary, idx, direct) {\n      direct = direct || 'down';\n      var part = ary[idx];\n\n      if (!part || part.constructor !== Object && part.constructor !== Array) {\n        return ary;\n      }\n\n      if (part.constructor === Object) {\n        part = [part];\n      }\n\n      if (direct == 'up') {\n        part.forEach(function (m) {\n          var index = ary.indexOf(m, 1);\n\n          if (index > 0) {\n            var t = ary[index - 1];\n            ary.splice(index - 1, 1, ary[index]);\n            ary.splice(index, 1, t);\n          }\n        });\n      } else if (direct == 'down') {\n        for (var i = part.length - 1, m; m = part[i--];) {\n          var index = ary.indexOf(m, 0);\n\n          if (index > -1 && index < ary.length - 1) {\n            var t = ary[index + 1];\n            ary.splice(index + 1, 1, ary[index]);\n            ary.splice(index, 1, t);\n          }\n        }\n      }\n    },\n    //构建svg图形页面\n    createSvgHtml: function createSvgHtml(pathArr) {\n      this.svgHtml = '';\n      var html = '<svg height=\"' + this.svgHeight + '\" version=\"1.1\" width=\"692\" xmlns=\"http://www.w3.org/2000/svg\" style=\"overflow: hidden; position: relative;\">';\n\n      for (var i = 0; i < pathArr.length; i++) {\n        html += '<path fill=\"none\" stroke=\"#787878\"' + 'd=\"' + this.pathList[i] + '\" style=\"-webkit-tap-highlight-color: rgba(0, 0, 0, 0);\"></path>';\n      }\n\n      html += '</svg>';\n      this.svgHtml = html;\n    },\n    changecondition: function changecondition(index) {\n      var _this = this;\n\n      var oldVal = this.branchList[index].oldjunction;\n      var newVal = this.branchList[index].newjunction;\n\n      if (newVal == '3' || newVal == '4' || newVal == '5') {\n        this.branchList[index].newjunction = this.branchList[index].oldjunction;\n        var indexStr = this.branchList[index].indexStr;\n\n        if (newVal == '3') {\n          this.addCondition(indexStr);\n        } else if (newVal == '4') {\n          this.addUnionCondition(indexStr);\n        } else {\n          this.$confirm('确定要删除此联合条件及其下属的所有子条件吗？', '提示', {\n            cancelButtonText: '取消',\n            confirmButtonText: '确定',\n            type: 'warning',\n            closeOnClickModal: false\n          }).then(function () {\n            _this.removeCondition(indexStr);\n          });\n        }\n      } else {\n        this.branchList[index].oldjunction = this.branchList[index].newjunction;\n        var indexStr = this.branchList[index].indexStr;\n        var indexArr = indexStr.split(',');\n\n        if (indexStr == 'root') {\n          this.conditionObj.junction = newVal;\n        } else if (indexArr.length == 1) {\n          this.conditionObj.condition[indexStr].junction = newVal;\n        } else if (indexArr.length == 2) {\n          this.conditionObj.condition[indexArr[0]].condition[indexArr[1]].junction = newVal;\n        }\n      }\n    },\n    //添加一个联合\n    addCondition: function addCondition(indexStr) {\n      var data = this.conditionObj.condition;\n\n      if (indexStr == 'root') {\n        data.push(JSON.parse(JSON.stringify(this.defaultCondition)));\n      } else {\n        var indexArr = [];\n        if (indexStr) indexArr = indexStr.split(',');\n\n        for (var i = 0; i < data.length; i++) {\n          if (indexArr.length > 0 && i == indexArr[0]) {\n            if (indexArr.length > 1) {\n              for (var j = 0; j < data[i].condition.length; j++) {\n                if (j == indexArr[1]) {\n                  data[i].condition[j].condition.push(JSON.parse(JSON.stringify(this.defaultCondition)));\n                  break;\n                }\n              }\n            } else {\n              data[i].condition.push(JSON.parse(JSON.stringify(this.defaultCondition)));\n            }\n\n            break;\n          }\n        }\n      }\n\n      this.conditionObj.condition = data;\n      this.buildConditionTree(this.conditionObj);\n    },\n    removeCondition: function removeCondition(indexStr) {\n      var indexArr = [];\n      if (indexStr) indexArr = indexStr.split(',');\n\n      if (indexArr.length > 0) {\n        var data = this.conditionObj.condition;\n\n        for (var i = 0; i < data.length; i++) {\n          if (i == indexArr[0]) {\n            if (indexArr.length > 1) {\n              for (var j = 0; j < data[i].condition.length; j++) {\n                if (j == indexArr[1]) {\n                  if (indexArr.length > 2) {\n                    for (var z = 0; z < data[i].condition[j].condition.length; z++) {\n                      if (z == indexArr[2]) {\n                        data[i].condition[j].condition.splice(z, 1);\n                        break;\n                      }\n                    }\n                  } else {\n                    data[i].condition.splice(j, 1);\n                  }\n\n                  break;\n                }\n              }\n            } else {\n              data.splice(i, 1);\n            }\n\n            break;\n          }\n        }\n\n        this.conditionObj.condition = data;\n        this.buildConditionTree(this.conditionObj);\n      }\n    },\n    //添加一个联合条件条件\n    addUnionCondition: function addUnionCondition(indexStr) {\n      var data = this.conditionObj.condition;\n\n      if (indexStr == 'root') {\n        data.push({\n          junction: 'or',\n          condition: []\n        });\n      } else {\n        var indexArr = [];\n        if (indexStr) indexArr = indexStr.split(',');\n\n        for (var i = 0; i < data.length; i++) {\n          if (indexArr.length > 0 && i == indexArr[0]) {\n            if (indexArr.length > 1) {\n              for (var j = 0; j < data[i].condition.length; j++) {\n                if (j == indexArr[1]) {\n                  data[i].condition[j].condition.push({\n                    junction: 'or',\n                    condition: []\n                  });\n                  break;\n                }\n              }\n            } else {\n              data[i].condition.push({\n                junction: 'or',\n                condition: []\n              });\n            }\n\n            break;\n          }\n        }\n      }\n\n      this.conditionObj.condition = data;\n      this.buildConditionTree(this.conditionObj);\n    },\n    buildData: function buildData(conditionData, pathArr, tableArr, branchArr) {\n      var curYIndex = 0;\n      var data = conditionData.condition; //算三级节点总共分支个数\n\n      var yIncaseNum = this.getyIncaseNum(conditionData.condition) > 1 ? this.getyIncaseNum(conditionData.condition) : 1; //第一个节点 this.Mtop 最后一个节点Mtop+this.YIncase*（yIncaseNum-1）\n\n      var startY1 = (this.Mtop * 2 + this.YIncase * (yIncaseNum - 1)) / 2;\n      branchArr.push({\n        newjunction: conditionData.junction,\n        oldjunction: conditionData.junction,\n        style: 'left:' + (this.Mleft - 35) + 'px; top:' + (startY1 - 15) + 'px',\n        indexStr: 'root',\n        condition: 'noDel'\n      });\n\n      for (var i = 0; i < data.length; i++) {\n        if (data[i].condition) {\n          var curchildNum = this.getyIncaseNum(data[i].condition); //如果该节点，没有分支条件，则保留节点\n\n          var isEmpty0 = false;\n\n          if (curchildNum < 1) {\n            curchildNum = 1;\n            isEmpty0 = true;\n          } //计算一级节点和该节点的连线\n\n\n          var startY2 = (this.Mtop * 2 + this.YIncase * (2 * curYIndex + curchildNum - 1)) / 2;\n          var path = 'M' + this.Mleft + ',' + startY1 + 'C' + this.Mleft + ',' + startY2 + ',' + this.Mleft + ',' + startY2 + ',' + (this.Mleft + this.XIncase) + ',' + startY2;\n          pathArr.push(path);\n          branchArr.push({\n            newjunction: data[i].junction,\n            oldjunction: data[i].junction,\n            style: 'left:' + (this.Mleft + this.XIncase - 35) + 'px; top:' + (startY2 - 15) + 'px',\n            indexStr: '' + i\n          });\n          if (isEmpty0) curYIndex++;\n\n          for (var j = 0; j < data[i].condition.length; j++) {\n            //如果第三级节点有分支，则计算分支\n            if (data[i].condition[j].condition) {\n              //计算改节点分支个数\n              var curchildNum2 = this.getyIncaseNum(data[i].condition[j].condition); //如果该节点，没有分支条件，则保留节点,默认其占一行\n\n              var isEmpty = false;\n\n              if (curchildNum2 < 1) {\n                curchildNum2 = 1;\n                isEmpty = true;\n              } // 改分支第一个节点纵坐标= this.Mtop+this.YIncase*curYIndex  上一个节点纵坐标加上递增值\n              // 改分支最后节点纵坐标=改分支第一个节点纵坐标 +计算改节点分支个数*y递增值 this.Mtop+this.YIncase*curYIndex+this.YIncase*(curchildNum2-1)\n              // 计算改节点的纵坐标。（改分支第一个节点纵坐标+该分支的最后一个纵坐标）/2\n              // 该节点起始点纵坐标=  this.Mtop+this.YIncase*curYIndex+ this.Mtop+this.YIncase*curYIndex+this.YIncase*(curchildNum2-1)\n\n\n              var startY3 = (this.Mtop * 2 + this.YIncase * (2 * curYIndex + curchildNum2 - 1)) / 2; //改分支指引线的终点的纵坐标等于startY2\n\n              var _path = 'M' + (this.Mleft + this.XIncase) + ',' + startY2 + 'C' + (this.Mleft + this.XIncase) + ',' + startY3 + ',' + (this.Mleft + this.XIncase) + ',' + startY3 + ',' + (this.Mleft + this.XIncase * 2) + ',' + startY3;\n\n              pathArr.push(_path);\n              branchArr.push({\n                newjunction: data[i].condition[j].junction,\n                oldjunction: data[i].condition[j].junction,\n                style: 'left:' + (this.Mleft + this.XIncase * 2 - 35) + 'px; top:' + (startY3 - 15) + 'px',\n                indexStr: i + ',' + j,\n                condition: 'noAdd'\n              });\n\n              if (isEmpty) {\n                curYIndex++;\n              }\n\n              for (var z = 0; z < data[i].condition[j].condition.length; z++) {\n                var obj = data[i].condition[j].condition[z];\n                obj.style = 'left:' + (this.Mleft + this.XIncase * 3) + 'px; top:' + (this.Mtop + this.YIncase * curYIndex - 19) + 'px';\n                obj.indexStr = i + ',' + j + ',' + z;\n                tableArr.push(obj); //改分支下所有节点的起始纵坐标为startY3，终点纵坐标根据该节点位置决定\n\n                var _path2 = 'M' + (this.Mleft + this.XIncase * 2) + ',' + startY3 + 'C' + (this.Mleft + this.XIncase * 2) + ',' + (this.Mtop + this.YIncase * curYIndex) + ',' + (this.Mleft + this.XIncase * 2) + ',' + (this.Mtop + this.YIncase * curYIndex) + ',' + (this.Mleft + this.XIncase * 3) + ',' + (this.Mtop + this.YIncase * curYIndex);\n\n                pathArr.push(_path2);\n                curYIndex++;\n              }\n            } else {\n              //第二级节点没有分支\n              var _obj = data[i].condition[j];\n              _obj.style = 'left:' + (this.Mleft + this.XIncase * 2) + 'px; top:' + (this.Mtop + this.YIncase * curYIndex - 19) + 'px';\n              _obj.indexStr = i + ',' + j;\n              tableArr.push(_obj); //计算改分支的路径。因为是第二节点。startY2\n\n              var _path3 = 'M' + (this.Mleft + this.XIncase) + ',' + startY2 + 'C' + (this.Mleft + this.XIncase) + ',' + (this.Mtop + this.YIncase * curYIndex) + ',' + (this.Mleft + this.XIncase) + ',' + (this.Mtop + this.YIncase * curYIndex) + ',' + (this.Mleft + this.XIncase * 2) + ',' + (this.Mtop + this.YIncase * curYIndex);\n\n              pathArr.push(_path3);\n              curYIndex++;\n            }\n          }\n        } else {\n          var _obj2 = data[i];\n          _obj2.style = 'left:' + (this.Mleft + this.XIncase) + 'px; top:' + (this.Mtop + this.YIncase * curYIndex - 19) + 'px';\n          _obj2.indexStr = '' + i;\n          tableArr.push(_obj2);\n\n          var _path4 = 'M' + this.Mleft + ',' + startY1 + 'C' + this.Mleft + ',' + (this.Mtop + this.YIncase * curYIndex) + ',' + this.Mleft + ',' + (this.Mtop + this.YIncase * curYIndex) + ',' + (this.Mleft + this.XIncase) + ',' + (this.Mtop + this.YIncase * curYIndex);\n\n          pathArr.push(_path4);\n          curYIndex++;\n        }\n      }\n    },\n    //获取条件总数\n    getyIncaseNum: function getyIncaseNum(data) {\n      var sum = 0;\n\n      for (var i = 0; i < data.length; i++) {\n        if (data[i].condition && data[i].condition.length > 0) {\n          for (var j = 0; j < data[i].condition.length; j++) {\n            if (data[i].condition[j].condition && data[i].condition[j].condition.length > 0) {\n              for (var z = 0; z < data[i].condition[j].condition.length; z++) {\n                sum++;\n              }\n            } else {\n              sum++;\n            }\n          }\n        } else {\n          sum++;\n        }\n      }\n\n      return sum;\n    },\n    calcTypeChange: function calcTypeChange(calc) {\n      calc.description = '';\n\n      if (calc.pluginType == 'approver') {\n        //流程实例审批人，在此处设置description\n        calc.description = '流程实例审批人';\n      } else if (calc.pluginType == 'depHead') {\n        //部门负责人审批人，在此处设置description\n        calc.description = '部门负责人';\n      } else if (calc.pluginType == 'position') {\n        calc.source = 'spec';\n      }\n    },\n    addCalc: function addCalc() {\n      this.userRule.calcs.push({\n        pluginType: 'cusers',\n        extract: 'no',\n        logicCal: 'or',\n        source: 'start',\n        vars: '',\n        description: '发起人',\n        nodeType: this.userRule.nodeType,\n        parentParam: {},\n        curEditIndex: ''\n      });\n    },\n    selector: function selector(index) {\n      this.curEditIndex = index;\n      var calc = this.userRule.calcs[index];\n      var type = calc.pluginType;\n\n      if (type != 'cusers' && type != 'hrScript' && type != 'customQuery' && type != 'matrix' && type != 'position') {\n        this.$message.error('没有其他类型的选择器，暂时只能选用户');\n        return;\n      }\n\n      eval('this.' + calc.pluginType + 'Selector(calc);');\n    },\n    cusersSelector: function cusersSelector(calc) {\n      var param = _objectSpread(_objectSpread({}, this.parentParam), {}, {\n        calc: calc\n      });\n\n      this.$refs.flowNodeCusersSelector.showDialog(param);\n    },\n    positionSelector: function positionSelector(calc) {\n      var param = _objectSpread(_objectSpread({}, this.parentParam), {}, {\n        calc: calc\n      });\n\n      this.$refs.flowNodePositionSelector.showDialog(param);\n    },\n    hrScriptSelector: function hrScriptSelector(calc) {\n      var param = _objectSpread(_objectSpread({}, this.parentParam), {}, {\n        calc: calc\n      });\n\n      this.$refs.flowHrScriptSelector.showDilaog(param);\n    },\n    matrixSelector: function matrixSelector(calc) {\n      var param = _objectSpread(_objectSpread({}, this.parentParam), {}, {\n        calc: calc\n      });\n\n      this.$refs.flowMatrixSelector.showDilaog(param);\n    },\n    customQuerySelector: function customQuerySelector(calc) {\n      var param = _objectSpread(_objectSpread({}, this.parentParam), {}, {\n        calc: calc\n      });\n\n      this.$refs.flowCustomQuerySelector.showDilaog(param);\n    },\n    showDialog: function showDialog(param) {\n      this.parentParam = param;\n      this.nodeList = [];\n\n      if (param.nodeId) {\n        var _iterator = _createForOfIteratorHelper(this.defConfigData.nodeSetData.nodes),\n            _step;\n\n        try {\n          for (_iterator.s(); !(_step = _iterator.n()).done;) {\n            var node = _step.value;\n\n            if (node.nodeId == param.nodeId) {\n              this.curNode = node;\n            } else {\n              if (node.type == 'signTask' || node.type == 'userTask') {\n                this.nodeList.push(node);\n              }\n            }\n          }\n        } catch (err) {\n          _iterator.e(err);\n        } finally {\n          _iterator.f();\n        }\n\n        if (this.curNode.name) {\n          this.title = '【' + this.curNode.name + '】节点人员设置';\n        }\n      }\n\n      if (param.userRule) {\n        param.userRule.nodeType = this.curNode.type;\n        this.userRule = param.userRule;\n      } else {\n        this.userRule = {\n          calcs: [],\n          nodeType: this.curNode.type\n        };\n      }\n\n      var this_ = this;\n      req.get(window.context.bpmModel + '/flow/node/usercalc/v1/getNodeUserPluginList').then(function (respose) {\n        var data = respose.data;\n        this_.nodeUserPluginList = data; //配置节点人员不显示可以选择【脚本】功能\n\n        for (var i = 0; i < this_.nodeUserPluginList.length; i++) {\n          if (this_.nodeUserPluginList[i].title == '脚本') {\n            this_.nodeUserPluginList.splice(i, 1);\n            break;\n          }\n        }\n\n        this_.conditionObj = {};\n\n        if (param && param.userRule && param.userRule.condition) {\n          //初始化\n          if (typeof param.userRule.condition == 'string') {\n            this_.conditionObj = JSON.parse(param.userRule.condition);\n          } else {\n            this_.conditionObj = JSON.parse(JSON.stringify(param.userRule.condition));\n          }\n        } else {\n          this_.conditionObj = {\n            junction: 'and',\n            condition: []\n          };\n        }\n\n        this_.buildConditionTree(this_.conditionObj);\n      });\n      this.dialogVisible = true;\n    },\n    handleClose: function handleClose() {\n      var r = {};\n\n      if (!this.userRule.calcs || this.userRule.calcs.length == 0 || !this.validateData(this.userRule.calcs)) {\n        this.$message.error('请设置节点审批人员！');\n        return false;\n      }\n\n      var conditionJson = JSON.stringify(this.conditionObj);\n      r.condition = conditionJson;\n      r.conditionMode = '';\n      r.name = '';\n      r.nodeType = this.userRule.nodeType;\n      r.parentFlowKey = '';\n      r.calcs = this.userRule.calcs; //拼装描述\n\n      r.description = '';\n\n      var _iterator2 = _createForOfIteratorHelper(r.calcs),\n          _step2;\n\n      try {\n        for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n          var c = _step2.value;\n\n          switch (c.pluginType) {\n            case 'org':\n              c.description = '[部门]' + c.orgName;\n              break;\n\n            case 'position':\n              c.description = '[岗位]' + c.posName;\n              break;\n\n            case 'job':\n              c.description = '[职务]' + c.jobName;\n              break;\n\n            case 'role':\n              c.description = '[角色]' + c.roleName;\n              break;\n          }\n\n          if (r.description) {\n            if (c.logicCal == 'or') {\n              r.description += '(或)';\n            } else if (c.logicCal == 'and') {\n              r.description += '(与)';\n            } else {\n              r.description += '(非)';\n            }\n          }\n\n          r.description += c.description;\n        }\n      } catch (err) {\n        _iterator2.e(err);\n      } finally {\n        _iterator2.f();\n      }\n\n      this.$emit('nodeUserConditionConfirm', r);\n      this.dialogVisible = false;\n    },\n    cuserSelectorConfirm: function cuserSelectorConfirm(selection) {\n      this.userRule.calcs.splice(this.curEditIndex, 1, selection);\n    },\n    positionSelectorConfirm: function positionSelectorConfirm(selection) {\n      this.userRule.calcs.splice(this.curEditIndex, 1, selection);\n    },\n    scriptSelectorConfirm: function scriptSelectorConfirm(selection) {\n      var calcs = _objectSpread(_objectSpread({}, this.userRule.calcs[this.curEditIndex]), selection);\n\n      calcs.description = '[人员脚本]' + selection.desc;\n      calcs.scriptId = selection.scriptId;\n      this.userRule.calcs.splice(this.curEditIndex, 1, calcs);\n    },\n    customQuerySelectorConfirm: function customQuerySelectorConfirm(selection) {\n      var calcs = _objectSpread(_objectSpread({}, this.userRule.calcs[this.curEditIndex]), selection);\n\n      calcs.description = '[关联查询]' + selection.desc;\n      calcs.alias = selection.alias;\n      calcs.name = selection.name;\n      this.userRule.calcs.splice(this.curEditIndex, 1, calcs);\n    },\n    matrixSelectorConfirm: function matrixSelectorConfirm(selection) {\n      var calcs = _objectSpread(_objectSpread({}, this.userRule.calcs[this.curEditIndex]), selection);\n\n      calcs.description = '[角色矩阵]' + selection.desc;\n      calcs.code = selection.code;\n      calcs.name = selection.name;\n      this.userRule.calcs.splice(this.curEditIndex, 1, calcs);\n    },\n    validateData: function validateData(calcs) {\n      var isTrue = true;\n\n      for (var i = 0; i < calcs.length; i++) {\n        switch (calcs[i].pluginType) {\n          case 'script':\n          case 'hrScript':\n            if (!calcs[i].script) isTrue = false;\n            break;\n\n          case 'sameNode':\n            if (!calcs[i].nodeId) isTrue = false;\n            break;\n\n          case 'cusers':\n            if (!calcs[i].description) isTrue = false;\n            break;\n\n          case 'org':\n            if (!calcs[i].orgCode) isTrue = false;\n            break;\n\n          case 'job':\n            if (!calcs[i].jobCode) isTrue = false;\n            break;\n\n          case 'role':\n            if (!calcs[i].roleCode) isTrue = false;\n            break;\n        }\n      }\n\n      return isTrue;\n    },\n    customScriptSelectorConfirm: function customScriptSelectorConfirm(result) {\n      this.curEditTab.script = result;\n      this.curEditTab.conDesc = result;\n    },\n    customRuleSelectorConfirm: function customRuleSelectorConfirm(result) {\n      this.curEditTab.conDesc = result.conDesc;\n      this.curEditTab.executorVar = result.executorVar;\n      this.curEditTab.expression = result.expression;\n      this.curEditTab.dataType = result.dataType;\n    },\n    editCondition: function editCondition(tab) {\n      this.curEditTab = tab;\n\n      if (tab.ruleType == 2) {\n        this.$refs.flowCustomScriptSelector.showDialog(tab.script || '');\n      } else {\n        this.$refs.flowNodeUserRuleSelector.showDialog(tab);\n      }\n\n      return;\n      var pageParam = $scope.$parent.pageParam.passConf;\n\n      if (tab.ruleType == 2) {\n        pageParam.script = tab.script;\n        dialogService.page('flow-customScript', {\n          area: ['800px', '480px'],\n          pageParam: pageParam\n        }).then(function (result) {\n          tab.script = result;\n          tab.conDesc = result;\n        });\n      } else {\n        pageParam.data = angular.copy(tab);\n        dialogService.page('flow-varDailog', {\n          area: ['800px', '480px'],\n          pageParam: pageParam\n        }).then(function (result) {\n          tab.conDesc = result.conDesc;\n          tab.executorVar = result.executorVar;\n          tab.expression = result.expression;\n          tab.dataType = result.dataType;\n        });\n      }\n    },\n    changeSameNode: function changeSameNode(calc) {\n      this.nodeList.forEach(function (node) {\n        if (node.nodeId == calc.nodeId) {\n          calc.description = '[节点]' + node.name;\n        }\n      });\n    }\n  }\n};",null]}