{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\src\\views\\StatisticalReport\\UserDefinedLedger.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\views\\StatisticalReport\\UserDefinedLedger.vue","mtime":1675214578105},{"path":"D:\\jenkins\\workspace\\xypm-web\\babel.config.js","mtime":1675214572901},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\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/es6.object.keys\";\nimport \"core-js/modules/es7.symbol.async-iterator\";\nimport \"core-js/modules/es6.symbol\";\nimport \"core-js/modules/es6.array.from\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport _defineProperty from \"D:/jenkins/workspace/xypm-web/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport _toConsumableArray from \"D:/jenkins/workspace/xypm-web/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";\nimport \"core-js/modules/es6.string.iterator\";\nimport \"core-js/modules/es6.map\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); 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 = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { 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 = it.call(o); }, 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\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 Sortable from 'sortablejs';\nimport utils from '@/hotent-ui-util';\nimport UserDefinedLedgerDialog from '@/components/dialog/UserDefinedLedgerDialog.vue';\nimport ViewDefinedDialog from '@/components/dialog/ViewDefinedDialog.vue';\nexport default {\n  name: 'UserDefinedLedger',\n  components: {\n    UserDefinedLedgerDialog: UserDefinedLedgerDialog,\n    ViewDefinedDialog: ViewDefinedDialog\n  },\n  props: {\n    pid: {\n      type: String,\n      default: ''\n    },\n    isShow: {\n      type: Boolean,\n      default: true\n    },\n    alias: {\n      type: String,\n      default: ''\n    }\n  },\n  data: function data() {\n    return {\n      data: [],\n      pageResult: {\n        pageSize: 10,\n        pageNum: 1,\n        total: 0\n      },\n      dialogVisible: false,\n      form: {},\n      propsData: [],\n      collapseActiveNames: ['1', '2'],\n      searchForm: {\n        name: ''\n      },\n      loading: false,\n      formRules: {\n        name: [{\n          required: true,\n          message: '请输入模板名称',\n          trigger: 'blur'\n        }] // projectName: [\n        //   {required: true, message: '请选择项目名称', trigger: 'blur'},\n        // ],\n\n      },\n      disabledKeys: ['2', '3', '4']\n    };\n  },\n  computed: {\n    deleteUrl: function deleteUrl() {\n      return window.context.cqxy + '/biz/menuFieldTemp/v1/delete';\n    }\n  },\n  created: function created() {},\n  methods: {\n    // select(val, arr) {\n    //   this.form.projectName = arr.projectName\n    //   this.form.projectId = arr.id\n    // },\n    //行拖拽\n    rowDrop: function rowDrop() {\n      var tbody = document.getElementById('propsTable').querySelector('.el-table__body-wrapper tbody');\n\n      var _this = this;\n\n      Sortable.create(tbody, {\n        onEnd: function onEnd(_ref) {\n          var newIndex = _ref.newIndex,\n              oldIndex = _ref.oldIndex;\n          var arr = [];\n\n          _this.propsData.forEach(function (item) {\n            arr.push(item);\n          });\n\n          arr[newIndex] = arr.splice(oldIndex, 1, arr[newIndex])[0];\n          _this.propsData = arr;\n        }\n        /* newDraggableIndex */\n        // onEnd({newIndex, oldIndex}) {\n        //   const oldRow = _this.propsData[oldIndex]\n        //   const newRow = _this.propsData[newIndex]\n        //   oldRow.oldDraggableIndex = newIndex\n        //   newRow.newDraggableIndex = oldIndex\n        //   let newRows\n        //   let rows\n        //   if (newIndex > oldIndex) {\n        //     newRows = _this.propsData.slice(oldIndex, newIndex + 1)\n        //     rows = _this.propsData.splice(oldIndex, newRows.length)\n        //   } else if (newIndex == oldIndex) {\n        //     return\n        //   } else {\n        //     newRows = _this.propsData.slice(newIndex, oldIndex + 1)\n        //     rows = _this.propsData.splice(newIndex, newRows.length)\n        //   }\n        //   const firstRow = rows.splice(0, 1)[0]\n        //   const lastRow = rows.splice(rows.length - 1, 1)[0]\n        //   _this.propsData.splice(newIndex, 0, lastRow, ...rows, firstRow)\n        // },\n\n      });\n    },\n    loadData: function loadData(param, cb) {\n      var _this2 = this;\n\n      var query = [];\n      var search = {\n        name_: this.searchForm.name\n      };\n\n      for (var i in search) {\n        if (search[i]) {\n          query.push({\n            group: 'advance',\n            operation: 'LIKE',\n            property: i,\n            relation: 'AND',\n            value: search[i]\n          });\n        }\n      }\n\n      if (param.querys && param.querys.length) {\n        var _param$querys;\n\n        (_param$querys = param.querys).push.apply(_param$querys, query);\n      } else {\n        param.querys = query;\n      }\n\n      this.$http.post('${cqxy}/biz/menuFieldTemp/v1/query', param).then(function (resp) {\n        var response = resp.data;\n        _this2.data = response.rows;\n        _this2.pageResult = {\n          page: response.page,\n          pageSize: response.pageSize,\n          total: response.total\n        };\n      }, function (error) {\n        reject(error);\n      }).finally(function () {\n        if (cb) {\n          cb();\n        }\n      });\n    },\n    handleDialogCancel: function handleDialogCancel() {\n      this.dialogVisible = false;\n    },\n    handleDialogClose: function handleDialogClose() {\n      this.dialogVisible = false;\n    },\n    handleAdd: function handleAdd() {\n      var _this3 = this;\n\n      this.dialogVisible = true;\n      this.form = {\n        // projectName:'',\n        // projectId:'',\n        name: '',\n        describe: ''\n      };\n      this.propsData = [];\n      this.$nextTick(function () {\n        _this3.rowDrop();\n      });\n    },\n    handleAddprops: function handleAddprops() {\n      this.$refs.templeteConfigRef.show(this.propsData);\n    },\n    handleCommand: function handleCommand(row) {\n      var _this4 = this;\n\n      this.loading = true;\n\n      if (row.command == 'preview') {\n        var param = {\n          id: row.row.id\n        };\n\n        if (this.pid) {\n          param.projectId = this.pid;\n        }\n\n        this.$http.post('${cqxy}/biz/menuFieldTemp/v1/getDataById', param).then(function (res) {\n          _this4.loading = false;\n          var data = res.data.value;\n          data.id = row.row.id;\n\n          if (_this4.pid) {\n            data.projectId = _this4.pid;\n            data.projectName = _this4.$route.params.projectName;\n            data.flag = true;\n          }\n\n          _this4.$refs.viewDefined.open(data);\n        }).catch(function () {\n          _this4.loading = false;\n        });\n      } else {\n        this.$http.get('${cqxy}/biz/menuFieldTemp/v1/exportData?id=' + row.row.id).then(function (res) {\n          _this4.loading = false;\n        }).catch(function (res) {\n          _this4.loading = false;\n        });\n      }\n    },\n    handleUp: function handleUp(row, index) {\n      if (index !== 0) {\n        var targetItem = row; // 当前Item\n\n        var upItem = this.propsData[index - 1]; // 前一个Item\n\n        var targetIndex = this.propsData[index].orderIndex; // 当前ItemIndex\n\n        var upIndex = this.propsData[index - 1].orderIndex; // 前一个ItemIndex\n        // 交换orderIndex\n\n        targetItem.orderIndex = upIndex;\n        upItem.orderIndex = targetIndex;\n        this.propsData.splice(index - 1, 2, targetItem, upItem);\n      } else {\n        this.$message.warning('已经处于置顶，无法上移');\n      }\n    },\n    handleDown: function handleDown(row, index) {\n      if (index !== this.propsData.length - 1) {\n        var targetItem = row; // 当前Item\n\n        var downItem = this.propsData[index + 1]; // 前一个Item\n\n        var targetIndex = this.propsData[index].orderIndex; // 当前ItemIndex\n\n        var downIndex = this.propsData[index + 1].orderIndex; // 前一个ItemIndex\n        // 交换orderIndex\n\n        targetItem.orderIndex = downIndex;\n        downItem.orderIndex = targetIndex;\n        this.propsData.splice(index, 2, downItem, targetItem);\n      } else {\n        this.$message.warning('已经处于置底，无法下移');\n      }\n    },\n    handleDelFields: function handleDelFields(row) {\n      var _this5 = this;\n\n      var formData = new FormData();\n      formData.append('ids', row.id);\n      this.$http.post('${cqxy}/biz/menuCustomizeField/v1/delete', formData).then(function (res) {\n        if (res.data.state) {\n          var data = utils.deepClone(_this5.propsData);\n          var target = data.filter(function (item) {\n            return item.id != row.id;\n          });\n          _this5.propsData = target;\n\n          _this5.$message.success(res.data.message);\n        } else {\n          _this5.$message.error(res.data.message);\n        }\n      });\n    },\n    findinfo: function findinfo() {\n      this.$refs.AtTable.load();\n    },\n    handleReset: function handleReset() {\n      this.searchForm = {\n        name: ''\n      };\n      this.$refs.AtTable.load();\n    },\n    submitPropsData: function submitPropsData(data) {\n      this.propsData = this.deweight(data);\n    },\n    deweight: function deweight(arr) {\n      var map = new Map();\n\n      var _iterator = _createForOfIteratorHelper(arr),\n          _step;\n\n      try {\n        for (_iterator.s(); !(_step = _iterator.n()).done;) {\n          var i = _step.value;\n\n          if (!map.has(i.id)) {\n            map.set(i.id, i);\n          }\n        }\n      } catch (err) {\n        _iterator.e(err);\n      } finally {\n        _iterator.f();\n      }\n\n      return _toConsumableArray(map.values());\n    },\n    handleDialogSubmit: function handleDialogSubmit() {\n      var _this6 = this;\n\n      var params = _objectSpread(_objectSpread({}, this.form), {}, {\n        menuCustomizeFieldList: this.propsData\n      });\n\n      this.$refs.form.validate(function (bool) {\n        if (bool) {\n          _this6.$http.post('${cqxy}/biz/menuFieldTemp/v1/save', params).then(function (res) {\n            _this6.$message.success('保存成功');\n\n            _this6.dialogVisible = false;\n\n            _this6.$refs.AtTable.load();\n          });\n        }\n      });\n    },\n    handleRowDBClick: function handleRowDBClick(data) {\n      var _this7 = this;\n\n      this.loading = true;\n      this.$http.post('${cqxy}/biz/menuFieldTemp/v1/detail/' + data.id).then(function (res) {\n        _this7.form = res.data.value;\n        _this7.dialogVisible = true;\n        _this7.propsData = _this7.form.menuCustomizeFieldList;\n\n        _this7.propsData.forEach(function (item) {\n          _this7.$set(item, 'calculationMethod', item.calculationMethod || '1');\n        });\n\n        _this7.loading = false;\n\n        _this7.$nextTick(function () {\n          _this7.rowDrop();\n        });\n      }).catch(function (err) {\n        console.error(err);\n        _this7.loading = false;\n      });\n    },\n    handleCloseViewDialog: function handleCloseViewDialog(done) {\n      done();\n    }\n  }\n};",null]}