{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\sys\\user-add-or-update.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\sys\\user-add-or-update.vue","mtime":1620724486256},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\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 _toConsumableArray from \"C:\\\\Users\\\\27446\\\\Desktop\\\\up\\\\front\\\\dkha-web-sz-main\\\\node_modules\\\\@babel\\\\runtime-corejs2/helpers/esm/toConsumableArray\";\nimport _defineProperty from \"C:\\\\Users\\\\27446\\\\Desktop\\\\up\\\\front\\\\dkha-web-sz-main\\\\node_modules\\\\@babel\\\\runtime-corejs2/helpers/esm/defineProperty\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.string.iterator\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 debounce from 'lodash/debounce';\nimport { isEmail, isMobile } from '@/utils/validate';\nimport { getDictDataList } from '@/utils';\nexport default {\n data: function data() {\n return {\n visible: false,\n roleList: [],\n roleIdListDefault: [],\n // genderList: getDictDataList('gender'),\n // genderList: [{dictLabel: \"男\", dictValue: \"男\"}, {dictLabel: \"女\", dictValue: \"女\"}, {dictLabel: \"保密\", dictValue: \"保密\"},],\n dataForm: {\n id: '',\n username: '',\n deptId: '0',\n deptName: '',\n password: '',\n confirmPassword: '',\n realName: '',\n gender: '0',\n email: '',\n mobile: '',\n roleIdList: [],\n status: 1\n }\n };\n },\n computed: {\n dataRule: function dataRule() {\n var _this = this;\n\n var validatePassword = function validatePassword(rule, value, callback) {\n if (!_this.dataForm.id && !/\\S/.test(value)) {\n return callback(new Error(_this.$t('validate.required')));\n }\n\n callback();\n };\n\n var validateConfirmPassword = function validateConfirmPassword(rule, value, callback) {\n if (!_this.dataForm.id && !/\\S/.test(value)) {\n return callback(new Error(_this.$t('validate.required')));\n }\n\n if (_this.dataForm.password !== value) {\n return callback(new Error(_this.$t('user.validate.confirmPassword')));\n }\n\n callback();\n };\n\n var validateEmail = function validateEmail(rule, value, callback) {\n if (!isEmail(value)) {\n return callback(new Error(_this.$t('validate.format', {\n 'attr': _this.$t('user.email')\n })));\n }\n\n callback();\n };\n\n var validateMobile = function validateMobile(rule, value, callback) {\n if (!isMobile(value)) {\n return callback(new Error(_this.$t('validate.format', {\n 'attr': _this.$t('user.mobile')\n })));\n }\n\n callback();\n }; // return {\n // \tusername: [{\n // \t\trequired: true,\n // \t\tmessage: this.$t('validate.required'),\n // \t\ttrigger: 'blur'\n // \t}],\n // \tdeptName: [{\n // \t\trequired: true,\n // \t\tmessage: this.$t('validate.required'),\n // \t\ttrigger: 'change'\n // \t}],\n // \tpassword: [{\n // \t\tvalidator: validatePassword,\n // \t\ttrigger: 'blur'\n // \t}],\n // \tconfirmPassword: [{\n // \t\tvalidator: validateConfirmPassword,\n // \t\ttrigger: 'blur'\n // \t}],\n // \trealName: [{\n // \t\trequired: true,\n // \t\tmessage: this.$t('validate.required'),\n // \t\ttrigger: 'blur'\n // \t}],\n // \temail: [{\n // \t\t\trequired: true,\n // \t\t\tmessage: this.$t('validate.required'),\n // \t\t\ttrigger: 'blur'\n // \t\t},\n // \t\t{\n // \t\t\tvalidator: isEmail,\n // \t\t\ttrigger: 'blur'\n // \t\t}\n // \t],\n // \tmobile: [{\n // \t\t\trequired: true,\n // \t\t\tmessage: this.$t('validate.required'),\n // \t\t\ttrigger: 'blur'\n // \t\t},\n // \t\t{\n // \t\t\tvalidator: isMobile,\n // \t\t\ttrigger: 'blur'\n // \t\t}\n // \t]\n // }\n\n }\n },\n methods: {\n init: function init() {\n var _this2 = this;\n\n this.visible = true;\n this.dataForm.deptId = '';\n this.$nextTick(function () {\n _this2.$refs['dataForm'].resetFields();\n\n _this2.roleIdListDefault = [];\n Promise.all([_this2.getRoleList()]).then(function () {\n if (_this2.dataForm.id) {\n _this2.getInfo();\n }\n });\n });\n },\n // 获取角色列表\n getRoleList: function getRoleList() {\n var _this3 = this;\n\n return this.$http.get('/sys/role/list').then(function (_ref) {\n var res = _ref.data;\n\n if (res.code !== 0) {\n return _this3.$message.error(res.msg);\n }\n\n _this3.roleList = res.data;\n }).catch(function () {});\n },\n // 获取信息\n getInfo: function getInfo() {\n var _this4 = this;\n\n this.$http.get(\"/sys/user/\".concat(this.dataForm.id)).then(function (_ref2) {\n var res = _ref2.data;\n\n if (res.code !== 0) {\n return _this4.$message.error(res.msg);\n }\n\n _this4.dataForm = _objectSpread({}, _this4.dataForm, {}, res.data, {\n gender: String(res.data.gender),\n roleIdList: [] // 角色配置, 区分是否为默认角色\n\n });\n\n for (var i = 0; i < res.data.roleIdList.length; i++) {\n if (_this4.roleList.filter(function (item) {\n return item.id === res.data.roleIdList[i];\n })[0]) {\n _this4.dataForm.roleIdList.push(res.data.roleIdList[i]);\n\n continue;\n }\n\n _this4.roleIdListDefault.push(res.data.roleIdList[i]);\n }\n }).catch(function () {});\n },\n // 表单提交\n dataFormSubmitHandle: debounce(function () {\n var _this5 = this;\n\n this.$refs['dataForm'].validate(function (valid) {\n if (!valid) {\n return false;\n }\n\n _this5.$http[!_this5.dataForm.id ? 'post' : 'put']('/sys/user', _objectSpread({}, _this5.dataForm, {\n roleIdList: [].concat(_toConsumableArray(_this5.dataForm.roleIdList), _toConsumableArray(_this5.roleIdListDefault))\n })).then(function (_ref3) {\n var res = _ref3.data;\n\n if (res.code !== 0) {\n return _this5.$message.error(res.msg);\n }\n\n _this5.$message({\n message: _this5.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: function onClose() {\n _this5.visible = false;\n\n _this5.$emit('refreshDataList');\n }\n });\n }).catch(function () {});\n });\n }, 1000, {\n 'leading': true,\n 'trailing': false\n })\n }\n};",{"version":3,"sources":["user-add-or-update.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,OAAA,QAAA,MAAA,iBAAA;AACA,SACA,OADA,E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