请输入分支内容
@@ -127,9 +130,11 @@ export default {
this.visGraph = new VisGraph(document.getElementById('graph-panel'), configWithEvents);
},
async showPopup(node) {
+ console.log("o----------")
+ console.log(node)
this.selectedNode = node;
this.newBranchParentId = node.properties.docId;
- this.newBranchLevel = node.properties.level - 1;
+
try {
const response = await this.getFileIdByDocId({ docId: node.properties.docId });
@@ -140,6 +145,7 @@ export default {
return;
}
+ this.newBranchLevel = parseInt(node.properties.level) + 1;
this.isModalVisible = true; // 显示模态框
},
getFileIdByDocId(data) {
@@ -246,34 +252,43 @@ export default {
var nodeList = data.nodes;
var lineList = data.links;
-
- var allOne = nodeList[0].docId
- for (let a = 0; a < nodeList.length; a++) {
- const group = parseInt(nodeList[a].group, 10);
- const style = this.getNodeStyle(group);
-
- nodes.push({
- id: nodeList[a].id,
- label: nodeList[a].name,
- properties: { name: nodeList[a].name, docId: nodeList[a].docId, parent: allOne },
- ...style // 展开 style 对象以应用样式属性
- });
+ var allOne = ""
+
+ console.log(nodeList)
+ if(nodeList!=undefined){
+ allOne = nodeList[0].docId
+ for (let a = 0; a < nodeList.length; a++) {
+ const group = parseInt(nodeList[a].group, 10);
+ const style = this.getNodeStyle(group);
+
+ nodes.push({
+ id: nodeList[a].id,
+ label: nodeList[a].name,
+ properties: { name: nodeList[a].name, docId: nodeList[a].docId, parent: allOne, leve: nodeList[a].group },
+ ...style // 展开 style 对象以应用样式属性
+ });
+ }
}
+ // var allOne = nodeList[0].docId
+
- for (let b = 0; b < lineList.length; b++) {
+ if(lineList!=undefined){
+ for (let b = 0; b < lineList.length; b++) {
- var bbb = {name: lineList[b].relate}
- links.push({
- source: lineList[b].source,
- target: lineList[b].target,
- type: lineList[b].relate,
- properties: bbb,
- color: '202,202,202',
- lineWidth: 3,
- })
+ var bbb = {name: lineList[b].relate}
+ links.push({
+ source: lineList[b].source,
+ target: lineList[b].target,
+ type: lineList[b].relate,
+ properties: bbb,
+ color: '202,202,202',
+ lineWidth: 3,
+ })
+ }
}
+
this.demoData = {
"nodes": nodes,
"links": links
diff --git a/kcui/src/view/TWInfo.vue b/kcui/src/view/TWInfo.vue
new file mode 100644
index 0000000..06050d1
--- /dev/null
+++ b/kcui/src/view/TWInfo.vue
@@ -0,0 +1,288 @@
+
+
+
+
+
+
+
+
+
Hi,{{ userName }}~
+
欢迎使用课程辅助系统
+
+
+
+
+

+
+
+
+
{{ item }}
+

+
+
+
{{ item }}
+

+
+
+
+
+
+
+
+

+
+
+
+

+
{{ item }}
+
+
+
+
+
+
+
+
+

+
+
+
{{ item.id }}
+
{{ item.name }}
+
图片
+
点击查看详情
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/main/woka/Web/Controller/KcInfoController.java b/src/main/java/com/main/woka/Web/Controller/KcInfoController.java
new file mode 100644
index 0000000..453d133
--- /dev/null
+++ b/src/main/java/com/main/woka/Web/Controller/KcInfoController.java
@@ -0,0 +1,47 @@
+package com.main.woka.Web.Controller;
+
+import com.main.woka.Common.core.AjaxResult;
+import com.main.woka.Web.Dao.GraphQuery;
+import com.main.woka.Web.Dao.KcInfo;
+import com.main.woka.Web.Mapper.KcFileMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/kcDoc")
+public class KcInfoController extends BaseController {
+
+ @Autowired
+ KcFileMapper kcFileMapper;
+
+
+ @PostMapping(value = "/getDocList")
+ public AjaxResult getDocList(@RequestBody KcInfo kcInfo) {
+
+
+ int pageNum = kcInfo.getPageNum() == null ? 1 : kcInfo.getPageNum();
+ int pageSize = kcInfo.getPageSize() == null ? 10 : kcInfo.getPageSize();
+ int offset = (pageNum - 1) * pageSize;
+
+ kcInfo.setOffset(offset);
+ Long total = kcFileMapper.getKcCount(kcInfo);
+ List
list = kcFileMapper.getkcList(kcInfo);
+
+ int totalPages = (int) Math.ceil((double) total / pageSize);
+
+ AjaxResult ajax = new AjaxResult();
+ ajax.put("list",list);
+ ajax.put("total",total);
+ ajax.put("totalPages",totalPages);
+ ajax.put("pageSize",pageSize);
+
+
+
+ return AjaxResult.success(ajax);
+ }
+}
diff --git a/src/main/java/com/main/woka/Web/Controller/KcTlFileController.java b/src/main/java/com/main/woka/Web/Controller/KcTlFileController.java
index 06d1ecc..c81adb0 100644
--- a/src/main/java/com/main/woka/Web/Controller/KcTlFileController.java
+++ b/src/main/java/com/main/woka/Web/Controller/KcTlFileController.java
@@ -277,4 +277,4 @@ public class KcTlFileController extends BaseController {
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/com/main/woka/Common/util/KcInfoRelation.java b/src/main/java/com/main/woka/Web/Dao/KcInfoRelation.java
similarity index 98%
rename from src/main/java/com/main/woka/Common/util/KcInfoRelation.java
rename to src/main/java/com/main/woka/Web/Dao/KcInfoRelation.java
index d044031..40d6245 100644
--- a/src/main/java/com/main/woka/Common/util/KcInfoRelation.java
+++ b/src/main/java/com/main/woka/Web/Dao/KcInfoRelation.java
@@ -1,4 +1,4 @@
-package com.main.woka.Common.util;
+package com.main.woka.Web.Dao;
import com.main.woka.Common.core.BaseEntity;
diff --git a/src/main/java/com/main/woka/Common/util/KcSetInfo.java b/src/main/java/com/main/woka/Web/Dao/KcSetInfo.java
similarity index 97%
rename from src/main/java/com/main/woka/Common/util/KcSetInfo.java
rename to src/main/java/com/main/woka/Web/Dao/KcSetInfo.java
index ae48a25..5a447bc 100644
--- a/src/main/java/com/main/woka/Common/util/KcSetInfo.java
+++ b/src/main/java/com/main/woka/Web/Dao/KcSetInfo.java
@@ -1,4 +1,4 @@
-package com.main.woka.Common.util;
+package com.main.woka.Web.Dao;
import com.main.woka.Common.annotation.Excel;
import com.main.woka.Common.core.BaseEntity;
diff --git a/src/main/java/com/main/woka/Common/util/KcTlFile.java b/src/main/java/com/main/woka/Web/Dao/KcTlFile.java
similarity index 97%
rename from src/main/java/com/main/woka/Common/util/KcTlFile.java
rename to src/main/java/com/main/woka/Web/Dao/KcTlFile.java
index 1173609..b4b6d48 100644
--- a/src/main/java/com/main/woka/Common/util/KcTlFile.java
+++ b/src/main/java/com/main/woka/Web/Dao/KcTlFile.java
@@ -1,4 +1,4 @@
-package com.main.woka.Common.util;
+package com.main.woka.Web.Dao;
import java.io.Serializable;
import java.util.Date;
diff --git a/src/main/java/com/main/woka/Web/Mapper/KcFileMapper.java b/src/main/java/com/main/woka/Web/Mapper/KcFileMapper.java
index 0afa905..e3e10c0 100644
--- a/src/main/java/com/main/woka/Web/Mapper/KcFileMapper.java
+++ b/src/main/java/com/main/woka/Web/Mapper/KcFileMapper.java
@@ -1,8 +1,8 @@
package com.main.woka.Web.Mapper;
-import com.main.woka.Common.util.KcInfo;
-import com.main.woka.Common.util.KcInfoRelation;
-import com.main.woka.Common.util.KcTlFile;
+import com.main.woka.Web.Dao.KcInfo;
+import com.main.woka.Web.Dao.KcInfoRelation;
+import com.main.woka.Web.Dao.KcTlFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@@ -55,7 +55,7 @@ public interface KcFileMapper {
KcTlFile getFileById(@Param("id") Integer id);
List getDocByFileId(@Param("fileId")Integer fileId);
- List getDocByFileIdNew(@Param("fileId")Integer fileId,@Param("name")String name);
+ List getDocByFileIdNew(@Param("fileId")Integer fileId, @Param("name")String name);
List selectAllDocByPLeve(KcInfo kcInfo);
@@ -77,5 +77,13 @@ public interface KcFileMapper {
+ //多条件查询图文资源
+ List getkcList(KcInfo kcInfo);
+
+ //查询总条数
+ Long getKcCount(KcInfo kcInfo);
+
+
+
}
diff --git a/src/main/java/com/main/woka/Web/Mapper/KcInfoRelationMapper.java b/src/main/java/com/main/woka/Web/Mapper/KcInfoRelationMapper.java
index 9864a96..9d30884 100644
--- a/src/main/java/com/main/woka/Web/Mapper/KcInfoRelationMapper.java
+++ b/src/main/java/com/main/woka/Web/Mapper/KcInfoRelationMapper.java
@@ -1,7 +1,7 @@
package com.main.woka.Web.Mapper;
-import com.main.woka.Common.util.KcInfoRelation;
-import com.main.woka.Common.util.KcTlFile;
+import com.main.woka.Web.Dao.KcInfoRelation;
+import com.main.woka.Web.Dao.KcTlFile;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
diff --git a/src/main/java/com/main/woka/Web/Service/impl/KcTlFileServiceImpl.java b/src/main/java/com/main/woka/Web/Service/impl/KcTlFileServiceImpl.java
index 15435f3..8b98362 100644
--- a/src/main/java/com/main/woka/Web/Service/impl/KcTlFileServiceImpl.java
+++ b/src/main/java/com/main/woka/Web/Service/impl/KcTlFileServiceImpl.java
@@ -1,6 +1,9 @@
package com.main.woka.Web.Service.impl;
import com.main.woka.Common.util.*;
+import com.main.woka.Web.Dao.KcInfo;
+import com.main.woka.Web.Dao.KcInfoRelation;
+import com.main.woka.Web.Dao.KcTlFile;
import com.main.woka.Web.Mapper.KcFileMapper;
import com.main.woka.Web.Mapper.KcInfoRelationMapper;
import org.neo4j.driver.v1.StatementResult;
diff --git a/src/main/java/com/main/woka/Web/Service/impl/WordSplitter.java b/src/main/java/com/main/woka/Web/Service/impl/WordSplitter.java
index fe2c172..9f40a97 100644
--- a/src/main/java/com/main/woka/Web/Service/impl/WordSplitter.java
+++ b/src/main/java/com/main/woka/Web/Service/impl/WordSplitter.java
@@ -1,7 +1,7 @@
package com.main.woka.Web.Service.impl;
-import com.main.woka.Common.util.KcInfo;
-import com.main.woka.Common.util.KcSetInfo;
+import com.main.woka.Web.Dao.KcInfo;
+import com.main.woka.Web.Dao.KcSetInfo;
import com.main.woka.Web.Mapper.KcFileMapper;
import org.apache.poi.xwpf.usermodel.*;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR;
@@ -1004,7 +1004,7 @@ public class WordSplitter {
doc.setName(title);
doc.setLevel(Long.valueOf(level));
doc.setTwUrl(path);
- doc.setFileId(fileId);
+ doc.setFileId(Long.valueOf(String.valueOf(fileId)));
docList.add(doc);
diff --git a/src/main/resources/Mapper/KcFileMapper.xml b/src/main/resources/Mapper/KcFileMapper.xml
index 10a8a41..887cc76 100644
--- a/src/main/resources/Mapper/KcFileMapper.xml
+++ b/src/main/resources/Mapper/KcFileMapper.xml
@@ -5,7 +5,7 @@
-
+
@@ -28,7 +28,7 @@
-
+
@@ -57,7 +57,7 @@
-
+
insert into kcfz.kc_info
type,
@@ -116,7 +116,7 @@
-
+
update kc_info
name = #{name},
@@ -272,4 +272,39 @@
where id = #{id}
+
+
+
+
+
+
+
diff --git a/src/main/resources/Mapper/KcInfoRelationMapper.xml b/src/main/resources/Mapper/KcInfoRelationMapper.xml
index 6c7f9d3..1de5c89 100644
--- a/src/main/resources/Mapper/KcInfoRelationMapper.xml
+++ b/src/main/resources/Mapper/KcInfoRelationMapper.xml
@@ -5,7 +5,7 @@
-
+
@@ -16,7 +16,7 @@
-
insert into kc_relation
@@ -36,7 +36,7 @@
from kc_relation where is_graph = 0
-
+
INSERT INTO kc_tl_file (file_url, create_time,update_time, create_by, update_by,file_name)
VALUES (
@@ -57,7 +57,7 @@
select id, source_id, target_id, relation, source_name, target_name,is_graph
from kc_relation
-
\ No newline at end of file
+