浏览代码

修改其他数量

yangg 9 月之前
父节点
当前提交
abeec695c9

文件差异内容过多而无法显示
+ 0 - 0
dist/index.html


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/chunk-76bddf0f.47789dc0.css


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.4107cbbe.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/chunk-4e1d7f6a.a5105aa3.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/chunk-76bddf0f.b768c440.js


+ 47 - 50
src/views/knowledgeMenu/category/knowledgeSet.vue

@@ -375,7 +375,7 @@ import {
   deleteType,
   Info,
   batchMove,
-  selectType0
+  selectType0,
 } from "@/api/knowledge";
 export default {
   components: {
@@ -576,59 +576,56 @@ export default {
     },
 
     typeList() {
-  this.loading = true;
-  Promise.all([
-    selectTypeList(this.typeForm),
-    selectType0({ type_id: 0 })
-  ])
-    .then(([typeListRes, type0Res]) => {
-      if (typeListRes.status === 200 && type0Res.status === 200) {
-        const folderList = typeListRes.data.dataList.map((folder) => ({
-          ...folder,
-          id: folder.id === 0 ? "001" : folder.id.toString(),
-          document_count: folder.document_count || 0,
-        }));
+      this.loading = true;
+      Promise.all([selectTypeList(this.typeForm), selectType0({ kb_id:this.typeForm.kb_id,type_id: 0 })])
+        .then(([typeListRes, type0Res]) => {
+          if (typeListRes.status === 200 && type0Res.status === 200) {
+            const folderList = typeListRes.data.dataList.map((folder) => ({
+              ...folder,
+              id: folder.id === 0 ? "001" : folder.id.toString(),
+              document_count: folder.document_count || 0,
+            }));
 
-        // Calculate total documents
-        const totalDocuments = folderList.reduce(
-          (sum, folder) => sum + folder.document_count,
-          0
-        );
+            // Calculate total documents
+            const totalDocuments = folderList.reduce(
+              (sum, folder) => sum + folder.document_count,
+              0
+            );
 
-        // Get the count of "其他" documents from selectType0 response
-        const otherFolderCount = type0Res.data || 0;
+            // Get the count of "其他" documents from selectType0 response
+            const otherFolderCount = type0Res.data || 0;
 
-        this.folders = [
-          {
-            id: "001",
-            name: "全部",
-            document_count: totalDocuments + otherFolderCount,
-          },
-          ...folderList.filter(
-            (folder) => folder.id !== "001" && folder.id !== 0
-          ),
-          {
-            id: 0,
-            name: "其他",
-            document_count: otherFolderCount,
-          },
-        ];
+            this.folders = [
+              {
+                id: "001",
+                name: "全部",
+                document_count: totalDocuments + otherFolderCount,
+              },
+              ...folderList.filter(
+                (folder) => folder.id !== "001" && folder.id !== 0
+              ),
+              {
+                id: 0,
+                name: "其他",
+                document_count: otherFolderCount,
+              },
+            ];
 
-        this.$nextTick(() => {
-          this.initializeTree();
+            this.$nextTick(() => {
+              this.initializeTree();
+            });
+          } else {
+            this.$message.error("获取文件夹列表失败");
+          }
+        })
+        .catch((error) => {
+          console.error("获取文件夹列表时出错:", error);
+          this.$message.error("获取文件夹列表时出错");
+        })
+        .finally(() => {
+          this.loading = false;
         });
-      } else {
-        this.$message.error("获取文件夹列表失败");
-      }
-    })
-    .catch((error) => {
-      console.error("获取文件夹列表时出错:", error);
-      this.$message.error("获取文件夹列表时出错");
-    })
-    .finally(() => {
-      this.loading = false;
-    });
-},
+    },
 
     initializeTree() {
       this.$nextTick(() => {
@@ -1013,7 +1010,7 @@ export default {
           _this.queryForm.pageSize = res.data.pagination.total_size;
           _this.loading = false;
 
-       /*    // Count documents with doc_type_id === 0 or null
+          /*    // Count documents with doc_type_id === 0 or null
           const unclassifiedCount = res.data.documents.filter(
             (doc) => !doc.doc_type_id || doc.doc_type_id === '0'
           ).length;

部分文件因为文件数量过多而无法显示