@@ -346,7 +425,7 @@ function getCategoryName(catId: string) {
-
✏️ 添加文本
+
✏️ 添加文本
📤 上传文档
diff --git a/frontend/src/views/KbDetail.vue.js b/frontend/src/views/KbDetail.vue.js
index 5160e94..9f0e984 100644
--- a/frontend/src/views/KbDetail.vue.js
+++ b/frontend/src/views/KbDetail.vue.js
@@ -1,4 +1,4 @@
-import { ref, onMounted } from 'vue';
+import { ref, onMounted, computed } from 'vue';
import { useRoute } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
import apiClient from '@/api/client';
@@ -73,10 +73,53 @@ async function loadDocs() {
catch { /* ignore */ }
loading.value = false;
}
+// 链接有效期
+const expiryOptions = [
+ { label: '10 分钟', value: 10 },
+ { label: '30 分钟', value: 30 },
+ { label: '1 小时', value: 60 },
+ { label: '3 小时', value: 180 },
+ { label: '24 小时', value: 1440 },
+ { label: '长期有效', value: 0 },
+];
+const linkExpiry = ref({
+ expires_at: null,
+ is_expired: false,
+});
+const expiryText = computed(() => {
+ if (linkExpiry.value.is_expired)
+ return '⛔ 已失效';
+ if (!linkExpiry.value.expires_at)
+ return '♾️ 长期有效';
+ return `⏱️ 有效期至 ${linkExpiry.value.expires_at}`;
+});
async function loadLink() {
try {
const { data } = await apiClient.get(`/knowledge-bases/${kbId}/link`);
aiUrl.value = `${window.location.origin}/k/${data.token}`;
+ linkExpiry.value = {
+ expires_at: data.expires_at,
+ is_expired: data.is_expired,
+ };
+ }
+ catch { /* ignore */ }
+}
+// 设置链接有效期(0 = 长期有效,需二次确认)
+async function handleExpiryChange(val) {
+ if (val === 0) {
+ try {
+ await ElMessageBox.confirm('长期有效的链接一旦泄露,任何持有该链接的人都可永久访问此知识库,存在泄露风险。确定设为长期有效?', '⚠️ 泄露风险提示', { type: 'warning', confirmButtonText: '仍要设为长期有效', cancelButtonText: '取消' });
+ }
+ catch {
+ return; // 用户取消
+ }
+ }
+ try {
+ await apiClient.post(`/knowledge-bases/${kbId}/set-expiry`, {
+ expires_in_minutes: val === 0 ? null : val,
+ });
+ ElMessage.success('链接有效期已更新。');
+ loadLink();
}
catch { /* ignore */ }
}
@@ -110,6 +153,11 @@ async function handleUpload(options) {
catch { /* ignore */ }
uploading.value = false;
}
+// 打开添加文本对话框(预填左侧选中的目录,对话框内的选择优先)
+function openTextDialog() {
+ textForm.value.category_id = selectedCategoryId.value;
+ showTextDialog.value = true;
+}
// 创建文本内容
async function handleCreateText() {
if (!textForm.value.title.trim() || !textForm.value.content.trim()) {
@@ -123,7 +171,7 @@ async function handleCreateText() {
title: textForm.value.title,
content: textForm.value.content,
content_format: textForm.value.content_format,
- category_id: selectedCategoryId.value || textForm.value.category_id,
+ category_id: textForm.value.category_id,
});
ElMessage.success('文本内容已创建!');
showTextDialog.value = false;
@@ -245,6 +293,17 @@ function getCategoryName(catId) {
const cat = allCategoriesFlat.value.find((c) => c.id === catId);
return cat ? cat.name : '未分类';
}
+// AI 链接打码:显示域名,token 部分用 • 代替
+const maskedAiUrl = computed(() => {
+ if (!aiUrl.value)
+ return '尚未生成';
+ const idx = aiUrl.value.indexOf('/k/');
+ if (idx === -1)
+ return '••••••••';
+ const prefix = aiUrl.value.slice(0, idx + 3);
+ const tokenLen = aiUrl.value.length - idx - 3;
+ return prefix + '•'.repeat(tokenLen);
+});
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
const __VLS_ctx = {};
let __VLS_components;
@@ -567,70 +626,83 @@ if (__VLS_ctx.kb) {
__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, ]} */ ;
+ __VLS_asFunctionalElement(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({
+ ...{ style: {} },
+ });
+ (__VLS_ctx.maskedAiUrl);
+ const __VLS_72 = {}.ElSelect;
+ /** @type {[typeof __VLS_components.ElSelect, typeof __VLS_components.elSelect, typeof __VLS_components.ElSelect, typeof __VLS_components.elSelect, ]} */ ;
// @ts-ignore
const __VLS_73 = __VLS_asFunctionalComponent(__VLS_72, new __VLS_72({
- modelValue: (__VLS_ctx.aiUrl),
- readonly: true,
+ ...{ 'onChange': {} },
+ modelValue: (null),
+ placeholder: "⏱️ 设置有效期",
...{ style: {} },
- size: "large",
}));
const __VLS_74 = __VLS_73({
- modelValue: (__VLS_ctx.aiUrl),
- readonly: true,
+ ...{ 'onChange': {} },
+ modelValue: (null),
+ placeholder: "⏱️ 设置有效期",
...{ style: {} },
- size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_73));
+ let __VLS_76;
+ let __VLS_77;
+ let __VLS_78;
+ const __VLS_79 = {
+ onChange: ((val) => __VLS_ctx.handleExpiryChange(val))
+ };
__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, ]} */ ;
+ for (const [opt] of __VLS_getVForSourceType((__VLS_ctx.expiryOptions))) {
+ const __VLS_80 = {}.ElOption;
+ /** @type {[typeof __VLS_components.ElOption, typeof __VLS_components.elOption, ]} */ ;
// @ts-ignore
- const __VLS_77 = __VLS_asFunctionalComponent(__VLS_76, new __VLS_76({
- ...{ 'onClick': {} },
+ const __VLS_81 = __VLS_asFunctionalComponent(__VLS_80, new __VLS_80({
+ key: (opt.value),
+ label: (opt.label),
+ value: (opt.value),
}));
- 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;
+ const __VLS_82 = __VLS_81({
+ key: (opt.value),
+ label: (opt.label),
+ value: (opt.value),
+ }, ...__VLS_functionalComponentArgsRest(__VLS_81));
}
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: {} },
+ type: "primary",
+ size: "large",
}));
const __VLS_86 = __VLS_85({
...{ 'onClick': {} },
- ...{ style: {} },
+ type: "primary",
+ size: "large",
}, ...__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;
- }
+ onClick: (__VLS_ctx.handleCopyLink)
};
__VLS_87.slots.default;
var __VLS_87;
+ __VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
+ ...{ style: {} },
+ });
+ __VLS_asFunctionalElement(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({
+ ...{ style: ({ color: __VLS_ctx.linkExpiry.is_expired ? '#f56c6c' : '#67c23a', fontWeight: __VLS_ctx.linkExpiry.is_expired ? 'bold' : 'normal' }) },
+ });
+ (__VLS_ctx.expiryText);
+ __VLS_asFunctionalElement(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({
+ ...{ style: {} },
+ });
+ var __VLS_71;
+ __VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
+ ...{ class: "mobile-actions" },
+ });
const __VLS_92 = {}.ElButton;
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
@@ -649,55 +721,74 @@ if (__VLS_ctx.kb) {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
- __VLS_ctx.showTextDialog = true;
+ __VLS_ctx.showMobileSidebar = 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, ]} */ ;
+ const __VLS_100 = {}.ElButton;
+ /** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
// @ts-ignore
const __VLS_101 = __VLS_asFunctionalComponent(__VLS_100, new __VLS_100({
- showFileList: (false),
- httpRequest: (__VLS_ctx.handleUpload),
- accept: ".docx,.pdf",
+ ...{ 'onClick': {} },
...{ style: {} },
}));
const __VLS_102 = __VLS_101({
+ ...{ 'onClick': {} },
+ ...{ style: {} },
+ }, ...__VLS_functionalComponentArgsRest(__VLS_101));
+ let __VLS_104;
+ let __VLS_105;
+ let __VLS_106;
+ const __VLS_107 = {
+ onClick: (__VLS_ctx.openTextDialog)
+ };
+ __VLS_103.slots.default;
+ var __VLS_103;
+ const __VLS_108 = {}.ElUpload;
+ /** @type {[typeof __VLS_components.ElUpload, typeof __VLS_components.elUpload, typeof __VLS_components.ElUpload, typeof __VLS_components.elUpload, ]} */ ;
+ // @ts-ignore
+ const __VLS_109 = __VLS_asFunctionalComponent(__VLS_108, new __VLS_108({
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",
+ showFileList: (false),
+ httpRequest: (__VLS_ctx.handleUpload),
+ accept: ".docx,.pdf",
+ ...{ style: {} },
}, ...__VLS_functionalComponentArgsRest(__VLS_109));
__VLS_111.slots.default;
+ const __VLS_112 = {}.ElButton;
+ /** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
+ // @ts-ignore
+ const __VLS_113 = __VLS_asFunctionalComponent(__VLS_112, new __VLS_112({
+ type: "primary",
+ loading: (__VLS_ctx.uploading),
+ ...{ style: {} },
+ }));
+ const __VLS_114 = __VLS_113({
+ type: "primary",
+ loading: (__VLS_ctx.uploading),
+ ...{ style: {} },
+ }, ...__VLS_functionalComponentArgsRest(__VLS_113));
+ __VLS_115.slots.default;
+ var __VLS_115;
+ var __VLS_111;
+ const __VLS_116 = {}.ElCard;
+ /** @type {[typeof __VLS_components.ElCard, typeof __VLS_components.elCard, typeof __VLS_components.ElCard, typeof __VLS_components.elCard, ]} */ ;
+ // @ts-ignore
+ const __VLS_117 = __VLS_asFunctionalComponent(__VLS_116, new __VLS_116({
+ shadow: "hover",
+ }));
+ const __VLS_118 = __VLS_117({
+ shadow: "hover",
+ }, ...__VLS_functionalComponentArgsRest(__VLS_117));
+ __VLS_119.slots.default;
{
- const { header: __VLS_thisSlot } = __VLS_111.slots;
+ const { header: __VLS_thisSlot } = __VLS_119.slots;
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ style: {} },
});
@@ -705,275 +796,246 @@ if (__VLS_ctx.kb) {
...{ style: {} },
});
if (__VLS_ctx.selectedCategoryPath) {
- const __VLS_112 = {}.ElTag;
+ const __VLS_120 = {}.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({
+ const __VLS_121 = __VLS_asFunctionalComponent(__VLS_120, new __VLS_120({
...{ 'onClose': {} },
closable: true,
...{ style: {} },
}));
- const __VLS_114 = __VLS_113({
+ const __VLS_122 = __VLS_121({
...{ 'onClose': {} },
closable: true,
...{ style: {} },
- }, ...__VLS_functionalComponentArgsRest(__VLS_113));
- let __VLS_116;
- let __VLS_117;
- let __VLS_118;
- const __VLS_119 = {
+ }, ...__VLS_functionalComponentArgsRest(__VLS_121));
+ let __VLS_124;
+ let __VLS_125;
+ let __VLS_126;
+ const __VLS_127 = {
onClose: (__VLS_ctx.clearCategoryFilter)
};
- __VLS_115.slots.default;
+ __VLS_123.slots.default;
(__VLS_ctx.selectedCategoryPath);
- var __VLS_115;
+ var __VLS_123;
}
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ class: "desktop-actions" },
});
- const __VLS_120 = {}.ElButton;
+ const __VLS_128 = {}.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",
+ ...{ 'onClick': {} },
}));
const __VLS_130 = __VLS_129({
+ ...{ 'onClick': {} },
+ }, ...__VLS_functionalComponentArgsRest(__VLS_129));
+ let __VLS_132;
+ let __VLS_133;
+ let __VLS_134;
+ const __VLS_135 = {
+ onClick: (__VLS_ctx.openTextDialog)
+ };
+ __VLS_131.slots.default;
+ var __VLS_131;
+ const __VLS_136 = {}.ElUpload;
+ /** @type {[typeof __VLS_components.ElUpload, typeof __VLS_components.elUpload, typeof __VLS_components.ElUpload, typeof __VLS_components.elUpload, ]} */ ;
+ // @ts-ignore
+ const __VLS_137 = __VLS_asFunctionalComponent(__VLS_136, new __VLS_136({
showFileList: (false),
httpRequest: (__VLS_ctx.handleUpload),
accept: ".docx,.pdf",
- }, ...__VLS_functionalComponentArgsRest(__VLS_129));
- __VLS_131.slots.default;
- const __VLS_132 = {}.ElButton;
+ }));
+ const __VLS_138 = __VLS_137({
+ showFileList: (false),
+ httpRequest: (__VLS_ctx.handleUpload),
+ accept: ".docx,.pdf",
+ }, ...__VLS_functionalComponentArgsRest(__VLS_137));
+ __VLS_139.slots.default;
+ const __VLS_140 = {}.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({
+ const __VLS_141 = __VLS_asFunctionalComponent(__VLS_140, new __VLS_140({
type: "primary",
loading: (__VLS_ctx.uploading),
}));
- const __VLS_134 = __VLS_133({
+ const __VLS_142 = __VLS_141({
type: "primary",
loading: (__VLS_ctx.uploading),
- }, ...__VLS_functionalComponentArgsRest(__VLS_133));
- __VLS_135.slots.default;
- var __VLS_135;
- var __VLS_131;
+ }, ...__VLS_functionalComponentArgsRest(__VLS_141));
+ __VLS_143.slots.default;
+ var __VLS_143;
+ var __VLS_139;
}
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ class: "desktop-table" },
});
- const __VLS_136 = {}.ElTable;
+ const __VLS_144 = {}.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",
+ data: (__VLS_ctx.docs),
+ ...{ style: {} },
}));
const __VLS_146 = __VLS_145({
+ data: (__VLS_ctx.docs),
+ ...{ style: {} },
+ }, ...__VLS_functionalComponentArgsRest(__VLS_145));
+ __VLS_asFunctionalDirective(__VLS_directives.vLoading)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.loading) }, null, null);
+ __VLS_147.slots.default;
+ const __VLS_148 = {}.ElTableColumn;
+ /** @type {[typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, ]} */ ;
+ // @ts-ignore
+ const __VLS_149 = __VLS_asFunctionalComponent(__VLS_148, new __VLS_148({
+ prop: "original_filename",
+ label: "标题",
+ minWidth: "180",
+ showOverflowTooltip: true,
+ }));
+ const __VLS_150 = __VLS_149({
+ prop: "original_filename",
+ label: "标题",
+ minWidth: "180",
+ showOverflowTooltip: true,
+ }, ...__VLS_functionalComponentArgsRest(__VLS_149));
+ const __VLS_152 = {}.ElTableColumn;
+ /** @type {[typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, ]} */ ;
+ // @ts-ignore
+ const __VLS_153 = __VLS_asFunctionalComponent(__VLS_152, new __VLS_152({
label: "目录",
width: "180",
- }, ...__VLS_functionalComponentArgsRest(__VLS_145));
- __VLS_147.slots.default;
+ }));
+ const __VLS_154 = __VLS_153({
+ label: "目录",
+ width: "180",
+ }, ...__VLS_functionalComponentArgsRest(__VLS_153));
+ __VLS_155.slots.default;
{
- const { default: __VLS_thisSlot } = __VLS_147.slots;
+ const { default: __VLS_thisSlot } = __VLS_155.slots;
const [{ row }] = __VLS_getSlotParams(__VLS_thisSlot);
- const __VLS_148 = {}.ElSelect;
+ const __VLS_156 = {}.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({
+ const __VLS_157 = __VLS_asFunctionalComponent(__VLS_156, new __VLS_156({
...{ 'onChange': {} },
modelValue: (row.category_id),
placeholder: "选择目录",
size: "small",
...{ style: {} },
}));
- const __VLS_150 = __VLS_149({
+ const __VLS_158 = __VLS_157({
...{ '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 = {
+ }, ...__VLS_functionalComponentArgsRest(__VLS_157));
+ let __VLS_160;
+ let __VLS_161;
+ let __VLS_162;
+ const __VLS_163 = {
onChange: ((val) => __VLS_ctx.handleChangeDocCategory(row, val))
};
- __VLS_151.slots.default;
+ __VLS_159.slots.default;
for (const [cat] of __VLS_getVForSourceType((__VLS_ctx.allCategoriesFlat))) {
- const __VLS_156 = {}.ElOption;
+ const __VLS_164 = {}.ElOption;
/** @type {[typeof __VLS_components.ElOption, typeof __VLS_components.elOption, ]} */ ;
// @ts-ignore
- const __VLS_157 = __VLS_asFunctionalComponent(__VLS_156, new __VLS_156({
+ const __VLS_165 = __VLS_asFunctionalComponent(__VLS_164, new __VLS_164({
key: (cat.id),
label: (cat.name),
value: (cat.id),
}));
- const __VLS_158 = __VLS_157({
+ const __VLS_166 = __VLS_165({
key: (cat.id),
label: (cat.name),
value: (cat.id),
- }, ...__VLS_functionalComponentArgsRest(__VLS_157));
+ }, ...__VLS_functionalComponentArgsRest(__VLS_165));
}
- var __VLS_151;
+ var __VLS_159;
}
- 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;
+ var __VLS_155;
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",
+ label: "状态",
+ width: "90",
align: "center",
}));
const __VLS_170 = __VLS_169({
- label: "大小",
- width: "80",
+ label: "状态",
+ width: "90",
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));
+ const __VLS_172 = {}.ElTag;
+ /** @type {[typeof __VLS_components.ElTag, typeof __VLS_components.elTag, typeof __VLS_components.ElTag, typeof __VLS_components.elTag, ]} */ ;
+ // @ts-ignore
+ const __VLS_173 = __VLS_asFunctionalComponent(__VLS_172, new __VLS_172({
+ type: (__VLS_ctx.statusType(row.status)),
+ size: "small",
+ }));
+ const __VLS_174 = __VLS_173({
+ type: (__VLS_ctx.statusType(row.status)),
+ size: "small",
+ }, ...__VLS_functionalComponentArgsRest(__VLS_173));
+ __VLS_175.slots.default;
+ (row.status);
+ var __VLS_175;
}
var __VLS_171;
- const __VLS_172 = {}.ElTableColumn;
+ const __VLS_176 = {}.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({
+ const __VLS_177 = __VLS_asFunctionalComponent(__VLS_176, new __VLS_176({
+ label: "大小",
+ width: "80",
+ align: "center",
+ }));
+ const __VLS_178 = __VLS_177({
+ label: "大小",
+ width: "80",
+ align: "center",
+ }, ...__VLS_functionalComponentArgsRest(__VLS_177));
+ __VLS_179.slots.default;
+ {
+ const { default: __VLS_thisSlot } = __VLS_179.slots;
+ const [{ row }] = __VLS_getSlotParams(__VLS_thisSlot);
+ (__VLS_ctx.formatSize(row.file_size));
+ }
+ var __VLS_179;
+ const __VLS_180 = {}.ElTableColumn;
+ /** @type {[typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, ]} */ ;
+ // @ts-ignore
+ const __VLS_181 = __VLS_asFunctionalComponent(__VLS_180, new __VLS_180({
label: "操作",
width: "180",
align: "center",
}));
- const __VLS_174 = __VLS_173({
+ const __VLS_182 = __VLS_181({
label: "操作",
width: "180",
align: "center",
- }, ...__VLS_functionalComponentArgsRest(__VLS_173));
- __VLS_175.slots.default;
+ }, ...__VLS_functionalComponentArgsRest(__VLS_181));
+ __VLS_183.slots.default;
{
- const { default: __VLS_thisSlot } = __VLS_175.slots;
+ const { default: __VLS_thisSlot } = __VLS_183.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;
@@ -982,14 +1044,39 @@ if (__VLS_ctx.kb) {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
- __VLS_ctx.handleDeleteDoc(row);
+ __VLS_ctx.handleReprocess(row);
}
};
__VLS_187.slots.default;
var __VLS_187;
+ const __VLS_192 = {}.ElButton;
+ /** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
+ // @ts-ignore
+ const __VLS_193 = __VLS_asFunctionalComponent(__VLS_192, new __VLS_192({
+ ...{ 'onClick': {} },
+ size: "small",
+ type: "danger",
+ }));
+ const __VLS_194 = __VLS_193({
+ ...{ 'onClick': {} },
+ size: "small",
+ type: "danger",
+ }, ...__VLS_functionalComponentArgsRest(__VLS_193));
+ let __VLS_196;
+ let __VLS_197;
+ let __VLS_198;
+ const __VLS_199 = {
+ onClick: (...[$event]) => {
+ if (!(__VLS_ctx.kb))
+ return;
+ __VLS_ctx.handleDeleteDoc(row);
+ }
+ };
+ __VLS_195.slots.default;
+ var __VLS_195;
}
- var __VLS_175;
- var __VLS_139;
+ var __VLS_183;
+ var __VLS_147;
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ class: "mobile-cards" },
});
@@ -1005,105 +1092,78 @@ if (__VLS_ctx.kb) {
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
...{ style: {} },
});
- const __VLS_192 = {}.ElTag;
+ const __VLS_200 = {}.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({
+ const __VLS_201 = __VLS_asFunctionalComponent(__VLS_200, new __VLS_200({
type: (__VLS_ctx.statusType(doc.status)),
size: "small",
}));
- const __VLS_194 = __VLS_193({
+ const __VLS_202 = __VLS_201({
type: (__VLS_ctx.statusType(doc.status)),
size: "small",
- }, ...__VLS_functionalComponentArgsRest(__VLS_193));
- __VLS_195.slots.default;
+ }, ...__VLS_functionalComponentArgsRest(__VLS_201));
+ __VLS_203.slots.default;
(doc.status);
- var __VLS_195;
+ var __VLS_203;
__VLS_asFunctionalElement(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({
...{ style: {} },
});
(__VLS_ctx.formatSize(doc.file_size));
- const __VLS_196 = {}.ElSelect;
+ const __VLS_204 = {}.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({
+ const __VLS_205 = __VLS_asFunctionalComponent(__VLS_204, new __VLS_204({
...{ 'onChange': {} },
modelValue: (doc.category_id),
placeholder: "选择目录",
size: "small",
...{ style: {} },
}));
- const __VLS_198 = __VLS_197({
+ const __VLS_206 = __VLS_205({
...{ '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 = {
+ }, ...__VLS_functionalComponentArgsRest(__VLS_205));
+ let __VLS_208;
+ let __VLS_209;
+ let __VLS_210;
+ const __VLS_211 = {
onChange: ((val) => __VLS_ctx.handleChangeDocCategory(doc, val))
};
- __VLS_199.slots.default;
+ __VLS_207.slots.default;
for (const [cat] of __VLS_getVForSourceType((__VLS_ctx.allCategoriesFlat))) {
- const __VLS_204 = {}.ElOption;
+ const __VLS_212 = {}.ElOption;
/** @type {[typeof __VLS_components.ElOption, typeof __VLS_components.elOption, ]} */ ;
// @ts-ignore
- const __VLS_205 = __VLS_asFunctionalComponent(__VLS_204, new __VLS_204({
+ const __VLS_213 = __VLS_asFunctionalComponent(__VLS_212, new __VLS_212({
key: (cat.id),
label: (cat.name),
value: (cat.id),
}));
- const __VLS_206 = __VLS_205({
+ const __VLS_214 = __VLS_213({
key: (cat.id),
label: (cat.name),
value: (cat.id),
- }, ...__VLS_functionalComponentArgsRest(__VLS_205));
+ }, ...__VLS_functionalComponentArgsRest(__VLS_213));
}
- var __VLS_199;
+ var __VLS_207;
__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;
@@ -1113,387 +1173,414 @@ if (__VLS_ctx.kb) {
onClick: (...[$event]) => {
if (!(__VLS_ctx.kb))
return;
- __VLS_ctx.handleDeleteDoc(doc);
+ __VLS_ctx.handleReprocess(doc);
}
};
__VLS_219.slots.default;
var __VLS_219;
+ const __VLS_224 = {}.ElButton;
+ /** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
+ // @ts-ignore
+ const __VLS_225 = __VLS_asFunctionalComponent(__VLS_224, new __VLS_224({
+ ...{ 'onClick': {} },
+ size: "small",
+ type: "danger",
+ ...{ style: {} },
+ }));
+ const __VLS_226 = __VLS_225({
+ ...{ 'onClick': {} },
+ size: "small",
+ type: "danger",
+ ...{ style: {} },
+ }, ...__VLS_functionalComponentArgsRest(__VLS_225));
+ let __VLS_228;
+ let __VLS_229;
+ let __VLS_230;
+ const __VLS_231 = {
+ onClick: (...[$event]) => {
+ if (!(__VLS_ctx.kb))
+ return;
+ __VLS_ctx.handleDeleteDoc(doc);
+ }
+ };
+ __VLS_227.slots.default;
+ var __VLS_227;
}
- var __VLS_111;
- const __VLS_224 = {}.ElDialog;
+ var __VLS_119;
+ const __VLS_232 = {}.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,
+ modelValue: (__VLS_ctx.showTextDialog),
+ title: "✏️ 添加文本内容",
+ width: (__VLS_ctx.isMobile ? '95%' : '700px'),
}));
const __VLS_234 = __VLS_233({
- label: "标题",
- required: true,
+ modelValue: (__VLS_ctx.showTextDialog),
+ title: "✏️ 添加文本内容",
+ width: (__VLS_ctx.isMobile ? '95%' : '700px'),
}, ...__VLS_functionalComponentArgsRest(__VLS_233));
__VLS_235.slots.default;
- const __VLS_236 = {}.ElInput;
- /** @type {[typeof __VLS_components.ElInput, typeof __VLS_components.elInput, ]} */ ;
+ const __VLS_236 = {}.ElForm;
+ /** @type {[typeof __VLS_components.ElForm, typeof __VLS_components.elForm, typeof __VLS_components.ElForm, typeof __VLS_components.elForm, ]} */ ;
// @ts-ignore
const __VLS_237 = __VLS_asFunctionalComponent(__VLS_236, new __VLS_236({
- modelValue: (__VLS_ctx.textForm.title),
- placeholder: "文档标题",
- size: "large",
+ model: (__VLS_ctx.textForm),
+ labelPosition: "top",
}));
const __VLS_238 = __VLS_237({
- modelValue: (__VLS_ctx.textForm.title),
- placeholder: "文档标题",
- size: "large",
+ model: (__VLS_ctx.textForm),
+ labelPosition: "top",
}, ...__VLS_functionalComponentArgsRest(__VLS_237));
- var __VLS_235;
+ __VLS_239.slots.default;
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: "所属目录",
+ label: "标题",
+ required: true,
}));
const __VLS_242 = __VLS_241({
- label: "所属目录",
+ label: "标题",
+ required: true,
}, ...__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, ]} */ ;
+ const __VLS_244 = {}.ElInput;
+ /** @type {[typeof __VLS_components.ElInput, typeof __VLS_components.elInput, ]} */ ;
// @ts-ignore
const __VLS_245 = __VLS_asFunctionalComponent(__VLS_244, new __VLS_244({
- modelValue: (__VLS_ctx.textForm.category_id),
- placeholder: "选择目录",
- clearable: true,
- ...{ style: {} },
+ modelValue: (__VLS_ctx.textForm.title),
+ placeholder: "文档标题",
size: "large",
}));
const __VLS_246 = __VLS_245({
+ modelValue: (__VLS_ctx.textForm.title),
+ placeholder: "文档标题",
+ size: "large",
+ }, ...__VLS_functionalComponentArgsRest(__VLS_245));
+ var __VLS_243;
+ const __VLS_248 = {}.ElFormItem;
+ /** @type {[typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, ]} */ ;
+ // @ts-ignore
+ const __VLS_249 = __VLS_asFunctionalComponent(__VLS_248, new __VLS_248({
+ label: "所属目录",
+ }));
+ const __VLS_250 = __VLS_249({
+ label: "所属目录",
+ }, ...__VLS_functionalComponentArgsRest(__VLS_249));
+ __VLS_251.slots.default;
+ const __VLS_252 = {}.ElSelect;
+ /** @type {[typeof __VLS_components.ElSelect, typeof __VLS_components.elSelect, typeof __VLS_components.ElSelect, typeof __VLS_components.elSelect, ]} */ ;
+ // @ts-ignore
+ const __VLS_253 = __VLS_asFunctionalComponent(__VLS_252, new __VLS_252({
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: "格式",
+ modelValue: (__VLS_ctx.textForm.category_id),
+ placeholder: "选择目录",
+ clearable: true,
+ ...{ style: {} },
+ size: "large",
}, ...__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;
+ for (const [cat] of __VLS_getVForSourceType((__VLS_ctx.allCategoriesFlat))) {
+ const __VLS_256 = {}.ElOption;
+ /** @type {[typeof __VLS_components.ElOption, typeof __VLS_components.elOption, ]} */ ;
+ // @ts-ignore
+ const __VLS_257 = __VLS_asFunctionalComponent(__VLS_256, new __VLS_256({
+ key: (cat.id),
+ label: (cat.name),
+ value: (cat.id),
+ }));
+ const __VLS_258 = __VLS_257({
+ key: (cat.id),
+ label: (cat.name),
+ value: (cat.id),
+ }, ...__VLS_functionalComponentArgsRest(__VLS_257));
+ }
var __VLS_255;
- const __VLS_268 = {}.ElFormItem;
+ var __VLS_251;
+ const __VLS_260 = {}.ElFormItem;
/** @type {[typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, ]} */ ;
// @ts-ignore
+ const __VLS_261 = __VLS_asFunctionalComponent(__VLS_260, new __VLS_260({
+ label: "格式",
+ }));
+ const __VLS_262 = __VLS_261({
+ label: "格式",
+ }, ...__VLS_functionalComponentArgsRest(__VLS_261));
+ __VLS_263.slots.default;
+ const __VLS_264 = {}.ElRadioGroup;
+ /** @type {[typeof __VLS_components.ElRadioGroup, typeof __VLS_components.elRadioGroup, typeof __VLS_components.ElRadioGroup, typeof __VLS_components.elRadioGroup, ]} */ ;
+ // @ts-ignore
+ const __VLS_265 = __VLS_asFunctionalComponent(__VLS_264, new __VLS_264({
+ modelValue: (__VLS_ctx.textForm.content_format),
+ size: "large",
+ }));
+ const __VLS_266 = __VLS_265({
+ modelValue: (__VLS_ctx.textForm.content_format),
+ size: "large",
+ }, ...__VLS_functionalComponentArgsRest(__VLS_265));
+ __VLS_267.slots.default;
+ const __VLS_268 = {}.ElRadio;
+ /** @type {[typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, ]} */ ;
+ // @ts-ignore
const __VLS_269 = __VLS_asFunctionalComponent(__VLS_268, new __VLS_268({
- label: "内容",
- required: true,
+ value: "markdown",
}));
const __VLS_270 = __VLS_269({
- label: "内容",
- required: true,
+ value: "markdown",
}, ...__VLS_functionalComponentArgsRest(__VLS_269));
__VLS_271.slots.default;
- const __VLS_272 = {}.ElInput;
- /** @type {[typeof __VLS_components.ElInput, typeof __VLS_components.elInput, ]} */ ;
+ var __VLS_271;
+ const __VLS_272 = {}.ElRadio;
+ /** @type {[typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, ]} */ ;
// @ts-ignore
const __VLS_273 = __VLS_asFunctionalComponent(__VLS_272, new __VLS_272({
+ value: "text",
+ }));
+ const __VLS_274 = __VLS_273({
+ value: "text",
+ }, ...__VLS_functionalComponentArgsRest(__VLS_273));
+ __VLS_275.slots.default;
+ var __VLS_275;
+ var __VLS_267;
+ var __VLS_263;
+ const __VLS_276 = {}.ElFormItem;
+ /** @type {[typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, ]} */ ;
+ // @ts-ignore
+ const __VLS_277 = __VLS_asFunctionalComponent(__VLS_276, new __VLS_276({
+ label: "内容",
+ required: true,
+ }));
+ const __VLS_278 = __VLS_277({
+ label: "内容",
+ required: true,
+ }, ...__VLS_functionalComponentArgsRest(__VLS_277));
+ __VLS_279.slots.default;
+ const __VLS_280 = {}.ElInput;
+ /** @type {[typeof __VLS_components.ElInput, typeof __VLS_components.elInput, ]} */ ;
+ // @ts-ignore
+ const __VLS_281 = __VLS_asFunctionalComponent(__VLS_280, new __VLS_280({
modelValue: (__VLS_ctx.textForm.content),
type: "textarea",
rows: (12),
placeholder: "输入文本内容(支持 Markdown)",
size: "large",
}));
- const __VLS_274 = __VLS_273({
+ const __VLS_282 = __VLS_281({
modelValue: (__VLS_ctx.textForm.content),
type: "textarea",
rows: (12),
placeholder: "输入文本内容(支持 Markdown)",
size: "large",
- }, ...__VLS_functionalComponentArgsRest(__VLS_273));
- var __VLS_271;
- var __VLS_231;
+ }, ...__VLS_functionalComponentArgsRest(__VLS_281));
+ var __VLS_279;
+ var __VLS_239;
{
- 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 { footer: __VLS_thisSlot } = __VLS_235.slots;
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)
+ onClick: (...[$event]) => {
+ if (!(__VLS_ctx.kb))
+ return;
+ __VLS_ctx.showTextDialog = false;
+ }
};
__VLS_287.slots.default;
var __VLS_287;
+ const __VLS_292 = {}.ElButton;
+ /** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
+ // @ts-ignore
+ const __VLS_293 = __VLS_asFunctionalComponent(__VLS_292, new __VLS_292({
+ ...{ 'onClick': {} },
+ type: "primary",
+ loading: (__VLS_ctx.textLoading),
+ size: "large",
+ }));
+ const __VLS_294 = __VLS_293({
+ ...{ 'onClick': {} },
+ type: "primary",
+ loading: (__VLS_ctx.textLoading),
+ size: "large",
+ }, ...__VLS_functionalComponentArgsRest(__VLS_293));
+ let __VLS_296;
+ let __VLS_297;
+ let __VLS_298;
+ const __VLS_299 = {
+ onClick: (__VLS_ctx.handleCreateText)
+ };
+ __VLS_295.slots.default;
+ var __VLS_295;
}
- var __VLS_227;
- const __VLS_292 = {}.ElDialog;
+ var __VLS_235;
+ const __VLS_300 = {}.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,
+ modelValue: (__VLS_ctx.showCatDialog),
+ title: (__VLS_ctx.editingCatId ? '✏️ 编辑目录' : '📁 新建目录'),
+ width: (__VLS_ctx.isMobile ? '95%' : '450px'),
}));
const __VLS_302 = __VLS_301({
- label: "目录名称",
- required: true,
+ modelValue: (__VLS_ctx.showCatDialog),
+ title: (__VLS_ctx.editingCatId ? '✏️ 编辑目录' : '📁 新建目录'),
+ width: (__VLS_ctx.isMobile ? '95%' : '450px'),
}, ...__VLS_functionalComponentArgsRest(__VLS_301));
__VLS_303.slots.default;
- const __VLS_304 = {}.ElInput;
- /** @type {[typeof __VLS_components.ElInput, typeof __VLS_components.elInput, ]} */ ;
+ const __VLS_304 = {}.ElForm;
+ /** @type {[typeof __VLS_components.ElForm, typeof __VLS_components.elForm, typeof __VLS_components.ElForm, typeof __VLS_components.elForm, ]} */ ;
// @ts-ignore
const __VLS_305 = __VLS_asFunctionalComponent(__VLS_304, new __VLS_304({
- modelValue: (__VLS_ctx.catForm.name),
- placeholder: "如:公司基本信息",
- size: "large",
+ model: (__VLS_ctx.catForm),
+ labelPosition: "top",
}));
const __VLS_306 = __VLS_305({
- modelValue: (__VLS_ctx.catForm.name),
- placeholder: "如:公司基本信息",
- size: "large",
+ model: (__VLS_ctx.catForm),
+ labelPosition: "top",
}, ...__VLS_functionalComponentArgsRest(__VLS_305));
- var __VLS_303;
+ __VLS_307.slots.default;
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: "类型",
+ label: "目录名称",
+ required: true,
}));
const __VLS_310 = __VLS_309({
- label: "类型",
+ label: "目录名称",
+ required: true,
}, ...__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, ]} */ ;
+ const __VLS_312 = {}.ElInput;
+ /** @type {[typeof __VLS_components.ElInput, typeof __VLS_components.elInput, ]} */ ;
// @ts-ignore
const __VLS_313 = __VLS_asFunctionalComponent(__VLS_312, new __VLS_312({
- modelValue: (__VLS_ctx.catForm.is_folder),
+ modelValue: (__VLS_ctx.catForm.name),
+ placeholder: "如:公司基本信息",
size: "large",
}));
const __VLS_314 = __VLS_313({
- modelValue: (__VLS_ctx.catForm.is_folder),
+ modelValue: (__VLS_ctx.catForm.name),
+ placeholder: "如:公司基本信息",
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, ]} */ ;
+ var __VLS_311;
+ const __VLS_316 = {}.ElFormItem;
+ /** @type {[typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, typeof __VLS_components.ElFormItem, typeof __VLS_components.elFormItem, ]} */ ;
// @ts-ignore
const __VLS_317 = __VLS_asFunctionalComponent(__VLS_316, new __VLS_316({
- value: (true),
+ label: "类型",
}));
const __VLS_318 = __VLS_317({
- value: (true),
+ label: "类型",
}, ...__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, ]} */ ;
+ const __VLS_320 = {}.ElRadioGroup;
+ /** @type {[typeof __VLS_components.ElRadioGroup, typeof __VLS_components.elRadioGroup, typeof __VLS_components.ElRadioGroup, typeof __VLS_components.elRadioGroup, ]} */ ;
// @ts-ignore
const __VLS_321 = __VLS_asFunctionalComponent(__VLS_320, new __VLS_320({
- value: (false),
+ modelValue: (__VLS_ctx.catForm.is_folder),
+ size: "large",
}));
const __VLS_322 = __VLS_321({
- value: (false),
+ modelValue: (__VLS_ctx.catForm.is_folder),
+ size: "large",
}, ...__VLS_functionalComponentArgsRest(__VLS_321));
__VLS_323.slots.default;
+ const __VLS_324 = {}.ElRadio;
+ /** @type {[typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, ]} */ ;
+ // @ts-ignore
+ const __VLS_325 = __VLS_asFunctionalComponent(__VLS_324, new __VLS_324({
+ value: (true),
+ }));
+ const __VLS_326 = __VLS_325({
+ value: (true),
+ }, ...__VLS_functionalComponentArgsRest(__VLS_325));
+ __VLS_327.slots.default;
+ var __VLS_327;
+ const __VLS_328 = {}.ElRadio;
+ /** @type {[typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, typeof __VLS_components.ElRadio, typeof __VLS_components.elRadio, ]} */ ;
+ // @ts-ignore
+ const __VLS_329 = __VLS_asFunctionalComponent(__VLS_328, new __VLS_328({
+ value: (false),
+ }));
+ const __VLS_330 = __VLS_329({
+ value: (false),
+ }, ...__VLS_functionalComponentArgsRest(__VLS_329));
+ __VLS_331.slots.default;
+ var __VLS_331;
var __VLS_323;
- var __VLS_315;
- var __VLS_311;
- var __VLS_299;
+ var __VLS_319;
+ var __VLS_307;
{
- 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 { footer: __VLS_thisSlot } = __VLS_303.slots;
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)
+ onClick: (...[$event]) => {
+ if (!(__VLS_ctx.kb))
+ return;
+ __VLS_ctx.showCatDialog = false;
+ }
};
__VLS_335.slots.default;
- (__VLS_ctx.editingCatId ? '保存' : '创建');
var __VLS_335;
+ const __VLS_340 = {}.ElButton;
+ /** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
+ // @ts-ignore
+ const __VLS_341 = __VLS_asFunctionalComponent(__VLS_340, new __VLS_340({
+ ...{ 'onClick': {} },
+ type: "primary",
+ loading: (__VLS_ctx.catLoading),
+ size: "large",
+ }));
+ const __VLS_342 = __VLS_341({
+ ...{ 'onClick': {} },
+ type: "primary",
+ loading: (__VLS_ctx.catLoading),
+ size: "large",
+ }, ...__VLS_functionalComponentArgsRest(__VLS_341));
+ let __VLS_344;
+ let __VLS_345;
+ let __VLS_346;
+ const __VLS_347 = {
+ onClick: (__VLS_ctx.handleSaveCategory)
+ };
+ __VLS_343.slots.default;
+ (__VLS_ctx.editingCatId ? '保存' : '创建');
+ var __VLS_343;
}
- var __VLS_295;
+ var __VLS_303;
}
/** @type {__VLS_StyleScopedClasses['mobile-header']} */ ;
/** @type {__VLS_StyleScopedClasses['main-layout']} */ ;
@@ -1522,7 +1609,6 @@ const __VLS_self = (await import('vue')).defineComponent({
allCategoriesFlat: allCategoriesFlat,
loading: loading,
uploading: uploading,
- aiUrl: aiUrl,
selectedCategoryId: selectedCategoryId,
selectedCategoryPath: selectedCategoryPath,
showTextDialog: showTextDialog,
@@ -1532,9 +1618,14 @@ const __VLS_self = (await import('vue')).defineComponent({
catForm: catForm,
catLoading: catLoading,
editingCatId: editingCatId,
+ expiryOptions: expiryOptions,
+ linkExpiry: linkExpiry,
+ expiryText: expiryText,
+ handleExpiryChange: handleExpiryChange,
selectCategory: selectCategory,
clearCategoryFilter: clearCategoryFilter,
handleUpload: handleUpload,
+ openTextDialog: openTextDialog,
handleCreateText: handleCreateText,
handleChangeDocCategory: handleChangeDocCategory,
handleDeleteDoc: handleDeleteDoc,
@@ -1547,6 +1638,7 @@ const __VLS_self = (await import('vue')).defineComponent({
handleDeleteCategory: handleDeleteCategory,
formatSize: formatSize,
statusType: statusType,
+ maskedAiUrl: maskedAiUrl,
};
},
});
diff --git a/frontend/src/views/KnowledgeBases.vue b/frontend/src/views/KnowledgeBases.vue
index 404f5a7..38f6cf2 100644
--- a/frontend/src/views/KnowledgeBases.vue
+++ b/frontend/src/views/KnowledgeBases.vue
@@ -3,6 +3,7 @@ import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage, ElMessageBox } from 'element-plus'
import apiClient from '@/api/client'
+import { copyToClipboard } from '@/utils/clipboard'
const router = useRouter()
const kbs = ref
([])
@@ -60,8 +61,12 @@ async function handleCopyLink(kb: any) {
try {
const { data } = await apiClient.get(`/knowledge-bases/${kb.id}/link`)
const url = `${window.location.origin}${data.ai_url}`
- await navigator.clipboard.writeText(url)
- ElMessage.success('AI 链接已复制到剪贴板!')
+ const success = await copyToClipboard(url)
+ if (success) {
+ ElMessage.success('AI 链接已复制到剪贴板!')
+ } else {
+ ElMessage.error('复制失败,请稍后重试。')
+ }
} catch { /* ignore */ }
}
diff --git a/frontend/src/views/KnowledgeBases.vue.js b/frontend/src/views/KnowledgeBases.vue.js
index 8d1c32e..4887f1c 100644
--- a/frontend/src/views/KnowledgeBases.vue.js
+++ b/frontend/src/views/KnowledgeBases.vue.js
@@ -2,6 +2,7 @@ import { ref, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
import apiClient from '@/api/client';
+import { copyToClipboard } from '@/utils/clipboard';
const router = useRouter();
const kbs = ref([]);
const loading = ref(false);
@@ -55,8 +56,13 @@ async function handleCopyLink(kb) {
try {
const { data } = await apiClient.get(`/knowledge-bases/${kb.id}/link`);
const url = `${window.location.origin}${data.ai_url}`;
- await navigator.clipboard.writeText(url);
- ElMessage.success('AI 链接已复制到剪贴板!');
+ const success = await copyToClipboard(url);
+ if (success) {
+ ElMessage.success('AI 链接已复制到剪贴板!');
+ }
+ else {
+ ElMessage.error('复制失败,请稍后重试。');
+ }
}
catch { /* ignore */ }
}