Commit ecd30cde authored by “yiyousong”'s avatar “yiyousong”

perf:修改门户用户列表

parent 00b86f6e
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
<script> <script>
import { userList, userDelete } from "@/api/userManagement.js"; import { userList, userDelete } from "@/api/userManagement.js";
import { mapGetters } from "vuex";
import addUser from "./components/addUser.vue"; import addUser from "./components/addUser.vue";
import EditUser from "./components/EditUser.vue"; import EditUser from "./components/EditUser.vue";
import EditPwd from "./components/EditPwd.vue"; import EditPwd from "./components/EditPwd.vue";
...@@ -174,8 +175,13 @@ export default { ...@@ -174,8 +175,13 @@ export default {
roleId: undefined, roleId: undefined,
searchVal: undefined, searchVal: undefined,
}, },
loginNames: ["admin", "administrator1", "Administrator"],
}; };
}, },
computed: {
...mapGetters("user", ["userData"]),
},
created() { created() {
this.getUserList(); this.getUserList();
}, },
...@@ -207,11 +213,6 @@ export default { ...@@ -207,11 +213,6 @@ export default {
realName = "%" + this.userform.searchVal + "%"; realName = "%" + this.userform.searchVal + "%";
} }
} }
// if (/^[\u4e00-\u9fa5]+$/.test(this.userform.searchVal)) {
// realName = "%" + this.userform.searchVal + "%";
// } else if (/^[\d]+$/.test(this.userform.searchVal)) {
// mobile = "%" + this.userform.searchVal + "%";
// }
let res = await userList({ let res = await userList({
page: this.tablePagination.current, page: this.tablePagination.current,
size: this.tablePagination.pageSize, size: this.tablePagination.pageSize,
...@@ -225,9 +226,18 @@ export default { ...@@ -225,9 +226,18 @@ export default {
this.tablePagination.current -= 1; this.tablePagination.current -= 1;
this.getUserList(); this.getUserList();
} }
this.tablePagination.total = total;
this.userDict = this.transverter(roleId); this.userDict = this.transverter(roleId);
this.tableSourceData = data; let { loginName } = this.userData;
if (this.loginNames.includes(loginName)) {
this.tableSourceData = data;
this.tablePagination.total = total;
} else {
this.tableSourceData = data.filter((v) => {
return !this.loginNames.includes(v.loginName);
});
this.tablePagination.total = total - 3;
}
this.tableLoading = false; this.tableLoading = false;
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment