| | |
| | | </div> |
| | | </div> |
| | | <div class="set_btn_group"> |
| | | <el-button |
| | | link |
| | | class="text-[12px]" |
| | | @click="publishKnowledgeBase(item)" |
| | | :style="{ color: item.publish === SupervisorPublished.Y ? '#f97316' : '#22c55e' }" |
| | | >{{ item.publish === SupervisorPublished.Y ? '下架' : '发布' }} |
| | | </el-button> |
| | | <el-divider direction="vertical" /> |
| | | <el-button link class="text-[12px] text-[#686682]" @click="viewKnowledgeBase(item)">查看 </el-button> |
| | | <el-divider direction="vertical" /> |
| | | <el-button link class="text-[12px] text-[#686682]" @click="openChatTest(item)">对话测试 </el-button> |
| | |
| | | |
| | | <script setup lang="ts"> |
| | | import { useDraggable } from '@vueuse/core'; |
| | | import axios, { CancelTokenSource } from 'axios'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus'; |
| | | import { nextTick, onMounted, ref } from 'vue'; |
| | | import { useRouter } from 'vue-router'; |
| | | import { check_docvector_validate, delete_docvector_name, get_docvector_list } from '/@/api/knowledge/docvector'; |
| | | import { |
| | | check_docvector_validate, |
| | | delete_docvector_name, |
| | | get_docvector_list, |
| | | publish_docvector_name, |
| | | } from '/@/api/knowledge/docvector'; |
| | | import Chat from '/@/components/chat/Chat.vue'; |
| | | import { useQueryTable } from '/@/hooks/useQueryTable'; |
| | | import mittBus from '/@/utils/mitt'; |
| | | import { useCompRef } from '/@/utils/types'; |
| | | import { SupervisorPublished, supervisorPublishedMap } from '/@/views/project/yw/lowCode/sqlAmis/types'; |
| | | import knowledgeLeft from '/static/images/knowledge/data_type_1.png'; |
| | | import axios, { CancelTokenSource } from 'axios'; |
| | | const router = useRouter(); |
| | | //#region ====================== 获取知识库sheet列表 ====================== |
| | | const knowledgeBaseList = ref([]); |
| | |
| | | }, |
| | | }); |
| | | }; |
| | | //发布 |
| | | const publishKnowledgeBase = async (row) => { |
| | | const res = await publish_docvector_name({ |
| | | knowlg_id: row.id, |
| | | publish: row.publish === SupervisorPublished.Y ? SupervisorPublished.N : SupervisorPublished.Y, |
| | | }); |
| | | if (res.json_ok) { |
| | | row.publish = row.publish === SupervisorPublished.Y ? SupervisorPublished.N : SupervisorPublished.Y; |
| | | ElMessage.success('同步成功'); |
| | | } |
| | | }; |
| | | //#endregion |
| | | |
| | | //#region ====================== 搜索表格,对表格排序 ====================== |
| | |
| | | chatTestIsShow.value = true; |
| | | nextTick(() => { |
| | | chatRef.value.clear(); |
| | | setTimeout(() => { |
| | | chatRef.value.autoSend(row.prompt); |
| | | }, 30); |
| | | // setTimeout(() => { |
| | | // chatRef.value.autoSend(row.title); |
| | | // }, 30); |
| | | }); |
| | | }; |
| | | |