yangg 11 månader sedan
förälder
incheckning
47f01923de

+ 5 - 38
dist/ckeditor/config.js

@@ -45,46 +45,13 @@ config.contentsCss = '/public/ckeditor/custom-ckeditor.css';
  config.toolbarLocation = 'top';
 
 
- // 设置正确的上传URL
- var uploadUrl = 'http://58.246.234.210:8084/upload/file';
 
- // 设置图片上传的参数名为 'file'
- config.imageUploadParam = 'file';
+// 修改图片上传配置
+config.filebrowserImageUploadUrl = 'http://58.246.234.210:8084/upload/image';
+config.imageUploadUrl = 'http://58.246.234.210:8084/upload/image';
 
- // 设置文件浏览器上传URL和方法
- config.filebrowserUploadUrl = uploadUrl;
- config.filebrowserImageUploadUrl = uploadUrl;
-/*  config.filebrowserUploadMethod = 'form'; */
+// 自定义上传处理
+config.uploadUrl = 'http://58.246.234.210:8084/upload/image';
 
- /* // 确保 'image' 插件被加载
- config.extraPlugins = (config.extraPlugins ? config.extraPlugins + ',image' : 'image');
-
- // 配置图片上传
- config.uploadUrl = uploadUrl;
-
- // 自定义文件上传处理
- config.uploadFile = function( file, successCallback, failureCallback ) {
-	 var xhr = new XMLHttpRequest();
-	 var fd = new FormData();
-	 
-	 fd.append('file', file);  // 使用 'file' 作为参数名
-
-	 xhr.open('POST', uploadUrl, true);
-	 xhr.onload = function() {
-		 if (xhr.status === 200) {
-			 var response = JSON.parse(xhr.responseText);
-			 successCallback(response.url);
-		 } else {
-			 console.error('Server responded with:', xhr.status, xhr.statusText);
-			 console.error('Response text:', xhr.responseText);
-			 failureCallback('Upload failed: ' + xhr.status + ' ' + xhr.statusText);
-		 }
-	 };
-	 xhr.onerror = function() {
-		 console.error('Network error occurred');
-		 failureCallback('Network error occurred');
-	 };
-	 xhr.send(fd);
- }; */
 
 };

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/index.html


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/css/chunk-4f299a7f.9863cc11.css


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/js/app.c99e8471.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/js/chunk-4f299a7f.ed1c0735.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/js/chunk-e8324248.7a7603cf.js


+ 5 - 38
public/ckeditor/config.js

@@ -45,46 +45,13 @@ config.contentsCss = '/public/ckeditor/custom-ckeditor.css';
  config.toolbarLocation = 'top';
 
 
- // 设置正确的上传URL
- var uploadUrl = 'http://58.246.234.210:8084/upload/file';
 
- // 设置图片上传的参数名为 'file'
- config.imageUploadParam = 'file';
+// 修改图片上传配置
+config.filebrowserImageUploadUrl = 'http://58.246.234.210:8084/upload/image';
+config.imageUploadUrl = 'http://58.246.234.210:8084/upload/image';
 
- // 设置文件浏览器上传URL和方法
- config.filebrowserUploadUrl = uploadUrl;
- config.filebrowserImageUploadUrl = uploadUrl;
-/*  config.filebrowserUploadMethod = 'form'; */
+// 自定义上传处理
+config.uploadUrl = 'http://58.246.234.210:8084/upload/image';
 
- /* // 确保 'image' 插件被加载
- config.extraPlugins = (config.extraPlugins ? config.extraPlugins + ',image' : 'image');
-
- // 配置图片上传
- config.uploadUrl = uploadUrl;
-
- // 自定义文件上传处理
- config.uploadFile = function( file, successCallback, failureCallback ) {
-	 var xhr = new XMLHttpRequest();
-	 var fd = new FormData();
-	 
-	 fd.append('file', file);  // 使用 'file' 作为参数名
-
-	 xhr.open('POST', uploadUrl, true);
-	 xhr.onload = function() {
-		 if (xhr.status === 200) {
-			 var response = JSON.parse(xhr.responseText);
-			 successCallback(response.url);
-		 } else {
-			 console.error('Server responded with:', xhr.status, xhr.statusText);
-			 console.error('Response text:', xhr.responseText);
-			 failureCallback('Upload failed: ' + xhr.status + ' ' + xhr.statusText);
-		 }
-	 };
-	 xhr.onerror = function() {
-		 console.error('Network error occurred');
-		 failureCallback('Network error occurred');
-	 };
-	 xhr.send(fd);
- }; */
 
 };

+ 4 - 3
src/views/knowledgeMenu/category/components/dataList.vue

@@ -70,12 +70,12 @@
               class="item"
               effect="dark"
               :content="
