forked from liweijie/education
1 line
10 KiB
JSON
1 line
10 KiB
JSON
{"remainingRequest":"C:\\Users\\Admin\\Desktop\\education\\frontend\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\Admin\\Desktop\\education\\frontend\\src\\views\\system\\role\\authUser.vue?vue&type=style&index=0&id=a25b8774&scoped=true&lang=css","dependencies":[{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\src\\views\\system\\role\\authUser.vue","mtime":1787640892014},{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\node_modules\\css-loader\\dist\\cjs.js","mtime":1787309792478},{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\node_modules\\vue-loader\\lib\\loaders\\stylePostLoader.js","mtime":1787309794547},{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\node_modules\\postcss-loader\\src\\index.js","mtime":1787309793084},{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1787309791955},{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\node_modules\\vue-loader\\lib\\index.js","mtime":1787309793790}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoNCi5zeXN0ZW0tcm9sZS1hdXRoLXVzZXIgOjp2LWRlZXAgLmVsLXRhYmxlIDo6LXdlYmtpdC1zY3JvbGxiYXIgew0KICBkaXNwbGF5OiBub25lOw0KfQ0KLnN5c3RlbS1yb2xlLWF1dGgtdXNlciA6OnYtZGVlcCAuZWwtdGFibGUgew0KICBzY3JvbGxiYXItd2lkdGg6IG5vbmU7DQogIC1tcy1vdmVyZmxvdy1zdHlsZTogbm9uZTsNCn0NCi5zeXN0ZW0tcm9sZS1hdXRoLXVzZXIgOjp2LWRlZXAgLmVsLXRhYmxlX19ib2R5LXdyYXBwZXI6Oi13ZWJraXQtc2Nyb2xsYmFyIHsNCiAgZGlzcGxheTogbm9uZTsNCn0NCi5zeXN0ZW0tcm9sZS1hdXRoLXVzZXIgOjp2LWRlZXAgLmVsLXRhYmxlX19ib2R5LXdyYXBwZXIgew0KICBzY3JvbGxiYXItd2lkdGg6IG5vbmU7DQogIC1tcy1vdmVyZmxvdy1zdHlsZTogbm9uZTsNCn0NCg=="},{"version":3,"sources":["authUser.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"authUser.vue","sourceRoot":"src/views/system/role","sourcesContent":["<template>\r\n <div class=\"app-container system-role-auth-user\">\r\n <el-form :model=\"queryParams\" ref=\"queryForm\" size=\"small\" :inline=\"true\" v-show=\"showSearch\">\r\n <el-form-item label=\"用户名称\" prop=\"userName\">\r\n <el-input\r\n v-model=\"queryParams.userName\"\r\n placeholder=\"请输入用户名称\"\r\n clearable\r\n style=\"width: 240px\"\r\n @keyup.enter.native=\"handleQuery\"\r\n />\r\n </el-form-item>\r\n <el-form-item label=\"手机号码\" prop=\"phonenumber\">\r\n <el-input\r\n v-model=\"queryParams.phonenumber\"\r\n placeholder=\"请输入手机号码\"\r\n clearable\r\n style=\"width: 240px\"\r\n @keyup.enter.native=\"handleQuery\"\r\n />\r\n </el-form-item>\r\n <el-form-item>\r\n <el-button type=\"primary\" icon=\"el-icon-search\" size=\"mini\" @click=\"handleQuery\">搜索</el-button>\r\n <el-button icon=\"el-icon-refresh\" size=\"mini\" @click=\"resetQuery\">重置</el-button>\r\n </el-form-item>\r\n </el-form>\r\n\r\n <el-row :gutter=\"10\" class=\"mb8\">\r\n <el-col :span=\"1.5\">\r\n <el-button\r\n type=\"primary\"\r\n plain\r\n icon=\"el-icon-plus\"\r\n size=\"mini\"\r\n @click=\"openSelectUser\"\r\n v-hasPermi=\"['system:role:add']\"\r\n >添加用户</el-button>\r\n </el-col>\r\n <el-col :span=\"1.5\">\r\n <el-button\r\n type=\"danger\"\r\n plain\r\n icon=\"el-icon-circle-close\"\r\n size=\"mini\"\r\n :disabled=\"multiple\"\r\n @click=\"cancelAuthUserAll\"\r\n v-hasPermi=\"['system:role:remove']\"\r\n >批量取消授权</el-button>\r\n </el-col>\r\n <el-col :span=\"1.5\">\r\n <el-button\r\n icon=\"el-icon-close\"\r\n size=\"mini\"\r\n @click=\"handleClose\"\r\n >关闭</el-button>\r\n </el-col>\r\n <right-toolbar :showSearch.sync=\"showSearch\" @queryTable=\"getList\"></right-toolbar>\r\n </el-row>\r\n\r\n <el-table v-loading=\"loading\" :data=\"userList\" @selection-change=\"handleSelectionChange\" :height=\"tableHeight\">\r\n <el-table-column type=\"selection\" width=\"55\" align=\"center\" />\r\n <el-table-column label=\"用户名称\" prop=\"userName\" :show-overflow-tooltip=\"true\" />\r\n <el-table-column label=\"用户昵称\" prop=\"nickName\" :show-overflow-tooltip=\"true\" />\r\n <el-table-column label=\"邮箱\" prop=\"email\" :show-overflow-tooltip=\"true\" />\r\n <el-table-column label=\"手机\" prop=\"phonenumber\" :show-overflow-tooltip=\"true\" />\r\n <el-table-column label=\"状态\" align=\"center\" prop=\"status\">\r\n <template slot-scope=\"scope\">\r\n <dict-tag :options=\"dict.type.sys_normal_disable\" :value=\"scope.row.status\"/>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"创建时间\" align=\"center\" prop=\"createTime\" width=\"180\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ parseTime(scope.row.createTime) }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"操作\" align=\"center\" class-name=\"small-padding fixed-width\">\r\n <template slot-scope=\"scope\">\r\n <el-button\r\n size=\"mini\"\r\n type=\"text\"\r\n icon=\"el-icon-circle-close\"\r\n @click=\"cancelAuthUser(scope.row)\"\r\n v-hasPermi=\"['system:role:remove']\"\r\n >取消授权</el-button>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n\r\n <pagination\r\n v-show=\"total>0\"\r\n :total=\"total\"\r\n :page.sync=\"queryParams.pageNum\"\r\n :limit.sync=\"queryParams.pageSize\"\r\n @pagination=\"getList\"\r\n />\r\n <select-user ref=\"select\" :roleId=\"queryParams.roleId\" @ok=\"handleQuery\" />\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { allocatedUserList, authUserCancel, authUserCancelAll } from \"@/api/system/role\"\r\nimport selectUser from \"./selectUser\"\r\n\r\nexport default {\r\n name: \"AuthUser\",\r\n dicts: ['sys_normal_disable'],\r\n components: { selectUser },\r\n data() {\r\n return {\r\n // 遮罩层\r\n loading: true,\r\n // 表格高度\r\n tableHeight: window.innerHeight - 240,\r\n // 选中用户组\r\n userIds: [],\r\n // 非多个禁用\r\n multiple: true,\r\n // 显示搜索条件\r\n showSearch: true,\r\n // 总条数\r\n total: 0,\r\n // 用户表格数据\r\n userList: [],\r\n // 查询参数\r\n queryParams: {\r\n pageNum: 1,\r\n pageSize: 10,\r\n roleId: undefined,\r\n userName: undefined,\r\n phonenumber: undefined\r\n }\r\n }\r\n },\r\n created() {\r\n const roleId = this.$route.params && this.$route.params.roleId\r\n if (roleId) {\r\n this.queryParams.roleId = roleId\r\n this.getList()\r\n }\r\n },\r\n mounted() {\r\n this.getTableHeight()\r\n window.addEventListener('resize', this.getTableHeight)\r\n },\r\n beforeDestroy() {\r\n window.removeEventListener('resize', this.getTableHeight)\r\n },\r\n watch: {\r\n showSearch() {\r\n this.$nextTick(() => {\r\n this.getTableHeight()\r\n })\r\n }\r\n },\r\n methods: {\r\n /** 获取表格高度 */\r\n getTableHeight() {\r\n const offset = this.showSearch ? 240 : 190\r\n this.tableHeight = window.innerHeight - offset\r\n },\r\n /** 查询授权用户列表 */\r\n getList() {\r\n this.loading = true\r\n allocatedUserList(this.queryParams).then(response => {\r\n this.userList = response.rows\r\n this.total = response.total\r\n this.loading = false\r\n }\r\n )\r\n },\r\n // 返回按钮\r\n handleClose() {\r\n const obj = { path: \"/system/role\" }\r\n this.$tab.closeOpenPage(obj)\r\n },\r\n /** 搜索按钮操作 */\r\n handleQuery() {\r\n this.queryParams.pageNum = 1\r\n this.getList()\r\n },\r\n /** 重置按钮操作 */\r\n resetQuery() {\r\n this.resetForm(\"queryForm\")\r\n this.handleQuery()\r\n },\r\n // 多选框选中数据\r\n handleSelectionChange(selection) {\r\n this.userIds = selection.map(item => item.userId)\r\n this.multiple = !selection.length\r\n },\r\n /** 打开授权用户表弹窗 */\r\n openSelectUser() {\r\n this.$refs.select.show()\r\n },\r\n /** 取消授权按钮操作 */\r\n cancelAuthUser(row) {\r\n const roleId = this.queryParams.roleId\r\n this.$modal.confirm('确认要取消该用户\"' + row.userName + '\"角色吗?').then(function() {\r\n return authUserCancel({ userId: row.userId, roleId: roleId })\r\n }).then(() => {\r\n this.getList()\r\n this.$modal.msgSuccess(\"取消授权成功\")\r\n }).catch(() => {})\r\n },\r\n /** 批量取消授权按钮操作 */\r\n cancelAuthUserAll() {\r\n const roleId = this.queryParams.roleId\r\n const userIds = this.userIds.join(\",\")\r\n this.$modal.confirm('是否取消选中用户授权数据项?').then(function() {\r\n return authUserCancelAll({ roleId: roleId, userIds: userIds })\r\n }).then(() => {\r\n this.getList()\r\n this.$modal.msgSuccess(\"取消授权成功\")\r\n }).catch(() => {})\r\n }\r\n }\r\n}\r\n</script>\r\n<style scoped>\r\n.system-role-auth-user ::v-deep .el-table ::-webkit-scrollbar {\r\n display: none;\r\n}\r\n.system-role-auth-user ::v-deep .el-table {\r\n scrollbar-width: none;\r\n -ms-overflow-style: none;\r\n}\r\n.system-role-auth-user ::v-deep .el-table__body-wrapper::-webkit-scrollbar {\r\n display: none;\r\n}\r\n.system-role-auth-user ::v-deep .el-table__body-wrapper {\r\n scrollbar-width: none;\r\n -ms-overflow-style: none;\r\n}\r\n</style>\r\n"]}]} |