forked from liweijie/education
1 line
7.3 KiB
JSON
1 line
7.3 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\\user\\authRole.vue?vue&type=style&index=0&id=2a58ea3c&scoped=true&lang=css","dependencies":[{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\src\\views\\system\\user\\authRole.vue","mtime":1787567871668},{"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:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCg0KLnN5c3RlbS11c2VyLWF1dGgtcm9sZSA6OnYtZGVlcCAuZWwtdGFibGUgOjotd2Via2l0LXNjcm9sbGJhciB7DQogIGRpc3BsYXk6IG5vbmU7DQp9DQouc3lzdGVtLXVzZXItYXV0aC1yb2xlIDo6di1kZWVwIC5lbC10YWJsZSB7DQogIHNjcm9sbGJhci13aWR0aDogbm9uZTsNCiAgLW1zLW92ZXJmbG93LXN0eWxlOiBub25lOw0KfQ0KLnN5c3RlbS11c2VyLWF1dGgtcm9sZSA6OnYtZGVlcCAuZWwtdGFibGVfX2JvZHktd3JhcHBlcjo6LXdlYmtpdC1zY3JvbGxiYXIgew0KICBkaXNwbGF5OiBub25lOw0KfQ0KLnN5c3RlbS11c2VyLWF1dGgtcm9sZSA6OnYtZGVlcCAuZWwtdGFibGVfX2JvZHktd3JhcHBlciB7DQogIHNjcm9sbGJhci13aWR0aDogbm9uZTsNCiAgLW1zLW92ZXJmbG93LXN0eWxlOiBub25lOw0KfQ0K"},{"version":3,"sources":["authRole.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"authRole.vue","sourceRoot":"src/views/system/user","sourcesContent":["<template>\r\n <div class=\"app-container system-user-auth-role\">\r\n <h4 class=\"form-header h4\">基本信息</h4>\r\n <el-form ref=\"form\" :model=\"form\" label-width=\"80px\">\r\n <el-row>\r\n <el-col :span=\"8\" :offset=\"2\">\r\n <el-form-item label=\"用户昵称\" prop=\"nickName\">\r\n <el-input v-model=\"form.nickName\" disabled />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"8\" :offset=\"2\">\r\n <el-form-item label=\"登录账号\" prop=\"userName\">\r\n <el-input v-model=\"form.userName\" disabled />\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n </el-form>\r\n\r\n <h4 class=\"form-header h4\">角色信息</h4>\r\n <el-table v-loading=\"loading\" :row-key=\"getRowKey\" @row-click=\"clickRow\" ref=\"table\" @selection-change=\"handleSelectionChange\" :data=\"roles.slice((pageNum-1)*pageSize,pageNum*pageSize)\" :height=\"tableHeight\">\r\n <el-table-column label=\"序号\" type=\"index\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column type=\"selection\" :reserve-selection=\"true\" :selectable=\"checkSelectable\" width=\"55\" />\r\n <el-table-column label=\"角色编号\" align=\"center\" prop=\"roleId\" />\r\n <el-table-column label=\"角色名称\" align=\"center\" prop=\"roleName\" />\r\n <el-table-column label=\"权限字符\" align=\"center\" prop=\"roleKey\" />\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>\r\n\r\n <pagination v-show=\"total>0\" :total=\"total\" :page.sync=\"pageNum\" :limit.sync=\"pageSize\" />\r\n\r\n <el-form label-width=\"100px\">\r\n <el-form-item style=\"text-align: center;margin-left:-120px;margin-top:30px;\">\r\n <el-button type=\"primary\" @click=\"submitForm()\">提交</el-button>\r\n <el-button @click=\"close()\">返回</el-button>\r\n </el-form-item>\r\n </el-form>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { getAuthRole, updateAuthRole } from \"@/api/system/user\"\r\n\r\nexport default {\r\n name: \"AuthRole\",\r\n data() {\r\n return {\r\n // 遮罩层\r\n loading: true,\r\n // 表格高度\r\n tableHeight: window.innerHeight - 240,\r\n // 分页信息\r\n total: 0,\r\n pageNum: 1,\r\n pageSize: 10,\r\n // 选中角色编号\r\n roleIds: [],\r\n // 角色信息\r\n roles: [],\r\n // 用户信息\r\n form: {}\r\n }\r\n },\r\n created() {\r\n const userId = this.$route.params && this.$route.params.userId\r\n if (userId) {\r\n this.loading = true\r\n getAuthRole(userId).then((response) => {\r\n this.form = response.user\r\n this.roles = response.roles\r\n this.total = this.roles.length\r\n this.$nextTick(() => {\r\n this.roles.forEach((row) => {\r\n if (row.flag) {\r\n this.$refs.table.toggleRowSelection(row)\r\n }\r\n })\r\n })\r\n this.loading = false\r\n })\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 methods: {\r\n /** 获取表格高度 */\r\n getTableHeight() {\r\n this.tableHeight = window.innerHeight - 240\r\n },\r\n /** 单击选中行数据 */\r\n clickRow(row) {\r\n if (this.checkSelectable(row)) {\r\n this.$refs.table.toggleRowSelection(row)\r\n }\r\n },\r\n // 多选框选中数据\r\n handleSelectionChange(selection) {\r\n this.roleIds = selection.map((item) => item.roleId)\r\n },\r\n // 保存选中的数据编号\r\n getRowKey(row) {\r\n return row.roleId\r\n },\r\n // 检查角色状态\r\n checkSelectable(row) {\r\n return row.status === \"0\" ? true : false\r\n },\r\n /** 提交按钮 */\r\n submitForm() {\r\n const userId = this.form.userId\r\n const roleIds = this.roleIds.join(\",\")\r\n updateAuthRole({ userId: userId, roleIds: roleIds }).then(() => {\r\n this.$modal.msgSuccess(\"授权成功\")\r\n this.close()\r\n })\r\n },\r\n /** 关闭按钮 */\r\n close() {\r\n const obj = { path: \"/system/user\" }\r\n this.$tab.closeOpenPage(obj)\r\n }\r\n }\r\n}\r\n</script>\r\n<style scoped>\r\n.system-user-auth-role ::v-deep .el-table ::-webkit-scrollbar {\r\n display: none;\r\n}\r\n.system-user-auth-role ::v-deep .el-table {\r\n scrollbar-width: none;\r\n -ms-overflow-style: none;\r\n}\r\n.system-user-auth-role ::v-deep .el-table__body-wrapper::-webkit-scrollbar {\r\n display: none;\r\n}\r\n.system-user-auth-role ::v-deep .el-table__body-wrapper {\r\n scrollbar-width: none;\r\n -ms-overflow-style: none;\r\n}\r\n</style>"]}]} |