改进 处理提示
All checks were successful
Build / build (push) Successful in 8m39s

This commit is contained in:
ivamp 2024-09-18 18:08:46 +08:00
parent a9376fb60f
commit 3781f011e0

View File

@ -100,6 +100,10 @@
/> />
</n-form-item> </n-form-item>
<n-p
>如果您需要上传文档请在聊天界面上传需要为对话设置默认助理才可以上传</n-p
>
<n-button type="primary" @click="newDocument"> 创建 </n-button> <n-button type="primary" @click="newDocument"> 创建 </n-button>
</n-form> </n-form>
</div> </div>
@ -149,7 +153,7 @@
<div> <div>
<div class="mt-3 mb-2"> <div class="mt-3 mb-2">
<n-button @click="showCreateDocumentDialog = true">上传文档</n-button> <n-button @click="showCreateDocumentDialog = true">填写文档</n-button>
</div> </div>
</div> </div>
<!-- 文档列表 --> <!-- 文档列表 -->
@ -162,12 +166,24 @@
{{ c.name }} {{ c.name }}
</div> </div>
<div> <div>
<n-icon size="16" v-if="c.chunked"> <n-tooltip trigger="hover" v-if="c.chunked">
<Checkmark /> <template #trigger>
</n-icon> <n-icon class="mr-1" size="16">
<n-icon v-else size="16" class="cursor-pointer"> <Checkmark />
<Reload /> </n-icon>
</n-icon> </template>
处理完成
</n-tooltip>
<n-tooltip trigger="hover" v-else>
<template #trigger>
<n-icon class="mr-1" size="16">
<SyncOutline />
</n-icon>
</template>
正在处理
</n-tooltip>
<n-popconfirm @positive-click="deleteDocument(c.id ?? 0)"> <n-popconfirm @positive-click="deleteDocument(c.id ?? 0)">
<template #trigger> <template #trigger>
<n-button quaternary circle type="warning"> <n-button quaternary circle type="warning">
@ -203,8 +219,8 @@ import {
TrashBinOutline, TrashBinOutline,
SettingsOutline, SettingsOutline,
DocumentOutline, DocumentOutline,
Reload, SyncOutline,
Checkmark Checkmark,
} from "@vicons/ionicons5"; } from "@vicons/ionicons5";
import { AxiosError } from "axios"; import { AxiosError } from "axios";
import { useMessage } from "naive-ui"; import { useMessage } from "naive-ui";
@ -235,6 +251,7 @@ const showEditDialog = async (library: EntityLibrary) => {
showEditLibraryDialog.value = true; showEditLibraryDialog.value = true;
getDocuments(library.id ?? 0); getDocuments(library.id ?? 0);
libraryStore.updateLibraries();
}; };
const getDocuments = async (libraryId: number) => { const getDocuments = async (libraryId: number) => {
@ -253,6 +270,8 @@ const updateLibrary = async () => {
default: currentLibrary.value.default ?? false, default: currentLibrary.value.default ?? false,
}); });
} }
libraryStore.updateLibraries();
}; };
const newLibrary = async () => { const newLibrary = async () => {