|
|
@@ -4,9 +4,9 @@
|
|
|
:leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
<div v-show="showSearch" class="mb-[10px]">
|
|
|
<el-card shadow="hover" :style="{ marginTop: '10px', height: '60px' }">
|
|
|
- <el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
|
|
- <el-form-item label="问答库" prop="name">
|
|
|
- <el-input v-model="queryParams.name" placeholder="请输入问答库名称" clearable @keyup.enter="handleQuery"/>
|
|
|
+ <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="60">
|
|
|
+ <el-form-item label="知识库" prop="name">
|
|
|
+ <el-input v-model="queryParams.name" placeholder="请输入知识库名称" clearable @keyup.enter="handleQuery"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
@@ -26,49 +26,50 @@
|
|
|
</div>
|
|
|
</transition>
|
|
|
|
|
|
- <el-card shadow="never">
|
|
|
+ <el-card shadow="never" style="height: calc(100% - 20px)">
|
|
|
<div class="table-content">
|
|
|
<el-table v-loading="loading" :data="difyDatasetsList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center"/>
|
|
|
+<!-- <el-table-column type="selection" width="55" align="center"/>-->
|
|
|
<!-- <el-table-column label="ID" align="left" prop="id" v-if="true" width="175"/>-->
|
|
|
- <el-table-column label="问答库ID" align="left" prop="difyId" width="300"/>
|
|
|
- <el-table-column label="问答库" align="left" prop="name" width="150" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="" align="left" prop="" width="10"/>
|
|
|
+ <el-table-column label="ID" align="left" prop="difyId" width="300"/>
|
|
|
+ <el-table-column label="知识库" align="left" prop="name" width="200" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="索引模式" align="center" prop="indexingTechnique" width="80">
|
|
|
<template #default="scope">
|
|
|
<span>{{ scope.row.indexingTechnique === 'high_quality' ? '高质量' : '经济' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="权限" align="center" prop="permission" width="80"/>
|
|
|
+<!-- <el-table-column label="权限" align="center" prop="permission" width="80"/>-->
|
|
|
<el-table-column label="提供类型" align="center" prop="provider" width="80">
|
|
|
<template #default="scope">
|
|
|
- <span>{{ scope.row.provider === 'vendor' ? '上传文件' : ' 外部问答库' }}</span>
|
|
|
+ <span>{{ scope.row.provider === 'vendor' ? '上传文件' : ' 外部知识库' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="数据源" align="center" prop="dataSourceType" width="100"/>
|
|
|
+<!-- <el-table-column label="数据源" align="center" prop="dataSourceType" width="100"/>-->
|
|
|
<el-table-column label="文字数量" align="center" prop="wordCount" width="80"/>
|
|
|
<el-table-column label="文档数量" align="center" prop="documentCount" width="80"/>
|
|
|
<el-table-column label="APP数量" align="center" prop="appCount" width="80"/>
|
|
|
<el-table-column label="创建时间" align="left" prop="createTime" width="160"/>
|
|
|
<el-table-column label="更新时间" align="left" prop="updateTime" width="160"/>
|
|
|
<el-table-column label="备注" align="left" prop="description" :show-overflow-tooltip="true"/>
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="280">
|
|
|
<template #default="scope">
|
|
|
<el-tooltip content="下发" placement="top">
|
|
|
<el-button link type="primary" icon="Position" @click="handlePush(scope.row)"
|
|
|
- v-hasPermi="['device:datasets:edit']"></el-button>
|
|
|
+ v-hasPermi="['device:datasets:edit']">下发</el-button>
|
|
|
</el-tooltip>
|
|
|
<el-tooltip content="问答条目" placement="top">
|
|
|
<el-button link type="primary" icon="View" @click="handleEntryList(scope.row)"
|
|
|
- v-hasPermi="['device:datasets:query']"></el-button>
|
|
|
+ v-hasPermi="['device:datasets:query']">条目</el-button>
|
|
|
</el-tooltip>
|
|
|
<el-tooltip content="刷新" placement="top">
|
|
|
<el-button link type="primary" icon="Refresh" @click="handleSync()"
|
|
|
- v-hasPermi="['device:datasets:add']">
|
|
|
+ v-hasPermi="['device:datasets:add']">刷新
|
|
|
</el-button>
|
|
|
</el-tooltip>
|
|
|
<el-tooltip content="删除" placement="top">
|
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['device:datasets:remove']"></el-button>
|
|
|
+ v-hasPermi="['device:datasets:remove']">删除</el-button>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -78,11 +79,11 @@
|
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
|
|
v-model:limit="queryParams.pageSize" @pagination="getList"/>
|
|
|
</el-card>
|
|
|
- <!-- 添加或修改问答库管理对话框 -->
|
|
|
+ <!-- 添加或修改知识库管理对话框 -->
|
|
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="700px" append-to-body>
|
|
|
<el-form ref="difyDatasetsFormRef" :model="form" :rules="rules" label-width="50px">
|
|
|
<el-form-item label="名称" prop="name">
|
|
|
- <el-input v-model="form.name" placeholder="请输入问答库名称"/>
|
|
|
+ <el-input v-model="form.name" placeholder="请输入知识库名称"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="描述" prop="description">
|
|
|
<el-input type="textarea" :rows="5" v-model="form.description" placeholder="请输入描述"/>
|
|
|
@@ -108,6 +109,7 @@
|
|
|
:props="{ key: 'key', label: 'label' }"
|
|
|
:titles="['可选条目', '已选条目']"
|
|
|
:button-texts="['移除', '添加']"
|
|
|
+ style="height: 70vh"
|
|
|
/>
|
|
|
<!-- style="height: 600px"-->
|
|
|
</div>
|
|
|
@@ -120,9 +122,9 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 知识条目列表 -->
|
|
|
- <el-dialog :title="viewDialog.title" v-model="viewDialog.visible" width="1200px" append-to-body>
|
|
|
- <div class="table-content">
|
|
|
- <el-table v-loading="entryLoading" :data="questionList">
|
|
|
+ <el-dialog :title="viewDialog.title" v-model="viewDialog.visible" style="height: 95vh" width="1300px" append-to-body>
|
|
|
+ <div class="table-content" style="height: 75vh">
|
|
|
+ <el-table v-loading="entryLoading" border :data="questionList">
|
|
|
<el-table-column label="问题" align="left" prop="question" width="250" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="回答" align="left" prop="answer" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="创建人" align="left" prop="createUser" width="100" :show-overflow-tooltip="true"/>
|
|
|
@@ -207,13 +209,13 @@ const data = reactive<PageData<DifyDatasetsForm, DifyDatasetsQuery>>({
|
|
|
params: {}
|
|
|
},
|
|
|
rules: {
|
|
|
- name: [{required: true, message: '问答库名称不能为空', trigger: 'blur'}],
|
|
|
+ name: [{required: true, message: '知识库名称不能为空', trigger: 'blur'}],
|
|
|
}
|
|
|
});
|
|
|
|
|
|
const {queryParams, form, rules} = toRefs(data);
|
|
|
|
|
|
-/** 查询问答库管理列表 */
|
|
|
+/** 查询知识库管理列表 */
|
|
|
const getList = async () => {
|
|
|
loading.value = true;
|
|
|
const res = await listDifyDatasets(queryParams.value);
|
|
|
@@ -270,11 +272,11 @@ const handleSelectionChange = (selection: DifyDatasetsVO[]) => {
|
|
|
const handleAdd = () => {
|
|
|
reset();
|
|
|
dialog.visible = true;
|
|
|
- dialog.title = "添加问答库";
|
|
|
+ dialog.title = "添加知识库";
|
|
|
}
|
|
|
|
|
|
const handleSync = async () => {
|
|
|
- await proxy?.$modal.confirm('是否确认同步问答库数据?').finally(() => loading.value = false);
|
|
|
+ await proxy?.$modal.confirm('是否确认同步知识库数据?').finally(() => loading.value = false);
|
|
|
loading.value = true;
|
|
|
await syncDifyDatasets();
|
|
|
proxy?.$modal.msgSuccess("同步成功");
|
|
|
@@ -290,7 +292,7 @@ const handleUpdate = async (row?: DifyDatasetsVO) => {
|
|
|
const res = await getDifyDatasets(_id);
|
|
|
Object.assign(form.value, res.data);
|
|
|
dialog.visible = true;
|
|
|
- dialog.title = "修改问答库";
|
|
|
+ dialog.title = "修改知识库";
|
|
|
}
|
|
|
|
|
|
/** 知识库下发 */
|
|
|
@@ -334,7 +336,7 @@ const submitEntry = async () => {
|
|
|
|
|
|
/** 跳转至文件列表页面 */
|
|
|
const handleToFileList = (row?: DifyDatasetsVO) => {
|
|
|
- proxy.$router.push('/device/datasetsFile?datasetsId=' + row.difyId);
|
|
|
+ proxy.$router.push('/agent/datasetsFile?datasetsId=' + row.difyId);
|
|
|
}
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
@@ -375,8 +377,12 @@ onMounted(() => {
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
-.edit_dev >>> .el-transfer-panel {
|
|
|
- width:40%;
|
|
|
+<style scoped lang="scss">
|
|
|
+:deep(.el-transfer-panel) {
|
|
|
+ width: 460px;
|
|
|
+}
|
|
|
+:deep(.el-transfer-panel__body) {
|
|
|
+ width:100%;
|
|
|
+ height: 65vh;
|
|
|
}
|
|
|
</style>
|