|
@@ -101,11 +101,16 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import ModifyUser from "../components/ModifyUser";
|
|
import ModifyUser from "../components/ModifyUser";
|
|
-import { userListPage, userRoleList, resetPwd } from "../api";
|
|
|
|
|
|
+import { userListPage, userRoleList, userInsertOrUpdate } from "../api";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "user-manage",
|
|
name: "user-manage",
|
|
components: { ModifyUser },
|
|
components: { ModifyUser },
|
|
|
|
+ filters: {
|
|
|
|
+ rolesFilter(val) {
|
|
|
|
+ return val.map(code => this.roleType[code]).join(",");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
filter: {
|
|
filter: {
|
|
@@ -116,6 +121,7 @@ export default {
|
|
size: this.GLOBAL.pageSize,
|
|
size: this.GLOBAL.pageSize,
|
|
total: 0,
|
|
total: 0,
|
|
roles: [],
|
|
roles: [],
|
|
|
|
+ roleType: {},
|
|
users: [],
|
|
users: [],
|
|
curUser: {},
|
|
curUser: {},
|
|
loading: false
|
|
loading: false
|
|
@@ -132,6 +138,11 @@ export default {
|
|
async getRoleList() {
|
|
async getRoleList() {
|
|
const data = await userRoleList();
|
|
const data = await userRoleList();
|
|
this.roles = data || [];
|
|
this.roles = data || [];
|
|
|
|
+ let roleType = {};
|
|
|
|
+ this.roles.forEach(item => {
|
|
|
|
+ roleType[item.code] = item.name;
|
|
|
|
+ });
|
|
|
|
+ this.roleType = roleType;
|
|
},
|
|
},
|
|
async getList() {
|
|
async getList() {
|
|
const datas = {
|
|
const datas = {
|
|
@@ -156,7 +167,7 @@ export default {
|
|
this.$refs.ModifyUser.open();
|
|
this.$refs.ModifyUser.open();
|
|
},
|
|
},
|
|
async toResetPwd(row) {
|
|
async toResetPwd(row) {
|
|
- await resetPwd(row.id);
|
|
|
|
|
|
+ await userInsertOrUpdate({ id: row.id, password: "123456" });
|
|
this.$message.success("密码重置成功!");
|
|
this.$message.success("密码重置成功!");
|
|
}
|
|
}
|
|
}
|
|
}
|