feat: tool
This commit is contained in:
parent
b13799d584
commit
d7b61c61e6
@ -5,7 +5,7 @@
|
|||||||
:placeholder="$t('common.search')"
|
:placeholder="$t('common.search')"
|
||||||
prefix-icon="Search"
|
prefix-icon="Search"
|
||||||
clearable
|
clearable
|
||||||
class="p-16"
|
class="p-8"
|
||||||
/>
|
/>
|
||||||
<el-tree
|
<el-tree
|
||||||
ref="treeRef"
|
ref="treeRef"
|
||||||
|
|||||||
@ -32,7 +32,6 @@
|
|||||||
v-model="model_search_form.name"
|
v-model="model_search_form.name"
|
||||||
@change="list_model"
|
@change="list_model"
|
||||||
:placeholder="$t('views.model.searchBar.placeholder')"
|
:placeholder="$t('views.model.searchBar.placeholder')"
|
||||||
prefix-icon="Search"
|
|
||||||
style="width: 220px"
|
style="width: 220px"
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -6,13 +6,47 @@
|
|||||||
:data="folderList"
|
:data="folderList"
|
||||||
:currentNodeKey="currentFolder?.id"
|
:currentNodeKey="currentFolder?.id"
|
||||||
@handleNodeClick="folderClickHandel"
|
@handleNodeClick="folderClickHandel"
|
||||||
|
class="p-8"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<ContentContainer>
|
<ContentContainer :header="currentFolder?.name">
|
||||||
<div class="flex-between mb-16">
|
<template #search>
|
||||||
<h4>{{ currentFolder?.name }}</h4>
|
<div class="flex">
|
||||||
<div class="flex-between"></div>
|
<div class="flex-between complex-search">
|
||||||
</div>
|
<el-select
|
||||||
|
class="complex-search__left"
|
||||||
|
v-model="search_type"
|
||||||
|
style="width: 120px"
|
||||||
|
@change="search_type_change"
|
||||||
|
>
|
||||||
|
<el-option :label="$t('common.creator')" value="create_user" />
|
||||||
|
|
||||||
|
<el-option :label="$t('views.model.modelForm.modeName.label')" value="name" />
|
||||||
|
</el-select>
|
||||||
|
<el-input
|
||||||
|
v-if="search_type === 'name'"
|
||||||
|
v-model="search_form.name"
|
||||||
|
@change="getList"
|
||||||
|
:placeholder="$t('views.model.searchBar.placeholder')"
|
||||||
|
style="width: 220px"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
<el-select
|
||||||
|
v-else-if="search_type === 'create_user'"
|
||||||
|
v-model="search_form.create_user"
|
||||||
|
@change="getList"
|
||||||
|
clearable
|
||||||
|
style="width: 220px"
|
||||||
|
>
|
||||||
|
<el-option v-for="u in user_options" :key="u.id" :value="u.id" :label="u.username" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<!-- <el-button class="ml-16" type="primary" @click="openCreateModel(active_provider)">
|
||||||
|
{{ $t('views.model.addModel') }}</el-button
|
||||||
|
> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<el-row v-if="toolList.length > 0" :gutter="15">
|
<el-row v-if="toolList.length > 0" :gutter="15">
|
||||||
<template v-for="(item, index) in toolList" :key="index">
|
<template v-for="(item, index) in toolList" :key="index">
|
||||||
@ -48,6 +82,17 @@ import { numberFormat } from '@/utils/common'
|
|||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
|
|
||||||
const { folder } = useStore()
|
const { folder } = useStore()
|
||||||
|
|
||||||
|
const search_type = ref('name')
|
||||||
|
const search_form = ref<{
|
||||||
|
name: string
|
||||||
|
create_user: string
|
||||||
|
}>({
|
||||||
|
name: '',
|
||||||
|
create_user: '',
|
||||||
|
})
|
||||||
|
const user_options = ref<any[]>([])
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const paginationConfig = reactive({
|
const paginationConfig = reactive({
|
||||||
current_page: 1,
|
current_page: 1,
|
||||||
@ -59,6 +104,10 @@ const folderList = ref<any[]>([])
|
|||||||
const toolList = ref<any[]>([])
|
const toolList = ref<any[]>([])
|
||||||
const currentFolder = ref<any>({})
|
const currentFolder = ref<any>({})
|
||||||
|
|
||||||
|
const search_type_change = () => {
|
||||||
|
search_form.value = { name: '', create_user: '' }
|
||||||
|
}
|
||||||
|
|
||||||
function getList() {
|
function getList() {
|
||||||
const params = {
|
const params = {
|
||||||
folder_id: currentFolder.value?.id || 'root',
|
folder_id: currentFolder.value?.id || 'root',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user