Browse Source

修改知识库样式并添加批量删除

yangg 8 tháng trước cách đây
mục cha
commit
9d685fe722

+ 1 - 1
.env.development

@@ -2,5 +2,5 @@
 ENV = 'development'
 port = 8080
 # base api
-VUE_APP_BASE_API = 'http://58.246.234.210:8084'
+VUE_APP_BASE_API = 'http://192.168.1.200:8084'
 #192.168.1.200

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/index.html


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/css/chunk-1120da8e.2ffae690.css


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/css/chunk-e61fad7e.ee22606a.css


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/app.6512c06a.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-1120da8e.25b081c4.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-386d37cb.2c4da508.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-43013872.81670170.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-708604c0.e89196a3.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-b580a2ac.417eafd2.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-cd009444.ca7f2c29.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-e61fad7e.9d892b96.js


+ 10 - 0
src/api/knowledge.js

@@ -301,4 +301,14 @@ export function configDelete(data) {
       method: 'post',
       data
     })
+  } 
+
+  /* 批量删除 */
+
+  export function delDocumentList(data) {
+    return request({
+      url: 'kbm/delDocumentList',
+      method: 'post',
+      data
+    })
   } 

+ 167 - 83
src/views/knowledgeMenu/category/knowledgeSet.vue

@@ -17,7 +17,9 @@
         <span class="custom-tree-node" slot-scope="{ node, data }">
           <span class="tree_title">
             <i class="el-icon-folder"></i>
-            <span class="folder-name">{{ node.label }}</span>
+            <span class="folder-name" :title="node.label">{{
+              node.label
+            }}</span>
           </span>
           <span v-if="data.id !== '001'" :class="getFileCountClass(data.id)"
             >{{ data.document_count }} files</span
@@ -71,11 +73,17 @@
             :disabled="!selectedRows.length"
             >批量修改目录</el-button
           >
+          <el-button
+            type="primary"
+            @click="batchDelect"
+            :disabled="!selectedRows.length"
+            >批量删除</el-button
+          >
         </div>
         <el-table
           ref="dataTable"
           :data="dataList"
-          style="width: 100%"
+          style="width: 100%; font-size: 12px"
           header-row-class-name="headerBg"
           empty-text="暂无数据"
           @selection-change="handleSelectionChange"
@@ -88,7 +96,7 @@
             label="文件名称"
             align="center"
             sortable="custom"
-            width="300"
+            width="600"
           >
             <template #default="scope">
               <span>{{ scope.row.name }}</span>
@@ -101,6 +109,7 @@
             label="上传时间"
             align="center"
             sortable="custom"
+             width="140"
           />
           <el-table-column prop="run" label="解析状态" align="center">
             <template #default="scope">
@@ -112,9 +121,9 @@
               <div v-if="scope.row.run == 6">文件异常</div>
             </template>
           </el-table-column>
-          <el-table-column label="操作" align="center" width="300">
+          <el-table-column label="操作" align="center" width="180">
             <template #default="scope">
-              <div>
+              <div class="operations-container">
                 <el-tooltip
                   class="item"
                   effect="dark"
@@ -129,51 +138,8 @@
                     v-if="checkAuth('/document/update')"
                     style="font-size: 15px"
                     @click="getName(scope.row)"
-                  ></el-button
-                ></el-tooltip>
-                <el-tooltip
-                  class="item"
-                  effect="dark"
-                  :content="
-                    scope.row.run == 1 || scope.row.run == 5 ? '解析中' : '解析'
-                  "
-                  placement="top"
-                >
-                  <el-button
-                    v-if="scope.row.run != 1 && scope.row.run != 5"
-                    type="text"
-                    icon="el-icon-caret-right"
-                    circle
-                    @click="analysis(scope.row)"
-                    style="font-size: 15px"
-                  >
-                  </el-button>
-                  <el-button
-                    v-else
-                    type="text"
-                    icon="el-icon-loading"
-                    circle
-                    :disabled="true"
-                    style="font-size: 15px"
-                  >
-                  </el-button>
+                  ></el-button>
                 </el-tooltip>
-                <el-tooltip
-                  class="item"
-                  effect="dark"
-                  content="解析方法"
-                  placement="top"
-                >
-                  <el-button
-                    type="text"
-                    size="small"
-                    circle
-                    icon="el-icon-tickets"
-                    v-if="checkAuth('/document/update')"
-                    style="font-size: 15px"
-                    @click="Analytical(scope.row)"
-                  ></el-button
-                ></el-tooltip>
                 <el-tooltip
                   class="item"
                   effect="dark"
@@ -188,40 +154,103 @@
                     v-if="checkAuth('/document/update')"
                     style="font-size: 15px"
                     @click="btnEdit(scope.row)"
-                  ></el-button
-                ></el-tooltip>
-                <el-tooltip
-                  class="item"
-                  effect="dark"
-                  content="下载"
-                  placement="top"
-                >
-                  <el-button
-                    type="text"
-                    size="small"
-                    circle
-                    icon="el-icon-download"
-                    @click="btnDown(scope.row)"
-                    :loading="scope.row.downloading"
-                    style="font-size: 15px"
-                  ></el-button
-                ></el-tooltip>
-                <el-tooltip
-                  class="item"
-                  effect="dark"
-                  content="删除"
-                  placement="top"
+                  ></el-button>
+                </el-tooltip>
+                <el-popover
+                  placement="bottom"
+                  trigger="click"
+                  popper-class="operations-popover"
                 >
