{"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\\form\\customView\\MathRowDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\form\\customView\\MathRowDialog.vue","mtime":1675071992131},{"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/es6.function.name\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nexport default {\n name: \"math-row-dialog\",\n props: [\"visible\", \"boDefData\", \"rowMathExp\", \"boSubEntity\", \"subTables\"],\n data: function data() {\n return {\n expandAll: true,\n defaultProps: {\n children: \"children\",\n label: \"desc\"\n },\n countSetting: {\n isSingleRecord: false,\n rowMathExps: []\n },\n curMathExp: '',\n curMathExpIndex: -1\n };\n },\n mounted: function mounted() {\n this.mathExpAssign(this.rowMathExp);\n },\n watch: {\n mathExp: function mathExp(val) {\n this.mathExpAssign(val);\n }\n },\n methods: {\n mathExpAssign: function mathExpAssign(val) {\n if (!val) {\n val = [];\n }\n\n this.$set(this.countSetting, \"rowMathExps\", val);\n },\n cancel: function cancel() {\n this.$emit(\"update:visible\", false);\n },\n confirm: function confirm() {\n this.$emit(\"update:rowMathExp\", this.countSetting.rowMathExps);\n\n try {\n if (this.$parent && this.$parent.$parent.setHotColumRowMathExp) {\n this.$parent.$parent.setHotColumRowMathExp(this.countSetting.rowMathExps);\n }\n } catch (error) {}\n\n this.$emit(\"update:visible\", false);\n },\n //统计函数相关配置\n insert: function () {\n var _insert = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(myValue) {\n var cindex, myField, value, endPosition, startPos, endPos;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n cindex = this.curMathExpIndex;\n myField = document.getElementById(cindex + '_singleText');\n value = myValue;\n endPosition = 0;\n\n if (myValue == \"abs\") {\n value = \"FormMath.abs()\";\n endPosition = 1;\n } else if (myValue == \"round\") {\n value = \"FormMath.round()\";\n endPosition = 1;\n } else if (myValue == \"sqrt\") {\n value = \"FormMath.sqrt()\";\n endPosition = 1;\n } else if (myValue == \"tofixed\") {\n endPosition = 3;\n value = \"FormMath.tofixed(,2)\";\n } else if (myValue == \"convertCurrency\") {\n value = \"FormMath.convertCurrency()\";\n endPosition = 1;\n } else if (myValue == \"()\") {\n endPosition = 1;\n } else if (myValue == \"sum\") {\n value = \"FormMath.sum()\";\n endPosition = 1;\n } else if (myValue == \"max\") {\n value = \"FormMath.max()\";\n endPosition = 1;\n } else if (myValue == \"min\") {\n value = \"FormMath.min()\";\n endPosition = 1;\n } else if (myValue == \"average\") {\n value = \"FormMath.average()\";\n endPosition = 1;\n }\n\n if (!(myField.selectionStart || myField.selectionStart === 0)) {\n _context.next = 13;\n break;\n }\n\n startPos = myField.selectionStart;\n endPos = myField.selectionEnd;\n this.curMathExp = myField.value.substring(0, startPos) + value + myField.value.substring(endPos, myField.value.length);\n _context.next = 11;\n return this.$nextTick();\n\n case 11:\n // 这句是重点, 圈起来\n myField.focus();\n myField.setSelectionRange(endPos + value.length, endPos + value.length - endPosition);\n\n case 13:\n if (!this.countSetting.rowMathExps[cindex]['mathExp']) {\n this.countSetting.rowMathExps[cindex]['mathExp'] = value;\n } else {\n this.countSetting.rowMathExps[cindex]['mathExp'] += value;\n }\n\n case 14:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function insert(_x) {\n return _insert.apply(this, arguments);\n }\n\n return insert;\n }(),\n handleNodeClick: function handleNodeClick(data, treeNode) {\n if (data.dataType != \"number\") {\n this.$message({\n message: \"请选择数字类型的字段! \",\n type: \"warning\"\n });\n return;\n }\n\n var isMain = treeNode.parent.data.nodeType == \"main\";\n var path = \"data.\" + data.path + \".\" + data.name;\n\n if (!isMain && this.countSetting.isSingleRecord) {\n path = \"item.\" + data.name;\n }\n\n if (isMain && this.countSetting.isSingleRecord) {\n this.$message({\n message: \"子表中单条记录运算模式下,不能选择主表字段!\",\n type: \"warning\"\n });\n return;\n }\n\n var desc = \"\";\n\n if (isMain || this.countSetting.isSingleRecord) {\n desc = \"{\" + data.desc + \"(\" + path + \")\" + \"}\";\n } else {\n desc = \"[{\" + data.desc + \"(\" + path + \")\" + \"}]\";\n }\n\n this.insert(desc);\n },\n addMathExp: function addMathExp() {\n this.countSetting.rowMathExps.push({\n desc: '',\n mathExp: ''\n });\n },\n rowClick: function rowClick(index) {\n this.curMathExpIndex = index;\n this.curMathExp = this.countSetting.rowMathExps[index]['mathExp'];\n },\n mathExpRemove: function mathExpRemove(item) {\n this.countSetting.rowMathExps.remove(item);\n },\n up: function up(index, data) {\n if (index === 0) {\n this.$message({\n message: \"已经是列表中第一位\",\n type: \"warning\"\n });\n } else {\n var temp = data[index - 1];\n Vue.set(data, index - 1, data[index]);\n Vue.set(data, index, temp);\n }\n },\n down: function down(index, data) {\n if (index === data.length - 1) {\n this.$message({\n message: \"已经是列表中最后一位\",\n type: \"warning\"\n });\n } else {\n this.isTransition = true;\n var i = data[index + 1];\n Vue.set(data, index + 1, data[index]);\n Vue.set(data, index, i);\n }\n }\n }\n};",null]}