{"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\\components\\common\\HtDeleteButton.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\components\\common\\HtDeleteButton.vue","mtime":1675214576620},{"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":456789000000},{"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.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.function.name\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xypm-web/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\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; } } }; }\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); }\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\nimport req from '@/request.js';\nexport default {\n  name: 'ht-delete-button',\n  props: {\n    type: {\n      type: String,\n      default: 'danger'\n    },\n    requestMethod: {\n      type: String,\n      default: 'DELETE'\n    },\n    url: {\n      type: String,\n      required: true\n    },\n    pk: {\n      type: String,\n      default: 'id'\n    },\n    parameter: {\n      type: String,\n      default: 'ids'\n    },\n    pureData: {\n      type: Boolean,\n      default: false\n    },\n    htTable: {\n      type: Object\n    },\n    row: {\n      type: Object\n    }\n  },\n  data: function data() {\n    return {\n      fullscreenLoading: false,\n      elTable: null\n    };\n  },\n  methods: {\n    handleDelete: function () {\n      var _handleDelete = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n        var _this = this;\n        var ids, _iterator, _step, item, params, data, response;\n        return regeneratorRuntime.wrap(function _callee$(_context) {\n          while (1) switch (_context.prev = _context.next) {\n            case 0:\n              this.elTable = this.htTable;\n              if (this.htTable.$refs && this.htTable.$refs.htTable) {\n                this.elTable = this.htTable.$refs.htTable;\n              }\n              console.log(this.elTable, this.elTable.selection, this.row);\n              if (!(this.elTable && this.elTable.selection && this.elTable.selection.length == 0 && !this.row)) {\n                _context.next = 6;\n                break;\n              }\n              this.$message.error('请至少选择一条数据');\n              return _context.abrupt(\"return\");\n            case 6:\n              ids = [];\n              if (this.row) {\n                ids.push(this.row[this.pk]);\n              } else {\n                _iterator = _createForOfIteratorHelper(this.elTable.selection);\n                try {\n                  for (_iterator.s(); !(_step = _iterator.n()).done;) {\n                    item = _step.value;\n                    //判断是否是合同管理传递的参数，因为合同管理的对象数据格式需要特殊处理\n                    if (item.contract) {\n                      ids.push(item.contract[this.pk]);\n                    } else {\n                      ids.push(item[this.pk]);\n                    }\n                  }\n                } catch (err) {\n                  _iterator.e(err);\n                } finally {\n                  _iterator.f();\n                }\n              }\n              params = {}, data = null;\n              params[this.parameter] = ids.join(',');\n              // 如果是纯文本作为参数，则直接传递文本作为参数\n              if (this.pureData) {\n                params = null;\n                data = ids.join(',');\n              }\n              this.fullscreenLoading = true;\n              _context.next = 14;\n              return req.request({\n                params: params,\n                data: data,\n                url: this.url,\n                method: this.requestMethod\n              }).finally(function () {\n                _this.fullscreenLoading = false;\n              });\n            case 14:\n              response = _context.sent;\n              if (response.data && response.data.state) {\n                this.$emit('after-delete');\n                this.htTable.load();\n                this.$message({\n                  message: response.data.message || '操作成功',\n                  showClose: true,\n                  type: 'success'\n                });\n              }\n            case 16:\n            case \"end\":\n              return _context.stop();\n          }\n        }, _callee, this);\n      }));\n      function handleDelete() {\n        return _handleDelete.apply(this, arguments);\n      }\n      return handleDelete;\n    }()\n  }\n};",null]}