diff --git a/gyxtp/src/view/graphPageCopy.vue b/gyxtp/src/view/graphPageCopy.vue index b788be7..29e4867 100644 --- a/gyxtp/src/view/graphPageCopy.vue +++ b/gyxtp/src/view/graphPageCopy.vue @@ -531,33 +531,40 @@ export default { }, getNodeClass(name) { - console.log(name) + // console.log(name) // 确保 this.heightLight.nodes 存在且是一个数组 const nodes = this.heightLight.nodes; const nodes1 = this.heightLight.nodes1; - if (!Array.isArray(nodes) || nodes.length === 0||!Array.isArray(nodes1) || nodes1.length === 0) { + if (nodes==undefined){ return ""; } - + if (nodes.length === 0&&nodes1.length === 0) { + return ""; + } + console.log(name) // 将传入的 id 转为字符串 const targetId = String(name).trim(); + + console.log(targetId) + // 遍历 nodes 数组,检查是否有元素的 id(转字符串)与 targetId 相等 let found = nodes.some(node => { const nodeId = node.sourceAsMap.abstracts return nodeId === targetId; }); - found = nodes1.some(node => { + let found2 = nodes1.some(node => { console.log("2222222") const nodeId = node.docTitle return nodeId === targetId; }); + found = found || found2 + // 找到了返回 'nodeclass',否则返回 '' return found ? 'nodeclass' : ''; }, getLinesClass(id) { const lines = this.heightLight.links; - console.log(this.heightLight) if (lines == undefined){ return "" } @@ -1001,7 +1008,7 @@ export default { } }); }); - console.log(lineList) + // 处理连线 lineList.forEach(line => { let style="" @@ -1010,8 +1017,6 @@ export default { style=this.getLinesClass(line.DbId) num=10 } - - console.log(line) links.push({ from: line.source, to: line.target, diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyFileManageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyFileManageController.java index f43a777..653b2c7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyFileManageController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyFileManageController.java @@ -1185,8 +1185,14 @@ public class ZhyFileManageController extends BaseController { .addField("abstracts") .addField("data") .build(); - elasticSearchUtil.createIndex("nodes",mappings); - elasticSearchUtil.createIndex("links",mappings); + + try { + elasticSearchUtil.createIndex("nodes",mappings); + elasticSearchUtil.createIndex("links",mappings); + }catch (Exception e){ + + } + List esDaos=new ArrayList<>(); List esDaos1=new ArrayList<>(); for (int i=0;i bookList = new ArrayList<>(); - - List docList = zhyDocApiMapper.selectAllDoc1(); - for (int i=0;i bookList2 = new ArrayList<>(); - ZhyArticle zhyArticle = new ZhyArticle(); - List lineList = zhyArticleMapper.selectZhyArticleList(zhyArticle); - for (int i=0;i a = zhyDocRelationMapper.selectZhyRelationshipArticle(zhyDocRelation); - List ids = new ArrayList<>(); - for (int j = 0;j bookList = new ArrayList<>(); +// +// List docList = zhyDocApiMapper.selectAllDoc1(); +// for (int i=0;i bookList2 = new ArrayList<>(); +// ZhyArticle zhyArticle = new ZhyArticle(); +// List lineList = zhyArticleMapper.selectZhyArticleList(zhyArticle); +// for (int i=0;i a = zhyDocRelationMapper.selectZhyRelationshipArticle(zhyDocRelation); +// List ids = new ArrayList<>(); +// for (int j = 0;j