-                  <el-button
-                    type="text"
-                    size="small"
-                    circle
-                    icon="el-icon-delete"
-                    v-if="checkAuth('/document/delete')"
-                    @click="btnDelete(scope.row.id)"
-                    style="font-size: 15px"
-                  ></el-button
-                ></el-tooltip>
+                  <template #reference>
+                    <el-button
+                      type="text"
+                      size="small"
+                      circle
+                      class="operation-button"
+                      style="font-size: 15px;margin-left: 10px;"
+                      icon="el-icon-more"
+                    ></el-button>
+                  </template>
+                  <div class="additional-operations">
+                    <el-tooltip
+                      class="item"
+                      effect="dark"
+                      :content="
+                        scope.row.run == 1 || scope.row.run == 5
+                          ? '解析中'
+                          : '解析'
+                      "
+                      placement="top"
+                    >
+                      <el-button
+                        v-if="scope.row.run != 1 && scope.row.run != 5"
+                        type="text"
+                        icon="el-icon-caret-right"
+                        circle
+                        @click="analysis(scope.row)"
+                        style="font-size: 15px"
+                      >
+                      </el-button>
+                      <el-button
+                        v-else
+                        type="text"
+                        icon="el-icon-loading"
+                        circle
+                        :disabled="true"
+                        style="font-size: 15px;"
+                      >
+                      </el-button>
+                    </el-tooltip>
+                    <el-tooltip
+                      class="item"
+                      effect="dark"
+                      content="解析方法"
+                      placement="top"
+                    >
+                      <el-button
+                        type="text"
+                        size="small"
+                        circle
+                        icon="el-icon-tickets"
+                        v-if="checkAuth('/document/update')"
+                        style="font-size: 15px"
+                        @click="Analytical(scope.row)"
+                      ></el-button>
+                    </el-tooltip>
+                    <el-tooltip
+                      class="item"
+                      effect="dark"
+                      content="下载"
+                      placement="top"
+                    >
+                      <el-button
+                        type="text"
+                        size="small"
+                        circle
+                        icon="el-icon-download"
+                        @click="btnDown(scope.row)"
+                        :loading="scope.row.downloading"
+                        style="font-size: 15px"
+                      ></el-button>
+                    </el-tooltip>
+                    <el-tooltip
+                      class="item"
+                      effect="dark"
+                      content="删除"
+                      placement="top"
+                    >
+                      <el-button
+                        type="text"
+                        size="small"
+                        circle
+                        icon="el-icon-delete"
+                        v-if="checkAuth('/document/delete')"
+                        @click="btnDelete(scope.row.id)"
+                        style="font-size: 15px"
+                      ></el-button>
+                    </el-tooltip>
+                  </div>
+                </el-popover>
               </div>
             </template>
           </el-table-column>
@@ -380,6 +409,7 @@ import {
   Info,
   batchMove,
   selectType0,
+  delDocumentList,
 } from "@/api/knowledge";
 export default {
   components: {
@@ -473,6 +503,23 @@ export default {
     Object.values(this.analysisStatusCheckers).forEach(clearTimeout);
   },
   methods: {
+    /* 操作栏 */
+    handleCommand(command, row) {
+      switch (command) {
+        case "analysis":
+          this.analysis(row);
+          break;
+        case "analyticalMethod":
+          this.Analytical(row);
+          break;
+        case "download":
+          this.btnDown(row);
+          break;
+        case "delete":
+          this.btnDelete(row.id);
+          break;
+      }
+    },
     /* 判断类名 */
     getFileCountClass(id) {
       const isSpecialFolder = id === 0 || id === "001";
@@ -759,6 +806,43 @@ export default {
         });
     },
 
+    /* 批量删除 */
+    batchDelect() {
+      const selectedIds = this.selectedRows.map((row) => row.id);
+      if (selectedIds.length === 0) {
+        this.$message.warning("请选择要删除的文件");
+        return;
+      }
+
+      this.$confirm("确定要批量删除选中的文件吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.loading = true;
+          delDocumentList({ document_ids: JSON.stringify(selectedIds) })
+            .then((res) => {
+              if (res.status === 200) {
+                this.$message.success("批量删除已完成");
+                this.search();
+              } else {
+                this.$message.error("批量删除请求失败");
+              }
+            })
+            .catch((error) => {
+              /* console.error("批量删除错误:", error);
+              this.$message.error("批量删除过程中出现错误"); */
+            })
+            .finally(() => {
+              this.loading = false;
+            });
+        })
+        .catch(() => {
+          // 取消操作
+        });
+    },
+
     updateAnalysisStatus(ids) {
       this.dataList.forEach((row) => {
         if (ids.includes(row.id)) {
@@ -1206,7 +1290,7 @@ export default {
 .el-tree {
   margin-left: 10px;
 }
-::v-deep .is-leaf {
+::v-deep .el-tree-node__expand-icon {
   display: none;
 }
 @import "./components/dataList.scss";

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác