Skip to content

Commit d7b61c6

Browse files
feat: tool
1 parent b13799d commit d7b61c6

File tree

3 files changed

+55
-7
lines changed

3 files changed

+55
-7
lines changed

ui/src/components/folder-tree/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:placeholder="$t('common.search')"
66
prefix-icon="Search"
77
clearable
8-
class="p-16"
8+
class="p-8"
99
/>
1010
<el-tree
1111
ref="treeRef"

ui/src/views/model/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
v-model="model_search_form.name"
3333
@change="list_model"
3434
:placeholder="$t('views.model.searchBar.placeholder')"
35-
prefix-icon="Search"
3635
style="width: 220px"
3736
clearable
3837
/>

ui/src/views/tool/index.vue

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,47 @@
66
:data="folderList"
77
:currentNodeKey="currentFolder?.id"
88
@handleNodeClick="folderClickHandel"
9+
class="p-8"
910
/>
1011
</template>
11-
<ContentContainer>
12-
<div class="flex-between mb-16">
13-
<h4>{{ currentFolder?.name }}</h4>
14-
<div class="flex-between"></div>
15-
</div>
12+
<ContentContainer :header="currentFolder?.name">
13+
<template #search>
14+
<div class="flex">
15+
<div class="flex-between complex-search">
16+
<el-select
17+
class="complex-search__left"
18+
v-model="search_type"
19+
style="width: 120px"
20+
@change="search_type_change"
21+
>
22+
<el-option :label="$t('common.creator')" value="create_user" />
23+
24+
<el-option :label="$t('views.model.modelForm.modeName.label')" value="name" />
25+
</el-select>
26+
<el-input
27+
v-if="search_type === 'name'"
28+
v-model="search_form.name"
29+
@change="getList"
30+
:placeholder="$t('views.model.searchBar.placeholder')"
31+
style="width: 220px"
32+
clearable
33+
/>
34+
<el-select
35+
v-else-if="search_type === 'create_user'"
36+
v-model="search_form.create_user"
37+
@change="getList"
38+
clearable
39+
style="width: 220px"
40+
>
41+
<el-option v-for="u in user_options" :key="u.id" :value="u.id" :label="u.username" />
42+
</el-select>
43+
</div>
44+
<!-- <el-button class="ml-16" type="primary" @click="openCreateModel(active_provider)">
45+
{{ $t('views.model.addModel') }}</el-button
46+
> -->
47+
</div>
48+
</template>
49+
1650
<div>
1751
<el-row v-if="toolList.length > 0" :gutter="15">
1852
<template v-for="(item, index) in toolList" :key="index">
@@ -48,6 +82,17 @@ import { numberFormat } from '@/utils/common'
4882
import { t } from '@/locales'
4983
5084
const { folder } = useStore()
85+
86+
const search_type = ref('name')
87+
const search_form = ref<{
88+
name: string
89+
create_user: string
90+
}>({
91+
name: '',
92+
create_user: '',
93+
})
94+
const user_options = ref<any[]>([])
95+
5196
const loading = ref(false)
5297
const paginationConfig = reactive({
5398
current_page: 1,
@@ -59,6 +104,10 @@ const folderList = ref<any[]>([])
59104
const toolList = ref<any[]>([])
60105
const currentFolder = ref<any>({})
61106
107+
const search_type_change = () => {
108+
search_form.value = { name: '', create_user: '' }
109+
}
110+
62111
function getList() {
63112
const params = {
64113
folder_id: currentFolder.value?.id || 'root',

0 commit comments

Comments
 (0)