feat: 增加文档筛选
This commit is contained in:
parent
689e74af4b
commit
ba023d20f0
@ -73,7 +73,55 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="paragraph_count" label="分段" align="right" />
|
<el-table-column prop="paragraph_count" label="分段" align="right" />
|
||||||
<el-table-column prop="status" label="文件状态" min-width="90">
|
<el-table-column prop="status" label="文件状态" width="130">
|
||||||
|
<template #header>
|
||||||
|
<div>
|
||||||
|
<span>文件状态</span>
|
||||||
|
<el-dropdown trigger="click" @command="dropdownHandle">
|
||||||
|
<el-button
|
||||||
|
style="margin-top: 1px"
|
||||||
|
link
|
||||||
|
:type="filterMethod['status'] ? 'primary' : ''"
|
||||||
|
>
|
||||||
|
<el-icon><Filter /></el-icon>
|
||||||
|
</el-button>
|
||||||
|
<template #dropdown>
|
||||||
|
<el-dropdown-menu style="width: 100px">
|
||||||
|
<el-dropdown-item
|
||||||
|
:class="filterMethod['status'] ? '' : 'is-active'"
|
||||||
|
:command="beforeCommand('status', '')"
|
||||||
|
class="justify-center"
|
||||||
|
>全部</el-dropdown-item
|
||||||
|
>
|
||||||
|
<el-dropdown-item
|
||||||
|
:class="filterMethod['status'] === '1' ? 'is-active' : ''"
|
||||||
|
class="justify-center"
|
||||||
|
:command="beforeCommand('status', '1')"
|
||||||
|
>成功</el-dropdown-item
|
||||||
|
>
|
||||||
|
<el-dropdown-item
|
||||||
|
:class="filterMethod['status'] === '2' ? 'is-active' : ''"
|
||||||
|
class="justify-center"
|
||||||
|
:command="beforeCommand('status', '2')"
|
||||||
|
>失败</el-dropdown-item
|
||||||
|
>
|
||||||
|
<el-dropdown-item
|
||||||
|
:class="filterMethod['status'] === '0' ? 'is-active' : ''"
|
||||||
|
class="justify-center"
|
||||||
|
:command="beforeCommand('status', '0')"
|
||||||
|
>索引中</el-dropdown-item
|
||||||
|
>
|
||||||
|
<el-dropdown-item
|
||||||
|
:class="filterMethod['status'] === '3' ? 'is-active' : ''"
|
||||||
|
class="justify-center"
|
||||||
|
:command="beforeCommand('status', '3')"
|
||||||
|
>排队中</el-dropdown-item
|
||||||
|
>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-text v-if="row.status === '1'">
|
<el-text v-if="row.status === '1'">
|
||||||
<el-icon class="success"><SuccessFilled /></el-icon> 成功
|
<el-icon class="success"><SuccessFilled /></el-icon> 成功
|
||||||
@ -89,7 +137,43 @@
|
|||||||
</el-text>
|
</el-text>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="启用状态">
|
<el-table-column width="130">
|
||||||
|
<template #header>
|
||||||
|
<div>
|
||||||
|
<span>启用状态</span>
|
||||||
|
<el-dropdown trigger="click" @command="dropdownHandle">
|
||||||
|
<el-button
|
||||||
|
style="margin-top: 1px"
|
||||||
|
link
|
||||||
|
:type="filterMethod['is_active'] ? 'primary' : ''"
|
||||||
|
>
|
||||||
|
<el-icon><Filter /></el-icon>
|
||||||
|
</el-button>
|
||||||
|
<template #dropdown>
|
||||||
|
<el-dropdown-menu style="width: 100px">
|
||||||
|
<el-dropdown-item
|
||||||
|
:class="filterMethod['is_active'] ? '' : 'is-active'"
|
||||||
|
:command="beforeCommand('is_active', '')"
|
||||||
|
class="justify-center"
|
||||||
|
>全部</el-dropdown-item
|
||||||
|
>
|
||||||
|
<el-dropdown-item
|
||||||
|
:class="filterMethod['is_active'] === true ? 'is-active' : ''"
|
||||||
|
class="justify-center"
|
||||||
|
:command="beforeCommand('is_active', true)"
|
||||||
|
>开启</el-dropdown-item
|
||||||
|
>
|
||||||
|
<el-dropdown-item
|
||||||
|
:class="filterMethod['is_active'] === false ? 'is-active' : ''"
|
||||||
|
class="justify-center"
|
||||||
|
:command="beforeCommand('is_active', false)"
|
||||||
|
>关闭</el-dropdown-item
|
||||||
|
>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div @click.stop>
|
<div @click.stop>
|
||||||
<el-switch
|
<el-switch
|
||||||
@ -105,22 +189,26 @@
|
|||||||
<div>
|
<div>
|
||||||
<span>命中处理方式</span>
|
<span>命中处理方式</span>
|
||||||
<el-dropdown trigger="click" @command="dropdownHandle">
|
<el-dropdown trigger="click" @command="dropdownHandle">
|
||||||
<el-button style="margin-top: 1px" link :type="filterMethod ? 'primary' : ''">
|
<el-button
|
||||||
|
style="margin-top: 1px"
|
||||||
|
link
|
||||||
|
:type="filterMethod['hit_handling_method'] ? 'primary' : ''"
|
||||||
|
>
|
||||||
<el-icon><Filter /></el-icon>
|
<el-icon><Filter /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu style="width: 100px">
|
<el-dropdown-menu style="width: 100px">
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
:class="filterMethod ? '' : 'is-active'"
|
:class="filterMethod['hit_handling_method'] ? '' : 'is-active'"
|
||||||
command=""
|
:command="beforeCommand('hit_handling_method', '')"
|
||||||
class="justify-center"
|
class="justify-center"
|
||||||
>全部</el-dropdown-item
|
>全部</el-dropdown-item
|
||||||
>
|
>
|
||||||
<template v-for="(value, key) of hitHandlingMethod" :key="key">
|
<template v-for="(value, key) of hitHandlingMethod" :key="key">
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
:class="filterMethod === key ? 'is-active' : ''"
|
:class="filterMethod['hit_handling_method'] === key ? 'is-active' : ''"
|
||||||
class="justify-center"
|
class="justify-center"
|
||||||
:command="key"
|
:command="beforeCommand('hit_handling_method', key)"
|
||||||
>{{ value }}</el-dropdown-item
|
>{{ value }}</el-dropdown-item
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
@ -281,7 +369,7 @@ const SyncWebDialogRef = ref()
|
|||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
let interval: any
|
let interval: any
|
||||||
const filterText = ref('')
|
const filterText = ref('')
|
||||||
const filterMethod = ref<string | number>('')
|
const filterMethod = ref<any>({})
|
||||||
const documentData = ref<any[]>([])
|
const documentData = ref<any[]>([])
|
||||||
const currentMouseId = ref(null)
|
const currentMouseId = ref(null)
|
||||||
const datasetDetail = ref<any>({})
|
const datasetDetail = ref<any>({})
|
||||||
@ -318,11 +406,18 @@ function openDatasetDialog(row?: any) {
|
|||||||
SelectDatasetDialogRef.value.open(arr)
|
SelectDatasetDialogRef.value.open(arr)
|
||||||
}
|
}
|
||||||
|
|
||||||
function dropdownHandle(val: string) {
|
function dropdownHandle(obj: any) {
|
||||||
filterMethod.value = val
|
filterMethod.value[obj.attr] = obj.command
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function beforeCommand(attr: string, val: any) {
|
||||||
|
return {
|
||||||
|
attr: attr,
|
||||||
|
command: val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function syncDataset() {
|
function syncDataset() {
|
||||||
SyncWebDialogRef.value.open(id)
|
SyncWebDialogRef.value.open(id)
|
||||||
}
|
}
|
||||||
@ -506,7 +601,7 @@ function handleSizeChange() {
|
|||||||
function getList(bool?: boolean) {
|
function getList(bool?: boolean) {
|
||||||
const param = {
|
const param = {
|
||||||
...(filterText.value && { name: filterText.value }),
|
...(filterText.value && { name: filterText.value }),
|
||||||
...(filterMethod.value && { hit_handling_method: filterMethod.value })
|
...filterMethod.value
|
||||||
}
|
}
|
||||||
documentApi
|
documentApi
|
||||||
.getDocument(id as string, paginationConfig.value, param, bool ? undefined : loading)
|
.getDocument(id as string, paginationConfig.value, param, bool ? undefined : loading)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user