fix:acl新增用户展示异常问题 (#223)

This commit is contained in:
wang-liang0615 2023-10-24 05:59:08 +08:00 committed by GitHub
parent 30ccb87499
commit 8c47105fbc
1 changed files with 198 additions and 194 deletions

View File

@ -111,10 +111,8 @@ export default {
}, },
async beforeMount() { async beforeMount() {
this.loading = true this.loading = true
await getOnDutyUser().then((res) => { await this.getOnDutyUser()
this.onDutuUids = res.map((i) => i.uid) this.search()
this.search()
})
}, },
computed: { computed: {
...mapState({ ...mapState({
@ -148,6 +146,11 @@ export default {
inject: ['reload'], inject: ['reload'],
methods: { methods: {
async getOnDutyUser() {
await getOnDutyUser().then((res) => {
this.onDutuUids = res.map((i) => i.uid)
})
},
search() { search() {
searchUser({ page_size: 10000 }).then((res) => { searchUser({ page_size: 10000 }).then((res) => {
const ret = res.users.filter((u) => this.onDutuUids.includes(u.uid)) const ret = res.users.filter((u) => this.onDutuUids.includes(u.uid))
@ -162,8 +165,9 @@ export default {
handleEdit(record) { handleEdit(record) {
this.$refs.userForm.handleEdit(record) this.$refs.userForm.handleEdit(record)
}, },
handleOk() { async handleOk() {
this.searchName = '' this.searchName = ''
await this.getOnDutyUser()
this.search() this.search()
}, },
handleCreate() { handleCreate() {