Files
amb_rag/frontend/src/views/KbDetail.vue.js
T
2026-09-01 21:43:27 +08:00

1556 lines
60 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { ref, onMounted } from 'vue';
import { useRoute } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
import apiClient from '@/api/client';
const route = useRoute();
const kbId = route.params.id;
const isMobile = ref(window.innerWidth <= 768);
const showMobileSidebar = ref(false);
window.addEventListener('resize', () => {
isMobile.value = window.innerWidth <= 768;
if (!isMobile.value)
showMobileSidebar.value = false;
});
const kb = ref(null);
const docs = ref([]);
const categories = ref([]);
const allCategoriesFlat = ref([]);
const loading = ref(false);
const uploading = ref(false);
const aiUrl = ref('');
const selectedCategoryId = ref(null);
const selectedCategoryPath = ref(null);
// 文本内容对话框
const showTextDialog = ref(false);
const textForm = ref({
title: '',
content: '',
content_format: 'markdown',
category_id: null,
});
const textLoading = ref(false);
// 目录管理
const showCatDialog = ref(false);
const catForm = ref({ name: '', parent_id: null, is_folder: true });
const catLoading = ref(false);
const editingCatId = ref(null);
// 编辑文档分类
const editingDocId = ref(null);
onMounted(async () => {
await loadKb();
await loadCategories();
await loadDocs();
await loadLink();
});
async function loadKb() {
try {
const { data } = await apiClient.get(`/knowledge-bases/${kbId}`);
kb.value = data;
}
catch { /* ignore */ }
}
async function loadCategories() {
try {
const { data } = await apiClient.get(`/knowledge-bases/${kbId}/categories/tree`);
categories.value = data;
// 同时加载平铺列表
const { data: flat } = await apiClient.get(`/knowledge-bases/${kbId}/categories`);
allCategoriesFlat.value = flat;
}
catch { /* ignore */ }
}
async function loadDocs() {
loading.value = true;
try {
let url = `/documents?kb_id=${kbId}`;
if (selectedCategoryId.value) {
url += `&category_id=${selectedCategoryId.value}`;
}
const { data } = await apiClient.get(url);
docs.value = data.items;
}
catch { /* ignore */ }
loading.value = false;
}
async function loadLink() {
try {
const { data } = await apiClient.get(`/knowledge-bases/${kbId}/link`);
aiUrl.value = `${window.location.origin}/k/${data.token}`;
}
catch { /* ignore */ }
}
function selectCategory(cat) {
selectedCategoryId.value = cat.id;
selectedCategoryPath.value = cat.path;
loadDocs();
}
function clearCategoryFilter() {
selectedCategoryId.value = null;
selectedCategoryPath.value = null;
loadDocs();
}
// 上传文档
async function handleUpload(options) {
uploading.value = true;
try {
const formData = new FormData();
formData.append('kb_id', kbId);
formData.append('file', options.file);
if (selectedCategoryId.value) {
formData.append('category_id', selectedCategoryId.value);
}
await apiClient.post('/documents/upload', formData, {
headers: { 'Content-Type': 'multipart/form-data' },
});
ElMessage.success('文档上传成功!');
loadDocs();
loadCategories();
}
catch { /* ignore */ }
uploading.value = false;
}
// 创建文本内容
async function handleCreateText() {
if (!textForm.value.title.trim() || !textForm.value.content.trim()) {
ElMessage.warning('请输入标题和内容。');
return;
}
textLoading.value = true;
try {
await apiClient.post('/documents/create-text', {
kb_id: kbId,
title: textForm.value.title,
content: textForm.value.content,
content_format: textForm.value.content_format,
category_id: selectedCategoryId.value || textForm.value.category_id,
});
ElMessage.success('文本内容已创建!');
showTextDialog.value = false;
textForm.value = { title: '', content: '', content_format: 'markdown', category_id: null };
loadDocs();
loadCategories();
}
catch { /* ignore */ }
textLoading.value = false;
}
// 修改文档分类
async function handleChangeDocCategory(doc, newCategoryId) {
try {
await apiClient.put(`/documents/${doc.id}`, { category_id: newCategoryId });
ElMessage.success('目录已更新。');
loadDocs();
loadCategories();
}
catch { /* ignore */ }
}
async function handleDeleteDoc(doc) {
try {
await ElMessageBox.confirm(`确定删除「${doc.original_filename}」?`, '确认删除', { type: 'warning' });
await apiClient.delete(`/documents/${doc.id}`);
ElMessage.success('已删除。');
loadDocs();
loadCategories();
}
catch { /* ignore */ }
}
async function handleReprocess(doc) {
try {
await apiClient.post(`/documents/${doc.id}/reprocess`);
ElMessage.success('重新解析已提交。');
loadDocs();
}
catch { /* ignore */ }
}
async function handleCopyLink() {
try {
await navigator.clipboard.writeText(aiUrl.value);
ElMessage.success('AI 链接已复制!');
}
catch { /* ignore */ }
}
// 重新生成 AI 链接
async function handleRegenerateLink() {
try {
await ElMessageBox.confirm('重新生成链接后,旧链接将立即失效。确定继续?', '确认', { type: 'warning' });
const { data } = await apiClient.post(`/knowledge-bases/${kbId}/regenerate-token`);
aiUrl.value = `${window.location.origin}/k/${data.token}`;
ElMessage.success('链接已重新生成!');
}
catch { /* ignore */ }
}
// 目录管理
function openAddCategory(parentId = null) {
editingCatId.value = null;
catForm.value = { name: '', parent_id: parentId, is_folder: true };
showCatDialog.value = true;
}
function openEditCategory(cat) {
editingCatId.value = cat.id;
catForm.value = { name: cat.name, parent_id: cat.parent_id || null, is_folder: cat.is_folder };
showCatDialog.value = true;
}
async function handleSaveCategory() {
if (!catForm.value.name.trim()) {
ElMessage.warning('请输入目录名称。');
return;
}
catLoading.value = true;
try {
if (editingCatId.value) {
await apiClient.put(`/knowledge-bases/${kbId}/categories/${editingCatId.value}`, catForm.value);
ElMessage.success('目录已更新。');
}
else {
await apiClient.post(`/knowledge-bases/${kbId}/categories`, catForm.value);
ElMessage.success('目录已创建。');
}
showCatDialog.value = false;
loadCategories();
}
catch { /* ignore */ }
catLoading.value = false;
}
async function handleDeleteCategory(cat) {
try {
await ElMessageBox.confirm(`确定删除目录「${cat.name}」及其所有子目录?`, '确认删除', { type: 'warning' });
await apiClient.delete(`/knowledge-bases/${kbId}/categories/${cat.id}`);
ElMessage.success('已删除。');
if (selectedCategoryId.value === cat.id) {
clearCategoryFilter();
}
loadCategories();
loadDocs();
}
catch { /* ignore */ }
}
function formatSize(bytes) {
if (bytes < 1024)
return bytes + ' B';
if (bytes < 1024 * 1024)
return (bytes / 1024).toFixed(1) + ' KB';
return (bytes / (1024 * 1024)).toFixed(1) + ' MB';
}
function statusType(status) {
if (status === 'READY')
return 'success';
if (status === 'FAILED')
return 'danger';
return 'warning';
}
// 获取分类名称
function getCategoryName(catId) {
const cat = allCategoriesFlat.value.find((c) => c.id === catId);
return cat ? cat.name : '未分类';
}
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
const __VLS_ctx = {};
let __VLS_components;
let __VLS_directives;
/** @type {__VLS_StyleScopedClasses['cat-item']} */ ;
/** @type {__VLS_StyleScopedClasses['cat-item']} */ ;
/** @type {__VLS_StyleScopedClasses['tree-label']} */ ;
/** @type {__VLS_StyleScopedClasses['main-layout']} */ ;
/** @type {__VLS_StyleScopedClasses['sidebar']} */ ;
/** @type {__VLS_StyleScopedClasses['sidebar']} */ ;
/** @type {__VLS_StyleScopedClasses['mobile-overlay']} */ ;
/** @type {__VLS_StyleScopedClasses['content']} */ ;
/** @type {__VLS_StyleScopedClasses['mobile-header']} */ ;
/** @type {__VLS_StyleScopedClasses['desktop-header']} */ ;
/** @type {__VLS_StyleScopedClasses['mobile-actions']} */ ;
/** @type {__VLS_StyleScopedClasses['desktop-actions']} */ ;
/** @type {__VLS_StyleScopedClasses['mobile-cards']} */ ;
// CSS variable injection
// CSS variable injection end
if (__VLS_ctx.kb) {
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({});
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ class: "mobile-header" },
});
__VLS_asFunctionalElement(__VLS_intrinsicElements.h1, __VLS_intrinsicElements.h1)({
...{ style: {} },
});
(__VLS_ctx.kb.name);
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ style: {} },
});
const __VLS_0 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
...{ 'onClick': {} },
size: "small",
...{ style: {} },
}));
const __VLS_2 = __VLS_1({
...{ 'onClick': {} },
size: "small",
...{ style: {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
let __VLS_4;
let __VLS_5;
let __VLS_6;
const __VLS_7 = {
onClick: (__VLS_ctx.handleCopyLink)
};
__VLS_3.slots.default;
var __VLS_3;
const __VLS_8 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_9 = __VLS_asFunctionalComponent(__VLS_8, new __VLS_8({
...{ 'onClick': {} },
type: "warning",
size: "small",
...{ style: {} },
}));
const __VLS_10 = __VLS_9({
...{ 'onClick': {} },
type: "warning",
size: "small",
...{ style: {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_9));
let __VLS_12;
let __VLS_13;
let __VLS_14;
const __VLS_15 = {
onClick: (__VLS_ctx.handleRegenerateLink)
};
__VLS_11.slots.default;
var __VLS_11;
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ class: "main-layout" },
});
__VLS_asFunctionalElement(__VLS_intrinsicElements.aside, __VLS_intrinsicElements.aside)({
...{ class: "sidebar" },
...{ class: ({ 'mobile-show': __VLS_ctx.showMobileSidebar }) },
});
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ style: {} },
});
__VLS_asFunctionalElement(__VLS_intrinsicElements.h3, __VLS_intrinsicElements.h3)({
...{ style: {} },
});
const __VLS_16 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_17 = __VLS_asFunctionalComponent(__VLS_16, new __VLS_16({
...{ 'onClick': {} },
size: "small",
type: "primary",
}));
const __VLS_18 = __VLS_17({
...{ 'onClick': {} },
size: "small",
type: "primary",
}, ...__VLS_functionalComponentArgsRest(__VLS_17));
let __VLS_20;
let __VLS_21;
let __VLS_22;
const __VLS_23 = {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.openAddCategory(null);
}
};
__VLS_19.slots.default;
var __VLS_19;
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ onClick: (__VLS_ctx.clearCategoryFilter) },
...{ class: "cat-item" },
...{ class: ({ active: !__VLS_ctx.selectedCategoryId }) },
});
const __VLS_24 = {}.ElTree;
/** @type {[typeof __VLS_components.ElTree, typeof __VLS_components.elTree, typeof __VLS_components.ElTree, typeof __VLS_components.elTree, ]} */ ;
// @ts-ignore
const __VLS_25 = __VLS_asFunctionalComponent(__VLS_24, new __VLS_24({
data: (__VLS_ctx.categories),
nodeKey: "id",
defaultExpandAll: true,
expandOnClickNode: (false),
}));
const __VLS_26 = __VLS_25({
data: (__VLS_ctx.categories),
nodeKey: "id",
defaultExpandAll: true,
expandOnClickNode: (false),
}, ...__VLS_functionalComponentArgsRest(__VLS_25));
__VLS_27.slots.default;
{
const { default: __VLS_thisSlot } = __VLS_27.slots;
const [{ data }] = __VLS_getSlotParams(__VLS_thisSlot);
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ class: "tree-node" },
});
__VLS_asFunctionalElement(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({
...{ onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.selectCategory(data);
} },
...{ class: "tree-label" },
...{ class: ({ selected: __VLS_ctx.selectedCategoryId === data.id }) },
});
(data.is_folder ? '📁' : '📄');
(data.name);
if (data.doc_count > 0) {
__VLS_asFunctionalElement(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({
...{ style: {} },
});
(data.doc_count);
}
__VLS_asFunctionalElement(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({
...{ class: "tree-actions" },
});
const __VLS_28 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_29 = __VLS_asFunctionalComponent(__VLS_28, new __VLS_28({
...{ 'onClick': {} },
size: "small",
text: true,
}));
const __VLS_30 = __VLS_29({
...{ 'onClick': {} },
size: "small",
text: true,
}, ...__VLS_functionalComponentArgsRest(__VLS_29));
let __VLS_32;
let __VLS_33;
let __VLS_34;
const __VLS_35 = {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.openAddCategory(data.id);
}
};
__VLS_31.slots.default;
var __VLS_31;
const __VLS_36 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_37 = __VLS_asFunctionalComponent(__VLS_36, new __VLS_36({
...{ 'onClick': {} },
size: "small",
text: true,
}));
const __VLS_38 = __VLS_37({
...{ 'onClick': {} },
size: "small",
text: true,
}, ...__VLS_functionalComponentArgsRest(__VLS_37));
let __VLS_40;
let __VLS_41;
let __VLS_42;
const __VLS_43 = {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.openEditCategory(data);
}
};
__VLS_39.slots.default;
var __VLS_39;
const __VLS_44 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_45 = __VLS_asFunctionalComponent(__VLS_44, new __VLS_44({
...{ 'onClick': {} },
size: "small",
text: true,
type: "danger",
}));
const __VLS_46 = __VLS_45({
...{ 'onClick': {} },
size: "small",
text: true,
type: "danger",
}, ...__VLS_functionalComponentArgsRest(__VLS_45));
let __VLS_48;
let __VLS_49;
let __VLS_50;
const __VLS_51 = {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.handleDeleteCategory(data);
}
};
__VLS_47.slots.default;
var __VLS_47;
}
var __VLS_27;
if (__VLS_ctx.showMobileSidebar) {
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
if (!(__VLS_ctx.showMobileSidebar))
return;
__VLS_ctx.showMobileSidebar = false;
} },
...{ class: "mobile-overlay" },
});
}
__VLS_asFunctionalElement(__VLS_intrinsicElements.main, __VLS_intrinsicElements.main)({
...{ class: "content" },
});
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ class: "desktop-header" },
});
__VLS_asFunctionalElement(__VLS_intrinsicElements.h1, __VLS_intrinsicElements.h1)({
...{ style: {} },
});
(__VLS_ctx.kb.name);
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ style: {} },
});
const __VLS_52 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_53 = __VLS_asFunctionalComponent(__VLS_52, new __VLS_52({
...{ 'onClick': {} },
size: "large",
}));
const __VLS_54 = __VLS_53({
...{ 'onClick': {} },
size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_53));
let __VLS_56;
let __VLS_57;
let __VLS_58;
const __VLS_59 = {
onClick: (__VLS_ctx.handleCopyLink)
};
__VLS_55.slots.default;
var __VLS_55;
const __VLS_60 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_61 = __VLS_asFunctionalComponent(__VLS_60, new __VLS_60({
...{ 'onClick': {} },
type: "warning",
size: "large",
}));
const __VLS_62 = __VLS_61({
...{ 'onClick': {} },
type: "warning",
size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_61));
let __VLS_64;
let __VLS_65;
let __VLS_66;
const __VLS_67 = {
onClick: (__VLS_ctx.handleRegenerateLink)
};
__VLS_63.slots.default;
var __VLS_63;
const __VLS_68 = {}.ElCard;
/** @type {[typeof __VLS_components.ElCard, typeof __VLS_components.elCard, typeof __VLS_components.ElCard, typeof __VLS_components.elCard, ]} */ ;
// @ts-ignore
const __VLS_69 = __VLS_asFunctionalComponent(__VLS_68, new __VLS_68({
...{ style: {} },
shadow: "hover",
}));
const __VLS_70 = __VLS_69({
...{ style: {} },
shadow: "hover",
}, ...__VLS_functionalComponentArgsRest(__VLS_69));
__VLS_71.slots.default;
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ style: {} },
});
__VLS_asFunctionalElement(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({
...{ style: {} },
});
const __VLS_72 = {}.ElInput;
/** @type {[typeof __VLS_components.ElInput, typeof __VLS_components.elInput, typeof __VLS_components.ElInput, typeof __VLS_components.elInput, ]} */ ;
// @ts-ignore
const __VLS_73 = __VLS_asFunctionalComponent(__VLS_72, new __VLS_72({
modelValue: (__VLS_ctx.aiUrl),
readonly: true,
...{ style: {} },
size: "large",
}));
const __VLS_74 = __VLS_73({
modelValue: (__VLS_ctx.aiUrl),
readonly: true,
...{ style: {} },
size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_73));
__VLS_75.slots.default;
{
const { append: __VLS_thisSlot } = __VLS_75.slots;
const __VLS_76 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_77 = __VLS_asFunctionalComponent(__VLS_76, new __VLS_76({
...{ 'onClick': {} },
}));
const __VLS_78 = __VLS_77({
...{ 'onClick': {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_77));
let __VLS_80;
let __VLS_81;
let __VLS_82;
const __VLS_83 = {
onClick: (__VLS_ctx.handleCopyLink)
};
__VLS_79.slots.default;
var __VLS_79;
}
var __VLS_75;
var __VLS_71;
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ class: "mobile-actions" },
});
const __VLS_84 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_85 = __VLS_asFunctionalComponent(__VLS_84, new __VLS_84({
...{ 'onClick': {} },
...{ style: {} },
}));
const __VLS_86 = __VLS_85({
...{ 'onClick': {} },
...{ style: {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_85));
let __VLS_88;
let __VLS_89;
let __VLS_90;
const __VLS_91 = {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.showMobileSidebar = true;
}
};
__VLS_87.slots.default;
var __VLS_87;
const __VLS_92 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_93 = __VLS_asFunctionalComponent(__VLS_92, new __VLS_92({
...{ 'onClick': {} },
...{ style: {} },
}));
const __VLS_94 = __VLS_93({
...{ 'onClick': {} },
...{ style: {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_93));
let __VLS_96;
let __VLS_97;
let __VLS_98;
const __VLS_99 = {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.showTextDialog = true;
}
};
__VLS_95.slots.default;
var __VLS_95;
const __VLS_100 = {}.ElUpload;
/** @type {[typeof __VLS_components.ElUpload, typeof __VLS_components.elUpload, typeof __VLS_components.ElUpload, typeof __VLS_components.elUpload, ]} */ ;
// @ts-ignore
const __VLS_101 = __VLS_asFunctionalComponent(__VLS_100, new __VLS_100({
showFileList: (false),
httpRequest: (__VLS_ctx.handleUpload),
accept: ".docx,.pdf",
...{ style: {} },
}));
const __VLS_102 = __VLS_101({
showFileList: (false),
httpRequest: (__VLS_ctx.handleUpload),
accept: ".docx,.pdf",
...{ style: {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_101));
__VLS_103.slots.default;
const __VLS_104 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_105 = __VLS_asFunctionalComponent(__VLS_104, new __VLS_104({
type: "primary",
loading: (__VLS_ctx.uploading),
...{ style: {} },
}));
const __VLS_106 = __VLS_105({
type: "primary",
loading: (__VLS_ctx.uploading),
...{ style: {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_105));
__VLS_107.slots.default;
var __VLS_107;
var __VLS_103;
const __VLS_108 = {}.ElCard;
/** @type {[typeof __VLS_components.ElCard, typeof __VLS_components.elCard, typeof __VLS_components.ElCard, typeof __VLS_components.elCard, ]} */ ;
// @ts-ignore
const __VLS_109 = __VLS_asFunctionalComponent(__VLS_108, new __VLS_108({
shadow: "hover",
}));
const __VLS_110 = __VLS_109({
shadow: "hover",
}, ...__VLS_functionalComponentArgsRest(__VLS_109));
__VLS_111.slots.default;
{
const { header: __VLS_thisSlot } = __VLS_111.slots;
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ style: {} },
});
__VLS_asFunctionalElement(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({
...{ style: {} },
});
if (__VLS_ctx.selectedCategoryPath) {
const __VLS_112 = {}.ElTag;
/** @type {[typeof __VLS_components.ElTag, typeof __VLS_components.elTag, typeof __VLS_components.ElTag, typeof __VLS_components.elTag, ]} */ ;
// @ts-ignore
const __VLS_113 = __VLS_asFunctionalComponent(__VLS_112, new __VLS_112({
...{ 'onClose': {} },
closable: true,
...{ style: {} },
}));
const __VLS_114 = __VLS_113({
...{ 'onClose': {} },
closable: true,
...{ style: {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_113));
let __VLS_116;
let __VLS_117;
let __VLS_118;
const __VLS_119 = {
onClose: (__VLS_ctx.clearCategoryFilter)
};
__VLS_115.slots.default;
(__VLS_ctx.selectedCategoryPath);
var __VLS_115;
}
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ class: "desktop-actions" },
});
const __VLS_120 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_121 = __VLS_asFunctionalComponent(__VLS_120, new __VLS_120({
...{ 'onClick': {} },
}));
const __VLS_122 = __VLS_121({
...{ 'onClick': {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_121));
let __VLS_124;
let __VLS_125;
let __VLS_126;
const __VLS_127 = {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.showTextDialog = true;
}
};
__VLS_123.slots.default;
var __VLS_123;
const __VLS_128 = {}.ElUpload;
/** @type {[typeof __VLS_components.ElUpload, typeof __VLS_components.elUpload, typeof __VLS_components.ElUpload, typeof __VLS_components.elUpload, ]} */ ;
// @ts-ignore
const __VLS_129 = __VLS_asFunctionalComponent(__VLS_128, new __VLS_128({
showFileList: (false),
httpRequest: (__VLS_ctx.handleUpload),
accept: ".docx,.pdf",
}));
const __VLS_130 = __VLS_129({
showFileList: (false),
httpRequest: (__VLS_ctx.handleUpload),
accept: ".docx,.pdf",
}, ...__VLS_functionalComponentArgsRest(__VLS_129));
__VLS_131.slots.default;
const __VLS_132 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_133 = __VLS_asFunctionalComponent(__VLS_132, new __VLS_132({
type: "primary",
loading: (__VLS_ctx.uploading),
}));
const __VLS_134 = __VLS_133({
type: "primary",
loading: (__VLS_ctx.uploading),
}, ...__VLS_functionalComponentArgsRest(__VLS_133));
__VLS_135.slots.default;
var __VLS_135;
var __VLS_131;
}
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ class: "desktop-table" },
});
const __VLS_136 = {}.ElTable;
/** @type {[typeof __VLS_components.ElTable, typeof __VLS_components.elTable, typeof __VLS_components.ElTable, typeof __VLS_components.elTable, ]} */ ;
// @ts-ignore
const __VLS_137 = __VLS_asFunctionalComponent(__VLS_136, new __VLS_136({
data: (__VLS_ctx.docs),
...{ style: {} },
}));
const __VLS_138 = __VLS_137({
data: (__VLS_ctx.docs),
...{ style: {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_137));
__VLS_asFunctionalDirective(__VLS_directives.vLoading)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.loading) }, null, null);
__VLS_139.slots.default;
const __VLS_140 = {}.ElTableColumn;
/** @type {[typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, ]} */ ;
// @ts-ignore
const __VLS_141 = __VLS_asFunctionalComponent(__VLS_140, new __VLS_140({
prop: "original_filename",
label: "标题",
minWidth: "180",
showOverflowTooltip: true,
}));
const __VLS_142 = __VLS_141({
prop: "original_filename",
label: "标题",
minWidth: "180",
showOverflowTooltip: true,
}, ...__VLS_functionalComponentArgsRest(__VLS_141));
const __VLS_144 = {}.ElTableColumn;
/** @type {[typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, ]} */ ;
// @ts-ignore
const __VLS_145 = __VLS_asFunctionalComponent(__VLS_144, new __VLS_144({
label: "目录",
width: "180",
}));
const __VLS_146 = __VLS_145({
label: "目录",
width: "180",
}, ...__VLS_functionalComponentArgsRest(__VLS_145));
__VLS_147.slots.default;
{
const { default: __VLS_thisSlot } = __VLS_147.slots;
const [{ row }] = __VLS_getSlotParams(__VLS_thisSlot);
const __VLS_148 = {}.ElSelect;
/** @type {[typeof __VLS_components.ElSelect, typeof __VLS_components.elSelect, typeof __VLS_components.ElSelect, typeof __VLS_components.elSelect, ]} */ ;
// @ts-ignore
const __VLS_149 = __VLS_asFunctionalComponent(__VLS_148, new __VLS_148({
...{ 'onChange': {} },
modelValue: (row.category_id),
placeholder: "选择目录",
size: "small",
...{ style: {} },
}));
const __VLS_150 = __VLS_149({
...{ 'onChange': {} },
modelValue: (row.category_id),
placeholder: "选择目录",
size: "small",
...{ style: {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_149));
let __VLS_152;
let __VLS_153;
let __VLS_154;
const __VLS_155 = {
onChange: ((val) => __VLS_ctx.handleChangeDocCategory(row, val))
};
__VLS_151.slots.default;
for (const [cat] of __VLS_getVForSourceType((__VLS_ctx.allCategoriesFlat))) {
const __VLS_156 = {}.ElOption;
/** @type {[typeof __VLS_components.ElOption, typeof __VLS_components.elOption, ]} */ ;
// @ts-ignore
const __VLS_157 = __VLS_asFunctionalComponent(__VLS_156, new __VLS_156({
key: (cat.id),
label: (cat.name),
value: (cat.id),
}));
const __VLS_158 = __VLS_157({
key: (cat.id),
label: (cat.name),
value: (cat.id),
}, ...__VLS_functionalComponentArgsRest(__VLS_157));
}
var __VLS_151;
}
var __VLS_147;
const __VLS_160 = {}.ElTableColumn;
/** @type {[typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, ]} */ ;
// @ts-ignore
const __VLS_161 = __VLS_asFunctionalComponent(__VLS_160, new __VLS_160({
label: "状态",
width: "90",
align: "center",
}));
const __VLS_162 = __VLS_161({
label: "状态",
width: "90",
align: "center",
}, ...__VLS_functionalComponentArgsRest(__VLS_161));
__VLS_163.slots.default;
{
const { default: __VLS_thisSlot } = __VLS_163.slots;
const [{ row }] = __VLS_getSlotParams(__VLS_thisSlot);
const __VLS_164 = {}.ElTag;
/** @type {[typeof __VLS_components.ElTag, typeof __VLS_components.elTag, typeof __VLS_components.ElTag, typeof __VLS_components.elTag, ]} */ ;
// @ts-ignore
const __VLS_165 = __VLS_asFunctionalComponent(__VLS_164, new __VLS_164({
type: (__VLS_ctx.statusType(row.status)),
size: "small",
}));
const __VLS_166 = __VLS_165({
type: (__VLS_ctx.statusType(row.status)),
size: "small",
}, ...__VLS_functionalComponentArgsRest(__VLS_165));
__VLS_167.slots.default;
(row.status);
var __VLS_167;
}
var __VLS_163;
const __VLS_168 = {}.ElTableColumn;
/** @type {[typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, ]} */ ;
// @ts-ignore
const __VLS_169 = __VLS_asFunctionalComponent(__VLS_168, new __VLS_168({
label: "大小",
width: "80",
align: "center",
}));
const __VLS_170 = __VLS_169({
label: "大小",
width: "80",
align: "center",
}, ...__VLS_functionalComponentArgsRest(__VLS_169));
__VLS_171.slots.default;
{
const { default: __VLS_thisSlot } = __VLS_171.slots;
const [{ row }] = __VLS_getSlotParams(__VLS_thisSlot);
(__VLS_ctx.formatSize(row.file_size));
}
var __VLS_171;
const __VLS_172 = {}.ElTableColumn;
/** @type {[typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, ]} */ ;
// @ts-ignore
const __VLS_173 = __VLS_asFunctionalComponent(__VLS_172, new __VLS_172({
label: "操作",
width: "180",
align: "center",
}));
const __VLS_174 = __VLS_173({
label: "操作",
width: "180",
align: "center",
}, ...__VLS_functionalComponentArgsRest(__VLS_173));
__VLS_175.slots.default;
{
const { default: __VLS_thisSlot } = __VLS_175.slots;
const [{ row }] = __VLS_getSlotParams(__VLS_thisSlot);
const __VLS_176 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_177 = __VLS_asFunctionalComponent(__VLS_176, new __VLS_176({
...{ 'onClick': {} },
size: "small",
}));
const __VLS_178 = __VLS_177({
...{ 'onClick': {} },
size: "small",
}, ...__VLS_functionalComponentArgsRest(__VLS_177));
let __VLS_180;
let __VLS_181;
let __VLS_182;
const __VLS_183 = {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.handleReprocess(row);
}
};
__VLS_179.slots.default;
var __VLS_179;
const __VLS_184 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_185 = __VLS_asFunctionalComponent(__VLS_184, new __VLS_184({
...{ 'onClick': {} },
size: "small",
type: "danger",
}));
const __VLS_186 = __VLS_185({
...{ 'onClick': {} },
size: "small",
type: "danger",
}, ...__VLS_functionalComponentArgsRest(__VLS_185));
let __VLS_188;
let __VLS_189;
let __VLS_190;
const __VLS_191 = {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.handleDeleteDoc(row);
}
};
__VLS_187.slots.default;
var __VLS_187;
}
var __VLS_175;
var __VLS_139;
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ class: "mobile-cards" },
});
for (const [doc] of __VLS_getVForSourceType((__VLS_ctx.docs))) {
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
key: (doc.id),
...{ class: "doc-card" },
});
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ style: {} },
});
(doc.original_filename);
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ style: {} },
});
const __VLS_192 = {}.ElTag;
/** @type {[typeof __VLS_components.ElTag, typeof __VLS_components.elTag, typeof __VLS_components.ElTag, typeof __VLS_components.elTag, ]} */ ;
// @ts-ignore
const __VLS_193 = __VLS_asFunctionalComponent(__VLS_192, new __VLS_192({
type: (__VLS_ctx.statusType(doc.status)),
size: "small",
}));
const __VLS_194 = __VLS_193({
type: (__VLS_ctx.statusType(doc.status)),
size: "small",
}, ...__VLS_functionalComponentArgsRest(__VLS_193));
__VLS_195.slots.default;
(doc.status);
var __VLS_195;
__VLS_asFunctionalElement(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({
...{ style: {} },
});
(__VLS_ctx.formatSize(doc.file_size));
const __VLS_196 = {}.ElSelect;
/** @type {[typeof __VLS_components.ElSelect, typeof __VLS_components.elSelect, typeof __VLS_components.ElSelect, typeof __VLS_components.elSelect, ]} */ ;
// @ts-ignore
const __VLS_197 = __VLS_asFunctionalComponent(__VLS_196, new __VLS_196({
...{ 'onChange': {} },
modelValue: (doc.category_id),
placeholder: "选择目录",
size: "small",
...{ style: {} },
}));
const __VLS_198 = __VLS_197({
...{ 'onChange': {} },
modelValue: (doc.category_id),
placeholder: "选择目录",
size: "small",
...{ style: {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_197));
let __VLS_200;
let __VLS_201;
let __VLS_202;
const __VLS_203 = {
onChange: ((val) => __VLS_ctx.handleChangeDocCategory(doc, val))
};
__VLS_199.slots.default;
for (const [cat] of __VLS_getVForSourceType((__VLS_ctx.allCategoriesFlat))) {
const __VLS_204 = {}.ElOption;
/** @type {[typeof __VLS_components.ElOption, typeof __VLS_components.elOption, ]} */ ;
// @ts-ignore
const __VLS_205 = __VLS_asFunctionalComponent(__VLS_204, new __VLS_204({
key: (cat.id),
label: (cat.name),
value: (cat.id),
}));
const __VLS_206 = __VLS_205({
key: (cat.id),
label: (cat.name),
value: (cat.id),
}, ...__VLS_functionalComponentArgsRest(__VLS_205));
}
var __VLS_199;
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ style: {} },
});
const __VLS_208 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_209 = __VLS_asFunctionalComponent(__VLS_208, new __VLS_208({
...{ 'onClick': {} },
size: "small",
...{ style: {} },
}));
const __VLS_210 = __VLS_209({
...{ 'onClick': {} },
size: "small",
...{ style: {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_209));
let __VLS_212;
let __VLS_213;
let __VLS_214;
const __VLS_215 = {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.handleReprocess(doc);
}
};
__VLS_211.slots.default;
var __VLS_211;
const __VLS_216 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_217 = __VLS_asFunctionalComponent(__VLS_216, new __VLS_216({
...{ 'onClick': {} },
size: "small",
type: "danger",
...{ style: {} },
}));
const __VLS_218 = __VLS_217({
...{ 'onClick': {} },
size: "small",
type: "danger",
...{ style: {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_217));
let __VLS_220;
let __VLS_221;
let __VLS_222;
const __VLS_223 = {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.handleDeleteDoc(doc);
}
};
__VLS_219.slots.default;
var __VLS_219;
}
var __VLS_111;
const __VLS_224 = {}.ElDialog;
/** @type {[typeof __VLS_components.ElDialog, typeof __VLS_components.elDialog, typeof __VLS_components.ElDialog, typeof __VLS_components.elDialog, ]} */ ;
// @ts-ignore
const __VLS_225 = __VLS_asFunctionalComponent(__VLS_224, new __VLS_224({
modelValue: (__VLS_ctx.showTextDialog),
title: "✏️ 添加文本内容",
width: (__VLS_ctx.isMobile ? '95%' : '700px'),
}));
const __VLS_226 = __VLS_225({
modelValue: (__VLS_ctx.showTextDialog),
title: "✏️ 添加文本内容",
width: (__VLS_ctx.isMobile ? '95%' : '700px'),
}, ...__VLS_functionalComponentArgsRest(__VLS_225));
__VLS_227.slots.default;
const __VLS_228 = {}.ElForm;
/** @type {[typeof __VLS_components.ElForm, typeof __VLS_components.elForm, typeof __VLS_components.ElForm, typeof __VLS_components.elForm, ]} */ ;
// @ts-ignore
const __VLS_229 = __VLS_asFunctionalComponent(__VLS_228, new __VLS_228({
model: (__VLS_ctx.textForm),
labelPosition: "top",
}));
const __VLS_230 = __VLS_229({
model: (__VLS_ctx.textForm),
labelPosition: "top",
}, ...__VLS_functionalComponentArgsRest(__VLS_229));
__VLS_231.slots.default;
const __VLS_232 = {}.ElFormItem;
/** @type {[typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, ]} */ ;
// @ts-ignore
const __VLS_233 = __VLS_asFunctionalComponent(__VLS_232, new __VLS_232({
label: "标题",
required: true,
}));
const __VLS_234 = __VLS_233({
label: "标题",
required: true,
}, ...__VLS_functionalComponentArgsRest(__VLS_233));
__VLS_235.slots.default;
const __VLS_236 = {}.ElInput;
/** @type {[typeof __VLS_components.ElInput, typeof __VLS_components.elInput, ]} */ ;
// @ts-ignore
const __VLS_237 = __VLS_asFunctionalComponent(__VLS_236, new __VLS_236({
modelValue: (__VLS_ctx.textForm.title),
placeholder: "文档标题",
size: "large",
}));
const __VLS_238 = __VLS_237({
modelValue: (__VLS_ctx.textForm.title),
placeholder: "文档标题",
size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_237));
var __VLS_235;
const __VLS_240 = {}.ElFormItem;
/** @type {[typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, ]} */ ;
// @ts-ignore
const __VLS_241 = __VLS_asFunctionalComponent(__VLS_240, new __VLS_240({
label: "所属目录",
}));
const __VLS_242 = __VLS_241({
label: "所属目录",
}, ...__VLS_functionalComponentArgsRest(__VLS_241));
__VLS_243.slots.default;
const __VLS_244 = {}.ElSelect;
/** @type {[typeof __VLS_components.ElSelect, typeof __VLS_components.elSelect, typeof __VLS_components.ElSelect, typeof __VLS_components.elSelect, ]} */ ;
// @ts-ignore
const __VLS_245 = __VLS_asFunctionalComponent(__VLS_244, new __VLS_244({
modelValue: (__VLS_ctx.textForm.category_id),
placeholder: "选择目录",
clearable: true,
...{ style: {} },
size: "large",
}));
const __VLS_246 = __VLS_245({
modelValue: (__VLS_ctx.textForm.category_id),
placeholder: "选择目录",
clearable: true,
...{ style: {} },
size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_245));
__VLS_247.slots.default;
for (const [cat] of __VLS_getVForSourceType((__VLS_ctx.allCategoriesFlat))) {
const __VLS_248 = {}.ElOption;
/** @type {[typeof __VLS_components.ElOption, typeof __VLS_components.elOption, ]} */ ;
// @ts-ignore
const __VLS_249 = __VLS_asFunctionalComponent(__VLS_248, new __VLS_248({
key: (cat.id),
label: (cat.name),
value: (cat.id),
}));
const __VLS_250 = __VLS_249({
key: (cat.id),
label: (cat.name),
value: (cat.id),
}, ...__VLS_functionalComponentArgsRest(__VLS_249));
}
var __VLS_247;
var __VLS_243;
const __VLS_252 = {}.ElFormItem;
/** @type {[typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, ]} */ ;
// @ts-ignore
const __VLS_253 = __VLS_asFunctionalComponent(__VLS_252, new __VLS_252({
label: "格式",
}));
const __VLS_254 = __VLS_253({
label: "格式",
}, ...__VLS_functionalComponentArgsRest(__VLS_253));
__VLS_255.slots.default;
const __VLS_256 = {}.ElRadioGroup;
/** @type {[typeof __VLS_components.ElRadioGroup, typeof __VLS_components.elRadioGroup, typeof __VLS_components.ElRadioGroup, typeof __VLS_components.elRadioGroup, ]} */ ;
// @ts-ignore
const __VLS_257 = __VLS_asFunctionalComponent(__VLS_256, new __VLS_256({
modelValue: (__VLS_ctx.textForm.content_format),
size: "large",
}));
const __VLS_258 = __VLS_257({
modelValue: (__VLS_ctx.textForm.content_format),
size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_257));
__VLS_259.slots.default;
const __VLS_260 = {}.ElRadio;
/** @type {[typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, ]} */ ;
// @ts-ignore
const __VLS_261 = __VLS_asFunctionalComponent(__VLS_260, new __VLS_260({
value: "markdown",
}));
const __VLS_262 = __VLS_261({
value: "markdown",
}, ...__VLS_functionalComponentArgsRest(__VLS_261));
__VLS_263.slots.default;
var __VLS_263;
const __VLS_264 = {}.ElRadio;
/** @type {[typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, ]} */ ;
// @ts-ignore
const __VLS_265 = __VLS_asFunctionalComponent(__VLS_264, new __VLS_264({
value: "text",
}));
const __VLS_266 = __VLS_265({
value: "text",
}, ...__VLS_functionalComponentArgsRest(__VLS_265));
__VLS_267.slots.default;
var __VLS_267;
var __VLS_259;
var __VLS_255;
const __VLS_268 = {}.ElFormItem;
/** @type {[typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, ]} */ ;
// @ts-ignore
const __VLS_269 = __VLS_asFunctionalComponent(__VLS_268, new __VLS_268({
label: "内容",
required: true,
}));
const __VLS_270 = __VLS_269({
label: "内容",
required: true,
}, ...__VLS_functionalComponentArgsRest(__VLS_269));
__VLS_271.slots.default;
const __VLS_272 = {}.ElInput;
/** @type {[typeof __VLS_components.ElInput, typeof __VLS_components.elInput, ]} */ ;
// @ts-ignore
const __VLS_273 = __VLS_asFunctionalComponent(__VLS_272, new __VLS_272({
modelValue: (__VLS_ctx.textForm.content),
type: "textarea",
rows: (12),
placeholder: "输入文本内容(支持 Markdown",
size: "large",
}));
const __VLS_274 = __VLS_273({
modelValue: (__VLS_ctx.textForm.content),
type: "textarea",
rows: (12),
placeholder: "输入文本内容(支持 Markdown",
size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_273));
var __VLS_271;
var __VLS_231;
{
const { footer: __VLS_thisSlot } = __VLS_227.slots;
const __VLS_276 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_277 = __VLS_asFunctionalComponent(__VLS_276, new __VLS_276({
...{ 'onClick': {} },
size: "large",
}));
const __VLS_278 = __VLS_277({
...{ 'onClick': {} },
size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_277));
let __VLS_280;
let __VLS_281;
let __VLS_282;
const __VLS_283 = {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.showTextDialog = false;
}
};
__VLS_279.slots.default;
var __VLS_279;
const __VLS_284 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_285 = __VLS_asFunctionalComponent(__VLS_284, new __VLS_284({
...{ 'onClick': {} },
type: "primary",
loading: (__VLS_ctx.textLoading),
size: "large",
}));
const __VLS_286 = __VLS_285({
...{ 'onClick': {} },
type: "primary",
loading: (__VLS_ctx.textLoading),
size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_285));
let __VLS_288;
let __VLS_289;
let __VLS_290;
const __VLS_291 = {
onClick: (__VLS_ctx.handleCreateText)
};
__VLS_287.slots.default;
var __VLS_287;
}
var __VLS_227;
const __VLS_292 = {}.ElDialog;
/** @type {[typeof __VLS_components.ElDialog, typeof __VLS_components.elDialog, typeof __VLS_components.ElDialog, typeof __VLS_components.elDialog, ]} */ ;
// @ts-ignore
const __VLS_293 = __VLS_asFunctionalComponent(__VLS_292, new __VLS_292({
modelValue: (__VLS_ctx.showCatDialog),
title: (__VLS_ctx.editingCatId ? '✏️ 编辑目录' : '📁 新建目录'),
width: (__VLS_ctx.isMobile ? '95%' : '450px'),
}));
const __VLS_294 = __VLS_293({
modelValue: (__VLS_ctx.showCatDialog),
title: (__VLS_ctx.editingCatId ? '✏️ 编辑目录' : '📁 新建目录'),
width: (__VLS_ctx.isMobile ? '95%' : '450px'),
}, ...__VLS_functionalComponentArgsRest(__VLS_293));
__VLS_295.slots.default;
const __VLS_296 = {}.ElForm;
/** @type {[typeof __VLS_components.ElForm, typeof __VLS_components.elForm, typeof __VLS_components.ElForm, typeof __VLS_components.elForm, ]} */ ;
// @ts-ignore
const __VLS_297 = __VLS_asFunctionalComponent(__VLS_296, new __VLS_296({
model: (__VLS_ctx.catForm),
labelPosition: "top",
}));
const __VLS_298 = __VLS_297({
model: (__VLS_ctx.catForm),
labelPosition: "top",
}, ...__VLS_functionalComponentArgsRest(__VLS_297));
__VLS_299.slots.default;
const __VLS_300 = {}.ElFormItem;
/** @type {[typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, ]} */ ;
// @ts-ignore
const __VLS_301 = __VLS_asFunctionalComponent(__VLS_300, new __VLS_300({
label: "目录名称",
required: true,
}));
const __VLS_302 = __VLS_301({
label: "目录名称",
required: true,
}, ...__VLS_functionalComponentArgsRest(__VLS_301));
__VLS_303.slots.default;
const __VLS_304 = {}.ElInput;
/** @type {[typeof __VLS_components.ElInput, typeof __VLS_components.elInput, ]} */ ;
// @ts-ignore
const __VLS_305 = __VLS_asFunctionalComponent(__VLS_304, new __VLS_304({
modelValue: (__VLS_ctx.catForm.name),
placeholder: "如:公司基本信息",
size: "large",
}));
const __VLS_306 = __VLS_305({
modelValue: (__VLS_ctx.catForm.name),
placeholder: "如:公司基本信息",
size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_305));
var __VLS_303;
const __VLS_308 = {}.ElFormItem;
/** @type {[typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, ]} */ ;
// @ts-ignore
const __VLS_309 = __VLS_asFunctionalComponent(__VLS_308, new __VLS_308({
label: "类型",
}));
const __VLS_310 = __VLS_309({
label: "类型",
}, ...__VLS_functionalComponentArgsRest(__VLS_309));
__VLS_311.slots.default;
const __VLS_312 = {}.ElRadioGroup;
/** @type {[typeof __VLS_components.ElRadioGroup, typeof __VLS_components.elRadioGroup, typeof __VLS_components.ElRadioGroup, typeof __VLS_components.elRadioGroup, ]} */ ;
// @ts-ignore
const __VLS_313 = __VLS_asFunctionalComponent(__VLS_312, new __VLS_312({
modelValue: (__VLS_ctx.catForm.is_folder),
size: "large",
}));
const __VLS_314 = __VLS_313({
modelValue: (__VLS_ctx.catForm.is_folder),
size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_313));
__VLS_315.slots.default;
const __VLS_316 = {}.ElRadio;
/** @type {[typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, ]} */ ;
// @ts-ignore
const __VLS_317 = __VLS_asFunctionalComponent(__VLS_316, new __VLS_316({
value: (true),
}));
const __VLS_318 = __VLS_317({
value: (true),
}, ...__VLS_functionalComponentArgsRest(__VLS_317));
__VLS_319.slots.default;
var __VLS_319;
const __VLS_320 = {}.ElRadio;
/** @type {[typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, ]} */ ;
// @ts-ignore
const __VLS_321 = __VLS_asFunctionalComponent(__VLS_320, new __VLS_320({
value: (false),
}));
const __VLS_322 = __VLS_321({
value: (false),
}, ...__VLS_functionalComponentArgsRest(__VLS_321));
__VLS_323.slots.default;
var __VLS_323;
var __VLS_315;
var __VLS_311;
var __VLS_299;
{
const { footer: __VLS_thisSlot } = __VLS_295.slots;
const __VLS_324 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_325 = __VLS_asFunctionalComponent(__VLS_324, new __VLS_324({
...{ 'onClick': {} },
size: "large",
}));
const __VLS_326 = __VLS_325({
...{ 'onClick': {} },
size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_325));
let __VLS_328;
let __VLS_329;
let __VLS_330;
const __VLS_331 = {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
__VLS_ctx.showCatDialog = false;
}
};
__VLS_327.slots.default;
var __VLS_327;
const __VLS_332 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_333 = __VLS_asFunctionalComponent(__VLS_332, new __VLS_332({
...{ 'onClick': {} },
type: "primary",
loading: (__VLS_ctx.catLoading),
size: "large",
}));
const __VLS_334 = __VLS_333({
...{ 'onClick': {} },
type: "primary",
loading: (__VLS_ctx.catLoading),
size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_333));
let __VLS_336;
let __VLS_337;
let __VLS_338;
const __VLS_339 = {
onClick: (__VLS_ctx.handleSaveCategory)
};
__VLS_335.slots.default;
(__VLS_ctx.editingCatId ? '保存' : '创建');
var __VLS_335;
}
var __VLS_295;
}
/** @type {__VLS_StyleScopedClasses['mobile-header']} */ ;
/** @type {__VLS_StyleScopedClasses['main-layout']} */ ;
/** @type {__VLS_StyleScopedClasses['sidebar']} */ ;
/** @type {__VLS_StyleScopedClasses['cat-item']} */ ;
/** @type {__VLS_StyleScopedClasses['tree-node']} */ ;
/** @type {__VLS_StyleScopedClasses['tree-label']} */ ;
/** @type {__VLS_StyleScopedClasses['tree-actions']} */ ;
/** @type {__VLS_StyleScopedClasses['mobile-overlay']} */ ;
/** @type {__VLS_StyleScopedClasses['content']} */ ;
/** @type {__VLS_StyleScopedClasses['desktop-header']} */ ;
/** @type {__VLS_StyleScopedClasses['mobile-actions']} */ ;
/** @type {__VLS_StyleScopedClasses['desktop-actions']} */ ;
/** @type {__VLS_StyleScopedClasses['desktop-table']} */ ;
/** @type {__VLS_StyleScopedClasses['mobile-cards']} */ ;
/** @type {__VLS_StyleScopedClasses['doc-card']} */ ;
var __VLS_dollars;
const __VLS_self = (await import('vue')).defineComponent({
setup() {
return {
isMobile: isMobile,
showMobileSidebar: showMobileSidebar,
kb: kb,
docs: docs,
categories: categories,
allCategoriesFlat: allCategoriesFlat,
loading: loading,
uploading: uploading,
aiUrl: aiUrl,
selectedCategoryId: selectedCategoryId,
selectedCategoryPath: selectedCategoryPath,
showTextDialog: showTextDialog,
textForm: textForm,
textLoading: textLoading,
showCatDialog: showCatDialog,
catForm: catForm,
catLoading: catLoading,
editingCatId: editingCatId,
selectCategory: selectCategory,
clearCategoryFilter: clearCategoryFilter,
handleUpload: handleUpload,
handleCreateText: handleCreateText,
handleChangeDocCategory: handleChangeDocCategory,
handleDeleteDoc: handleDeleteDoc,
handleReprocess: handleReprocess,
handleCopyLink: handleCopyLink,
handleRegenerateLink: handleRegenerateLink,
openAddCategory: openAddCategory,
openEditCategory: openEditCategory,
handleSaveCategory: handleSaveCategory,
handleDeleteCategory: handleDeleteCategory,
formatSize: formatSize,
statusType: statusType,
};
},
});
export default (await import('vue')).defineComponent({
setup() {
return {};
},
});
; /* PartiallyEnd: #4569/main.vue */