{"remainingRequest":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\babel-loader\\lib\\index.js!D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\HTC\\program\\善行少年\\security-enterprise-admin\\src\\views\\modules\\sys\\role-add-or-update.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\src\\views\\modules\\sys\\role-add-or-update.vue","mtime":1581948666000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\babel.config.js","mtime":1581948662000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\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 \"D:/HTC/program/\\u5584\\u884C\\u5C11\\u5E74/security-enterprise-admin/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";\nimport _defineProperty from \"D:/HTC/program/\\u5584\\u884C\\u5C11\\u5E74/security-enterprise-admin/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.string.iterator\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport debounce from 'lodash/debounce';\nexport default {\n data: function data() {\n return {\n visible: false,\n menuList: [],\n deptList: [],\n dataForm: {\n id: '',\n name: '',\n menuIdList: [],\n deptIdList: [],\n remark: ''\n }\n };\n },\n computed: {\n dataRule: function dataRule() {\n return {\n name: [{\n required: true,\n message: this.$t('validate.required'),\n trigger: 'blur'\n }]\n };\n }\n },\n methods: {\n init: function init() {\n var _this = this;\n this.visible = true;\n this.$nextTick(function () {\n _this.$refs['dataForm'].resetFields();\n _this.$refs.menuListTree.setCheckedKeys([]);\n _this.$refs.deptListTree.setCheckedKeys([]);\n Promise.all([_this.getMenuList(), _this.getDeptList()]).then(function () {\n if (_this.dataForm.id) {\n _this.getInfo();\n }\n });\n });\n },\n // 获取菜单列表\n getMenuList: function getMenuList() {\n var _this2 = this;\n return this.$http.get('/sys/menu/select').then(function (_ref) {\n var res = _ref.data;\n if (res.code !== 0) {\n return _this2.$message.error(res.msg);\n }\n _this2.menuList = res.data;\n }).catch(function () {});\n },\n // 获取部门列表\n getDeptList: function getDeptList() {\n var _this3 = this;\n return this.$http.get('/sys/dept/list').then(function (_ref2) {\n var res = _ref2.data;\n if (res.code !== 0) {\n return _this3.$message.error(res.msg);\n }\n _this3.deptList = res.data;\n }).catch(function () {});\n },\n // 获取信息\n getInfo: function getInfo() {\n var _this4 = this;\n this.$http.get(\"/sys/role/\".concat(this.dataForm.id)).then(function (_ref3) {\n var res = _ref3.data;\n if (res.code !== 0) {\n return _this4.$message.error(res.msg);\n }\n _this4.dataForm = _objectSpread(_objectSpread({}, _this4.dataForm), res.data);\n _this4.dataForm.menuIdList.forEach(function (item) {\n return _this4.$refs.menuListTree.setChecked(item, true);\n });\n _this4.$refs.deptListTree.setCheckedKeys(_this4.dataForm.deptIdList);\n }).catch(function () {});\n },\n // 表单提交\n dataFormSubmitHandle: debounce(function () {\n var _this5 = this;\n this.$refs['dataForm'].validate(function (valid) {\n if (!valid) {\n return false;\n }\n _this5.dataForm.menuIdList = [].concat(_toConsumableArray(_this5.$refs.menuListTree.getHalfCheckedKeys()), _toConsumableArray(_this5.$refs.menuListTree.getCheckedKeys()));\n _this5.dataForm.deptIdList = _this5.$refs.deptListTree.getCheckedKeys();\n _this5.$http[!_this5.dataForm.id ? 'post' : 'put']('/sys/role', _this5.dataForm).then(function (_ref4) {\n var res = _ref4.data;\n if (res.code !== 0) {\n return _this5.$message.error(res.msg);\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 _this5.$emit('refreshDataList');\n }\n });\n }).catch(function () {});\n });\n }, 1000, {\n 'leading': true,\n 'trailing': false\n })\n }\n};",{"version":3,"names":["debounce","data","visible","menuList","deptList","dataForm","id","name","menuIdList","deptIdList","remark","computed","dataRule","required","message","$t","trigger","methods","init","_this","$nextTick","$refs","resetFields","menuListTree","setCheckedKeys","deptListTree","Promise","all","getMenuList","getDeptList","then","getInfo","_this2","$http","get","_ref","res","code","$message","error","msg","catch","_this3","_ref2","_this4","concat","_ref3","_objectSpread","forEach","item","setChecked","dataFormSubmitHandle","_this5","validate","valid","_toConsumableArray","getHalfCheckedKeys","getCheckedKeys","_ref4","type","duration","onClose","$emit"],"sources":["src/views/modules/sys/role-add-or-update.vue"],"sourcesContent":["\r\n\r\n\r\n"],"mappings":";;;;;;;;AA4CA,OAAAA,QAAA;AACA;EACAC,IAAA,WAAAA,KAAA;IACA;MACAC,OAAA;MACAC,QAAA;MACAC,QAAA;MACAC,QAAA;QACAC,EAAA;QACAC,IAA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