vue 集成jTopo 处理方法
2019-10-27 18:05
2903 查看
jTopo 帮助说明网站
http://www.jtopo.com/index.html
使用例子:
http://www.jtopo.com/demo/helloworld.html
不建议直接安装 github 上的代码,因为代码版本不是最新,有部分功能未实现。
下载最新的js类库文件放到 vue 项目 public 文件夹下。
引入 import "/jtopo/jtopo-0.4.8-min.js";
<template> <div> <PanelBase title="拓扑图"> <div slot="head-btns" class="panel-head-btns"></div> <div slot="body-content"> <section class="table-section"> <canvas width="2000" height="600" id="canvas"></canvas> </section> </div> </PanelBase> </div> </template> let canvas = document.getElementById("canvas"); that.stage = new JTopo.Stage(canvas); that.scene = new JTopo.Scene(that.stage); that.scene.background = "/jtopo/aa.png"; let s1 = that.node("a1", 305, 43, "server.png"); s1.alarm = "2 W"; let s2 = that.node("a2", 365, 43, "server.png"); let s3 = that.node("a3", 425, 43, "server.png"); let g1 = that.node("a4", 366, 125, "gather.png"); that.linkNode(s1, g1, true); that.linkNode(s2, g1, true); that.linkNode(s3, g1, true); let w1 = that.node("a5", 324, 167, "wanjet.png"); that.linkNode(g1, w1); let c1 = that.node("a6", 364, 214, "center.png"); that.linkNode(w1, c1); let cloud = that.node("a7", 344, 259, "cloud.png"); that.linkNode(c1, cloud); let c2 = that.node("a8", 364, 328, "center.png"); that.linkNode(cloud, c2); let w2 = that.node("a9", 324, 377, "wanjet.png"); that.linkNode(c2, w2); linkNode(nodeA: number, nodeZ: number, f: boolean) { /**连线*/ let link; if (f) { link = new JTopo.FoldLink(nodeA, nodeZ); } else { link = new JTopo.Link(nodeA, nodeZ); } link.direction = "vertical"; this.scene.add(link); return link; }, hostLink(nodeA: any, nodeZ: any, name: string) { let link1 = new JTopo.FlexionalLink(nodeA, nodeZ, name); //var link = new JTopo.FlexionalLink(nodeA, nodeZ, text); //var link = new JTopo.FlexionalLink(nodeA, nodeZ, text);// 二次折线 link1.shadow = false; link1.offsetGap = 44; this.scene.add(link1); return link1; }
总结
以上所述是小编给大家介绍的vue 集成jTopo 处理方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!
相关文章推荐
- 关于小程序&VUE上传文件的java处理方法
- vue-cli3配置与跨域处理方法
- vue的token刷新处理的方法
- Vue在列表中绑定点击事件后的处理方法
- Windows下LAMP集成环境AppServ虚拟目录配置方法及错误处理
- Vue下的国际化处理方法
- 用Vue中遇到的问题和处理方法
- 用Vue中遇到的问题和处理方法
- 集成百度地图的时候的常见错误及其处理方法
- windows系统中端口被占用时的处理方法(Vue项目为例)
- vue打包后显示空白正确处理方法
- vue 集成 vis-network 实现网络拓扑图的方法
- 集成vue到jquery/bootstrap项目的方法
- 关于vue单文件中引用路径的处理方法
- vue中使用axios处理post方法导出excel表格(后端返回文件流)
- 实例分析vue循环列表动态数据的处理方法
- vue多页面开发和打包正确处理方法
- Vue 拦截器对token过期处理方法
- vue-cli与webpack处理静态资源的方法及webpack打包的坑
- Vue 按键修饰符处理事件的方法