lsc 2 months ago
parent
commit
edd389cdfe

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       width: 100%;
       background: #e6eaf0;
       background: #e6eaf0;
       font-family: '黑体';
       font-family: '黑体';
-    }</style><link href=./static/css/app.acdfeb5e61a9fa9f3ec886ec075f39ca.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.41f9d44fcc305a660223.js></script><script type=text/javascript src=./static/js/app.d0882fb6eec1c960f7c2.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.16153dbf3fb1c62d1781f15c85b9cdd4.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.41f9d44fcc305a660223.js></script><script type=text/javascript src=./static/js/app.9e54bbab571d83caff00.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.16153dbf3fb1c62d1781f15c85b9cdd4.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.16153dbf3fb1c62d1781f15c85b9cdd4.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.acdfeb5e61a9fa9f3ec886ec075f39ca.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.9e54bbab571d83caff00.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.9e54bbab571d83caff00.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.d0882fb6eec1c960f7c2.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.d0882fb6eec1c960f7c2.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


+ 70 - 8
src/components/pages/knowledge/fileBox.vue

@@ -54,7 +54,7 @@
           />
           />
         </div>
         </div>
         <div class="f_box_top_right">
         <div class="f_box_top_right">
-          <el-button type="primary" size="small" @click="serchFile"
+          <el-button type="primary" size="small" @click="refresh"
           style="background-color: rgb(51, 112, 255);"
           style="background-color: rgb(51, 112, 255);"
             >
             >
           <img style="vertical-align: middle;transform: scale(1.1);padding-bottom: 2px;box-sizing: border-box;" src="../../../assets/shuax.svg" alt="">
           <img style="vertical-align: middle;transform: scale(1.1);padding-bottom: 2px;box-sizing: border-box;" src="../../../assets/shuax.svg" alt="">
@@ -170,7 +170,7 @@
                         @mouseleave="isHover = false"
                         @mouseleave="isHover = false"
                         v-if="scope.row.userid == userid">
                         v-if="scope.row.userid == userid">
                         <img
                         <img
-                        style="width: 14px;"
+                        style="width: 14px; margin-right:8px;"
                         :src="isHover ? tqList2 : tqList"
                         :src="isHover ? tqList2 : tqList"
                          alt="">
                          alt="">
                         <span :class="isHover ? 'lookHp2' : 'lookHp1'">{{lang.extract}}</span>
                         <span :class="isHover ? 'lookHp2' : 'lookHp1'">{{lang.extract}}</span>
@@ -238,6 +238,7 @@
         :total="total"
         :total="total"
         @current-change="handleCurrentChange"
         @current-change="handleCurrentChange"
         :page-sizes="[10, 20, 50, 100]"
         :page-sizes="[10, 20, 50, 100]"
+        :current-page="page"
       >
       >
       <el-select v-model="limit" @change="handleSizeChange" class="file_mySelect">
       <el-select v-model="limit" @change="handleSizeChange" class="file_mySelect">
           <el-option
           <el-option
@@ -264,6 +265,21 @@
       :url="wurl"
       :url="wurl"
     ></wOffice>
     ></wOffice>
     <checkDialog ref="checkDialog"></checkDialog>
     <checkDialog ref="checkDialog"></checkDialog>
+    <el-dialog
+      :title="lang.prompt2"
+      :visible.sync="promptDialog"
+      class="fileDialogBlock"
+      :close-on-click-modal="false"
+      :before-close="handleClose" 
+    >
+      <span class="promptBox" v-loading="promptLoading">
+        <!-- <el-input v-model="prompt" :placeholder="lang.promptPlaceholder" class="promptInput"></el-input> -->
+        <el-input type="textarea" v-model="prompt" :placeholder="lang.promptPlaceholder" rows="5"></el-input>
+        <div class="btnbox">
+          <el-button type="primary" @click="handleExtract">{{ lang.confirm }}</el-button>
+        </div>
+      </span>
+    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -373,7 +389,11 @@ export default {
       user: "",
       user: "",
       userArray: [],
       userArray: [],
       pcount: 0,
       pcount: 0,
-      ptotal: 0
+      ptotal: 0,
+      row: {},
+      promptDialog: false,
+      promptLoading: false,
+      prompt: "",
     };
     };
   },
   },
   computed: {
   computed: {
@@ -424,6 +444,9 @@ export default {
     },
     },
   },
   },
   methods: {
   methods: {
+    handleClose(done){
+      done();
+    },
     handleCurrentChange(val) {
     handleCurrentChange(val) {
       this.page = val;
       this.page = val;
       this.getData();
       this.getData();
@@ -486,6 +509,9 @@ export default {
         this.serchFile();
         this.serchFile();
       }, 300);
       }, 300);
     },
     },
