lsc 7 maanden geleden
bovenliggende
commit
7930e20fff

+ 1 - 1
dist/index.html

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

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


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


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


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


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


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


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


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


+ 1 - 1
src/common/axios.config.js

@@ -36,7 +36,7 @@ axios.interceptors.request.use((config) => {
         config.headers = {
             'Content-Type': 'application/json',
         }
-    } else if (config.data && config.data[0].post == '1' && config.method === 'post') {
+    } else if (config.data && config.data[0].post == '1' && config.method === 'post' ) {
         config.data = 'mode=' + (Object.values(config.data[0]).join(','))//序列化post 参数
     } else if (config.method === 'post') {
 

+ 116 - 13
src/components/pages/knowledge/components/checkDialog.vue

@@ -37,11 +37,29 @@
           <div class="text">{{ getState2(data.username) }}</div>
         </div>
       </div>
-      <!-- <div class="nav">
-        <span>切片</span>
-        <span>实体</span>
-        <span>关系</span>
-      </div> -->
+      <div class="nav">
+        <span :class="{ active: type == 1 }" @click="type = 1">切片</span>
+        <span :class="{ active: type == 2 }" @click="type = 2">图谱</span>
+      </div>
+      <div class="chunkBox" v-show="type == 1" v-loading="chunksLoading">
+        <div class="chunks" v-for="(item, index) in chunksArray" :key="index">
+          {{ item.text }}
+        </div>
+        <div class="noneData" v-if="!chunksArray.length">暂无获取切片数据</div>
+        <el-pagination
+          v-if="chunksArray.length > 0"
+          style="margin-top: 10px"
+          background
+          layout="prev, pager, next"
+          :page-size="limit"
+          :total="total"
+          @current-change="handleCurrentChange"
+        >
+        </el-pagination>
+      </div>
+      <div class="tuBox" v-show="type == 2">
+        <div class="noneData">暂无获取图谱数据</div>
+      </div>
     </div>
     <span slot="footer">
       <el-button @click="dialogVisible = false">关 闭</el-button>
@@ -56,7 +74,13 @@ export default {
       dialogVisible: false,
       data: {},
       did: "",
-      isLoading: false
+      isLoading: false,
+      type: 1,
+      limit: 10,
+      total: 0,
+      page: 1,
+      chunksArray: [],
+      chunksLoading: false
     };
   },
   computed: {
@@ -106,7 +130,9 @@ export default {
     openG(did) {
       this.did = did;
       this.dialogVisible = true;
+      this.page = 1;
       this.getFileDetail();
+      this.getChunks();
     },
     getFileDetail() {
       this.isLoading = true;
@@ -124,6 +150,30 @@ export default {
           this.isLoading = false;
           console.error(err);
         });
+    },
+    getChunks() {
+      this.chunksLoading = true;
+      let params = {
+        documentId: this.did,
+        page: this.page
+      };
+      // 获取切片
+      this.ajax
+        .post(this.$store.state.fileApi + "getChunks", [params])
+        .then(res => {
+          this.chunksLoading = false;
+          console.log(res.data);
+          this.total = res.data.result.totalEntries;
+          this.chunksArray = res.data.result.results;
+        })
+        .catch(err => {
+          this.chunksLoading = false;
+          console.error(err);
+        });
+    },
+    handleCurrentChange(val) {
+      this.page = val;
+      this.getChunks();
     }
   }
 };
