Skip to content

Commit b5efa49

Browse files
committed
refactor: update user options to use nick_name and load members from workspace
1 parent 621cd37 commit b5efa49

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ui/src/views/model/index.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
clearable
4444
style="width: 220px"
4545
>
46-
<el-option v-for="u in user_options" :key="u.id" :value="u.id" :label="u.username" />
46+
<el-option v-for="u in user_options" :key="u.id" :value="u.id" :label="u.nick_name" />
4747
</el-select>
4848
<el-select
4949
v-else-if="search_type === 'model_type'"
@@ -128,7 +128,7 @@ import { useRoute } from 'vue-router'
128128
import permissionMap from '@/permission'
129129
130130
const route = useRoute()
131-
const { model } = useStore()
131+
const { model, user } = useStore()
132132
const apiType = computed(() => {
133133
if (route.path.includes('shared')) {
134134
return 'systemShare'
@@ -204,10 +204,11 @@ const list_model = () => {
204204
.getModelList({ ...model_search_form.value, ...params }, list_model_loading)
205205
.then((ok: any) => {
206206
model_list.value = ok.data
207-
const v = model_list.value.map((m) => ({ id: m.user_id, username: m.username }))
208-
if (user_options.value.length === 0) {
209-
user_options.value = Array.from(new Map(v.map((item) => [item.id, item])).values())
210-
}
207+
})
208+
loadSharedApi({type: 'workspace', isShared: isShared.value, systemType: apiType.value })
209+
.getAllMemberList(user.getWorkspaceId(), loading)
210+
.then((res: any) => {
211+
user_options.value = res.data
211212
})
212213
}
213214

0 commit comments

Comments
 (0)