refactor: clean up formatting and improve code readability in ModelResourceIndex.vue
This commit is contained in:
parent
ba3a2153e0
commit
82779d1719
@ -209,6 +209,7 @@ const getRowProvider = computed(() => {
|
||||
return provider_list.value.find((p) => p.provider === row.provider)
|
||||
}
|
||||
})
|
||||
|
||||
function filterWorkspaceChange(val: string) {
|
||||
if (val === 'clear') {
|
||||
workspaceArr.value = []
|
||||
@ -216,6 +217,7 @@ function filterWorkspaceChange(val: string) {
|
||||
getList()
|
||||
workspaceVisible.value = false
|
||||
}
|
||||
|
||||
async function getWorkspaceList() {
|
||||
if (user.isEE()) {
|
||||
const res = await loadPermissionApi('workspace').getSystemWorkspaceList(loading)
|
||||
@ -225,18 +227,32 @@ async function getWorkspaceList() {
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
const search_type_change = () => {
|
||||
model_search_form.value = {name: '', create_user: '', model_type: ''}
|
||||
}
|
||||
|
||||
function getRequestParams() {
|
||||
let obj: any = {
|
||||
name: model_search_form.value.name,
|
||||
create_user: model_search_form.value.create_user,
|
||||
model_type: model_search_form.value.model_type,
|
||||
}
|
||||
if (workspaceArr.value.length > 0) {
|
||||
obj['workspace_ids'] = JSON.stringify(workspaceArr.value)
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
function getList() {
|
||||
ModelResourceApi.getModelListPage(paginationConfig, model_search_form.value, loading).then(
|
||||
ModelResourceApi.getModelListPage(paginationConfig, getRequestParams(), loading).then(
|
||||
(res: any) => {
|
||||
paginationConfig.total = res.data?.total
|
||||
modelList.value = res.data?.records
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
function getProvider() {
|
||||
model.asyncGetProvider(loading).then((res: any) => {
|
||||
provider_list.value = res?.data
|
||||
|
||||
Loading…
Reference in New Issue
Block a user