文档地址:https://balkangraph.com/OrgChartJS/Demos/FirstLook
效果

html:

<div id="tree" style="height: 500px;width: 100%;"></div>
<script src="__TMPL__/public/assets/js/orgchart.js"></script>
<script>window.onload = function () {OrgChart.templates.company = Object.assign({}, OrgChart.templates.ana);OrgChart.templates.company.size = [280, 90];OrgChart.templates.company.node ='<rect x="0" y="0" rx="10" ry="10" fill="#f04848"  width="280" height="90" stroke-width="1" stroke="#f04848"></rect>'OrgChart.templates.company.field_0 = '<text text-overflow="multiline" style="font-size: 16px;font-weight:600" fill="#fff" x="140" y="70" text-anchor="middle">{val}</text>';OrgChart.templates.company.img_0 ='<clipPath id="ulaImg">'+ '<circle cx="140" cy="35" r="30"></circle>'+ '</clipPath>'+ '<image preserveAspectRatio="xMidYMid slice" clip-path="url(#ulaImg)" xlink:href="{val}" x="115" y="5" width="40" height="40">'+ '</image>';OrgChart.templates.company.plus ='<rect x="0" y="0" width="18" height="18" rx="9" ry="9" fill="#fff" stroke="#ff993f" stroke-width="1"></rect>'+ '<line x1="4" y1="9" x2="14" y2="9" stroke-width="1" stroke="#ff993f"></line>'OrgChart.templates.company.minus ='<rect x="0" y="0" width="18" height="18" rx="9" ry="9" fill="#fff" stroke="#ff993f" stroke-width="1"></rect>'+ '<line x1="4" y1="9" x2="14" y2="9" stroke-width="1" stroke="#ff993f"></line>'OrgChart.templates.company.expandCollapseSize = 15;OrgChart.templates.department = Object.assign({}, OrgChart.templates.ana);OrgChart.templates.department.size = [120, 55];OrgChart.templates.department.node ='<rect x="0" y="0" rx="6" rx="6" width="120" height="55" fill="#ffa13d" stroke-width="1" stroke="#ff993f"></rect>';OrgChart.templates.department.ripple = {radius: 40,color: "#0890D3",rect: null};OrgChart.templates.department.plus ='<rect x="0" y="0" width="18" height="18" rx="9" ry="9" fill="#fff" stroke="#ff993f" stroke-width="1"></rect>'+ '<line x1="4" y1="9" x2="14" y2="9" stroke-width="1" stroke="#ff993f"></line>'OrgChart.templates.department.minus ='<rect x="0" y="0" width="18" height="18" rx="9" ry="9" fill="#fff" stroke="#ff993f" stroke-width="1"></rect>'+ '<line x1="4" y1="9" x2="14" y2="9" stroke-width="1" stroke="#ff993f"></line>'OrgChart.templates.department.expandCollapseSize = 15;OrgChart.templates.department.field_0 = '<text style="font-size: 14px;" width="50" text-overflow="multiline" fill="#fff" x="60" y="20" text-anchor="middle">{val}</text>';OrgChart.templates.staff = Object.assign({}, OrgChart.templates.ana);OrgChart.templates.staff.size = [26, 150];OrgChart.templates.staff.node ='<rect x="0" y="0" width="26" rx="5" ry="5" height="150" fill="#ff7734" stroke-width="1" stroke="#ff7734"></rect>';OrgChart.templates.staff.field_0 = '<text text-overflow="multiline" width="18" style="font-size: 14px;" fill="#fff" x="12.5" y="20" text-anchor="middle">{val}</text>';OrgChart.templates.staff.plus ='<rect x="0" y="0" width="18" height="18" rx="9" ry="9" fill="#fff" stroke="#ff993f" stroke-width="1"></rect>'+ '<line x1="4" y1="9" x2="14" y2="9" stroke-width="1" stroke="#ff993f"></line>'OrgChart.templates.staff.minus ='<rect x="0" y="0" width="18" height="18" rx="9" ry="9" fill="#fff" stroke="#ff993f" stroke-width="1"></rect>'+ '<line x1="4" y1="9" x2="14" y2="9" stroke-width="1" stroke="#ff993f"></line>'OrgChart.templates.staff.expandCollapseSize = 15;var chart = new OrgChart(document.getElementById("tree"), {nodeMouseClick: OrgChart.action.none,nodeBinding: {field_0: "name",img_0: 'img'},//列表格式layout: OrgChart.treeRightOffset,//自定义节点样式tags: {"Company": {template: "company"},"Department": {template: "department"},"Staff": {template: "staff"}},nodes: {$arr}});chart.on('click', function (sender, args) {if (args.node.tags == 'Company') {window.location.href = "{:url('home/organization/branch')}?orgid=" + args.node.id + "&type=" + args.node.tags;}if (args.node.tags == 'Department') {window.location.href = "{:url('home/organization/branch')}?orgid=" + args.node.id;}if (args.node.tags == 'Staff') {window.location.href = "{:url('home/organization/group')}?orgid=" + args.node.pid + "&groupid=" + args.node.id;}});};
</script>

orgChart的应用相关推荐

  1. OrgChart 组织架构与PHP结合使用

    一.OrgChart下载地址: https://github.com/dabeng/OrgChart 二.组织架构的表设计 CREATE TABLE `org_info` ( `id` int(11) ...

  2. orgchart php,最需要的时候遇见你OrgChart

    聊聊OrgChart 使用,优雅的方式为你展现舒服的组织架构图, 前言 闲来无事写一个多级用户关系层,于是就存在展示的问题.这时OrgChart就派上了用场. 在用的过程中,有一耐耐的小问题,咔咔就借 ...

  3. OrgChart组织架构图控件

    利用OrgChart组织架构图控件 欢迎加入公众号进行互动:

  4. orgchart实现组织结构图

    之前项目需要我搞一个组织架构图,用大约一周时间挑选了框架并开发,最后用orgchart搞出来了,先上结果图 orgchart下载地址 :https://github.com/dabeng/OrgCha ...

  5. jquery组织结构图插件 (基于jit-yc 做可拖动、自适应伸缩的orgchart)

    一个基于jquery jit-yc插件实现的orgchart结构图demo 首先 后台处理转入JSON数据是必须的, var json = {"id": 1,"name& ...

  6. vue拓扑图、组织结构图插件使用(orgChart.js)

    今天使用orgChart没有找到合适的,所以今天来写篇使用文档. OrgChart.js是什么? 基于ES6的组织结构图插件. 特征 支持本地数据和远程数据(JSON). 基于CSS3过渡的平滑扩展/ ...

  7. orgchart组织机构图

    官网地址:https://github.com/dabeng/OrgChart <html> <head><link href="jquery.orgchart ...

  8. JQuery OrgChart

    Query OrgChart 是一个jQuery插件能够让帮你将一组嵌套的元素渲染成一个易于阅读的树形结构.易于使用. 你可以一个特定的树节来展示和隐藏一个树分支.可以采用CSS进行风格修改.还可以拖 ...

  9. 使用jquery.orgchart实现栏目树的配置与展示

    1.首先引入需要的js和css文件,必需的为:jquery-1.8.3.min.js,jquery.orgchart.js 2.在html树中,定义id值为chart-container的节点 < ...

  10. react中使用orgchart组织结构插件

    一.使用前的准备 $ npm install jquery $ npm install expose-loader $ npm install orgchart $ npm install font- ...

最新文章

  1. 【数据结构】关键路径
  2. 10行 python 代码做出哪些酷炫的事情?
  3. 网站添加自己公司的地图(使用的百度地图)时只显示一个空白框
  4. wkhtmltopdf:wkhtmltopdf(将html转换成pdf的利器)简介、安装、使用方法详细攻略
  5. java new java.text.SimpleDateFormat(yyyyMM01).format(date)
  6. 网络中的七层协议与TCP/IP五层模型
  7. 第三次学JAVA再学不好就吃翔(part16)--方法及方法重载
  8. Angular Lazy load(延迟加载,惰性加载) 机制和 feature module 的学习笔记
  9. LPC1768的SPI通讯
  10. python编码示例_python urllib中的编码处理示例
  11. git学习入门~~~
  12. mysql-8.0.16-winx64.zip安装教程
  13. matlab在机械中的应用,MATLAB在机械工程控制基础中的应用
  14. 苹果关掉200m限制_苹果下载超过200兆怎么设置
  15. 风影ASP.NET基础教学 13 NET3.0特性补充
  16. 通过PS把月亮装进灯泡里打造创意灯泡月亮
  17. .NET CORE 下收发邮件之 MAILKIT
  18. 腾讯QQ大数据:BI方法论-数据体系建设之路
  19. 2.STM32F4/7点灯
  20. HbuilderX恢复文件的方式

热门文章

  1. ambari发现正常磁盘未挂载(Datanode服务已启动)
  2. 基于html5的智慧校园选课系统的设计与实现
  3. 获取网页字体图标转成图片
  4. mysql索引是什么 优点和缺点_MySQL索引优缺点、使用原则及种类介绍
  5. 还记得那个恐怖的机器人视频吗?工信部发布机器人行业规范
  6. c语言基本的数据类型输入,C语言基本数据类型输入输出格式
  7. 双十一1682亿背后的真相曝光
  8. 微信小程序防抖处理 高频访问
  9. 使用EasyExcel实现无模板、全动态excel导出
  10. 迷宫问题(简单模拟)