Commit ae7e7706 authored by 黄奎's avatar 黄奎

页面修改

parent 2de57df0
<template> <template>
<div> <div class="page-body" style="width: calc(100% - 10px);height:calc(100vh - 50px);">
<div style="height:calc(100vh - 50px);">
<RelationGraph ref="seeksRelationGraph" :options="graphOptions" :on-node-click="onNodeClick" <RelationGraph ref="seeksRelationGraph" :options="graphOptions" :on-node-click="onNodeClick"
:on-line-click="onLineClick" /> :on-line-click="onLineClick" />
</div> </div>
</div>
</template> </template>
<script> <script>
...@@ -28,9 +26,11 @@ ...@@ -28,9 +26,11 @@
'defaultJunctionPoint': 'border', 'defaultJunctionPoint': 'border',
'defaultNodeShape': 0, 'defaultNodeShape': 0,
'defaultLineShape': 1, 'defaultLineShape': 1,
'min_per_width': 50, 'min_per_width': 10,
'max_per_width': 70, 'max_per_width': 60,
'min_per_height': 200 'min_per_height': 60,
'centerOffset_x': -180,
'centerOffset_y': -180,
}], }],
'defaultLineMarker': { 'defaultLineMarker': {
'markerWidth': 12, 'markerWidth': 12,
...@@ -59,8 +59,16 @@ ...@@ -59,8 +59,16 @@
getOrganizationChart({}).then(res => { getOrganizationChart({}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.DeptList = res.Data; this.DeptList = res.Data;
this.$refs.seeksRelationGraph.setJsonData(this.DeptList, (seeksRGGraph) => { if (this.DeptList && this.DeptList.nodes && this.DeptList.nodes.length > 0) {
}) this.DeptList.nodes.forEach(item => {
//判断是否是根节点
if (item.id == this.DeptList.rootId) {
item.width = 120;
item.height = 60;
}
});
}
this.$refs.seeksRelationGraph.setJsonData(this.DeptList, (seeksRGGraph) => {})
} }
}) })
}, },
...@@ -72,4 +80,5 @@ ...@@ -72,4 +80,5 @@
} }
} }
} }
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment