From 68e6c50defd99a8014d6e20281f1d206c6363c63 Mon Sep 17 00:00:00 2001 From: "20932067@zju.edu.cn" Date: Tue, 11 May 2021 11:57:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0er-=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/system/top/demo-topology.vue | 18 ++ .../packages/topology/src/node/er-table.js | 21 +++ packages/topology.vue | 176 ++++++++++++++++++ 3 files changed, 215 insertions(+) create mode 100644 hchyun-ui/src/views/system/top/packages/topology/src/node/er-table.js create mode 100644 packages/topology.vue diff --git a/hchyun-ui/src/views/system/top/demo-topology.vue b/hchyun-ui/src/views/system/top/demo-topology.vue index 6aacb23..5dc1759 100644 --- a/hchyun-ui/src/views/system/top/demo-topology.vue +++ b/hchyun-ui/src/views/system/top/demo-topology.vue @@ -27,6 +27,24 @@ export default { return { graphData: { nodes: [ + // { + // id: "job", + // label: "Job", + // type:'base', + // attrs: [{ + // key: "id", + // type: "number(3)" + // }, + // { + // key: "title", + // type: "varchar(255)" + // }, + // { + // key: "level", + // type: "number(3)" + // } + // ] + // }, { id: 'client-01', x: -95, diff --git a/hchyun-ui/src/views/system/top/packages/topology/src/node/er-table.js b/hchyun-ui/src/views/system/top/packages/topology/src/node/er-table.js new file mode 100644 index 0000000..eb7feb1 --- /dev/null +++ b/hchyun-ui/src/views/system/top/packages/topology/src/node/er-table.js @@ -0,0 +1,21 @@ +/** + * @author: clay + * @data: 2021/5/10 + * @description: 节点基础方法 + */ + +import utils from '../utils' + +export default { + setState(name, value, item) { + // 设置节点状态 + utils.node.setState(name, value, item) + // 设置锚点状态 + utils.anchor.setState(name, value, item) + }, + // 绘制后附加锚点 + afterDraw(cfg, group) { + // 绘制锚点 + utils.anchor.draw(cfg, group) + } +} diff --git a/packages/topology.vue b/packages/topology.vue new file mode 100644 index 0000000..0f66c1b --- /dev/null +++ b/packages/topology.vue @@ -0,0 +1,176 @@ + + + + + + +