1 line
16 KiB
JSON
1 line
16 KiB
JSON
{"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\\main-navbar-update-info.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\main-navbar-update-info.vue","mtime":1614735254000},{"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//\nimport debounce from 'lodash/debounce';\nimport { isEmail, isMobile } from '@/utils/validate';\nimport { clearLoginInfo } from '@/utils';\nexport default {\n data: function data() {\n return {\n visible: false,\n loading: false,\n roleList: [],\n roleIdListDefault: [],\n dataForm: {\n realName: '',\n mobile: '',\n email: ''\n }\n };\n },\n computed: {\n dataRule: function dataRule() {\n var _this = this;\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 };\n\n return {\n realName: [{\n required: true,\n message: this.$t('validate.required'),\n trigger: 'blur'\n }],\n email: [{\n required: true,\n message: this.$t('validate.required'),\n trigger: 'blur'\n }, {\n validator: isEmail,\n trigger: 'blur'\n }],\n mobile: [{\n required: true,\n message: this.$t('validate.required'),\n trigger: 'blur'\n }, {\n validator: isMobile,\n trigger: 'blur'\n }]\n };\n }\n },\n created: function created() {\n this.dataForm.id = this.$store.state.user.id;\n },\n methods: {\n init: function init() {\n var _this2 = this;\n\n this.visible = true;\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 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 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.loading = true;\n\n _this5.$http['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 }).finally(function () {\n _this5.loading = true;\n });\n });\n }, 1000, {\n 'leading': true,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CAiBA,YAAA,CAAA,CAjBA;AAkBA,KA3CA;AA4CA;AACA,IAAA,oBAAA,EAAA,QAAA,CAAA,YAAA;AAAA;;AACA,WAAA,KAAA,CAAA,UAAA,EAAA,QAAA,CAAA,UAAA,KAAA,EAAA;AACA,YAAA,CAAA,KAAA,EAAA;AACA,iBAAA,KAAA;AACA;;AACA,QAAA,MAAA,CAAA,OAAA,GAAA,IAAA;;AACA,QAAA,MAAA,CAAA,KAAA,CAAA,KAAA,EAAA,WAAA,oBACA,MAAA,CAAA,QADA;AAEA,UAAA,UAAA,+BACA,MAAA,CAAA,QAAA,CAAA,UADA,sBAEA,MAAA,CAAA,iBAFA;AAFA,YAMA,IANA,CAMA,iBAAA;AAAA,cAAA,GAAA,SAAA,IAAA;;AACA,cAAA,GAAA,CAAA,IAAA,KAAA,CAAA,EAAA;AACA,mBAAA,MAAA,CAAA,QAAA,CAAA,KAAA,CAAA,GAAA,CAAA,GAAA,CAAA;AACA;;AACA,UAAA,MAAA,CAAA,QAAA,CAAA;AACA,YAAA,OAAA,EAAA,MAAA,CAAA,EAAA,CAAA,gBAAA,CADA;AAEA,YAAA,IAAA,EAAA,SAFA;AAGA,YAAA,QAAA,EAAA,GAHA;AAIA,YAAA,OAAA,EAAA,mBAAA;AACA,cAAA,MAAA,CAAA,OAAA,GAAA,KAAA;;AACA,cAAA,MAAA,CAAA,KAAA,CAAA,iBAAA;AACA;AAPA,WAAA;AASA,SAnBA,EAoBA,OApBA,CAoBA,YAAA;AACA,UAAA,MAAA,CAAA,OAAA,GAAA,IAAA;AACA,SAtBA;AAuBA,OA5BA;AA6BA,KA9BA,EA8BA,IA9BA,EA8BA;AAAA,iBAAA,IAAA;AAAA,kBAAA;AAAA,KA9BA;AA7CA;AA9CA,CAAA","sourcesContent":["<template>\n <el-dialog\n :visible.sync=\"visible\"\n title=\"修改个人信息\"\n :close-on-click-modal=\"false\"\n :close-on-press-escape=\"false\"\n :append-to-body=\"true\">\n <el-form :model=\"dataForm\" :rules=\"dataRule\" ref=\"dataForm\" label-width=\"120px\">\n <el-form-item prop=\"realName\" :label=\"$t('user.realName')\">\n <el-input v-model=\"dataForm.realName\" :placeholder=\"$t('user.realName')\"></el-input>\n </el-form-item>\n <el-form-item prop=\"mobile\" label=\"联系电话\">\n <el-input v-model=\"dataForm.mobile\" :placeholder=\"$t('user.mobile')\"></el-input>\n </el-form-item>\n <el-form-item prop=\"email\" label=\"邮箱\">\n <el-input v-model=\"dataForm.email\" :placeholder=\"$t('user.email')\"></el-input>\n </el-form-item>\n </el-form>\n <template slot=\"footer\">\n <el-button @click=\"visible = false\">{{ $t('cancel') }}</el-button>\n <el-button type=\"primary\" v-loading=\"loading\" @click=\"dataFormSubmitHandle()\">{{ $t('confirm') }}</el-button>\n </template>\n </el-dialog>\n</template>\n\n<script>\nimport debounce from 'lodash/debounce'\nimport { isEmail, isMobile } from '@/utils/validate'\nimport { clearLoginInfo } from '@/utils'\nexport default {\n data () {\n return {\n visible: false,\n loading:false,\n roleList: [],\n roleIdListDefault: [],\n dataForm: {\n realName: '',\n mobile: '',\n email: ''\n }\n }\n },\n computed: {\n dataRule () {\n var validateEmail = (rule, value, callback) => {\n if (!isEmail(value)) {\n return callback(new Error(this.$t('validate.format', { 'attr': this.$t('user.email') })))\n }\n callback()\n }\n var validateMobile = (rule, value, callback) => {\n if (!isMobile(value)) {\n return callback(new Error(this.$t('validate.format', { 'attr': this.$t('user.mobile') })))\n }\n callback()\n }\n return {\n realName: [\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\n ],\n email: [\n { required: true, message: this.$t('validate.required'), trigger: 'blur' },\n { validator: isEmail, trigger: 'blur' }\n ],\n mobile: [\n { required: true, message: this.$t('validate.required'), trigger: 'blur' },\n { validator: isMobile, trigger: 'blur' }\n ]\n }\n }\n },\n created(){\n this.dataForm.id=this.$store.state.user.id;\n },\n methods: {\n init () {\n this.visible = true\n this.$nextTick(() => {\n this.$refs['dataForm'].resetFields();\n this.roleIdListDefault = [];\n Promise.all([\n this.getRoleList()\n ]).then(() => {\n if (this.dataForm.id) {\n this.getInfo()\n }\n })\n })\n },\n // 获取角色列表\n getRoleList () {\n return this.$http.get('/sys/role/list').then(({ data: res }) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n this.roleList = res.data\n }).catch(() => {})\n },\n getInfo(){\n this.$http.get(`/sys/user/${this.dataForm.id}`).then(({ data: res }) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n this.dataForm = {\n ...this.dataForm,\n ...res.data,\n roleIdList: []\n }\n // 角色配置, 区分是否为默认角色\n for (var i = 0; i < res.data.roleIdList.length; i++) {\n if (this.roleList.filter(item => item.id === res.data.roleIdList[i])[0]) {\n this.dataForm.roleIdList.push(res.data.roleIdList[i])\n continue\n }\n this.roleIdListDefault.push(res.data.roleIdList[i])\n }\n }).catch(() => {})\n },\n // 表单提交\n dataFormSubmitHandle: debounce(function () {\n this.$refs['dataForm'].validate((valid) => {\n if (!valid) {\n return false\n }\n this.loading=true;\n this.$http['put']('/sys/user', {\n ...this.dataForm,\n roleIdList: [\n ...this.dataForm.roleIdList,\n ...this.roleIdListDefault\n ]\n }).then(({ data: res }) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n this.$message({\n message: this.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: () => {\n this.visible = false\n this.$emit('refreshDataList')\n }\n })\n })\n .finally(()=>{\n this.loading=true;\n })\n })\n }, 1000, { 'leading': true, 'trailing': false })\n }\n}\n</script>\n"],"sourceRoot":"src/views"}]} |