+    refresh(){
+      this.getData();
+    },
     serchFile() {
     serchFile() {
       this.page = 1;
       this.page = 1;
       this.getData();
       this.getData();
@@ -698,16 +724,21 @@ export default {
 
 
     extractFile(row) {
     extractFile(row) {
       if (row.ingestionStatus != "success") return this.$message.info(this.lang.fileUploadFail)
       if (row.ingestionStatus != "success") return this.$message.info(this.lang.fileUploadFail)
-
+      this.row = row
+      this.promptDialog = true;
+    },
+    handleExtract() {
+      this.promptLoading = true
       let params = {
       let params = {
-        documentid: row.documentid
+        documentid: this.row.documentid,
+        prompt: this.prompt
       };
       };
       // 获取切片
       // 获取切片
       try {
       try {
         const res = this.ajax.post(this.$store.state.fileApi + "extractFile2", [
         const res = this.ajax.post(this.$store.state.fileApi + "extractFile2", [
           params
           params
         ]).then(res => {
         ]).then(res => {
-          console.log(res, row);
+          console.log(res, this.row);
           const message = res.data.result && res.data.result.message;
           const message = res.data.result && res.data.result.message;
           // const status = message === 'Document entities and relationships extracted successfully.' ? 'success' : 'failed';
           // const status = message === 'Document entities and relationships extracted successfully.' ? 'success' : 'failed';
           // const msg = message === 'Document entities and relationships extracted successfully.' ? '提取成功' : '提取失败';
           // const msg = message === 'Document entities and relationships extracted successfully.' ? '提取成功' : '提取失败';
@@ -721,12 +752,15 @@ export default {
           //   }
           //   }
           // });
           // });
           setTimeout(() => {
           setTimeout(() => {
+            this.promptLoading = false
+            this.promptDialog = false
             this.getData();
             this.getData();
           }, 1000)
           }, 1000)
         }).catch(err => {
         }).catch(err => {
+          this.promptLoading = false
           this.$message.error(this.lang.extrFailed)
           this.$message.error(this.lang.extrFailed)
           this.fileArray.forEach(e => {
           this.fileArray.forEach(e => {
-            if (e.documentid === row.documentid) {
+            if (e.documentid === this.row.documentid) {
               e.extractionStatus = 'failed';
               e.extractionStatus = 'failed';
             }
             }
           });
           });
@@ -736,8 +770,10 @@ export default {
         this.$message.success(this.lang.extractingFile);
         this.$message.success(this.lang.extractingFile);
         this.getData();
         this.getData();
       } catch (err) {
       } catch (err) {
+        this.promptLoading = false
+        
         console.error(err);
         console.error(err);
-      }
+      } 
     },
     },
     isSelectable(row) {
     isSelectable(row) {
       return row.userid == this.userid;
       return row.userid == this.userid;
@@ -1355,5 +1391,31 @@ export default {
   padding: 8px 6px;
   padding: 8px 6px;
   border-radius: 8px;
   border-radius: 8px;
 }
 }
+
+.fileDialogBlock >>> .el-dialog {
+  width: 648px;
+  min-height: 180px;
+  border-radius: 12px;
+  box-sizing: border-box;
+}
+
+.fileDialogBlock >>> .el-dialog__title {
+  font-weight: 600 !important;
+  font-size: 18px !important;
+}
+
+.fileDialogBlock >>> .el-upload-list__item .el-icon-close {
+  top: 13px;
+}
+
+.promptBox{
+  display: block;
+}
+
+.btnbox{
+  margin-top: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
 </style>
 </style>
 
 

+ 109 - 38
src/components/pages/knowledge/folderFileBox.vue

@@ -395,6 +395,21 @@
     <relateFiles ref="relateFiles"></relateFiles>
     <relateFiles ref="relateFiles"></relateFiles>
     <checkDialog ref="checkDialog"></checkDialog>
     <checkDialog ref="checkDialog"></checkDialog>
     <WebCrawlDialog :visible.sync="webUrlDialogVisible" :input-url.sync="webInputUrl" @confirm="handleWebUrlConfirm"/>
     <WebCrawlDialog :visible.sync="webUrlDialogVisible" :input-url.sync="webInputUrl" @confirm="handleWebUrlConfirm"/>
+    <el-dialog
+      :title="lang.prompt2"
+      :visible.sync="promptDialog"
+      class="fileDialogBlock"
+      :close-on-click-modal="false"
+      :before-close="handleClose" 
+    >
+      <span class="promptBox" v-loading="promptLoading">
+        <!-- <el-input v-model="prompt" :placeholder="lang.promptPlaceholder" class="promptInput"></el-input> -->
+        <el-input type="textarea" v-model="prompt" :placeholder="lang.promptPlaceholder" rows="5"></el-input>
+        <div class="btnbox">
+          <el-button type="primary" @click="handleExtract">{{ lang.confirm }}</el-button>
+        </div>
+      </span>
+    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -513,7 +528,10 @@ export default {
       fileType: 1,
       fileType: 1,
       webUrlDialogVisible: false,
       webUrlDialogVisible: false,
       webInputUrl: '',
       webInputUrl: '',
-
+      row: {},
+      promptDialog: false,
+      promptLoading: false,
+      prompt: "",
     };
     };
   },
   },
   computed: {
   computed: {
@@ -989,53 +1007,106 @@ export default {
         });
         });
     },
     },
 
 
+    // extractFile(row) {
+    //   if (row.ingestionStatus != "success")
+    //     return this.$message.info(this.lang.fileUploadFail);
+
+    //   let params = {
+    //     documentid: row.documentid,
+    //   };
+    //   // 获取切片
+    //   try {
+    //     const res = this.ajax
+    //       .post(this.$store.state.fileApi + "extractFile2", [params])
+    //       .then((res) => {
+    //         console.log(res, row);
+    //         const message = res.data.result && res.data.result.message;
+    //         // const status = message === 'Document entities and relationships extracted successfully.' ? 'success' : 'failed';
+    //         // const msg = message === 'Document entities and relationships extracted successfully.' ? '提取成功' : '提取失败';
+    //         // this.$message({
+    //         //   message: msg,
+    //         //   type: status == 'success' ? status : 'error'
+    //         // })
+    //         // this.fileArray.forEach(e => {
+    //         //   if (e.documentid === row.documentid) {
+    //         //     e.extractionStatus = status;
+    //         //   }
+    //         // });
+    //         setTimeout(() => {
+    //           this.getData();
+    //         }, 1000);
+    //       })
+    //       .catch((err) => {
+    //         this.$message.error(this.lang.extrFailed);
+    //         this.fileArray.forEach((e) => {
+    //           if (e.documentid === row.documentid) {
+    //             e.extractionStatus = "failed";
+    //           }
+    //         });
+    //         console.error(err);
+    //       });
+
+    //     console.log(res.data);
+    //     this.$message.success(this.lang.extractingFile);
+    //   } catch (err) {
+    //     console.error(err);
+    //   }
+    // },
+    checkType(type) {
+      this.fileType = type;
+    },
     extractFile(row) {
     extractFile(row) {
-      if (row.ingestionStatus != "success")
-        return this.$message.info(this.lang.fileUploadFail);
-
+      if (row.ingestionStatus != "success") return this.$message.info(this.lang.fileUploadFail)
+      this.row = row
+      this.promptDialog = true;
+    },
+    handleExtract() {
+      this.promptLoading = true
       let params = {
       let params = {
-        documentid: row.documentid,
+        documentid: this.row.documentid,
+        prompt: this.prompt
       };
       };
       // 获取切片
       // 获取切片
       try {
       try {
-        const res = this.ajax
-          .post(this.$store.state.fileApi + "extractFile2", [params])
-          .then((res) => {
-            console.log(res, row);
-            const message = res.data.result && res.data.result.message;
-            // const status = message === 'Document entities and relationships extracted successfully.' ? 'success' : 'failed';
-            // const msg = message === 'Document entities and relationships extracted successfully.' ? '提取成功' : '提取失败';
-            // this.$message({
-            //   message: msg,
-            //   type: status == 'success' ? status : 'error'
-            // })
-            // this.fileArray.forEach(e => {
-            //   if (e.documentid === row.documentid) {
-            //     e.extractionStatus = status;
-            //   }
-            // });
-            setTimeout(() => {
-              this.getData();
-            }, 1000);
-          })
-          .catch((err) => {
-            this.$message.error(this.lang.extrFailed);
-            this.fileArray.forEach((e) => {
-              if (e.documentid === row.documentid) {
-                e.extractionStatus = "failed";
-              }
-            });
-            console.error(err);
+        const res = this.ajax.post(this.$store.state.fileApi + "extractFile2", [
+          params
+        ]).then(res => {
+          console.log(res, this.row);
+          const message = res.data.result && res.data.result.message;
+          // const status = message === 'Document entities and relationships extracted successfully.' ? 'success' : 'failed';
+          // const msg = message === 'Document entities and relationships extracted successfully.' ? '提取成功' : '提取失败';
+          // this.$message({
+          //   message: msg,
+          //   type: status == 'success' ? status : 'error'
+          // })
+          // this.fileArray.forEach(e => {
+          //   if (e.documentid === row.documentid) {
+          //     e.extractionStatus = status;
+          //   }
+          // });
+          setTimeout(() => {
+            this.promptLoading = false
+            this.promptDialog = false
+            this.getData();
+          }, 1000)
+        }).catch(err => {
+          this.promptLoading = false
+          this.$message.error(this.lang.extrFailed)
+          this.fileArray.forEach(e => {
+            if (e.documentid === this.row.documentid) {
+              e.extractionStatus = 'failed';
+            }
           });
           });
-
+          console.error(err);
+        });
         console.log(res.data);
         console.log(res.data);
         this.$message.success(this.lang.extractingFile);
         this.$message.success(this.lang.extractingFile);
+        this.getData();
       } catch (err) {
       } catch (err) {
+        this.promptLoading = false
+        
         console.error(err);
         console.error(err);
-      }
-    },
-    checkType(type) {
-      this.fileType = type;
+      } 
     },
     },
   },
   },
   mounted() {
   mounted() {

+ 3 - 0
src/lang/cn.json

@@ -29,6 +29,7 @@
   "knowledgeDesc":"请输入知识库描述",
   "knowledgeDesc":"请输入知识库描述",
   "cancel":"取消",
   "cancel":"取消",
   "confirm":"确定",
   "confirm":"确定",
+
   "office":"OFFICE文件",
   "office":"OFFICE文件",
   "video":"视频文件",
   "video":"视频文件",
   "img":"图片",
   "img":"图片",
@@ -41,6 +42,8 @@
   "defaultFolderDesc":"该文件夹为系统创设,将自动关联您所有上传的文件",
   "defaultFolderDesc":"该文件夹为系统创设,将自动关联您所有上传的文件",
   "confirmDelete":"确定删除文件夹吗?",
   "confirmDelete":"确定删除文件夹吗?",
   "prompt":"提示",
   "prompt":"提示",
+  "prompt2": "提示词设置",
+  "promptPlaceholder": "提示词设置(非必填)",
   "deleteSuccess":"删除成功",
   "deleteSuccess":"删除成功",
   "deleteFail":"删除失败",
   "deleteFail":"删除失败",
   "copySuccess":"复制成功",
   "copySuccess":"复制成功",

+ 2 - 0
src/lang/en.json

@@ -41,6 +41,8 @@
   "defaultFolderDesc":"This folder is created by the system and will automatically associate with all your uploaded files",
   "defaultFolderDesc":"This folder is created by the system and will automatically associate with all your uploaded files",
   "confirmDelete":"This action cannot be undone. Do you want to continue?",
   "confirmDelete":"This action cannot be undone. Do you want to continue?",
   "prompt":"Tip",
   "prompt":"Tip",
+  "prompt2": "Prompt Setting",
+  "promptPlaceholder": "Prompt Setting (Optional)",
   "deleteSuccess":"Deletion Successful",
   "deleteSuccess":"Deletion Successful",
   "deleteFail":"Delete Failed",
   "deleteFail":"Delete Failed",
   "copySuccess":"Copy Success",
   "copySuccess":"Copy Success",

+ 2 - 0
src/lang/hk.json

@@ -41,6 +41,8 @@
   "defaultFolderDesc": "該文件夾為系統創設,將自動關聯您所有上傳的文件",
   "defaultFolderDesc": "該文件夾為系統創設,將自動關聯您所有上傳的文件",
   "confirmDelete": "確定刪除文件夾嗎?",
   "confirmDelete": "確定刪除文件夾嗎?",
   "prompt": "提示",
   "prompt": "提示",
+  "prompt2": "提示詞設定",
+  "promptPlaceholder": "提示詞設定(非必填)",
   "deleteSuccess": "刪除成功",
   "deleteSuccess": "刪除成功",
   "deleteFail": "刪除失敗",
   "deleteFail": "刪除失敗",
   "copySuccess": "複製成功",
   "copySuccess": "複製成功",

Some files were not shown because too many files changed in this diff