lsc 5 tháng trước cách đây
mục cha
commit
fa756dd2b6

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.13bc3d1f8e64d686352915721daf2f41.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.48a578a7c9e065d22bb8.js></script><script type=text/javascript src=./static/js/app.9ac6c486fc89d0e1e575.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.84146a578e2bc45b350bea0bf7775d07.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.48a578a7c9e065d22bb8.js></script><script type=text/javascript src=./static/js/app.4a710510d38e54ce730c.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

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


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


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


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


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


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


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


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


+ 124 - 0
src/components/pages/knowledge/components/testBox.vue

@@ -0,0 +1,124 @@
+<template>
+    <div class="testBox">
+        <div class="test_right">
+            <div class="test_input_box">
+                <el-input class="test_input" type="textarea" :rows="8" v-model="value" placeholder="输入需要测试的文本"
+                    resize="none">
+                </el-input>
+                <el-button type="primary" size="small" @click="testCheck" v-loading="isLoading">测试</el-button>
+            </div>
+
+            <div class="test_history">
+                <div class="title">测试记录</div>
+                <div class="test_history_box" v-for="item in 100" :key="item">{{ item }}</div>
+            </div>
+        </div>
+        <div class="test_left">
+            <div class="test_check">
+                <div class="title">测试参数</div>
+            </div>
+            <div class="test_result">
+                <div class="title">测试结果</div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            value: "",
+            isLoading: false
+        }
+    },
+    props: {
+        userid: {
+            type: String
+        },
+        folderid: {
+            type: String
+        },
+    },
+    methods: {
+        testCheck() {
+            this.isLoading = true;
+            let params = {
+                userid: this.userid,
+                ids: this.folderid,
+                query: this.value,
+                type: 2,
+                useType: 1,
+                fullTextWeight: 5,
+                semanticWeight: 5,
+                limit: 10,
+                temperature: 0,
+                tokens: 1500,
+            };
+            this.ajax
+                .post(this.$store.state.fileApi + "ragFolder", [params])
+                .then((res) => {
+                    this.isLoading = false;
+                    console.log(res);
+                })
+                .catch((err) => {
+                    this.isLoading = false;
+                    console.error(err);
+                });
+        }
+    },
+}
+</script>
+
+<style scoped>
+.testBox {
+    display: flex;
+    gap: 20px;
+    height: 100%;
+    overflow: hidden;
+}
+
+.testBox .test_right {
+    width: 400px;
+    min-width: 400px;
+    height: 100%;
+    overflow: hidden;
+    display: flex;
+    flex-direction: column;
+    gap: 10px;
+}
+
+.testBox .test_right .test_input_box {}
+
+.testBox .test_right .test_input_box .test_input {}
+
+.testBox .test_right .test_input_box>>>.el-button {
+    height: 35px !important;
+    font-size: 12.8px;
+    background-color: #3370FF;
+    border-radius: 6px;
+    margin-left: 12px;
+    border:none;
+}
+
+.testBox .test_right .test_input_box>>>.el-button--primary:focus,
+.f_box_top_right>>>.el-button--primary:hover {
+    filter: brightness(120%);
+}
+
+.testBox .test_right .test_history {
+    height: 100%;
+    overflow: auto;
+}
+
+.testBox .test_right .test_history>.title {}
+
+.testBox .test_right .test_history>.test_history_box {}
+
+.testBox .test_left {
+    width: 100%;
+    flex: 1;
+    height: 100%;
+    overflow: auto;
+}
+</style>

+ 16 - 14
src/components/pages/knowledge/fileBox.vue

