fix: 修复消息接受人用户搜索问题

This commit is contained in:
Eric
2021-08-18 11:38:19 +08:00
committed by 老广
parent 8906fa3292
commit 973b1fbae2
2 changed files with 23 additions and 3 deletions

View File

@@ -15,6 +15,7 @@
<script>
import Dialog from '@/components/Dialog'
import { krryPaging } from 'krry-transfer'
import { getUserList } from '@/api/users'
export default {
name: 'ListSelect',
components: {
@@ -39,8 +40,27 @@ export default {
getPageData: async function(pageIndex, pageSize) {
const limit = pageSize
const offset = (pageIndex - 1) * pageSize
const url = `/api/v1/users/users/?limit=${limit}&offset=${offset}&oid=ROOT`
const data = await this.$axios.get(url)
const params = {
'limit': limit,
'offset': offset,
'oid': 'ROOT'
}
const data = await getUserList(params)
const results = data['results'].map(item => {
return { id: item.id, label: `${item.name}(${item.username})` }
})
return results
},
getSearchData: async function(keyword, pageIndex, pageSize) {
const limit = pageSize
const offset = (pageIndex - 1) * pageSize
const params = {
'limit': limit,
'offset': offset,
'oid': 'ROOT',
'search': keyword
}
const data = await getUserList(params)
const results = data['results'].map(item => {
return { id: item.id, label: `${item.name}(${item.username})` }
})

View File

@@ -33,7 +33,7 @@
<SelectDialog
v-if="dialogVisible"
:visible.sync="dialogVisible"
title="修改消息接受人"
:title="$t('notifications.ChangeReceiver')"
:selected-users="dialogSelectedUsers"
@submit="onDialogSelectSubmit"
@cancel="dialogVisible=false"