Procházet zdrojové kódy

修改知识库样式

yangg před 9 měsíci
rodič
revize
e7236e7ba9

+ 1 - 1
.env.development

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

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/index.html


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/static/css/app.5c024de2.css


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/static/css/chunk-10052f9f.d781ae5d.css


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/static/css/chunk-499732b2.e29bc68e.css


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/static/css/chunk-50f2d6b3.2bce171b.css


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/static/css/chunk-50f2d6b3.435d9c22.css


binární
dist/static/img/aiBgimg.cfd7462d.jpg


binární
dist/static/img/微信图片_20240924181537.b3b964bd.png


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/static/js/app.15292e69.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/static/js/app.7ebb5341.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/static/js/chunk-10052f9f.d5338c01.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/static/js/chunk-33b89c2e.1445c296.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/static/js/chunk-33b89c2e.e9f1d581.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/static/js/chunk-499732b2.57a8856b.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/static/js/chunk-b4ab3520.45ea5ae3.js


+ 10 - 0
src/api/knowledge.js

@@ -18,6 +18,16 @@ export function createBucket(data) {
   })
 }
 
+/* 编辑知识库  */
+export function updateKbm(data) {
+  return request({
+    url: '/kbm/updateKbm',
+    method: 'post',
+    data
+  })
+}
+
+
 /* 删除知识库  kbm/deleteBucket*/
 export function deleteBucket(data) {
   return request({

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
src/icons/svg/file.svg


+ 2 - 2
src/styles/element-ui.scss

@@ -83,14 +83,14 @@
   box-sizing: content-box;
 }
 
-.el-button{
+/* .el-button{
   background-color: $btn;
   
 }
 .el-button:hover{
   background-color: $btn_hover;
   
-}
+} */
 .el-button--primary{
   background-color: $btn;
 }

+ 96 - 67
src/views/knowledgeMenu/index.scss

@@ -1,77 +1,106 @@
 .ledge_box{
-    .data-search{
-        padding:20px 10px 0px 10px;
-    }
-    .data-list{
-        padding: 10px;
-        min-height: 200px; // 确保在没有内容时也有足够的高度显示加载动画
-        position: relative; // 为加载动画提供定位上下文
-        .time {
-            font-size: 13px;
-            color: #999;
-          }
-          
-          .bottom {
-            margin-top: 13px;
-            line-height: 12px;
-          }
+  .data-search{
+      padding:20px 10px 0px 10px;
+  }
+  .data-list{
+      padding: 10px;
+      min-height: 200px; // 确保在没有内容时也有足够的高度显示加载动画
+      position: relative; // 为加载动画提供定位上下文
+      .time {
+          font-size: 13px;
+          color: #999;
+        }
         
-          .button {
-            padding: 0;
-            float: right;
-          }
-        
-          .image {
-            width: 100%;
-            display: block;
-          }
+        .bottom {
+          margin-top: 13px;
+          line-height: 12px;
+        }
+      
+        .button {
+          padding: 0;
+          float: right;
+        }
+      
+        .image {
+          width: 100%;
+          display: block;
+        }
+      
+        .clearfix:before,
+        .clearfix:after {
+            display: table;
+            content: "";
+        }
         
-          .clearfix:before,
-          .clearfix:after {
-              display: table;
-              content: "";
-          }
-          
-          .clearfix:after {
-              clear: both
+        .clearfix:after {
+            clear: both
+        }
+        .card_box{
+          padding: 20px;
+          .header{
+              display: flex;
+              justify-content: space-between;
+              align-items: center;
           }
+        }
+        .card-col{
+          border-radius: 10px;
+          margin-bottom: 30px;
           .card_box{
-            padding: 20px;
-            .header{
-                display: flex;
-                justify-content: space-between;
-                align-items: center;
-            }
-          }
-          .card-col{
             border-radius: 10px;
-            margin-bottom: 30px;
-            .card_box{
-              border-radius: 10px;
-                height:330px;
-                .box_content{
+            height: 275px;
+              .box_content{
+                  display: flex;
+                  flex-direction: column;
+                  justify-content: space-between;
+                  height: 100%;
+                  .content{
+                    margin-top: -50px;
+                      font-size: 32px;
+                      line-height: 32px;
+                      font-weight: 600;
+                      cursor: pointer;
+                      color: #000000e0;
+                      word-break: break-all;
+                      .content_info{
+                        font-size: 14px;
+                        line-height: 18px;
+                        font-weight: 400;
+                        height: 36px;
+                        margin: 30px 10px 10px;
+                        overflow: hidden;
+                        text-overflow: ellipsis;
+                        display: -webkit-box;
+                        -webkit-line-clamp: 2;
+                        -webkit-box-orient: vertical;
+                      }
+                      .content_file{
+                        font-size: 14px;
+                        line-height: 16px;
+                        font-weight: 400;
+                        display: flex;
+                        .file{
+                          width: 60px;
+                          display: flex;
+                          flex-direction: column;
+                          align-items: center;                      
+                          margin-right: 10px;
+                          p{
+                            margin: 0;
+                          }
+                        }
+                      }
+                  }
+                  .footer{
                     display: flex;
-                    flex-direction: column;
                     justify-content: space-between;
-                    height: 100%;
-                    .content{
-                        font-size: 35px;
-                        line-height: 32px;
-                        font-weight: 600;
-                        cursor: pointer;
-                        color: #000000e0;
-                        word-break: break-all;
-                    }
-                    .footer{
-                      display: flex;
-                      justify-content: space-between;
-                        font-size: 14px;
-                        font-weight: 600;
-                        color: #000000a6;
-                        vertical-align: middle;
-                    }
-                }
-            }
+                      font-size: 14px;
+                      font-weight: 600;
+                      color: #000000a6;
+                      vertical-align: middle;
+                  }
+              }
           }
-    }
+        }
+  }
 }

+ 88 - 14
src/views/knowledgeMenu/knowledgeList.vue

@@ -45,12 +45,18 @@
               <div class="box_content" @click="getInfo(item)">
                 <div class="header">
                   <div class="header_left">
-                    <svg-icon
+                    <!-- <svg-icon
                       icon-class="header"
                       style="width: 34px; height: 34px"
-                    />
+                    /> -->
                   </div>
                   <el-popover placement="bottom" trigger="hover">
+                    <el-button
+                      type="success"
+                      icon="el-icon-edit"
+                      @click="editInfo(item)"
+                      >编辑</el-button
+                    >
                     <el-button
                       type="danger"
                       icon="el-icon-delete"
@@ -66,15 +72,42 @@
                   </el-popover>
                 </div>
                 <div class="content">
-                  {{ item.name }}
+                  <p style="margin: 0">{{ item.name }}</p>
+                  <div class="content_info">{{ item.description }}</div><!--  -->
+                  <div class="content_file">
+                    <div class="file">
+                      <svg-icon
+                      icon-class="file"
+                      style="width: 40px; height: 40px;"
+                    />
+                    <p>WORD</p>
+                    <p>{{ item.word_count }}</p>
+                    </div>
+                    <div class="file">
+                      <svg-icon
+                      icon-class="file"
+                      style="width: 40px; height: 40px;"
+                    />
+                    <p>EXCEL</p>
+                    <p>{{ item.excel_count }}</p>
+                    </div>
+                    <div class="file">
+                      <svg-icon
+                      icon-class="file"
+                      style="width: 40px; height: 40px;"
+                    />
+                    <p>PDF</p>
+                    <p>{{ item.pdf_count }}</p>
+                    </div>
+                  </div>
                 </div>
                 <div class="footer">
                   <div class="file">
-                    <svg-icon
+                    <!-- <svg-icon
                       icon-class="word"
                       style="width: 18px; height: 18px; filter: grayscale(100%)"
                     />
-                    {{ item.doc_num }}
+                    {{ item.doc_num }} -->
                   </div>
                   <div class="date">
                     <svg-icon
@@ -92,7 +125,7 @@
     </div>
     <!-- 创建弹窗 -->
     <el-dialog
-      title="创建知识库"
+      :title="dialogTitle"
       :visible.sync="dialogVisible"
       width="30%"
       :before-close="handleClose"
@@ -104,6 +137,16 @@
             placeholder="请输入内容"
           ></el-input>
         </el-form-item>
+        <el-form-item label="描述:" prop="description">
+          <el-input
+            show-word-limit
+            type="textarea"
+            :rows="5"
+            maxlength="250"
+            v-model="creatForm.description"
+            placeholder="请输入描述内容"
+          ></el-input>
+        </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="handleClose">取 消</el-button>
@@ -114,7 +157,12 @@
 </template>
   
 <script>
-import { listBuckets, createBucket, deleteBucket } from "@/api/knowledge";
+import {
+  listBuckets,
+  createBucket,
+  deleteBucket,
+  updateKbm,
+} from "@/api/knowledge";
 import { mapGetters } from "vuex";
 
 export default {
@@ -139,9 +187,13 @@ export default {
       buckList: [],
       visible: false,
       dialogVisible: false,
+      dialogTitle: "创建知识库",
       creatForm: {
+        id: null,
         bucket_name: "",
-      }, //知识库名称
+        description: "",
+        user_id: null,
+      },//知识库名称
       creatRules: {
         bucket_name: [
           { required: true, message: "请输入知识库名称", trigger: "blur" },
@@ -158,14 +210,32 @@ export default {
     this.onSubmit();
   },
   methods: {
-    /* 搜索创建模块 */
+    editInfo(item) {
+      this.dialogTitle = "编辑知识库";
+      this.creatForm = {
+        id: item.id,
+        bucket_name: item.name,
+        description: item.description,
+        user_id: this.$store.state.user.id,
+      };
+      this.dialogVisible = true;
+    },
+    /* 创建知识库 */
     onCreate(e) {
+      this.dialogTitle = "创建知识库";
       this.creatForm = {
+        id: null,
         bucket_name: "",
+        description: "",
         user_id: this.$store.state.user.id,
       };
       this.dialogVisible = true;
     },
+    /* 关闭弹窗 */
+    handleClose() {
+      this.$refs.creatRef.resetFields();
+      this.dialogVisible = false;
+    },
     onClose(e) {
       this.dialogVisible = false;
       this.onSubmit();
@@ -209,22 +279,26 @@ export default {
         });
     },
     /* 关闭弹窗 */
-    handleClose(done) {
+  /*   handleClose(done) {
       this.creatForm = {};
       done();
-    },
+    }, */
     /* 创建知识库 */
     submitBuck() {
       this.$refs.creatRef.validate((valid) => {
         if (valid) {
-          createBucket(this.creatForm).then((res) => {
+          const action = this.creatForm.id ? updateKbm : createBucket;
+          const successMessage = this.creatForm.id ? "修改成功" : "创建成功";
+          this.creatForm.id ? this.creatForm.name=this.creatForm.bucket_name :this.creatForm.bucket_name=this.creatForm.bucket_name ;
+          action(this.creatForm).then((res) => {
             if (res.status !== 200) return;
             this.dialogVisible = false;
+            this.$message.success(successMessage);
             this.onSubmit();
-            this.creatForm = {};
+            this.$refs.creatRef.resetFields();
           });
         } else {
-          this.$message.error("请填写知识库名称");
+          this.$message.error("请填写必填项");
         }
       });
     },

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů