| | |
| | | <template #status="{ record }"> |
| | | <a-switch |
| | | v-model="record.status" |
| | | :disabled="!getAut('/kb/data_status')" |
| | | size="small" |
| | | checked-value="1" |
| | | unchecked-value="0" |
| | |
| | | type="text" |
| | | size="large" |
| | | @click="run(record)" |
| | | v-hasPermi="'/kb/data_analysis'" |
| | | :loading="record.loading" |
| | | > |
| | | <template #icon> |
| | |
| | | type="text" |
| | | :disabled="record.run == '1'" |
| | | @click="handleClick(record)" |
| | | v-hasPermi="'/kb/data_update'" |
| | | size="small" |
| | | > |
| | | <template #icon> |
| | | <icon-tool /> |
| | | </template> |
| | | </a-button> |
| | | <edit :item="record" @upTabdateItem="upTabdateItem" /> |
| | | <edit |
| | | :item="record" |
| | | v-hasPermi="'/kb/rename'" |
| | | @upTabdateItem="upTabdateItem" |
| | | /> |
| | | <a-popconfirm |
| | | :content="'确定删除吗'" |
| | | type="warning" |
| | |
| | | type="text" |
| | | size="small" |
| | | :disabled="record.run == '1'" |
| | | v-hasPermi="'/kb/data_delete'" |
| | | > |
| | | <template #icon> |
| | | <icon-delete /> |
| | |
| | | <a-button |
| | | type="text" |
| | | size="small" |
| | | v-hasPermi="'/kb/data_download'" |
| | | :disabled="record.run == '1'" |
| | | @click="onDownloadDocument(record)" |
| | | > |
| | |
| | | </a-card> |
| | | </a-scrollbar> |
| | | </a-tab-pane> |
| | | <a-tab-pane key="2" :title="t('dmx.list.test')"> |
| | | <a-tab-pane |
| | | key="2" |
| | | :title="t('dmx.list.test')" |
| | | v-if="getAut('/kb/test')" |
| | | > |
| | | <a-scrollbar |
| | | class="rt-container-main" |
| | | :style="{ height: documentHeight + 70 + 'px' }" |
| | |
| | | <test ref="testForm"></test> |
| | | </a-scrollbar> |
| | | </a-tab-pane> |
| | | <a-tab-pane key="3" :title="t('dmx.list.disposition')"> |
| | | <a-tab-pane |
| | | key="3" |
| | | :title="t('dmx.list.disposition')" |
| | | v-if="getAut('/kb/update')" |
| | | > |
| | | <a-scrollbar |
| | | class="rt-container-main" |
| | | :style="{ height: documentHeight + 70 + 'px' }" |
| | |
| | | watch, |
| | | nextTick, |
| | | onBeforeMount, |
| | | onMounted, onBeforeUnmount |
| | | } from "vue"; |
| | | onMounted, |
| | | onBeforeUnmount, |
| | | } from 'vue'; |
| | | import { useI18n } from 'vue-i18n'; |
| | | import useLoading from '@/hooks/loading'; |
| | | import { |
| | |
| | | import { documentHeight, parseTime } from '@/utils'; |
| | | import { deleteLlm } from '@/api/model'; |
| | | import { userModelState } from '@/store'; |
| | | import { getUserResources } from '@/utils/auth'; |
| | | |
| | | let modelStore = userModelState(); |
| | | const httpUrl = modelStore.hrefUrl; |
| | |
| | | let tabs = ref([]); |
| | | let timer = null;// 定时器 |
| | | |
| | | |
| | | |
| | | const selectTab = (index, item) => { |
| | | selectedTab.value = index; |
| | | checkedArr.value = []; |
| | |
| | | ...basePagination, |
| | | }); |
| | | getKbdetail(kbobj.id); |
| | | }; |
| | | |
| | | const getAut = (val) => { |
| | | const roleData = JSON.parse(getUserResources()); |
| | | const roleBtn = roleData.map((item: any) => item.component); |
| | | return roleBtn.includes(val); |
| | | }; |
| | | |
| | | const basePagination: Pagination = { |
| | |
| | | } |
| | | // 定时器查询文档 |
| | | timer = setInterval(async () => { |
| | | let params = { ...basePagination, kb_id: kbobj.id } |
| | | let params = { ...basePagination, kb_id: kbobj.id }; |
| | | const data = await queryKbDocumentList(params); |
| | | if (data.code == '0') { |
| | | parser_ids = kbtenantInfo.parser_ids.split(',').reduce((acc, pair) => { |
| | | parser_ids = kbtenantInfo.parser_ids |
| | | .split(',') |
| | | .reduce((acc, pair) => { |
| | | const [key, value] = pair.split(':'); |
| | | acc[key] = value; |
| | | return acc; |
| | |
| | | // console.log(renderData.value, 'renderData'); |
| | | } |
| | | }, 10000); |
| | | |
| | | |
| | | } |
| | | } catch (err) { |
| | | // you can report use errorHandler or other |
| | |
| | | kb_id: tabs.value[selectedTab.value].id, |
| | | ...basePagination, |
| | | }); |
| | | |
| | | |
| | | |
| | | } else { |
| | | // Message.error('解析失败'); |
| | | // row.run = '1'; |
| | |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | clearInterval(timer); |
| | | }) |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |