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 |   56 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/src/views/dmx/knowledgeLib/index.vue b/src/views/dmx/knowledgeLib/index.vue
index b77ffe6..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>
@@ -876,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
@@ -912,6 +887,31 @@
     }
   };
 
+  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;
     fetchData({

--
Gitblit v1.8.0