@@ -131,10 +181,10 @@ export default {
 
 <style scoped>
 .el-dialogClass >>> .el-dialog {
-    margin: 0 auto !important;
-    height: calc(100% - 200px);
-    transform: translateY(-50%);
-    top: 50%;
+  margin: 0 auto !important;
+  height: calc(100% - 200px);
+  transform: translateY(-50%);
+  top: 50%;
 }
 
 .el-dialogClass >>> .el-dialog__body {
@@ -144,9 +194,9 @@ export default {
   box-sizing: border-box;
   padding: 0 20px;
 }
-.container{
-    height: 100%;
-    overflow: auto;
+.container {
+  height: 100%;
+  overflow: auto;
 }
 
 .contentBox {
@@ -173,4 +223,57 @@ export default {
 
 .contentBox > .content > .text {
 }
+
+.nav {
+  width: 100%;
+  height: 40px;
+  display: flex;
+  align-items: center;
+  background: #f8f8f8;
+  margin: 15px 0;
+  border-radius: 5px;
+  padding: 5px;
+  box-sizing: border-box;
+  color: #a3a3a3;
+}
+
+.nav > span {
+  height: 100%;
+  display: flex;
+  align-items: center;
+  width: calc(100% / 2);
+  justify-content: center;
+  border-radius: 5px;
+  cursor: pointer;
+}
+
+.nav > span.active {
+  background: #fff;
+  color: #000;
+}
+
+.noneData {
+  width: 100%;
+  text-align: center;
+  margin: 20px 0;
+  color: #000;
+}
+
+.chunkBox {
+  width: 100%;
+}
+
+.chunks {
+  width: 100%;
+  background: #f8f9fc;
+  border-radius: 5px;
+  box-sizing: border-box;
+  padding: 10px;
+  color: rgb(15, 21, 40);
+  line-height: 20px;
+}
+
+.chunks + .chunks {
+  margin-top: 10px;
+}
 </style>

+ 62 - 0
src/components/pages/knowledge/components/graph.vue

@@ -0,0 +1,62 @@
+<template>
+    <div style="width: 100%; max-height: 600px; overflow: auto;padding-bottom: 10px;" class="content">
+        <div style="height:600px;position: relative;">
+            <RelationGraph ref="seeksRelationGraph" :options="graphOptions" :on-node-click="onNodeClick"
+                :on-line-click="onLineClick" />
+        </div>
+    </div>
+</template>
+
+<script>
+import RelationGraph from 'relation-graph'
+
+export default {
+    props: ['Json'],
+    components: {
+        RelationGraph,
+    },
+    data() {
+        return {
+            graphOptions: {
+                allowSwitchLineShape: true,
+                zoomToFitWhenRefresh: true,
+                moveToCenterWhenRefresh: true,
+                // allowSwitchJunctionPoint: true,
+                defaultJunctionPoint: 'border'
+                // 这里可以参考"Graph 图谱"中的参数进行设置
+            }
+        }
+    },
+    mounted() {
+        this.showSeeksGraph()
+    },
+    watch: {
+        Json: {
+            immediate: true,
+            deep: true,
+            handler(newValue, oldValue) {
+                this.Json = newValue
+                this.showSeeksGraph()
+            }
+        }
+    },
+    methods: {
+        showSeeksGraph() {
+            const __graph_json_data = this.Json
+            // 以上数据中的node和link可以参考"Node节点"和"Link关系"中的参数进行配置 
+            this.$refs.seeksRelationGraph.setJsonData(__graph_json_data, (seeksRGGraph) => {
+                // Called when the relation-graph is completed 
+            })
+        },
+        onNodeClick(nodeObject, $event) {
+            console.log('onNodeClick:', nodeObject)
+        },
+        onLineClick(lineObject, $event) {
+            console.log('onLineClick:', lineObject)
+        }
+    }
+}
+
+</script>
+
+<style></style>

+ 2 - 3
src/components/pages/knowledge/fileBox.vue

@@ -304,7 +304,7 @@ export default {
           
           if (!allowedExtensions.includes(fileExtension)) {
             this.$message.error(`不支持的文件格式: ${file.name}`);
-            cfindex2++;
+            await new Promise(resolve => setTimeout(resolve, 1000)); // 延迟1秒再跳过
             continue; // 跳过不支持的文件
           }
           let uuid = uuidv4();
@@ -319,7 +319,6 @@ export default {
 
           // 使用同步方式上传文件
           await this.uploadFile(formData, file.name, uuid);
-          cfindex2++;
 
           // 每5秒上传一次
           if (cfindex < files.length - 1) {
@@ -328,7 +327,7 @@ export default {
         }
         this.proVisible = false;
         this.$message.success("上传成功");
-        await this.getData(); // 在上传完文件后再调用getData
+        this.getData(); // 在上传完文件后再调用getData
       };
 
       await uploadFiles(event.target.files);

+ 3 - 4
src/components/pages/knowledge/folder.vue

@@ -387,21 +387,20 @@ export default {
       this.isLoading = true;
       let params = {
         uid: id,
+        n: this.fileName.trim(),
         sub: this.check1,
         class: this.check2,
         page: this.page,
         num: 10
       };
       this.ajax
-        .post(this.$store.state.api + "getFolderPage", [params])
+        .post(this.$store.state.fileApi + "getFolderPage", [params])
         .then(res => {
           this.isLoading = false;
           this.total = res.data[0].length ? res.data[0][0].num : 0;
           this.fileArray = res.data[0];
           if (
-            res.data[0].length == 0 &&
-            this.check1 == "" &&
-            this.check2 == ""
+            res.data[1].length == 0
           ) {
             this.folderName = "默认文件夹";
             this.folderDescription = "该文件夹为系统创设,将自动关联您所有上传的文件";

+ 1 - 2
src/components/pages/knowledge/folderFileBox.vue

@@ -313,7 +313,7 @@ export default {
           
           if (!allowedExtensions.includes(fileExtension)) {
             this.$message.error(`不支持的文件格式: ${file.name}`);
-            cfindex2++;
+            await new Promise(resolve => setTimeout(resolve, 1000)); // 延迟1秒再跳过
             continue; // 跳过不支持的文件
           }
 
@@ -330,7 +330,6 @@ export default {
 
           // 使用同步方式上传文件
           await this.uploadFile(formData, file.name, uuid);
-          cfindex2++;
 
           // 每5秒上传一次
           if (cfindex < files.length - 1) {

+ 2 - 2
src/config/config.js

@@ -12,8 +12,8 @@ const store = new Vuex.Store({
         report:"",
         api: 'https://pbl.cocorobo.cn/api/pbl/',
         // fileApi: 'http://localhost:7004/file/',
-        // fileApi: 'http://10.3.16.166:7004/file/',
-        fileApi: 'https://r2rapi.cocorobo.cn/file/',
+        fileApi: 'http://10.3.16.166:7004/file/',
+        // fileApi: 'https://r2rapi.cocorobo.cn/file/',
         socket: "https://poll.cocorobo.cn",
         // socket: "http://localhost:1473",
         // api: 'http://localhost:7003/api/pbl/',

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