|
|
@ -15,7 +15,6 @@ |
|
|
:activable="true" |
|
|
:activable="true" |
|
|
:active-multiple="false" |
|
|
:active-multiple="false" |
|
|
hover |
|
|
hover |
|
|
expand-all |
|
|
|
|
|
empty="暂无分类与目录" |
|
|
empty="暂无分类与目录" |
|
|
v-model:actived="activedKeys" |
|
|
v-model:actived="activedKeys" |
|
|
@active="onTreeActive" |
|
|
@active="onTreeActive" |
|
|
@ -44,7 +43,6 @@ |
|
|
<t-input v-model="keyword" placeholder="搜索文档标题或文件名..." clearable @change="debouncedLoad" style="max-width:260px;" size="small" /> |
|
|
<t-input v-model="keyword" placeholder="搜索文档标题或文件名..." clearable @change="debouncedLoad" style="max-width:260px;" size="small" /> |
|
|
<t-select v-model="filterCategory" :options="categoryOptions" placeholder="全部分类" clearable size="small" style="width:140px;" @change="onCategoryChange" /> |
|
|
<t-select v-model="filterCategory" :options="categoryOptions" placeholder="全部分类" clearable size="small" style="width:140px;" @change="onCategoryChange" /> |
|
|
<t-select v-model="filterStatus" :options="statusOptions" placeholder="全部状态" clearable size="small" style="width:110px;" @change="load()" /> |
|
|
<t-select v-model="filterStatus" :options="statusOptions" placeholder="全部状态" clearable size="small" style="width:110px;" @change="load()" /> |
|
|
<t-select v-model="filterTag" :options="tagOptions" placeholder="全部标签" clearable size="small" style="width:140px;" @change="load()" /> |
|
|
|
|
|
<t-button variant="outline" size="small" @click="load()">刷新</t-button> |
|
|
<t-button variant="outline" size="small" @click="load()">刷新</t-button> |
|
|
<t-tag v-if="hasProcessing" theme="warning" size="small">⏳ 有文档处理中...</t-tag> |
|
|
<t-tag v-if="hasProcessing" theme="warning" size="small">⏳ 有文档处理中...</t-tag> |
|
|
<t-tag v-if="filterFolder" theme="primary" variant="light" size="small" :closable="true" @close="clearFolderFilter">📁 目录筛选</t-tag> |
|
|
<t-tag v-if="filterFolder" theme="primary" variant="light" size="small" :closable="true" @close="clearFolderFilter">📁 目录筛选</t-tag> |
|
|
@ -172,7 +170,6 @@ const loading = ref(false) |
|
|
const filterCategory = ref('') |
|
|
const filterCategory = ref('') |
|
|
const filterStatus = ref('') |
|
|
const filterStatus = ref('') |
|
|
const keyword = ref('') |
|
|
const keyword = ref('') |
|
|
const filterTag = ref('') |
|
|
|
|
|
const selectedIds = ref(new Set<string>()) |
|
|
const selectedIds = ref(new Set<string>()) |
|
|
const hasProcessing = ref(false) |
|
|
const hasProcessing = ref(false) |
|
|
|
|
|
|
|
|
@ -247,7 +244,6 @@ const columns = [ |
|
|
// ==================== 选项 ==================== |
|
|
// ==================== 选项 ==================== |
|
|
const categoryOptions = computed(() => [{ label: '全部分类', value: '' }, ...categoryStore.categories.map(c => ({ label: c.name, value: String(c.id) }))]) |
|
|
const categoryOptions = computed(() => [{ label: '全部分类', value: '' }, ...categoryStore.categories.map(c => ({ label: c.name, value: String(c.id) }))]) |
|
|
const statusOptions = [{ label: '全部状态', value: '' }, { label: '已完成', value: 'READY' }, { label: '处理中', value: 'PROCESSING' }, { label: '失败', value: 'FAILED' }] |
|
|
const statusOptions = [{ label: '全部状态', value: '' }, { label: '已完成', value: 'READY' }, { label: '处理中', value: 'PROCESSING' }, { label: '失败', value: 'FAILED' }] |
|
|
const tagOptions = computed(() => [{ label: '全部标签', value: '' }, ...(documentStore.tags || []).map((t: any) => ({ label: `${t.tag} (${t.count})`, value: t.tag }))]) |
|
|
|
|
|
// 移动弹窗目录树:确保有「未分类」节点,保留移出到未分类的能力 |
|
|
// 移动弹窗目录树:确保有「未分类」节点,保留移出到未分类的能力 |
|
|
const moveTreeData = computed(() => { |
|
|
const moveTreeData = computed(() => { |
|
|
const hasUnclassified = treeData.value.some(n => n.value === 'cat:0') |
|
|
const hasUnclassified = treeData.value.some(n => n.value === 'cat:0') |
|
|
@ -519,7 +515,7 @@ async function loadData(p = page.value) { |
|
|
page.value = p |
|
|
page.value = p |
|
|
loading.value = true |
|
|
loading.value = true |
|
|
try { |
|
|
try { |
|
|
const json = await listDocuments(p, pageSize.value, filterCategory.value || undefined, filterStatus.value || undefined, keyword.value.trim() || undefined, filterTag.value || undefined, filterFolder.value || undefined, sortInfo.value?.sortBy || undefined, sortInfo.value ? (sortInfo.value.descending ? 'desc' : 'asc') : undefined) |
|
|
|
|
|
|
|
|
const json = await listDocuments(p, pageSize.value, filterCategory.value || undefined, filterStatus.value || undefined, keyword.value.trim() || undefined, filterFolder.value || undefined, sortInfo.value?.sortBy || undefined, sortInfo.value ? (sortInfo.value.descending ? 'desc' : 'asc') : undefined) |
|
|
if (json.success) { |
|
|
if (json.success) { |
|
|
documents.value = (json.data || []).map((d: any) => ({ ...d, _enabled: d.enabled !== false })) |
|
|
documents.value = (json.data || []).map((d: any) => ({ ...d, _enabled: d.enabled !== false })) |
|
|
total.value = json.total || 0 |
|
|
total.value = json.total || 0 |
|
|
|