42.d9e8f8131e7173e9369b.js.map 27 KB

1
  1. {"version":3,"sources":["webpack:///src/views/ums/role/index.vue","webpack:///./src/views/ums/role/index.vue?329f","webpack:///./src/views/ums/role/index.vue"],"names":["defaultListQuery","pageNum","pageSize","keyword","defaultRole","id","name","description","adminCount","status","ums_role","data","listQuery","assign_default","list","total","listLoading","dialogVisible","role","isEdit","created","this","getList","filters","formatDateTime","time","date","Date","Object","utils_date","methods","handleResetSearch","handleSearchList","handleSizeChange","val","handleCurrentChange","handleAdd","handleStatusChange","index","row","_this","$confirm","confirmButtonText","cancelButtonText","type","then","response","$message","message","catch","handleDelete","_this2","ids","push","obj","join","handleUpdate","handleDialogConfirm","_this3","handleSelectMenu","$router","path","query","roleId","handleSelectResource","_this4","views_ums_role","render","_vm","_h","$createElement","_c","_self","staticClass","attrs","shadow","_v","staticStyle","float","size","on","click","$event","margin-right","margin-top","inline","model","label-width","label","placeholder","clearable","value","callback","$$v","$set","expression","margin-left","directives","rawName","ref","width","border","align","scopedSlots","_u","key","fn","scope","_s","_f","createTime","active-value","inactive-value","change","$index","background","layout","current-page","page-size","page-sizes","size-change","current-change","update:currentPage","title","visible","update:visible","rows","slot","staticRenderFns","Component","__webpack_require__","normalizeComponent","ssrContext","__webpack_exports__"],"mappings":"uJAwIAA,GACAC,QAAA,EACAC,SAAA,EACAC,QAAA,MAEAC,GACAC,GAAA,KACAC,KAAA,KACAC,YAAA,KACAC,WAAA,EACAC,OAAA,GAEAC,GACAJ,KAAA,WACAK,KAFA,WAGA,OACAC,UAAAC,OAAAb,GACAc,KAAA,KACAC,MAAA,KACAC,aAAA,EACAC,eAAA,EACAC,KAAAL,OAAAT,GACAe,QAAA,IAGAC,QAbA,WAcAC,KAAAC,WAEAC,SACAC,eADA,SACAC,GACA,SAAAA,GAAA,KAAAA,EACA,WAEA,IAAAC,EAAA,IAAAC,KAAAF,GACA,OAAAG,OAAAC,EAAA,EAAAD,CAAAF,EAAA,yBAGAI,SACAC,kBADA,WAEAV,K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AA,SAAAR,EAAAQ,GAAA,KAAAL,EAAA,aAA8CG,OAAO9B,KAAA,UAAAmC,KAAA,SAAgCC,IAAKC,MAAA,SAAAC,GAAyBd,EAAAX,0BAA4BW,EAAAQ,GAAA,sBAE3oLoD,oBCCjB,IAcAC,EAdAC,EAAA,OAcAC,CACAzH,EACAwD,GATA,EAVA,SAAAkE,GACAF,EAAA,SAaA,KAEA,MAUAG,EAAA,QAAAJ,EAAA","file":"static/js/42.d9e8f8131e7173e9369b.js","sourcesContent":["<template> \n <div class=\"app-container\">\n <el-card class=\"filter-container\" shadow=\"never\">\n <div>\n <i class=\"el-icon-search\"></i>\n <span>筛选搜索</span>\n <el-button\n style=\"float:right\"\n type=\"primary\"\n @click=\"handleSearchList()\"\n size=\"small\">\n 查询搜索\n </el-button>\n <el-button\n style=\"float:right;margin-right: 15px\"\n @click=\"handleResetSearch()\"\n size=\"small\">\n 重置\n </el-button>\n </div>\n <div style=\"margin-top: 15px\">\n <el-form :inline=\"true\" :model=\"listQuery\" size=\"small\" label-width=\"140px\">\n <el-form-item label=\"输入搜索:\">\n <el-input v-model=\"listQuery.keyword\" class=\"input-width\" placeholder=\"角色名称\" clearable></el-input>\n </el-form-item>\n </el-form>\n </div>\n </el-card>\n <el-card class=\"operate-container\" shadow=\"never\">\n <i class=\"el-icon-tickets\"></i>\n <span>数据列表</span>\n <el-button size=\"mini\" class=\"btn-add\" @click=\"handleAdd()\" style=\"margin-left: 20px\">添加</el-button>\n </el-card>\n <div class=\"table-container\">\n <el-table ref=\"roleTable\"\n :data=\"list\"\n style=\"width: 100%;\"\n v-loading=\"listLoading\" border>\n <el-table-column label=\"编号\" width=\"100\" align=\"center\">\n <template slot-scope=\"scope\">{{scope.row.id}}</template>\n </el-table-column>\n <el-table-column label=\"角色名称\" align=\"center\">\n <template slot-scope=\"scope\">{{scope.row.name}}</template>\n </el-table-column>\n <el-table-column label=\"描述\" align=\"center\">\n <template slot-scope=\"scope\">{{scope.row.description}}</template>\n </el-table-column>\n <el-table-column label=\"用户数\" width=\"100\" align=\"center\">\n <template slot-scope=\"scope\">{{scope.row.adminCount}}</template>\n </el-table-column>\n <el-table-column label=\"添加时间\" width=\"160\" align=\"center\">\n <template slot-scope=\"scope\">{{scope.row.createTime | formatDateTime}}</template>\n </el-table-column>\n <el-table-column label=\"是否启用\" width=\"140\" align=\"center\">\n <template slot-scope=\"scope\">\n <el-switch\n @change=\"handleStatusChange(scope.$index, scope.row)\"\n :active-value=\"1\"\n :inactive-value=\"0\"\n v-model=\"scope.row.status\">\n </el-switch>\n </template>\n </el-table-column>\n <el-table-column label=\"操作\" width=\"160\" align=\"center\">\n <template slot-scope=\"scope\">\n <el-row>\n <el-button size=\"mini\"\n type=\"text\"\n @click=\"handleSelectMenu(scope.$index, scope.row)\">分配菜单\n </el-button>\n <el-button size=\"mini\"\n type=\"text\"\n @click=\"handleSelectResource(scope.$index, scope.row)\">分配资源\n </el-button>\n </el-row>\n <el-row>\n <el-button size=\"mini\"\n type=\"text\"\n @click=\"handleUpdate(scope.$index, scope.row)\">\n 编辑\n </el-button>\n <el-button size=\"mini\"\n type=\"text\"\n @click=\"handleDelete(scope.$index, scope.row)\">删除\n </el-button>\n </el-row>\n </template>\n </el-table-column>\n </el-table>\n </div>\n <div class=\"pagination-container\">\n <el-pagination\n background\n @size-change=\"handleSizeChange\"\n @current-change=\"handleCurrentChange\"\n layout=\"total, sizes,prev, pager, next,jumper\"\n :current-page.sync=\"listQuery.pageNum\"\n :page-size=\"listQuery.pageSize\"\n :page-sizes=\"[5,10,15]\"\n :total=\"total\">\n </el-pagination>\n </div>\n <el-dialog\n :title=\"isEdit?'编辑角色':'添加角色'\"\n :visible.sync=\"dialogVisible\"\n width=\"40%\">\n <el-form :model=\"role\"\n ref=\"roleForm\"\n label-width=\"150px\" size=\"small\">\n <el-form-item label=\"角色名称:\">\n <el-input v-model=\"role.name\" style=\"width: 250px\"></el-input>\n </el-form-item>\n <el-form-item label=\"描述:\">\n <el-input v-model=\"role.description\"\n type=\"textarea\"\n :rows=\"5\"\n style=\"width: 250px\"></el-input>\n </el-form-item>\n <el-form-item label=\"是否启用:\">\n <el-radio-group v-model=\"role.status\">\n <el-radio :label=\"1\">是</el-radio>\n <el-radio :label=\"0\">否</el-radio>\n </el-radio-group>\n </el-form-item>\n </el-form>\n <span slot=\"footer\" class=\"dialog-footer\">\n <el-button @click=\"dialogVisible = false\" size=\"small\">取 消</el-button>\n <el-button type=\"primary\" @click=\"handleDialogConfirm()\" size=\"small\">确 定</el-button>\n </span>\n </el-dialog>\n </div>\n</template>\n<script>\n import {fetchList,createRole,updateRole,updateStatus,deleteRole} from '@/api/role';\n import {formatDate} from '@/utils/date';\n\n const defaultListQuery = {\n pageNum: 1,\n pageSize: 5,\n keyword: null\n };\n const defaultRole = {\n id: null,\n name: null,\n description: null,\n adminCount: 0,\n status: 1\n };\n export default {\n name: 'roleList',\n data() {\n return {\n listQuery: Object.assign({}, defaultListQuery),\n list: null,\n total: null,\n listLoading: false,\n dialogVisible: false,\n role: Object.assign({}, defaultRole),\n isEdit: false\n }\n },\n created() {\n this.getList();\n },\n filters: {\n formatDateTime(time) {\n if (time == null || time === '') {\n return '--';\n }\n let date = new Date(time);\n return formatDate(date, 'yyyy-MM-dd hh:mm:ss')\n }\n },\n methods: {\n handleResetSearch() {\n this.listQuery = Object.assign({}, defaultListQuery);\n },\n handleSearchList() {\n this.listQuery.pageNum = 1;\n this.getList();\n },\n handleSizeChange(val) {\n this.listQuery.pageNum = 1;\n this.listQuery.pageSize = val;\n this.getList();\n },\n handleCurrentChange(val) {\n this.listQuery.pageNum = val;\n this.getList();\n },\n handleAdd() {\n this.dialogVisible = true;\n this.isEdit = false;\n this.role = Object.assign({},defaultRole);\n },\n handleStatusChange(index, row) {\n this.$confirm('是否要修改该状态?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(() => {\n updateStatus(row.id, {status: row.status}).then(response => {\n this.$message({\n type: 'success',\n message: '修改成功!'\n });\n });\n }).catch(() => {\n this.$message({\n type: 'info',\n message: '取消修改'\n });\n this.getList();\n });\n },\n handleDelete(index, row) {\n this.$confirm('是否要删除该角色?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(() => {\n let ids = [];\n ids.push(row.id);\n // let params=new URLSearchParams();\n // params.append(\"ids\",ids);\n let obj = {\n ids:ids.join(',')\n }\n deleteRole(obj).then(response => {\n this.$message({\n type: 'success',\n message: '删除成功!'\n });\n this.getList();\n });\n });\n },\n handleUpdate(index, row) {\n this.dialogVisible = true;\n this.isEdit = true;\n this.role = Object.assign({},row);\n },\n handleDialogConfirm() {\n this.$confirm('是否要确认?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(() => {\n if (this.isEdit) {\n updateRole(this.role.id,this.role).then(response => {\n this.$message({\n message: '修改成功!',\n type: 'success'\n });\n this.dialogVisible =false;\n this.getList();\n })\n } else {\n createRole(this.role).then(response => {\n this.$message({\n message: '添加成功!',\n type: 'success'\n });\n this.dialogVisible =false;\n this.getList();\n })\n }\n })\n },\n handleSelectMenu(index,row){\n this.$router.push({path:'/ums/allocMenu',query:{roleId:row.id}})\n },\n handleSelectResource(index,row){\n this.$router.push({path:'/ums/allocResource',query:{roleId:row.id}})\n },\n getList() {\n this.listLoading = true;\n fetchList(this.listQuery).then(response => {\n this.listLoading = false;\n this.list = response.data.list;\n this.total = response.data.total;\n });\n }\n }\n }\n</script>\n<style></style>\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/views/ums/role/index.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"app-container\"},[_c('el-card',{staticClass:\"filter-container\",attrs:{\"shadow\":\"never\"}},[_c('div',[_c('i',{staticClass:\"el-icon-search\"}),_vm._v(\" \"),_c('span',[_vm._v(\"筛选搜索\")]),_vm._v(\" \"),_c('el-button',{staticStyle:{\"float\":\"right\"},attrs:{\"type\":\"primary\",\"size\":\"small\"},on:{\"click\":function($event){_vm.handleSearchList()}}},[_vm._v(\"\\n 查询搜索\\n \")]),_vm._v(\" \"),_c('el-button',{staticStyle:{\"float\":\"right\",\"margin-right\":\"15px\"},attrs:{\"size\":\"small\"},on:{\"click\":function($event){_vm.handleResetSearch()}}},[_vm._v(\"\\n 重置\\n \")])],1),_vm._v(\" \"),_c('div',{staticStyle:{\"margin-top\":\"15px\"}},[_c('el-form',{attrs:{\"inline\":true,\"model\":_vm.listQuery,\"size\":\"small\",\"label-width\":\"140px\"}},[_c('el-form-item',{attrs:{\"label\":\"输入搜索:\"}},[_c('el-input',{staticClass:\"input-width\",attrs:{\"placeholder\":\"角色名称\",\"clearable\":\"\"},model:{value:(_vm.listQuery.keyword),callback:function ($$v) {_vm.$set(_vm.listQuery, \"keyword\", $$v)},expression:\"listQuery.keyword\"}})],1)],1)],1)]),_vm._v(\" \"),_c('el-card',{staticClass:\"operate-container\",attrs:{\"shadow\":\"never\"}},[_c('i',{staticClass:\"el-icon-tickets\"}),_vm._v(\" \"),_c('span',[_vm._v(\"数据列表\")]),_vm._v(\" \"),_c('el-button',{staticClass:\"btn-add\",staticStyle:{\"margin-left\":\"20px\"},attrs:{\"size\":\"mini\"},on:{\"click\":function($event){_vm.handleAdd()}}},[_vm._v(\"添加\")])],1),_vm._v(\" \"),_c('div',{staticClass:\"table-container\"},[_c('el-table',{directives:[{name:\"loading\",rawName:\"v-loading\",value:(_vm.listLoading),expression:\"listLoading\"}],ref:\"roleTable\",staticStyle:{\"width\":\"100%\"},attrs:{\"data\":_vm.list,\"border\":\"\"}},[_c('el-table-column',{attrs:{\"label\":\"编号\",\"width\":\"100\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(_vm._s(scope.row.id))]}}])}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":\"角色名称\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(_vm._s(scope.row.name))]}}])}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":\"描述\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(_vm._s(scope.row.description))]}}])}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":\"用户数\",\"width\":\"100\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(_vm._s(scope.row.adminCount))]}}])}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":\"添加时间\",\"width\":\"160\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(_vm._s(_vm._f(\"formatDateTime\")(scope.row.createTime)))]}}])}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":\"是否启用\",\"width\":\"140\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_c('el-switch',{attrs:{\"active-value\":1,\"inactive-value\":0},on:{\"change\":function($event){_vm.handleStatusChange(scope.$index, scope.row)}},model:{value:(scope.row.status),callback:function ($$v) {_vm.$set(scope.row, \"status\", $$v)},expression:\"scope.row.status\"}})]}}])}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":\"操作\",\"width\":\"160\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_c('el-row',[_c('el-button',{attrs:{\"size\":\"mini\",\"type\":\"text\"},on:{\"click\":function($event){_vm.handleSelectMenu(scope.$index, scope.row)}}},[_vm._v(\"分配菜单\\n \")]),_vm._v(\" \"),_c('el-button',{attrs:{\"size\":\"mini\",\"type\":\"text\"},on:{\"click\":function($event){_vm.handleSelectResource(scope.$index, scope.row)}}},[_vm._v(\"分配资源\\n \")])],1),_vm._v(\" \"),_c('el-row',[_c('el-button',{attrs:{\"size\":\"mini\",\"type\":\"text\"},on:{\"click\":function($event){_vm.handleUpdate(scope.$index, scope.row)}}},[_vm._v(\"\\n 编辑\\n \")]),_vm._v(\" \"),_c('el-button',{attrs:{\"size\":\"mini\",\"type\":\"text\"},on:{\"click\":function($event){_vm.handleDelete(scope.$index, scope.row)}}},[_vm._v(\"删除\\n \")])],1)]}}])})],1)],1),_vm._v(\" \"),_c('div',{staticClass:\"pagination-container\"},[_c('el-pagination',{attrs:{\"background\":\"\",\"layout\":\"total, sizes,prev, pager, next,jumper\",\"current-page\":_vm.listQuery.pageNum,\"page-size\":_vm.listQuery.pageSize,\"page-sizes\":[5,10,15],\"total\":_vm.total},on:{\"size-change\":_vm.handleSizeChange,\"current-change\":_vm.handleCurrentChange,\"update:currentPage\":function($event){_vm.$set(_vm.listQuery, \"pageNum\", $event)}}})],1),_vm._v(\" \"),_c('el-dialog',{attrs:{\"title\":_vm.isEdit?'编辑角色':'添加角色',\"visible\":_vm.dialogVisible,\"width\":\"40%\"},on:{\"update:visible\":function($event){_vm.dialogVisible=$event}}},[_c('el-form',{ref:\"roleForm\",attrs:{\"model\":_vm.role,\"label-width\":\"150px\",\"size\":\"small\"}},[_c('el-form-item',{attrs:{\"label\":\"角色名称:\"}},[_c('el-input',{staticStyle:{\"width\":\"250px\"},model:{value:(_vm.role.name),callback:function ($$v) {_vm.$set(_vm.role, \"name\", $$v)},expression:\"role.name\"}})],1),_vm._v(\" \"),_c('el-form-item',{attrs:{\"label\":\"描述:\"}},[_c('el-input',{staticStyle:{\"width\":\"250px\"},attrs:{\"type\":\"textarea\",\"rows\":5},model:{value:(_vm.role.description),callback:function ($$v) {_vm.$set(_vm.role, \"description\", $$v)},expression:\"role.description\"}})],1),_vm._v(\" \"),_c('el-form-item',{attrs:{\"label\":\"是否启用:\"}},[_c('el-radio-group',{model:{value:(_vm.role.status),callback:function ($$v) {_vm.$set(_vm.role, \"status\", $$v)},expression:\"role.status\"}},[_c('el-radio',{attrs:{\"label\":1}},[_vm._v(\"是\")]),_vm._v(\" \"),_c('el-radio',{attrs:{\"label\":0}},[_vm._v(\"否\")])],1)],1)],1),_vm._v(\" \"),_c('span',{staticClass:\"dialog-footer\",attrs:{\"slot\":\"footer\"},slot:\"footer\"},[_c('el-button',{attrs:{\"size\":\"small\"},on:{\"click\":function($event){_vm.dialogVisible = false}}},[_vm._v(\"取 消\")]),_vm._v(\" \"),_c('el-button',{attrs:{\"type\":\"primary\",\"size\":\"small\"},on:{\"click\":function($event){_vm.handleDialogConfirm()}}},[_vm._v(\"确 定\")])],1)],1)],1)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-3bcb86b5\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/views/ums/role/index.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../../../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true,\\\"publicPath\\\":\\\"../../\\\"}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-3bcb86b5\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./index.vue\")\n}\nvar normalizeComponent = require(\"!../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./index.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./index.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-3bcb86b5\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./index.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/views/ums/role/index.vue\n// module id = null\n// module chunks = "],"sourceRoot":""}