{"remainingRequest":"/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/organization/components/UserForm.vue?vue&type=script&lang=js","dependencies":[{"path":"/Users/admin/projects/dms/src/dealer_admin/src/views/system/organization/components/UserForm.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/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":["\"use strict\";\n\nvar _interopRequireWildcard = require(\"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime/helpers/interopRequireWildcard.js\");\nvar _interopRequireDefault = require(\"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime/helpers/interopRequireDefault.js\");\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _regeneratorRuntime2 = _interopRequireDefault(require(\"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/regeneratorRuntime.js\"));\nrequire(\"regenerator-runtime/runtime\");\nvar _asyncToGenerator2 = _interopRequireDefault(require(\"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator.js\"));\nvar API = _interopRequireWildcard(require(\"@/api/admin\"));\nvar PositionAPI = _interopRequireWildcard(require(\"@/api/position\"));\nvar _lodash = _interopRequireDefault(require(\"lodash\"));\nvar Utils = _interopRequireWildcard(require(\"@/utils/validate\"));\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nvar _default2 = exports.default = {\n  components: {},\n  props: {\n    userRoleList: {\n      default: function _default() {\n        return [];\n      },\n      type: Array\n    }\n  },\n  data: function data() {\n    return {\n      dateVal: \"\",\n      dialogFormVisible: false,\n      textMap: {\n        add: \"新增\",\n        update: \"编辑\"\n      },\n      picbase: \"\",\n      //记录 上传头像基础地址\n      // 新增更新相关\n      dialogStatus: \"add\",\n      disabled: false,\n      //是否禁用用户\n      userStatusList: [{\n        value: false,\n        label: \"启用\"\n      }, {\n        value: true,\n        label: \"禁用\"\n      }],\n      superList: [{\n        value: 1,\n        label: \"否\"\n      }, {\n        value: 2,\n        label: \"是\"\n      }],\n      //记录输入信息\n      form: {\n        position: null\n      },\n      regionid: \"\",\n      positionList: []\n    };\n  },\n  computed: {},\n  created: function created() {\n    this.$forceUpdate();\n  },\n  methods: {\n    resetForm: function resetForm() {\n      this.form = {\n        position: null\n      };\n    },\n    change: function change(e) {\n      this.$forceUpdate();\n    },\n    logTimeChange: function logTimeChange(val) {\n      this.form.hiredate = val;\n    },\n    init: function () {\n      var _init = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(id, organization) {\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {\n          while (1) switch (_context.prev = _context.next) {\n            case 0:\n              this.resetForm();\n              this.form.organization = organization;\n              if (id) {\n                this.handleUpdate(id);\n              } else {\n                this.handleAdd();\n              }\n              this.getPositionList();\n            case 4:\n            case \"end\":\n              return _context.stop();\n          }\n        }, _callee, this);\n      }));\n      function init(_x, _x2) {\n        return _init.apply(this, arguments);\n      }\n      return init;\n    }(),\n    /** 处理更新 */handleUpdate: function () {\n      var _handleUpdate = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_id) {\n        var _this = this;\n        var resData;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {\n          while (1) switch (_context2.prev = _context2.next) {\n            case 0:\n              _context2.next = 2;\n              return API.getAdminInfo(_id);\n            case 2:\n              resData = _context2.sent;\n              //console.log(resData);\n              this.form = Object.assign(this.form, resData.result.detail, {\n                password: \"\"\n              });\n              this.dialogStatus = \"update\";\n              this.disabled = true;\n              this.dialogFormVisible = true;\n              this.$nextTick(function () {\n                _this.$refs[\"dataForm\"].clearValidate();\n              });\n            case 8:\n            case \"end\":\n              return _context2.stop();\n          }\n        }, _callee2, this);\n      }));\n      function handleUpdate(_x3) {\n        return _handleUpdate.apply(this, arguments);\n      }\n      return handleUpdate;\n    }(),\n    /** 处理新增 */handleAdd: function () {\n      var _handleAdd = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {\n        var _this2 = this;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {\n          while (1) switch (_context3.prev = _context3.next) {\n            case 0:\n              this.dialogStatus = \"add\";\n              this.disabled = false;\n              this.dialogFormVisible = true;\n              this.$nextTick(function () {\n                _this2.$refs[\"dataForm\"].clearValidate();\n              });\n            case 4:\n            case \"end\":\n              return _context3.stop();\n          }\n        }, _callee3, this);\n      }));\n      function handleAdd() {\n        return _handleAdd.apply(this, arguments);\n      }\n      return handleAdd;\n    }(),\n    /** 表单提交，区分好 是 新增 、 更新 */dataFormSubmit: function () {\n      var _dataFormSubmit = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5() {\n        var _this3 = this;\n        var tempData;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {\n          while (1) switch (_context5.prev = _context5.next) {\n            case 0:\n              tempData = _lodash.default.cloneDeep(this.form); //验证数据是否为空\n              if (!(tempData.username == undefined)) {\n                _context5.next = 4;\n                break;\n              }\n              this.showError(\"请输入邮箱名\");\n              return _context5.abrupt(\"return\");\n            case 4:\n              tempData.username = tempData.username;\n              //console.log(tempData);\n              if (!(tempData.password == undefined)) {\n                _context5.next = 8;\n                break;\n              }\n              this.showError(\"请输入密码\");\n              return _context5.abrupt(\"return\");\n            case 8:\n              if (!(tempData.disable == undefined)) {\n                _context5.next = 11;\n                break;\n              }\n              this.showError(\"请选择用户状态\");\n              return _context5.abrupt(\"return\");\n            case 11:\n              if (!(tempData.role == undefined)) {\n                _context5.next = 14;\n                break;\n              }\n              this.showError(\"请选择用户角色\");\n              return _context5.abrupt(\"return\");\n            case 14:\n              //console.log(\"form - info\", tempData);\n              //点击确认再次提示\n              this.$confirm(\"确认提交???\", \"提示\").then(function (_) {\n                console.log(\"确认\");\n                _this3.$refs[\"dataForm\"].validate(/*#__PURE__*/function () {\n                  var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4(valid) {\n                    var res;\n                    return (0, _regeneratorRuntime2.default)().wrap(function _callee4$(_context4) {\n                      while (1) switch (_context4.prev = _context4.next) {\n                        case 0:\n                          if (!valid) {\n                            _context4.next = 17;\n                            break;\n                          }\n                          if (!(_this3.dialogStatus === \"update\")) {\n                            _context4.next = 8;\n                            break;\n                          }\n                          tempData.id = _this3.form._id;\n                          _context4.next = 5;\n                          return API.updateAdminInfo(tempData);\n                        case 5:\n                          res = _context4.sent;\n                          _context4.next = 13;\n                          break;\n                        case 8:\n                          if (!(_this3.dialogStatus === \"add\")) {\n                            _context4.next = 13;\n                            break;\n                          }\n                          //tempData.type = 100;\n                          console.log(\"创建用户\");\n                          _context4.next = 12;\n                          return API.createByAdmin(tempData);\n                        case 12:\n                          res = _context4.sent;\n                        case 13:\n                          _this3.dialogFormVisible = false;\n                          _this3.$message({\n                            message: \"\".concat(_this3.textMap[_this3.dialogStatus], \"\\u6210\\u529F\"),\n                            type: \"success\",\n                            duration: 1501,\n                            onClose: function onClose() {}\n                          });\n                          //添加成功后,记得移出\n                          _this3.fileList = [];\n                          setTimeout(function () {\n                            _this3.$emit(\"refreshDataList\");\n                          }, 500);\n                        case 17:\n                        case \"end\":\n                          return _context4.stop();\n                      }\n                    }, _callee4);\n                  }));\n                  return function (_x4) {\n                    return _ref.apply(this, arguments);\n                  };\n                }());\n              }).catch(function (_) {});\n            case 15:\n            case \"end\":\n              return _context5.stop();\n          }\n        }, _callee5, this);\n      }));\n      function dataFormSubmit() {\n        return _dataFormSubmit.apply(this, arguments);\n      }\n      return dataFormSubmit;\n    }(),\n    showError: function showError(msg) {\n      this.$message.error(msg);\n    },\n    getPositionList: function () {\n      var _getPositionList = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee6() {\n        var res;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee6$(_context6) {\n          while (1) switch (_context6.prev = _context6.next) {\n            case 0:\n              _context6.next = 2;\n              return PositionAPI.getAllList();\n            case 2:\n              res = _context6.sent;\n              this.positionList = [];\n              this.positionList = res.result;\n            case 5:\n            case \"end\":\n              return _context6.stop();\n          }\n        }, _callee6, this);\n      }));\n      function getPositionList() {\n        return _getPositionList.apply(this, arguments);\n      }\n      return getPositionList;\n    }()\n  }\n};",null]}