{"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\\FlowConditionBuildDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\flow\\FlowConditionBuildDialog.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":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/web.dom.iterable\";\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/es6.regexp.split\";\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//\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\nexport default {\n components: {\n FlowNodeCusersSelector: FlowNodeCusersSelector,\n eipOrgSelector: eipOrgSelector,\n eipJobSelector: eipJobSelector,\n eipPostSelector: eipPostSelector,\n FlowHrScriptSelector: FlowHrScriptSelector\n },\n props: ['defId', 'value'],\n data: function data() {\n return {\n userConditionTab: 'first',\n dialogVisible: false,\n title: '条件脚本设置',\n conditionList: [],\n conditionObj: {},\n conditionName: '',\n pathList: [],\n data: {},\n branchList: [],\n tabList: [],\n Tree: [],\n svgHeight: '400px',\n defaultCondition: {\n property: '',\n operator: '1',\n dataType: '',\n value: '',\n compType: '1'\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 varTree: [],\n filedsObj: {},\n scriptStr: '',\n bindForm: true\n };\n },\n computed: mapState({\n defConfigData: function defConfigData(state) {\n return state.flow.defConfigData;\n }\n }),\n methods: {\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 //构建svg图形页面\n createSvgHtml: function createSvgHtml(pathArr) {\n this.svgHtml = '';\n var html = '';\n\n for (var i = 0; i < pathArr.length; i++) {\n html += '';\n }\n\n html += '';\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 }\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') {\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 hrScriptSelector: function hrScriptSelector(calc) {\n var param = _objectSpread(_objectSpread({}, this.parentParam), {}, {\n calc: calc\n });\n\n this.$refs.flowHrScriptSelector.showDilaog(param);\n },\n showDialog: function showDialog(param) {\n param = param || {};\n var this_ = this;\n this.svgHtml = '';\n this.scriptStr = '';\n req.post(window.context.bpmModel + '/flow/node/v1/varTree', {\n defId: this.defId,\n removeSub: true\n }).then(function (respose) {\n var treeData = respose.data;\n\n if (treeData && treeData.constructor == Array && treeData.length > 0) {\n this_.conditionObj = {\n junction: 'and',\n condition: []\n };\n this_.buildConditionTree(this_.conditionObj);\n this_.buildVarTree(treeData);\n } else if (treeData && treeData.constructor == Array) {\n this_.$message.error('请先绑定业表单');\n this_.bindForm = false;\n } else {\n this_.$message.error('请求错误');\n }\n\n this_.dialogVisible = true;\n });\n },\n buildVarTree: function buildVarTree(treeData) {\n var treeArr = [];\n\n for (var i = 0, t; t = treeData[i++];) {\n //处理表单变量\n if (t && t.name == '表单变量') {\n if (t.children) {\n for (var j = 0, tChild; tChild = t.children[j++];) {\n if (tChild.children) {\n for (var z = 0, cAttr; cAttr = tChild.children[z++];) {\n var typeMoth = cAttr.dataType == 'number' ? '.getDouble' : '.getString';\n cAttr.pathStr = tChild.path + typeMoth + '(\"' + cAttr.name + '\")';\n this.filedsObj[cAttr.pathStr] = cAttr;\n }\n\n treeArr.push(tChild);\n }\n }\n }\n } else if (t && t.name == 'url表单变量') {\n if (t.children) {\n for (var j = 0, tChild; tChild = t.children[j++];) {\n if (tChild.attrs) {\n for (var z = 0, cAttr; cAttr = tChild.attrs[z++];) {\n cAttr.path = tChild.formKey;\n\n if (cAttr.dataType == 'number') {\n cAttr.pathStr = cAttr.path + '.getIntValue(\"' + cAttr.name + '\")';\n } else {\n cAttr.pathStr = cAttr.path + '.getString(\"' + cAttr.name + '\")';\n }\n\n this.filedsObj[cAttr.pathStr] = cAttr;\n }\n\n tChild.children = tChild.attrs;\n tChild.desc = tChild.name;\n delete tChild.attrs;\n treeArr.push(tChild);\n }\n }\n }\n }\n }\n\n if (treeArr.length > 0) {\n this.varTree = treeArr;\n } else {\n dialogService.fail('请先绑定业表单');\n this_.bindForm = false;\n }\n },\n setFieldOtherInfo: function setFieldOtherInfo(ele, tab, type) {\n var selectFiled = this.filedsObj[tab.property];\n\n if (type == 1) {\n tab.dataType = selectFiled.dataType;\n tab.format = selectFiled.format;\n tab.chooseDesc = selectFiled.desc;\n tab.value = '';\n } else {\n tab.changeDesc = selectFiled.desc;\n }\n },\n IsShowfiled: function IsShowfiled(m, tab) {\n if (!tab) return false;\n\n if (m.pathStr == tab.property) {\n return false;\n } else if (m.dataType != tab.dataType) {\n return false;\n }\n\n return true;\n },\n previewCondition: function previewCondition(isConfirm) {\n var _this2 = this;\n\n utils.validateForm(this, 'form1').then(function (r) {\n if (!_this2.conditionObj) return;\n\n var data = _this2.getConditionStr(_this2.conditionObj);\n\n data.conditionObj = JSON.stringify(_this2.conditionObj);\n _this2.scriptStr = data.conditionString;\n\n if (isConfirm) {\n _this2.$emit('input', _this2.scriptStr);\n\n _this2.$emit('onConfirm', _this2.scriptStr);\n\n _this2.dialogVisible = false;\n }\n }).catch(function (items) {\n _this2.$message.error(\"\\u8FD8\\u6709\\u5185\\u5BB9\\u672A\\u586B\\u5199\\uFF0C\\u65E0\\u6CD5\\u751F\\u6210\\u8868\\u8868\\u8FBE\\u5F0F\\u3002\");\n }).finally(function () {\n _this2.loading = false;\n });\n },\n getConditionStr: function getConditionStr(obj) {\n if (!obj || !obj.condition) return;\n var returnData = {};\n var data = obj.condition;\n var res = '';\n var desString = '';\n\n for (var i = 0; i < data.length; i++) {\n //第一节点的表达式\n var curcondStr1 = '';\n var curcondDes1 = ''; //如果第一节点有分支则计算\n\n if (data[i].condition && data[i].condition.length > 0) {\n curcondStr1 += '(';\n curcondDes1 += '(';\n\n for (var j = 0; j < data[i].condition.length; j++) {\n //第二节点的表达式\n var curcondStr2 = '';\n var curcondDes2 = ''; //如果第三级节点有分支,则计算分支\n\n if (data[i].condition[j].condition && data[i].condition[j].condition.length > 0) {\n curcondStr2 += '(';\n curcondDes2 += '(';\n var curcondStr3 = '';\n var curcondDes3 = '';\n\n for (var z = 0; z < data[i].condition[j].condition.length; z++) {\n curcondStr3 = this.getConditionStrByObj(data[i].condition[j].condition[z]);\n curcondDes3 = this.getConditionStrByObj(data[i].condition[j].condition[z], 'des');\n\n if (curcondStr3 != '') {\n //循环拼接第三节点的条件\n if (z == 0) {\n //第一个不拼接运算符\n curcondStr2 += curcondStr3;\n curcondDes2 += curcondDes3;\n } else {\n curcondStr2 += this.getjunction(data[i].condition[j].junction) + curcondStr3;\n curcondDes2 += this.getjunction(data[i].condition[j].junction) + curcondDes3;\n }\n }\n }\n\n curcondStr2 += ')';\n curcondDes2 += ')';\n } else if (data[i].condition[j].property) {\n //第二节点没有分只\n curcondStr2 = this.getConditionStrByObj(data[i].condition[j]);\n curcondDes2 = this.getConditionStrByObj(data[i].condition[j], 'des');\n }\n\n if (curcondStr2 != '') {\n //循环拼接第二节点的条件\n if (j == 0) {\n //第一个不拼接运算符\n curcondStr1 += curcondStr2;\n curcondDes1 += curcondDes2;\n } else {\n curcondStr1 += this.getjunction(data[i].junction) + curcondStr2;\n curcondDes1 += this.getjunction(data[i].junction) + curcondDes2;\n }\n }\n }\n\n curcondStr1 += ')';\n curcondDes1 += ')';\n } else if (data[i].property) {\n //第一节点没有分只\n curcondStr1 = this.getConditionStrByObj(data[i]);\n curcondDes1 = this.getConditionStrByObj(data[i], 'des');\n }\n\n if (curcondStr1 != '') {\n //循环拼接第一节点的条件\n if (i == 0) {\n //第一个不拼接运算符\n res += curcondStr1;\n desString += curcondDes1;\n } else {\n res += this.getjunction(obj.junction) + curcondStr1;\n desString += this.getjunction(obj.junction) + curcondDes1;\n }\n }\n }\n\n returnData.conditionString = res;\n returnData.conditionDes = desString;\n return returnData;\n },\n getjunction: function getjunction(str) {\n var res = '';\n\n switch (str) {\n case 'and':\n res = ' && ';\n break;\n\n case 'or':\n res = ' || ';\n break;\n }\n\n return res;\n },\n getConditionStrByObj: function getConditionStrByObj(obj, type) {\n var res = '';\n\n switch (obj.dataType) {\n case 'varchar':\n res = this.buildStringCondition(obj, type);\n break;\n\n case 'date':\n res = this.buildDateCondition(obj, type);\n break;\n\n case 'number':\n res = this.buildIntCondition(obj, type);\n break;\n }\n\n return res;\n },\n buildDateCondition: function buildDateCondition(obj, type) {\n var value = obj.value;\n var valueDes = '';\n var property = obj.property;\n var res = '';\n\n if (obj.compType == 1) {\n value = '\"' + obj.value + '\"';\n valueDes = value;\n } else {\n valueDes = obj.changeDesc;\n }\n\n if (type == 'des') {\n property = obj.chooseDesc;\n value = valueDes;\n\n switch (obj.operator) {\n case '1':\n res = property + '==' + value;\n break;\n\n case '2':\n res = property + '!=' + value;\n break;\n\n case '3':\n res = property + '>' + value;\n break;\n\n case '4':\n res = property + '<' + value;\n break;\n }\n } else {\n switch (obj.operator) {\n case '1':\n res = 'scriptImpl.isDateEquals(' + property + ',' + value + ')';\n break;\n\n case '2':\n res = '!scriptImpl.isDateEquals(' + property + ',' + value + ')';\n break;\n\n case '3':\n res = 'scriptImpl.isDateLarge(' + property + ',' + value + ')';\n break;\n\n case '4':\n res = 'scriptImpl.isDateLittle(' + property + ',' + value + ')';\n break;\n\n case '7':\n res = 'scriptImpl.isDateLargeEquals(' + property + ',' + value + ')';\n break;\n\n case '8':\n res = 'scriptImpl.isDateLittleEquals(' + property + ',' + value + ')';\n break;\n\n case '9':\n res = 'scriptImpl.isDateBelongTo(' + property + ',' + value + ')';\n break;\n }\n }\n\n return res;\n },\n buildStringCondition: function buildStringCondition(obj, type) {\n var value = obj.value;\n var valueDes = '';\n var property = obj.property;\n var res = '';\n\n if (obj.compType == 1) {\n value = '\"' + obj.value + '\"';\n valueDes = value;\n } else {\n valueDes = obj.changeDesc;\n }\n\n if (type == 'des') {\n property = obj.chooseDesc;\n value = valueDes;\n\n switch (obj.operator) {\n case '1':\n res = property + '==' + value;\n break;\n\n case '2':\n res = property + '!=' + value;\n break;\n\n case '3':\n res = property + '>' + value;\n break;\n\n case '4':\n res = property + '<' + value;\n break;\n\n case '5':\n res = property + 'contains' + value;\n break;\n\n case '6':\n res = property + '! contains' + value;\n break;\n }\n } else {\n switch (obj.operator) {\n case '1':\n res = 'scriptImpl.equals(' + property + ',' + value + ')';\n break;\n\n case '2':\n res = '!scriptImpl.equals(' + property + ',' + value + ')';\n break;\n\n case '3':\n res = 'scriptImpl.LargeThen(' + property + ',' + value + ')';\n break;\n\n case '4':\n res = 'scriptImpl.littleThen(' + property + ',' + value + ')';\n break;\n\n case '5':\n res = 'scriptImpl.contains(' + property + ',' + value + ')';\n break;\n\n case '6':\n res = '!scriptImpl.contains(' + property + ',' + value + ')';\n break;\n\n case '9':\n res = 'scriptImpl.isStringBelongTo(' + property + ',' + value + ')';\n break;\n }\n }\n\n return res;\n },\n buildIntCondition: function buildIntCondition(obj, type) {\n var value = obj.value;\n var valueDes = '';\n var property = obj.property;\n\n if (obj.compType == 1) {\n value = obj.value;\n valueDes = value;\n } else {\n valueDes = obj.changeDesc;\n }\n\n if (type == 'des') {\n property = obj.chooseDesc;\n value = valueDes;\n }\n\n var res = '';\n\n switch (obj.operator) {\n case '1':\n res = property + '==' + value;\n break;\n\n case '2':\n res = property + '!=' + value;\n break;\n\n case '3':\n res = property + '>' + value;\n break;\n\n case '4':\n res = property + '<' + value;\n break;\n\n case '7':\n res = property + '>=' + value;\n break;\n\n case '8':\n res = property + '<=' + value;\n break;\n\n case '9':\n // res = \"scriptImpl.isNumberBelongTo(\" + property + \",\\\"\" + value + \"\\\")\";\n var valueArr = value.split(',');\n res = \"(\".concat(property, \">=\").concat(valueArr[0], \" && \").concat(property, \"<=\").concat(valueArr[1], \")\");\n break;\n }\n\n return res;\n },\n handleClose: function handleClose() {\n var _this3 = this;\n\n utils.validateForm(this, 'form1').then(function (r) {\n _this3.$message.success(JSON.stringify(_this3.data));\n }).catch(function (items) {\n _this3.$message.error(\"\\u8FD8\\u6709\\u5185\\u5BB9\\u672A\\u586B\\u5199\\uFF0C\\u65E0\\u6CD5\\u751F\\u6210\\u8868\\u8868\\u8FBE\\u5F0F\\u3002\");\n }).finally(function () {\n _this3.loading = false;\n });\n },\n cuserSelectorConfirm: function cuserSelectorConfirm(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 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 }\n\n return isTrue;\n },\n editCondition: function editCondition(tab) {\n this.$message.error('研发中,敬请期待!');\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 },\n created: function created() {\n this.$validator = this.$root.$validator;\n }\n};",null]}