{"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\\CellMathDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\form\\customView\\CellMathDialog.vue","mtime":1675071992069},{"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//\nexport default {\n  name: \"math-dialog\",\n  props: [\"visible\", \"boDefData\", \"mathExp\"],\n  data: function data() {\n    return {\n      expandAll: true,\n      defaultProps: {\n        children: \"children\",\n        label: \"desc\"\n      },\n      countSetting: {\n        isSingleRecord: \"\",\n        mathExp: \"\"\n      }\n    };\n  },\n  mounted: function mounted() {\n    this.mathExpAssign(this.mathExp);\n  },\n  watch: {\n    mathExp: function mathExp(val) {\n      this.mathExpAssign(val);\n    }\n  },\n  methods: {\n    mathExpAssign: function mathExpAssign(val) {\n      this.$set(this.countSetting, \"mathExp\", val);\n    },\n    cancel: function cancel() {\n      this.$emit(\"update:visible\", false);\n    },\n    confirm: function confirm() {\n      this.$emit(\"update:mathExp\", this.countSetting.mathExp);\n\n      try {\n        if (this.$parent && this.$parent.$parent.setHotCellMathExp) {\n          this.$parent.$parent.setHotCellMathExp(this.countSetting.mathExp);\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 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                myField = document.getElementById('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 = 14;\n                  break;\n                }\n\n                startPos = myField.selectionStart;\n                endPos = myField.selectionEnd;\n                this.countSetting.mathExp = myField.value.substring(0, startPos) + value + myField.value.substring(endPos, myField.value.length);\n                _context.next = 10;\n                return this.$nextTick();\n\n              case 10:\n                // 这句是重点, 圈起来\n                myField.focus();\n                myField.setSelectionRange(endPos + value.length, endPos + value.length - endPosition);\n                _context.next = 15;\n                break;\n\n              case 14:\n                if (!this.countSetting.mathExp) {\n                  this.countSetting.mathExp = value;\n                } else {\n                  this.countSetting.mathExp += value;\n                }\n\n              case 15:\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) {\n        path += \"[rowIndex]\";\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  }\n};",null]}