瀏覽代碼

feat:1、文件上传增加文件下载路径,配合带宽控制使用。
2、知识库管理拆分-问答库和产品库管理。
3、增加知识库根据租户进行数据隔离。

lihao16 4 月之前
父節點
當前提交
2942a7c620

+ 6 - 3
smsb-admin/src/main/resources/application.yml

@@ -48,6 +48,10 @@ server:
   # minio 访问IP
   minio:
     ip: 221.214.76.110
+    # 文件下载端口
+    dPort: 83
+    # 文件桶名称
+    bucket: smsb-plus
 
 # 日志配置
 logging:
@@ -107,10 +111,10 @@ spring:
 
 # Dify 对接参数
 dify:
-  url: https://f4e2-120-221-12-231.ngrok-free.app
+  url: http://dify01.snctv.net:83
   # 知识库配置
   datasets:
-    apiKey: dataset-rBAPZ6gomXSNRcDDghcSVJP1
+    apiKey: dataset-pxmsgigYhODHnTlDERv1956U
 
 
 # Sa-Token配置
@@ -161,7 +165,6 @@ tenant:
     - smsb_device_login
     - smsb_device_auth
     - smsb_device_heart_record
-    - smsb_dify_datasets
     - smsb_dify_datasets_file
 
 # MyBatisPlus配置

+ 7 - 2
smsb-modules/smsb-device/src/main/java/com/inspur/device/domain/SmsbDifyDatasets.java

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import org.dromara.common.mybatis.core.domain.BaseEntity;
+import org.dromara.common.tenant.core.TenantEntity;
 
 import java.io.Serial;
 
@@ -17,7 +17,7 @@ import java.io.Serial;
 @Data
 @EqualsAndHashCode(callSuper = true)
 @TableName("smsb_dify_datasets")
-public class SmsbDifyDatasets extends BaseEntity {
+public class SmsbDifyDatasets extends TenantEntity {
 
     @Serial
     private static final long serialVersionUID = 1L;
@@ -88,5 +88,10 @@ public class SmsbDifyDatasets extends BaseEntity {
      */
     private String updateUser;
 
+    /**
+     * 知识库类型 1-问答 2-产品
+     */
+    private Integer tag;
+
 
 }

+ 5 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/domain/bo/SmsbDifyDatasetsBo.java

@@ -72,5 +72,10 @@ public class SmsbDifyDatasetsBo extends BaseEntity {
      */
     private String difyId;
 
+    /**
+     * 知识库类型 1-问答 2-产品
+     */
+    private Integer tag;
+
 
 }

+ 4 - 1
smsb-modules/smsb-device/src/main/java/com/inspur/device/domain/vo/SmsbDifyDatasetsVo.java

@@ -115,5 +115,8 @@ public class SmsbDifyDatasetsVo implements Serializable {
     @ExcelProperty(value = "更新人姓名")
     private String updateUser;
 
-
+    /**
+     * 知识库类型 1-问答 2-产品
+     */
+    private Integer tag;
 }

+ 6 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/mapper/SmsbDifyDatasetsMapper.java

@@ -1,10 +1,13 @@
 package com.inspur.device.mapper;
 
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.inspur.device.domain.SmsbDifyDatasets;
 import com.inspur.device.domain.vo.SmsbDifyDatasetsVo;
 import org.apache.ibatis.annotations.Param;
 import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 
+import java.util.List;
+
 /**
  * 知识库管理Mapper接口
  *
@@ -14,4 +17,7 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 public interface SmsbDifyDatasetsMapper extends BaseMapperPlus<SmsbDifyDatasets, SmsbDifyDatasetsVo> {
 
     SmsbDifyDatasetsVo selectVoByDifyId(@Param("difyId") String difyId);
+
+    @InterceptorIgnore(tenantLine = "true", dataPermission = "false")
+    List<SmsbDifyDatasetsVo> selectAllVoNoTenant();
 }

+ 12 - 2
smsb-modules/smsb-device/src/main/java/com/inspur/device/service/impl/SmsbDifyDatasetsServiceImpl.java

@@ -19,6 +19,7 @@ import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.satoken.utils.LoginHelper;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -78,7 +79,7 @@ public class SmsbDifyDatasetsServiceImpl implements ISmsbDifyDatasetsService {
         // data中取出知识库列表
         List<DifyDatasetsRspData> datasets = jsonObject.getJSONArray("data").toJavaList(DifyDatasetsRspData.class);
         // 获取数据库中的所有知识库
-        List<SmsbDifyDatasetsVo> smsbDifyDatasetsVos = baseMapper.selectVoList(null);
+        List<SmsbDifyDatasetsVo> smsbDifyDatasetsVos = baseMapper.selectAllVoNoTenant();
         List<SmsbDifyDatasets> insertList = new ArrayList<>();
         // List<SmsbDifyDatasets> updateList = new ArrayList<>();
         // 数据库为空 则全部新增
@@ -162,6 +163,8 @@ public class SmsbDifyDatasetsServiceImpl implements ISmsbDifyDatasetsService {
         Map<String, Object> params = bo.getParams();
         LambdaQueryWrapper<SmsbDifyDatasets> lqw = Wrappers.lambdaQuery();
         lqw.like(StringUtils.isNotBlank(bo.getName()), SmsbDifyDatasets::getName, bo.getName());
+        lqw.eq(SmsbDifyDatasets::getTag,bo.getTag());
+        lqw.orderByDesc(SmsbDifyDatasets::getId);
         return lqw;
     }
 
@@ -193,7 +196,14 @@ public class SmsbDifyDatasetsServiceImpl implements ISmsbDifyDatasetsService {
         if (!response.isOk()) {
             return false;
         }
-        // 3 接口请求成功 重新同步知识库列表
+        // 3 根据返回的结构 插入数据库
+        String responseBody = response.body();
+        JSONObject jsonObject = JSON.parseObject(responseBody);
+        String difyId = jsonObject.getString("id");
+        add.setDifyId(difyId);
+        add.setCreateUser(LoginHelper.getLoginUser().getNickname());
+        baseMapper.insert(add);
+        // 4 接口请求成功 重新同步知识库列表
         this.syncFromDify();
         return true;
     }

+ 4 - 0
smsb-modules/smsb-device/src/main/resources/mapper/device/SmsbDifyDatasetsMapper.xml

@@ -6,4 +6,8 @@
     <select id="selectVoByDifyId" resultType="com.inspur.device.domain.vo.SmsbDifyDatasetsVo" parameterType="String">
         select * from smsb_dify_datasets where dify_id = #{difyId}
     </select>
+
+    <select id="selectAllVoNoTenant" resultType="com.inspur.device.domain.vo.SmsbDifyDatasetsVo">
+        select * from smsb_dify_datasets
+    </select>
 </mapper>

+ 3 - 0
smsb-modules/smsb-source/src/main/java/com/inspur/source/domain/SmsbMinioData.java

@@ -139,5 +139,8 @@ public class SmsbMinioData extends TenantEntity {
 
     private String fileUrl;
 
+    /** 文件的下载地址 */
+    private String downloadUrl;
+
 
 }

+ 3 - 0
smsb-modules/smsb-source/src/main/java/com/inspur/source/domain/bo/SmsbMinioDataBo.java

@@ -69,4 +69,7 @@ public class SmsbMinioDataBo extends BaseEntity {
      * 转码状态 0:待转码,1:转码成功,2:转码失败
      */
     private Integer transState;
+
+    /** 文件的下载地址 */
+    private String downloadUrl;
 }

+ 3 - 0
smsb-modules/smsb-source/src/main/java/com/inspur/source/domain/vo/SmsbMinioDataVo.java

@@ -112,4 +112,7 @@ public class SmsbMinioDataVo implements Serializable {
     private Integer transState;
 
     private Integer useNum;
+
+    /** 文件的下载地址 */
+    private String downloadUrl;
 }

+ 15 - 0
smsb-modules/smsb-source/src/main/java/com/inspur/source/service/impl/SmsbMinioDataServiceImpl.java

@@ -14,6 +14,7 @@ import com.inspur.source.mapper.*;
 import com.inspur.source.service.ISmsbMinioDataService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.dromara.common.core.constant.Constants;
 import org.dromara.common.core.exception.ServiceException;
 import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.common.core.utils.StringUtils;
@@ -84,6 +85,12 @@ public class SmsbMinioDataServiceImpl implements ISmsbMinioDataService {
     @Value("${server.minio.ip}")
     private String minioServerIp;
 
+    @Value("${server.minio.dPort}")
+    private String minioServerDPort;
+
+    @Value("${server.minio.bucket}")
+    private String minioServerBucket;
+
     // 计算目标分辨率(高或宽压缩至480,保持比例)
     private static String calculateResolution(int width, int height) {
         String scaleFilter;
@@ -721,6 +728,14 @@ public class SmsbMinioDataServiceImpl implements ISmsbMinioDataService {
         // validEntityBeforeSave(add);
         add.setValue(sysOssVo.getOssId().toString());
         add.setCreateUser(LoginHelper.getLoginUser().getUsername());
+        // 文件的下载地址生成
+        // http://117.73.3.135:83/download?tenant_id=00000&file_key=/smsb-plus/2025/06/05/548b91398cbe4762b68c6177e088a12b.jpg
+        StringBuffer dUrlSb = new StringBuffer();
+        dUrlSb.append(Constants.HTTP).append(minioServerIp).append(":").append(minioServerDPort);
+        dUrlSb.append("/download?tenant_id=").append(LoginHelper.getTenantId());
+        dUrlSb.append("&file_key=").append(StringUtils.SLASH).append(minioServerBucket);
+        dUrlSb.append(add.getKeyName());
+        add.setDownloadUrl(dUrlSb.toString());
         return add;
     }
 

+ 6 - 0
smsb-plus-ui/src/api/smsb/device/datasets_type.ts

@@ -74,6 +74,8 @@ export interface DifyDatasetsVO {
    */
   updateUser: string;
 
+  tag: number;
+
 }
 
 export interface DifyDatasetsForm extends BaseEntity {
@@ -132,6 +134,8 @@ export interface DifyDatasetsForm extends BaseEntity {
    */
   difyId?: string | number;
 
+  tag? :string | number;
+
 }
 
 export interface DifyDatasetsQuery extends PageQuery {
@@ -141,6 +145,8 @@ export interface DifyDatasetsQuery extends PageQuery {
    */
   name?: string;
 
+  tag?: number;
+
   /**
    * 日期范围参数
    */

+ 259 - 0
smsb-plus-ui/src/views/smsb/datasets/product.vue

@@ -0,0 +1,259 @@
+<template>
+  <div class="p-2">
+    <transition :enter-active-class="proxy?.animate.searchAnimate.enter"
+                :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-item>
+            <el-form-item>
+              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+              <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['device:datasets:add']">
+                新增
+              </el-button>
+              <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
+                         v-hasPermi="['device:datasets:remove']">删除
+              </el-button>
+              <el-button type="warning" plain icon="Refresh" @click="handleSync()"
+                         v-hasPermi="['device:datasets:add']">同步
+              </el-button>
+            </el-form-item>
+          </el-form>
+        </el-card>
+      </div>
+    </transition>
+
+    <el-card shadow="never">
+      <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 label="ID" align="left" prop="id" v-if="true" width="175"/>-->
+          <el-table-column label="产品库ID" align="left" prop="difyId" width="180" :show-overflow-tooltip = "true"/>
+          <el-table-column label="产品库" align="left" prop="name" width="200" :show-overflow-tooltip="true"/>
+          <el-table-column label="描述" align="left" prop="description" :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="provider" width="80">
+            <template #default="scope">
+              <span>{{ scope.row.provider === 'vendor' ? '上传文件' : ' 外部产品库' }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="数据源" align="center" prop="dataSourceType" width="120"/>
+          <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="center" class-name="small-padding fixed-width" width="100">
+            <template #default="scope">
+              <el-tooltip content="文件列表" placement="top">
+                <el-button link type="primary" icon="Document" @click="handleToFileList(scope.row)"
+                           v-hasPermi="['device:datasetsFile:list']"></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>
+              </el-tooltip>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <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-form-item>
+        <el-form-item label="描述" prop="description">
+          <el-input type="textarea" :rows="5" v-model="form.description" placeholder="请输入描述"/>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup name="DifyDatasets" lang="ts">
+import {
+  addDifyDatasets,
+  delDifyDatasets,
+  getDifyDatasets,
+  listDifyDatasets, syncDifyDatasets,
+  updateDifyDatasets
+} from '@/api/smsb/device/datasets';
+import {DifyDatasetsForm, DifyDatasetsQuery, DifyDatasetsVO} from '@/api/smsb/device/datasets_type';
+
+const {proxy} = getCurrentInstance() as ComponentInternalInstance;
+
+const difyDatasetsList = ref<DifyDatasetsVO[]>([]);
+const buttonLoading = ref(false);
+const loading = ref(true);
+const showSearch = ref(true);
+const ids = ref<Array<string | number>>([]);
+const single = ref(true);
+const multiple = ref(true);
+const total = ref(0);
+
+const queryFormRef = ref<ElFormInstance>();
+const difyDatasetsFormRef = ref<ElFormInstance>();
+
+const dialog = reactive<DialogOption>({
+  visible: false,
+  title: ''
+});
+
+const initFormData: DifyDatasetsForm = {
+  id: undefined,
+  name: undefined,
+  description: undefined,
+  indexingTechnique: undefined,
+  permission: undefined,
+  provider: undefined,
+  dataSourceType: undefined,
+  wordCount: undefined,
+  documentCount: undefined,
+  appCount: undefined,
+  difyId: undefined,
+  tag: 2,
+}
+const data = reactive<PageData<DifyDatasetsForm, DifyDatasetsQuery>>({
+  form: {...initFormData},
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    name: undefined,
+    tag: 2,
+    params: {}
+  },
+  rules: {
+    name: [{ required: true, message: '产品库名称不能为空', trigger: 'blur' }],
+  }
+});
+
+const {queryParams, form, rules} = toRefs(data);
+
+/** 查询产品库管理列表 */
+const getList = async () => {
+  loading.value = true;
+  const res = await listDifyDatasets(queryParams.value);
+  difyDatasetsList.value = res.rows;
+  total.value = res.total;
+  loading.value = false;
+}
+
+/** 取消按钮 */
+const cancel = () => {
+  reset();
+  dialog.visible = false;
+}
+
+/** 表单重置 */
+const reset = () => {
+  form.value = {...initFormData};
+  difyDatasetsFormRef.value?.resetFields();
+}
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.value.pageNum = 1;
+  getList();
+}
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value?.resetFields();
+  handleQuery();
+}
+
+/** 多选框选中数据 */
+const handleSelectionChange = (selection: DifyDatasetsVO[]) => {
+  ids.value = selection.map(item => item.id);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+}
+
+/** 新增按钮操作 */
+const handleAdd = () => {
+  reset();
+  dialog.visible = true;
+  dialog.title = "添加产品库";
+}
+
+const handleSync = async () => {
+  await proxy?.$modal.confirm('是否确认同步产品库数据?').finally(() => loading.value = false);
+  loading.value = true;
+  await syncDifyDatasets();
+  proxy?.$modal.msgSuccess("同步成功");
+  await getList();
+  loading.value = false;
+}
+
+
+/** 修改按钮操作 */
+const handleUpdate = async (row?: DifyDatasetsVO) => {
+  reset();
+  const _id = row?.id || ids.value[0]
+  const res = await getDifyDatasets(_id);
+  Object.assign(form.value, res.data);
+  dialog.visible = true;
+  dialog.title = "修改产品库";
+}
+
+/** 跳转至文件列表页面  */
+const handleToFileList = (row?: DifyDatasetsVO) =>{
+  proxy.$router.push('/device/datasetsFile?datasetsId=' + row.difyId);
+}
+
+/** 提交按钮 */
+const submitForm = () => {
+  difyDatasetsFormRef.value?.validate(async (valid: boolean) => {
+    if (valid) {
+      buttonLoading.value = true;
+      if (form.value.id) {
+        await updateDifyDatasets(form.value).finally(() => buttonLoading.value = false);
+      } else {
+        await addDifyDatasets(form.value).finally(() => buttonLoading.value = false);
+      }
+      proxy?.$modal.msgSuccess("操作成功");
+      dialog.visible = false;
+      await getList();
+    }
+  });
+}
+
+/** 删除按钮操作 */
+const handleDelete = async (row?: DifyDatasetsVO) => {
+  const _ids = row?.id || ids.value;
+  await proxy?.$modal.confirm('是否确认删除已选择的数据项?').finally(() => loading.value = false);
+  await delDifyDatasets(_ids);
+  proxy?.$modal.msgSuccess("删除成功");
+  await getList();
+}
+
+/** 导出按钮操作 */
+const handleExport = () => {
+  proxy?.download('device/difyDatasets/export', {
+    ...queryParams.value
+  }, `difyDatasets_${new Date().getTime()}.xlsx`)
+}
+
+onMounted(() => {
+  getList();
+});
+</script>

+ 14 - 12
smsb-plus-ui/src/views/smsb/datasets/index.vue → smsb-plus-ui/src/views/smsb/datasets/question.vue

@@ -5,8 +5,8 @@
       <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-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>
@@ -31,8 +31,8 @@
         <el-table v-loading="loading" :data="difyDatasetsList" @selection-change="handleSelectionChange">
           <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="180" :show-overflow-tooltip = "true"/>
-          <el-table-column label="知识库" align="left" prop="name" width="200" :show-overflow-tooltip="true"/>
+          <el-table-column label="问答库ID" align="left" prop="difyId" width="180" :show-overflow-tooltip = "true"/>
+          <el-table-column label="问答库" align="left" prop="name" width="200" :show-overflow-tooltip="true"/>
           <el-table-column label="描述" align="left" prop="description" :show-overflow-tooltip="true"/>
           <el-table-column label="索引模式" align="center" prop="indexingTechnique" width="80">
             <template #default="scope">
@@ -42,7 +42,7 @@
           <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="120"/>
@@ -69,11 +69,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="请输入描述"/>
@@ -130,6 +130,7 @@ const initFormData: DifyDatasetsForm = {
   documentCount: undefined,
   appCount: undefined,
   difyId: undefined,
+  tag:1
 }
 const data = reactive<PageData<DifyDatasetsForm, DifyDatasetsQuery>>({
   form: {...initFormData},
@@ -137,16 +138,17 @@ const data = reactive<PageData<DifyDatasetsForm, DifyDatasetsQuery>>({
     pageNum: 1,
     pageSize: 10,
     name: undefined,
+    tag: 1,
     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);
@@ -190,11 +192,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("同步成功");
@@ -210,7 +212,7 @@ const handleUpdate = async (row?: DifyDatasetsVO) => {
   const res = await getDifyDatasets(_id);
   Object.assign(form.value, res.data);
   dialog.visible = true;
-  dialog.title = "修改知识库";
+  dialog.title = "修改问答库";
 }
 
 /** 跳转至文件列表页面  */