-                scope.row.run === 1 || scope.row.run === 5 ? '解析中' : '解析'
+                 scope.row.run === '1' || scope.row.run === '5' ? '解析中' : '解析'
               "
               placement="top"
             >
               <el-button
-                v-if="scope.row.run !== 1 && scope.row.run !== 5"
+                v-if="scope.row.run !== '1' || scope.row.run !== '5'"
                 type="text"
                 icon="el-icon-caret-right"
                 circle
@@ -657,7 +657,8 @@ export default {
 
           // Initialize the analysis status for each row
           _this.dataList.forEach((row) => {
-            if (row.run === 1) {
+            console.log(row.run);
+            if (row.run === '1'||row.run==='5') {
               _this.startAnalysisStatusChecker(row);
             }
           });

+ 19 - 12
src/views/knowledgeMenu/category/knowledgeSet.vue

@@ -133,14 +133,14 @@
                   class="item"
                   effect="dark"
                   :content="
-                    scope.row.run === 1 || scope.row.run === 5
+                    scope.row.run ==1 || scope.row.run ==5
                       ? '解析中'
                       : '解析'
                   "
                   placement="top"
                 >
                   <el-button
-                    v-if="scope.row.run !== 1 && scope.row.run !== 5"
+                    v-if="scope.row.run !=1 && scope.row.run !=5"
                     type="text"
                     icon="el-icon-caret-right"
                     circle
@@ -314,7 +314,9 @@
             </el-form-item>
           </el-form>
           <span slot="footer" class="dialog-footer">
-            <el-button type="primary" @click="newFolderDialogVisible = false">取 消</el-button>
+            <el-button type="primary" @click="newFolderDialogVisible = false"
+              >取 消</el-button
+            >
             <el-button type="primary" @click="submitNewFolder">确 定</el-button>
           </span>
         </el-dialog>
@@ -345,7 +347,9 @@
             </el-form-item>
           </el-form>
           <span slot="footer" class="dialog-footer">
-            <el-button type="primary" @click="batchModifyFolderDialogVisible = false"
+            <el-button
+              type="primary"
+              @click="batchModifyFolderDialogVisible = false"
               >取 消</el-button
             >
             <el-button type="primary" @click="submitBatchModifyFolder"
@@ -577,7 +581,10 @@ export default {
 
     typeList() {
       this.loading = true;
-      Promise.all([selectTypeList(this.typeForm), selectType0({ kb_id:this.typeForm.kb_id,type_id: 0 })])
+      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) => ({
@@ -780,8 +787,9 @@ export default {
     },
     /* 解析 */
     analysis(row) {
-      if (row.run === 1 || row.run === 5) return;
+      if (row.run ==1 || row.run ==5) return;
 
+      // Set the status to "解析中" (1) immediately
       this.$set(row, "run", 1);
 
       analysis({
@@ -792,6 +800,7 @@ export default {
       })
         .then((res) => {
           if (res.status === 200) {
+            // Start checking the status immediately after successful API call
             this.startAnalysisStatusChecker(row);
           } else {
             this.$message.error("解析请求失败");
@@ -806,7 +815,7 @@ export default {
     },
 
     startAnalysisStatusChecker(row) {
-      // 如果已经有一个检查器在运行,先停止它
+      // Clear any existing checker for this row
       if (this.analysisStatusCheckers[row.id]) {
         clearTimeout(this.analysisStatusCheckers[row.id]);
       }
@@ -825,7 +834,7 @@ export default {
                 this.$message.error("解析失败");
                 delete this.analysisStatusCheckers[row.id];
               } else if (newStatus === 1 || newStatus === 5) {
-                // 继续检查
+                // Continue checking
                 this.analysisStatusCheckers[row.id] = setTimeout(
                   checkStatus,
                   5000 + Math.random() * 5000
@@ -833,19 +842,17 @@ export default {
               }
             } else {
               this.$message.error("获取解析状态失败");
-              this.$set(row, "run", 0);
               delete this.analysisStatusCheckers[row.id];
             }
           })
           .catch((error) => {
             console.error("获取解析状态错误:", error);
             this.$message.error("获取解析状态时出现错误");
-            this.$set(row, "run", 0);
             delete this.analysisStatusCheckers[row.id];
           });
       };
 
-      // 立即开始第一次检查
+      // Start checking immediately
       checkStatus();
     },
 
@@ -1039,7 +1046,7 @@ export default {
 
           // Initialize the analysis status for each row
           _this.dataList.forEach((row) => {
-            if (row.run === 1) {
+            if (row.run == 1 || row.run ==5) {
               _this.startAnalysisStatusChecker(row);
             }
           });

Vissa filer visades inte eftersom för många filer har ändrats