Browse Source

初始化界面

wzx
zhangxiaomeng 1 year ago
parent
commit
3bff53abcb
  1. 2
      kcui/src/assets/js/graphvis.min.20241008.js
  2. 14
      kcui/src/router/router.js
  3. 24
      kcui/src/view/Home.vue
  4. 1
      kcui/src/view/TWInfo.vue

2
kcui/src/assets/js/graphvis.min.20241008.js

@ -2622,7 +2622,7 @@
} }
} }
else { else {
console.log(this.radius)
return ( return (
(x - this.cx) * (x - this.cx) + (y - this.cy) * (y - this.cy) < (x - this.cx) * (x - this.cx) + (y - this.cy) * (y - this.cy) <
this.radius * this.scaleX * this.radius * this.scaleX this.radius * this.scaleX * this.radius * this.scaleX

14
kcui/src/router/router.js

@ -1,7 +1,7 @@
//1.导入vue 和 vuerouter 的包 //1.导入vue 和 vuerouter 的包
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
// import Home from '@/view/Home.vue' import Home from '@/view/Home.vue'
import Book from '@/view/Book.vue' import Book from '@/view/Book.vue'
import TwInfo from '@/view/TWInfo.vue' import TwInfo from '@/view/TWInfo.vue'
@ -12,18 +12,18 @@ Vue.use(VueRouter)
export default new VueRouter({ export default new VueRouter({
routes: [ //配置路由,这里是个数组 routes: [ //配置路由,这里是个数组
// { //每一个链接都是一个对象 { //每一个链接都是一个对象
// path: '/', //链接路径 path: '/', //链接路径
// name: 'Home', //路由名称, name: 'Home', //路由名称,
// component: Home //对应的组件模板 component: Home //对应的组件模板
// }, },
{ //每一个链接都是一个对象 { //每一个链接都是一个对象
path: '/Book', //链接路径 path: '/Book', //链接路径
name: 'Book', //路由名称, name: 'Book', //路由名称,
component: Book //对应的组件模板 component: Book //对应的组件模板
}, },
{ //每一个链接都是一个对象 { //每一个链接都是一个对象
path: '/', //链接路径 path: '/TwInfo', //链接路径
name: 'TwInfo', //路由名称, name: 'TwInfo', //路由名称,
component: TwInfo //对应的组件模板 component: TwInfo //对应的组件模板
}, },

24
kcui/src/view/Home.vue

@ -3,14 +3,17 @@
<div style="width: 100%;height: 4vw;background-color: #42b983;"> <div style="width: 100%;height: 4vw;background-color: #42b983;">
<div style="background-color: silver;width: 3vw;height: 2vw;line-height: 2vw;text-align: center;" @click="goBook">跳转1</div> <div style="background-color: silver;width: 3vw;height: 2vw;line-height: 2vw;text-align: center;" @click="goBook">跳转1</div>
</div> </div>
<div style="width: 100%;height: 100%;"> <div style="width: 100%;height: 80%;">
<div class="gContainer"> <div class="gContainer">
<div id="graph-panel" style="width: 100%;height: 100%;"></div> <div id="graph-panel" style="width: 100%;height: 100%;"></div>
</div> </div>
</div> </div>
<!-- 弹窗 --> <!-- 弹窗 -->
<div v-if="isModalVisible" class="modal-overlay" @click.self="closeModal"> <div v-if="isModalVisible" style="height: 5vw;width: 100%;" class="modal-overlay" @click.self="closeModal">
<div class="modal-content"> <div class="modal-content">
<h3>请输入分支内容</h3> <h3>请输入分支内容</h3>
<label for="fileId">fileId:</label> <label for="fileId">fileId:</label>
@ -120,9 +123,11 @@ export default {
this.visGraph = new VisGraph(document.getElementById('graph-panel'), configWithEvents); this.visGraph = new VisGraph(document.getElementById('graph-panel'), configWithEvents);
}, },
showPopup(node) { showPopup(node) {
console.log("o----------")
console.log(node)
this.selectedNode = node; this.selectedNode = node;
this.newBranchParentId = node.properties.docId; this.newBranchParentId = node.properties.docId;
this.newBranchLevel = node.properties.level - 1; this.newBranchLevel = parseInt(node.properties.level) + 1;
this.isModalVisible = true; // this.isModalVisible = true; //
}, },
closeModal() { closeModal() {
@ -226,8 +231,11 @@ export default {
var nodeList = data.nodes; var nodeList = data.nodes;
var lineList = data.links; var lineList = data.links;
var allOne = ""
var allOne = nodeList[0].docId console.log(nodeList)
if(nodeList!=undefined){
allOne = nodeList[0].docId
for (let a = 0; a < nodeList.length; a++) { for (let a = 0; a < nodeList.length; a++) {
const group = parseInt(nodeList[a].group, 10); const group = parseInt(nodeList[a].group, 10);
const style = this.getNodeStyle(group); const style = this.getNodeStyle(group);
@ -235,12 +243,16 @@ export default {
nodes.push({ nodes.push({
id: nodeList[a].id, id: nodeList[a].id,
label: nodeList[a].name, label: nodeList[a].name,
properties: { name: nodeList[a].name, docId: nodeList[a].docId, parent: allOne }, properties: { name: nodeList[a].name, docId: nodeList[a].docId, parent: allOne, leve: nodeList[a].group },
...style // style ...style // style
}); });
} }
}
// var allOne = nodeList[0].docId
if(lineList!=undefined){
for (let b = 0; b < lineList.length; b++) { for (let b = 0; b < lineList.length; b++) {
var bbb = {name: lineList[b].relate} var bbb = {name: lineList[b].relate}
@ -253,6 +265,8 @@ export default {
lineWidth: 3, lineWidth: 3,
}) })
} }
}
this.demoData = { this.demoData = {
"nodes": nodes, "nodes": nodes,

1
kcui/src/view/TWInfo.vue

@ -30,7 +30,6 @@
</div> </div>
<div class="rightContent"> <div class="rightContent">
<img src="../assets/img/rightBox.png" style="height: 96%;width: 100%;margin-top: 2%;position: absolute;z-index: 1;"> <img src="../assets/img/rightBox.png" style="height: 96%;width: 100%;margin-top: 2%;position: absolute;z-index: 1;">
<div class="rigthHeadInfo" style="position: relative;"> <div class="rigthHeadInfo" style="position: relative;">
<div style="display: flex;flex-direction: row;"> <div style="display: flex;flex-direction: row;">
<div v-for="item in typeList" :key="item" style="position: relative;"> <div v-for="item in typeList" :key="item" style="position: relative;">

Loading…
Cancel
Save