{"remainingRequest":"/Users/admin/projects/dms/src/dealer_admin/node_modules/thread-loader/dist/cjs.js!/Users/admin/projects/dms/src/dealer_admin/node_modules/babel-loader/lib/index.js!/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js??ref--0-0!/Users/admin/projects/dms/src/dealer_admin/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/admin/projects/dms/src/dealer_admin/src/views/system/adminUser/index.vue?vue&type=script&lang=js","dependencies":[{"path":"/Users/admin/projects/dms/src/dealer_admin/src/views/system/adminUser/index.vue","mtime":1713161556000},{"path":"/Users/admin/projects/dms/src/dealer_admin/babel.config.js","mtime":1713161556000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.function.name\";\nimport _regeneratorRuntime from \"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/esm/regeneratorRuntime.js\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/esm/asyncToGenerator.js\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 * as API from \"@/api/admin\";\nimport * as RoleAPI from \"@/api/role\";\nimport Form from \"../organization/components/UserForm.vue\";\nimport waves from \"@/directive/waves\"; // waves directive\nimport { parseTime } from \"@/utils\";\nimport Pagination from \"@/components/Pagination\";\nimport UserResign from \"../organization/components/UserResign.vue\";\nimport UserTransfer from \"../organization/components/UserTransfer.vue\";\nexport default {\n  name: \"User\",\n  components: {\n    Form: Form,\n    Pagination: Pagination,\n    UserResign: UserResign,\n    UserTransfer: UserTransfer\n  },\n  directives: {\n    waves: waves\n  },\n  data: function data() {\n    return {\n      picbase: \"\",\n      tableKey: 0,\n      list: [],\n      total: 0,\n      listLoading: true,\n      listQuery: {\n        page: 1,\n        limit: 10,\n        search: \"\"\n      },\n      meta: {\n        meta: \"xlsx\"\n      },\n      exportLoading: false,\n      //导出\n      addLoading: false,\n      //添加\n\n      //批量导入\n      importLoading: false,\n      //批量添加\n      uploadLoading: false,\n      //批量添加 上传动画\n      fileList: [],\n      form: {},\n      userRoleList: []\n    };\n  },\n  created: function created() {\n    this.$forceUpdate();\n    this.getRoleList();\n    this.getList();\n  },\n  methods: {\n    getList: function () {\n      var _getList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n        var res, list;\n        return _regeneratorRuntime().wrap(function _callee$(_context) {\n          while (1) switch (_context.prev = _context.next) {\n            case 0:\n              this.listLoading = true;\n              _context.next = 3;\n              return API.getAdminList(this.listQuery);\n            case 3:\n              res = _context.sent;\n              this.total = res.result.total;\n              list = res.result.list;\n              this.list = list;\n              this.listLoading = false;\n            case 8:\n            case \"end\":\n              return _context.stop();\n          }\n        }, _callee, this);\n      }));\n      function getList() {\n        return _getList.apply(this, arguments);\n      }\n      return getList;\n    }(),\n    delHandle: function () {\n      var _delHandle = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(id) {\n        var _this = this;\n        return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n          while (1) switch (_context3.prev = _context3.next) {\n            case 0:\n              this.$confirm(\"确认删除???\", \"提示\").then(/*#__PURE__*/function () {\n                var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_) {\n                  var res;\n                  return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n                    while (1) switch (_context2.prev = _context2.next) {\n                      case 0:\n                        console.log(\"确认\");\n                        _context2.next = 3;\n                        return API.delAdminUser(id);\n                      case 3:\n                        res = _context2.sent;\n                        if (res.__error === 0) {\n                          _this.$message({\n                            message: \"成功\",\n                            type: \"success\"\n                          });\n                          _this.getList();\n                        }\n                      case 5:\n                      case \"end\":\n                        return _context2.stop();\n                    }\n                  }, _callee2);\n                }));\n                return function (_x2) {\n                  return _ref.apply(this, arguments);\n                };\n              }()).catch(function (_) {\n                console.log(\"取消\");\n              });\n            case 1:\n            case \"end\":\n              return _context3.stop();\n          }\n        }, _callee3, this);\n      }));\n      function delHandle(_x) {\n        return _delHandle.apply(this, arguments);\n      }\n      return delHandle;\n    }(),\n    fromHandle: function fromHandle(id, parent_id) {\n      var _this2 = this;\n      this.$nextTick(function () {\n        _this2.$refs.fromType.init(id, parent_id);\n      });\n    },\n    handleFilter: function handleFilter() {\n      this.listQuery.page = 1;\n      this.getList();\n    },\n    getRoleList: function () {\n      var _getRoleList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n        var resData, list, userRoleList;\n        return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n          while (1) switch (_context4.prev = _context4.next) {\n            case 0:\n              _context4.next = 2;\n              return RoleAPI.getValidList();\n            case 2:\n              resData = _context4.sent;\n              list = resData.result.list;\n              if (list && list.length > 0) {\n                userRoleList = [];\n                list.map(function (v) {\n                  var item = {\n                    label: v.name,\n                    value: v._id\n                  };\n                  userRoleList.push(item);\n                });\n                this.userRoleList = [];\n                this.userRoleList = userRoleList;\n              }\n            case 5:\n            case \"end\":\n              return _context4.stop();\n          }\n        }, _callee4, this);\n      }));\n      function getRoleList() {\n        return _getRoleList.apply(this, arguments);\n      }\n      return getRoleList;\n    }(),\n    resignUser: function resignUser(id) {\n      var _this3 = this;\n      this.$nextTick(function () {\n        _this3.$refs.userResign.init(id);\n      });\n    },\n    restoreUser: function () {\n      var _restoreUser = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(record) {\n        var _this4 = this;\n        return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n          while (1) switch (_context6.prev = _context6.next) {\n            case 0:\n              this.$confirm(\"确认恢复该用户???\", \"提示\").then(/*#__PURE__*/function () {\n                var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_) {\n                  var payload, res;\n                  return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n                    while (1) switch (_context5.prev = _context5.next) {\n                      case 0:\n                        console.log(\"确认\");\n                        payload = {\n                          id: record._id,\n                          status: 1\n                        };\n                        if (record.role && record.role._id) payload.role = record.role._id;\n                        if (record.position && record.position._id) payload.position = record.position._id;\n                        _context5.next = 6;\n                        return API.updateAdminInfo(payload);\n                      case 6:\n                        res = _context5.sent;\n                        if (res.__error === 0) {\n                          _this4.$message({\n                            message: \"成功\",\n                            type: \"success\"\n                          });\n                          _this4.getList();\n                        }\n                      case 8:\n                      case \"end\":\n                        return _context5.stop();\n                    }\n                  }, _callee5);\n                }));\n                return function (_x4) {\n                  return _ref2.apply(this, arguments);\n                };\n              }()).catch(function (_) {\n                console.log(\"取消\");\n              });\n            case 1:\n            case \"end\":\n              return _context6.stop();\n          }\n        }, _callee6, this);\n      }));\n      function restoreUser(_x3) {\n        return _restoreUser.apply(this, arguments);\n      }\n      return restoreUser;\n    }(),\n    transferUser: function transferUser(id, organizationId) {\n      var _this5 = this;\n      this.$nextTick(function () {\n        _this5.$refs.userTransfer.init(id, organizationId);\n      });\n    }\n  }\n};",null]}