@@ -523,7 +523,7 @@ export default {
           formData.append("id", uuid);
           formData.append("metadata", JSON.stringify({ title: file.name }));
           formData.append("ingestion_mode", "fast");
-          formData.append("run_with_orchestration", "false");
+          // formData.append("run_with_orchestration", "false");
 
           // 使用同步方式上传文件
           await this.uploadFile(formData, file.name, uuid);
@@ -553,20 +553,22 @@ export default {
         }).then(res => {
           console.log(res, formData);
           const message = res.data.results && res.data.results.message;
-          const status = message === 'Document created and ingested successfully.' ? 'success' : 'failed';
-          const msg = message === 'Document created and ingested successfully.' ? '切片成功' : '切片失败';
-          this.$message({
-            message: msg,
-            type: status == 'success' ? status : 'error'
-          })
-          this.getData()
+          // const status = message === 'Document created and ingested successfully.' ? 'success' : 'failed';
+          // const msg = message === 'Document created and ingested successfully.' ? '切片成功' : '切片失败';
+          // this.$message({
+          //   message: msg,
+          //   type: status == 'success' ? status : 'error'
+          // })
           setTimeout(() => {
-            this.fileArray.forEach(e => {
-              if (e.documentid === uuid) {
-                e.ingestionStatus = status;
-              }
-            });
-          }, 1000);
+            this.getData()
+          }, 1000)
+          // setTimeout(() => {
+          //   this.fileArray.forEach(e => {
+          //     if (e.documentid === uuid) {
+          //       e.ingestionStatus = status;
+          //     }
+          //   });
+          // }, 1000);
         }).catch(err => {
           this.$message.error('上传失败')
           this.fileArray.forEach(e => {

+ 54 - 18
src/components/pages/knowledge/folderFileBox.vue

@@ -8,7 +8,11 @@
         </el-breadcrumb>
       <!-- <div class="f_box_top_title">文件</div> -->
       </div>
-      <div class="f_box_top_right">
+      <div class="f_box_top_center" v-show="false">
+        <span :class="{active: fileType == 1}" @click="checkType(1)">文件数据</span>
+        <span :class="{active: fileType == 2}" @click="checkType(2)">召回测试</span>
+      </div>
+      <div class="f_box_top_right" v-if="fileType == 1">
 
         <div class="input">
           <input
@@ -83,6 +87,7 @@
     <!-- v-else-if="stype == '2' && fileArray.length" -->
 
     <div
+      v-show="fileType == 1"
       class="f_box_file_list"
       v-loading.body="isLoading"
     >
@@ -278,6 +283,7 @@
         </div>
       </div>
     </div>
+    <testBox v-show="fileType == 2" :userid="userid" :folderid="folderid"></testBox>
     <wpdf :dialogVisiblePdf.sync="dialogVisiblePdf" :url="wurl"></wpdf>
     <wVideo :dialogVisibleVideo.sync="dialogVisibleVideo" :url="wurl"></wVideo>
     <wOffice
@@ -313,13 +319,15 @@ import wOffice from "../test/file/wOffice.vue";
 import { v4 as uuidv4 } from "uuid";
 import relateFiles from "./components/relateFiles";
 import checkDialog from "./components/checkDialog";
+import testBox from "./components/testBox";
 export default {
   components: {
     wVideo,
     wpdf,
     wOffice,
     relateFiles,
-    checkDialog
+    checkDialog,
+    testBox
   },
   props: {
     userid: {
@@ -396,7 +404,8 @@ export default {
       page: 1,
       debounceTimeout: null,
       pcount: 0,
-      ptotal: 0
+      ptotal: 0,
+      fileType: 1
     };
   },
   computed: {
@@ -550,7 +559,7 @@ export default {
             JSON.stringify({ title: file.name, collection_ids: string })
           );
           formData.append("ingestion_mode", "fast");
-          formData.append("run_with_orchestration", "false");
+          // formData.append("run_with_orchestration", "false");
 
           // 使用同步方式上传文件
           await this.uploadFile(formData, file.name, uuid);
@@ -579,20 +588,22 @@ export default {
         }).then(res => {
           console.log(res, formData);
           const message = res.data.results && res.data.results.message;
-          const status = message === 'Document created and ingested successfully.' ? 'success' : 'failed';
-          const msg = message === 'Document created and ingested successfully.' ? '切片成功' : '切片失败';
-          this.$message({
-            message: msg,
-            type: status == 'success' ? status : 'error'
-          })
-          this.getData()
+          // const status = message === 'Document created and ingested successfully.' ? 'success' : 'failed';
+          // const msg = message === 'Document created and ingested successfully.' ? '切片成功' : '切片失败';
+          // this.$message({
+          //   message: msg,
+          //   type: status == 'success' ? status : 'error'
+          // })
           setTimeout(() => {
-            this.fileArray.forEach(e => {
-              if (e.documentid === uuid) {
-                e.ingestionStatus = status;
-              }
-            });
-          }, 1000);
+            this.getData()
+          }, 1000)
+          // setTimeout(() => {
+          //   this.fileArray.forEach(e => {
+          //     if (e.documentid === uuid) {
+          //       e.ingestionStatus = status;
+          //     }
+          //   });
+          // }, 1000);
         }).catch(err => {
           this.$message.error('上传失败')
           this.fileArray.forEach(e => {
@@ -646,7 +657,7 @@ export default {
             }
           ];
           this.ajax //deleteFileByFilter
-            .post(this.$store.state.fileApi + "deleteFileByFilter", params)
+            .post(this.$store.state.fileApi + "deleteFile", params)
             .then(res => {
               this.$message({
                 message: "删除成功",
@@ -792,6 +803,9 @@ export default {
       } catch (err) {
         console.error(err);
       }
+    },
+    checkType(type){
+      this.fileType = type
     }
   },
   mounted() {
@@ -1554,5 +1568,27 @@ export default {
     display: flex !important;
     align-items: center !important;
 }
+
+.f_box_top_center{
+  margin: auto;
+  display: flex;
+  align-items: center;
+}
+
+.f_box_top_center > span{
+  font-size: 14px;
+  cursor: pointer;
+  padding: 6px 8px;
+  color: #1A202C;
+}
+
+.f_box_top_center > span:hover{
+  background: rgb(242, 243, 243);
+  border-radius: 5px;
+}
+
+.f_box_top_center > span.active{
+  color: #2B5FD9;
+}
 </style>
 

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