From ff0ae974a1c561eaf2915988dac63cd066af189f Mon Sep 17 00:00:00 2001 From: yinbangzhong <zhongbangyin@126.com> Date: 星期四, 12 九月 2024 09:23:44 +0800 Subject: [PATCH] bug fix --- src/views/dmx/knowledgeLib/index.vue | 82 ++++++++++++++++++++++------------------ 1 files changed, 45 insertions(+), 37 deletions(-) diff --git a/src/views/dmx/knowledgeLib/index.vue b/src/views/dmx/knowledgeLib/index.vue index 26a7557..4beaa09 100644 --- a/src/views/dmx/knowledgeLib/index.vue +++ b/src/views/dmx/knowledgeLib/index.vue @@ -23,8 +23,9 @@ :class="{ active: selectedTab === index }" > {{ tab.name }} - <a-popover position="bl"> + <a-popover position="bl" > <icon-more + v-hasPermi="'/kb/delete'" :style="{ position: 'absolute', top: '10px', right: '10px' }" /> <template #content> @@ -34,6 +35,7 @@ <span style="cursor: pointer; color: #4977ba; font-size: 12px" @click="deleteKnowledge(tab.id)" + v-hasPermi="'/kb/delete'" ><icon-delete style="font-size: 14px" />鍒犻櫎</span > </template> @@ -88,6 +90,7 @@ type="text" class="button" style="color: #2a2a2b" + v-hasPermi="'/kb/data_status'" @click="enableDisable(1)" > <template #icon> @@ -101,6 +104,7 @@ type="text" class="button" style="color: #2a2a2b" + v-hasPermi="'/kb/data_status'" @click="enableDisable(0)" > <template #icon> @@ -114,6 +118,7 @@ type="text" class="button" style="color: #2a2a2b" + v-hasPermi="'/kb/data_analysis'" @click="addBlock(1)" > <template #icon> @@ -127,6 +132,7 @@ type="text" class="button" style="color: #2a2a2b" + v-hasPermi="'/kb/data_analysis'" @click="addBlock(2)" > <template #icon> @@ -140,6 +146,7 @@ <a-button type="text" class="button" + v-hasPermi="'/kb/data_delete'" style="color: #2a2a2b" @click="addBlock(3)" > @@ -469,7 +476,7 @@ type="text" :disabled="record.run == '1'" @click="handleClick(record)" - v-hasPermi="'/kb/data_update'" + 鏌� size="small" > <template #icon> @@ -513,8 +520,8 @@ </template> </a-button> </a-tooltip> - - <!-- <a-button + <!-- + <a-button type="text" size="small" :disabled="record.run == '1'" @@ -599,12 +606,12 @@ <!-- </div>--> </div> </div> -<!-- <a-modal title=" " v-model:visible="visible" :footer="false" fullscreen>--> -<!-- <!– <docx previewSrc="http://192.168.20.116:1080/v1/document/get/405c3efa4d8c11ef97560242ac120006"></docx>–>--> -<!-- <docx v-if="documenttype == 'docx'" :previewSrc="previewSrc"></docx>--> -<!-- <excel v-if="documenttype == 'excel'" :previewSrc="previewSrc"></excel>--> -<!-- <txtPdf v-if="documenttype == 'txtPdf'" :previewSrc="previewSrc"></txtPdf>--> -<!-- </a-modal>--> + <!-- <a-modal title=" " v-model:visible="visible" :footer="false" fullscreen>--> + <!-- <!– <docx previewSrc="http://192.168.20.116:1080/v1/document/get/405c3efa4d8c11ef97560242ac120006"></docx>–>--> + <!-- <docx v-if="documenttype == 'docx'" :previewSrc="previewSrc"></docx>--> + <!-- <excel v-if="documenttype == 'excel'" :previewSrc="previewSrc"></excel>--> + <!-- <txtPdf v-if="documenttype == 'txtPdf'" :previewSrc="previewSrc"></txtPdf>--> + <!-- </a-modal>--> <tool ref="toolForm" :kbtenantInfo="kbtenantInfo" @@ -870,34 +877,8 @@ pagination.current = params.page; pagination.total = data.data.total; - if (timer) { - clearInterval(timer); - } // 瀹氭椂鍣ㄦ煡璇㈡枃妗� - timer = setInterval(async () => { - 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) => { - const [key, value] = pair.split(':'); - acc[key] = value; - return acc; - }, {}); - // console.log(parser_ids, 'parser_ids'); - kbtenantInfo.parser_idObj = parser_ids; - renderData.value = data.data.docs || []; - renderData.value = renderData.value.map((item) => { - return { - ...item, - loading: false, - parser_id: parser_ids[item.parser_id], - }; - }); - // console.log(renderData.value, 'renderData'); - } - }, 10000); + documentList() } } catch (err) { // you can report use errorHandler or other @@ -905,6 +886,31 @@ setLoading(false); } }; + + const documentList= async () => { + 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) => { + const [key, value] = pair.split(':'); + acc[key] = value; + return acc; + }, {}); + // console.log(parser_ids, 'parser_ids'); + kbtenantInfo.parser_idObj = parser_ids; + renderData.value = data.data.docs || []; + renderData.value = renderData.value.map((item) => { + return { + ...item, + loading: false, + parser_id: parser_ids[item.parser_id], + }; + }); + // console.log(renderData.value, 'renderData'); + } + } const search = () => { basePagination.page = 1; @@ -978,12 +984,14 @@ setLoading(true); try { const { data } = await queryKbList({ page: 1, page_size: 10 }); + console.log(data, '鏌ヨ鐭ヨ瘑搴撳垪琛�'); tabs.value = data; if (tabs.value.length > 0) { // 瀹氫綅鍒版柊澧炵殑鐭ヨ瘑搴撳崟鍏� selectedTab.value = tabs.value.findIndex((item) => item.id == id); getKbdetail(id); // 鑾峰彇璇︽儏 + kbobj.id = id; activeKey.value = '3'; } } catch (err) { -- Gitblit v1.8.0