|
|
@@ -30,8 +30,8 @@
|
|
|
<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="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">
|
|
|
@@ -57,10 +57,14 @@
|
|
|
<el-button link type="primary" icon="Position" @click="handlePush(scope.row)"
|
|
|
v-hasPermi="['device:datasets:edit']"></el-button>
|
|
|
</el-tooltip>
|
|
|
-<!-- <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="View" @click="handleEntryList(scope.row)"
|
|
|
+ v-hasPermi="['device:datasets:query']"></el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ <!-- <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>
|
|
|
@@ -112,6 +116,22 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</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-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"/>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -124,20 +144,22 @@ import {
|
|
|
updateDifyDatasets
|
|
|
} from '@/api/smsb/device/datasets';
|
|
|
import {DifyDatasetsForm, DifyDatasetsQuery, DifyDatasetsVO} from '@/api/smsb/device/datasets_type';
|
|
|
-import {listAllProduct} from "@/api/smsb/device/difyDatasetsProduct_index";
|
|
|
-import {listAllQuestion, listDifyDatasetsQuestion} from "@/api/smsb/device/difyDatasetsQuestion_index";
|
|
|
+import {listDifyDatasetsQuestion, listQuestionByDatasetsId} from "@/api/smsb/device/difyDatasetsQuestion_index";
|
|
|
+import {DifyDatasetsQuestionVO} from "@/api/smsb/device/difyDatasetsQuestion_types";
|
|
|
|
|
|
const {proxy} = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
|
const difyDatasetsList = ref<DifyDatasetsVO[]>([]);
|
|
|
const buttonLoading = ref(false);
|
|
|
const loading = ref(true);
|
|
|
+const entryLoading = 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 entryList = ref([]);
|
|
|
+const questionList = ref<DifyDatasetsQuestionVO>([]);
|
|
|
const selectedEntry = ref([]);
|
|
|
const datasetsId = ref<number | string>();
|
|
|
|
|
|
@@ -146,6 +168,11 @@ const pushDialog = reactive<DialogOption>({
|
|
|
title: ''
|
|
|
});
|
|
|
|
|
|
+const viewDialog = reactive<DialogOption>({
|
|
|
+ visible: false,
|
|
|
+ title: ''
|
|
|
+});
|
|
|
+
|
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
|
const difyDatasetsFormRef = ref<ElFormInstance>();
|
|
|
|
|
|
@@ -166,7 +193,7 @@ const initFormData: DifyDatasetsForm = {
|
|
|
documentCount: undefined,
|
|
|
appCount: undefined,
|
|
|
difyId: undefined,
|
|
|
- tag:1
|
|
|
+ tag: 1
|
|
|
}
|
|
|
const data = reactive<PageData<DifyDatasetsForm, DifyDatasetsQuery>>({
|
|
|
form: {...initFormData},
|
|
|
@@ -178,7 +205,7 @@ const data = reactive<PageData<DifyDatasetsForm, DifyDatasetsQuery>>({
|
|
|
params: {}
|
|
|
},
|
|
|
rules: {
|
|
|
- name: [{ required: true, message: '问答库名称不能为空', trigger: 'blur' }],
|
|
|
+ name: [{required: true, message: '问答库名称不能为空', trigger: 'blur'}],
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -193,6 +220,16 @@ const getList = async () => {
|
|
|
loading.value = false;
|
|
|
}
|
|
|
|
|
|
+const handleEntryList = async (row?: DifyDatasetsVO) => {
|
|
|
+ entryLoading.value = true;
|
|
|
+ viewDialog.visible = true;
|
|
|
+ viewDialog.title = '知识条目';
|
|
|
+ const datasetsId = row.id;
|
|
|
+ const res = await listQuestionByDatasetsId(datasetsId);
|
|
|
+ questionList.value = res.data;
|
|
|
+ entryLoading.value = false;
|
|
|
+}
|
|
|
+
|
|
|
/** 取消按钮 */
|
|
|
const cancel = () => {
|
|
|
reset();
|
|
|
@@ -291,7 +328,7 @@ const submitEntry = async () => {
|
|
|
}
|
|
|
|
|
|
/** 跳转至文件列表页面 */
|
|
|
-const handleToFileList = (row?: DifyDatasetsVO) =>{
|
|
|
+const handleToFileList = (row?: DifyDatasetsVO) => {
|
|
|
proxy.$router.push('/device/datasetsFile?datasetsId=' + row.difyId);
|
|
|
}
|
|
|
|