diff --git a/gyxtp/src/api/api/graph.js b/gyxtp/src/api/api/graph.js index 2f7ba8f..c1c1ad9 100644 --- a/gyxtp/src/api/api/graph.js +++ b/gyxtp/src/api/api/graph.js @@ -80,4 +80,25 @@ export const getKeyWorlds = () => { url: '/api/test/getKeyWorlds', method: 'get', }); -}; \ No newline at end of file +}; + +export const getDocInfoBylinkIds = (param) => { + return request({ + url: '/api/test/getDocInfoBylinkIds/'+param, + method: 'get', + }); +}; + +export const getPointInfoByUUID = (param) => { + return request({ + url: '/api/test/getPointInfoByUUID/'+param, + method: 'get', + }); +}; + +export const getReInfoByNameAndType = (name,type) => { + return request({ + url: '/api/test/getReInfoByNameAndType/'+name+"/"+type, + method: 'get', + }); +}; diff --git a/gyxtp/src/router/router.js b/gyxtp/src/router/router.js index 9a0b2fe..5ce14f6 100644 --- a/gyxtp/src/router/router.js +++ b/gyxtp/src/router/router.js @@ -99,6 +99,15 @@ const routes = [ // component: () => import ("../views/graphPageNoJson.vue") }, { + path: '/pointInfo/:id', + name: 'pointInfo', + meta: { + title: '详情界面', + }, + component: () => import('../view/pointInfo.vue'), + // component: () => import ("../views/graphPageNoJson.vue") + }, + { path: '/articleInfo', name: 'articleInfo', meta: { diff --git a/gyxtp/src/view/pointInfo.vue b/gyxtp/src/view/pointInfo.vue new file mode 100644 index 0000000..f33d832 --- /dev/null +++ b/gyxtp/src/view/pointInfo.vue @@ -0,0 +1,1053 @@ + + + + + + + diff --git a/gyxtp/src/view/small.vue b/gyxtp/src/view/small.vue index ae03e32..08b72de 100644 --- a/gyxtp/src/view/small.vue +++ b/gyxtp/src/view/small.vue @@ -2,41 +2,22 @@
-
- -
-
- -
+ :leftNum="3" :zhedie="zhedie">
-
-
-
关键字:
- -
- 查询 -
-
- +
+ + + + + + + +
- - - - - - - - - -
-
-
关键字:
- - - -
-
- - - - - - - - - - - - - -
-
- 图谱快速定位 -
- - - -
- -
- - -
- - -
- - - -
- -
- -
+ :append-to-body="true" style="position: fixed;right: 0;background-color: rgba(76, 100, 233, 0.71);top: 5.35vw;height: 91%;color: #fff"> - + + +
@@ -236,7 +120,7 @@ import { demoData } from '@/assets/demo2.js' import HeaderInfo from "@/components/UseAll/headerInfo.vue"; import leftInfo from "@/components/UseAll/leftInfo.vue"; import { getAllTitle, getDocInfo } from "@/api/api/doc"; -import {getDomainGraphTest, getKeyWorlds, getpoinAll, getpoinByName} from "@/api/api/graph"; +import {getDocInfoBylinkIds, getDomainGraphTest, getKeyWorlds, getpoinAll, getpoinByName} from "@/api/api/graph"; import { Picture } from "@element-plus/icons-vue"; import { selectAticleByRelation } from '@/api/api/article' @@ -364,7 +248,25 @@ export default { nodes: [], links: [] }, - data1: [], + data1: [ + { + docTitle: '模型', + level:1, + level2: [ + {docTitle: '演化博弈推演决策模型'}, + {docTitle: '模糊综合评价方法'}, + {docTitle: '数据包络评估方法'}, + {docTitle: '湿热指数计算方法'} + ] + }, + { + docTitle: '装备', + level:1, + level2: [ + {docTitle: ''} + ] + } + ], defaultProps: { children: 'level2', label: 'docTitle', @@ -417,100 +319,11 @@ export default { handleNodeClick(node) { console.log(node); }, - loadPng() { - this.visGraph.saveImage(); - }, - // 获取所有的知识节点信息 - async drawGraphData() { - this.graphData = this.demoData; - if (this.visGraph === null) { - this.createGraph(); - this.visGraph.drawData(this.graphData); - this.visGraph.incremaNodesCodinate(this.graphData.nodes); - this.reLayout(); - } else { - this.createGraph(); - this.visGraph.drawData(this.graphData); - this.visGraph.incremaNodesCodinate(this.graphData.nodes); - this.reLayout(); - } - this.loading = false; - }, - // 创建全局绘图客户端对象 - createGraph() { - this.visGraph = new VisGraph(document.getElementById('graph-panel'), this.config) - }, - async goCenter(node) { - try { - const docId = node.id.toString(); - const graph = this.$refs.graphRef?.getInstance(); - - if (!graph) return; - - graph.getNodes().forEach(n => { - n.selected = false; - }); - - const targetNode = graph.getNodes().find(n => - n.data?.docId === docId || n.id === docId - ); - await graph.focusNodeById(targetNode.id); - this.$nextTick(() => { - this.$refs.tree?.setCurrentKey(node.id); - }); - } catch (error) { - console.error('定位失败:', error); - } - }, - - // 执行布局算法 - reLayout(alpha) { - var that = this; - if (alpha == null) { - that.visLayout = null; - that.visLayout = new LayoutFactory(this.visGraph.getGraphData()).createLayout('fastFR'); - that.visLayout.resetConfig({ - label: { - show: true - }, - friction: 0.8, - linkDistance: 400, - linkStrength: 0.2, - charge: -1000, - gravity: 0.01, - noverlap: true, - size: [that.visGraph.stage.width, that.visGraph.stage.height] - }); - } else { - that.visLayout.alpha += (alpha > 1 ? 0.2 : alpha); //继续运动 - } - - runLayout();//开始继续动画执行 - - //通过动画帧控制控制布局算法的执行,有动画效果 - function runLayout() { - cancelAnimationFrame(that.layoutLoopName);//停止动画控制 - that.visLayout.runLayout(); //运行布局算法 - that.visGraph.refresh(); - if (that.visLayout.alpha > 0.05) { - that.layoutLoopName = requestAnimationFrame(runLayout); - } else { - if (that.visGraph.currentNode && that.visGraph.currentNode.isDragging) { - that.visLayout.alpha = 0.1; //继续运动 - that.layoutLoopName = requestAnimationFrame(runLayout); - } else { - that.visLayout.alpha = 0; //停止运动 - cancelAnimationFrame(that.layoutLoopName); - } - } - } - - }, - - getAll() { - getAllTitle().then((res) => { - this.data1 = res; - }) + goCenter(node) { + if (node.level == 1) + return + this.getpoinName = node.docTitle + this.getPointData() }, opending() { if (this.isDing == true) { @@ -518,108 +331,22 @@ export default { } else { this.isDing = !this.isDing; } - }, isZhe(zhedie) { this.zhedie = zhedie; }, - getInfoInit() { - if (localStorage.getItem("userName") != null && localStorage.getItem("userName") != "") { - this.userNameInfo = localStorage.getItem("userName"); - } else { - this.$router.push('/'); - } - }, - logout() { - const expirationDate = new Date(); - expirationDate.setDate(expirationDate.getDate() - 1); - document.cookie = 'satoken=; expires=${expirationDate.toUTCString()}'; - localStorage.clear(); - this.$router.push('/'); - }, - goChat() { - this.$router.push('/intelligentQA'); - }, - goIndex() { - this.$router.push('/'); - }, - goZc() { - this.$router.push('/battlefield'); - }, - golist() { - this.$router.push('/list'); - }, - goBack() { - this.$router.go(-1) - }, - getInfo() { - if (this.keywords) { - let params = { nodename: this.keywords }; - getDomainGraphTest(params).then((res) => { - - this.zhengl(res.data); - }) - } else { - getDomainGraphTest({}).then((res) => { - this.zhengl(res.data); - console.log(res) - console.log(this.graphData.nodes) - console.log(this.graphData.links) - }) - } - }, - getInfo2() { - // 1. 清空当前数据 - this.data = undefined; - - // 2. 准备查询参数(有关键词时用关键词查询,否则查询全部) - const params = this.keywords ? { nodename: this.keywords } : {}; - - // 3. 调用API获取数据 - getDomainGraphTest(params) - .then((res) => { - // 4. 处理并渲染新数据 - this.zhengl(res.data); - }) - .catch((error) => { - console.error("数据加载失败:", error); - // 可以在这里添加错误处理,比如显示提示信息 - }); - }, - - // }, - async onLineClick(lineObject, linkObject, event) { - console.log(linkObject.data) - console.log(linkObject.relations[0].data) - }, - //整理图谱数据 - zhengl(data) { - const nodes = [] - const links = [] - const nodeList = data.nodes; - const lineList = data.links; - - this.graphData = { nodes, links }; + onLineClick(lineObject, linkObject, event) { + getDocInfoBylinkIds(linkObject.relations[0].data.uuids).then((res)=>{ + this.drawer = true + this.tableData = res + }) }, onNodeClick(nodeObject, $event) { - console.log(nodeObject) - const data = { - 'id': nodeObject.data.docId, - 'docTitle': nodeObject.text, - } - getDocInfo(data).then((res) => { - localStorage.setItem("docUrl", res.data.docUrl) - this.$router.push({ - name: 'docInfo', - query: { - title: res.data.docTitle, - level: res.data.docLevel, - keyword: res.data.docTitle, - docId: res.data.id - } - }) - }); + this.$router.push({ + name: 'pointInfo', // 对应路由中定义的 name + params: { id: nodeObject.id } + }) }, getColor(type){ let res = "rgb(227,203,0)" @@ -634,118 +361,46 @@ export default { } return res }, - }, - created() { - var that = this; - - //节点的点击事件 - this.config.node.onClick = function (event, node) { - - var data = { - 'id': node.properties.docId, - 'docTitle': node.properties.name, - } - getDocInfo(data).then((res) => { - localStorage.setItem("docUrl", res.data.docUrl) - that.$router.push({ - name: 'docInfo', - query: { - title: res.data.docTitle, - level: res.data.docLevel, - keyword: res.data.docTitle, - docId: res.data.id + getPointData(){ + getpoinByName(this.getpoinName).then((res) => { + let nodes = [] + let links = [] + for (let i = 0;i{ - console.log(res) - }) - - getpoinByName(this.getpoinName).then((res) => { - let nodes = [] - let links = [] - for (let i = 0;i { - // for (let i = 0;i diff --git a/ruoyi-api/src/main/java/com/ruoyi/api/controller/TestXiaoTuPuController.java b/ruoyi-api/src/main/java/com/ruoyi/api/controller/TestXiaoTuPuController.java index cf10a57..bf3da60 100644 --- a/ruoyi-api/src/main/java/com/ruoyi/api/controller/TestXiaoTuPuController.java +++ b/ruoyi-api/src/main/java/com/ruoyi/api/controller/TestXiaoTuPuController.java @@ -163,6 +163,41 @@ public class TestXiaoTuPuController extends BaseController { List a = zhyPointMapper.selectPointResByNeo4jId(id); return a; } + @GetMapping("getReInfoByNameAndType/{name}/{type}") + public List selectPointRelationshipByName(@PathVariable("name")String name,@PathVariable("type")String type) throws IOException { + String author = ""; + String keyword = ""; + String agency = ""; + String title = ""; + if (type.equals("author")){ + author = name; + } + if (type.equals("keyword")){ + keyword = name; + } + if (type.equals("agency")){ + agency = name; + } + if (type.equals("title")){ + title = name; + } + + List a = zhyPointMapper.selectPointRelationshipByName(author,keyword,agency,title); + return a; + } + + + @GetMapping("getDocInfoBylinkIds/{LinkIds}") + public List getTitlebyReId(@PathVariable("LinkIds")List LinkIds) throws IOException { + List a = zhyPointMapper.selectPointRelationshipByRids(LinkIds); + return a; + } + @GetMapping("getPointInfoByUUID/{id}") + public List selectPointByUUID(@PathVariable("id")Integer id) { + List a = zhyPointMapper.selectPointByUUID(id); + return a; + } + diff --git a/ruoyi-api/src/main/java/com/ruoyi/api/mapper/ZhyPointMapper.java b/ruoyi-api/src/main/java/com/ruoyi/api/mapper/ZhyPointMapper.java index 991849d..a6f87bd 100644 --- a/ruoyi-api/src/main/java/com/ruoyi/api/mapper/ZhyPointMapper.java +++ b/ruoyi-api/src/main/java/com/ruoyi/api/mapper/ZhyPointMapper.java @@ -8,10 +8,15 @@ import java.util.Map; @Mapper public interface ZhyPointMapper { List selectPointByName(@Param("name") String name); + + List selectPointByUUID(@Param("uuid") Integer uuid); + + + List selectPointResByNeo4jId(@Param("neo4jId") Integer neo4jId); List selectPointByType1(@Param("type1") String type1); - + List selectPointRelationshipByRids(@Param("ids") List ids); List selectPointRelationshipByName(@Param("author") String author,@Param("keyword") String keyword,@Param("agency") String agency,@Param("title") String title); int insertPoint(@Param("name") String name,@Param("uuid") Integer uuid,@Param("type1") String type1); int insertPointReship(@Param("author") String author,@Param("keyword") String keyword,@Param("agency") String agency,@Param("relationship_id") Integer relationship_id,@Param("title") String title,@Param("url") String url); diff --git a/ruoyi-api/src/main/resources/mapper/api/ZhyPointMapper.xml b/ruoyi-api/src/main/resources/mapper/api/ZhyPointMapper.xml index 844a5fb..0e17c68 100644 --- a/ruoyi-api/src/main/resources/mapper/api/ZhyPointMapper.xml +++ b/ruoyi-api/src/main/resources/mapper/api/ZhyPointMapper.xml @@ -8,6 +8,9 @@ + select * from zhy_point_relationship where relationship_id=#{neo4jId} + +