Browse Source

初始化项目

张启 4 years ago
parent
commit
a805bcb951
100 changed files with 13790 additions and 0 deletions
  1. 29 0
      404.html
  2. 11 0
      css/animate.min.css
  3. 127 0
      css/common.css
  4. 127 0
      css/font_eolqem241z66flxr.css
  5. 21 0
      css/images.css
  6. 82 0
      css/inputTags.css
  7. 142 0
      css/main.css
  8. 15 0
      css/message.css
  9. 8 0
      css/news.css
  10. 38 0
      css/systemTree.css
  11. 28 0
      css/user.css
  12. 4 0
      iconfont/iconfont.css
  13. BIN
      iconfont/iconfont.eot
  14. 0 0
      iconfont/iconfont.js
  15. 31 0
      iconfont/iconfont.svg
  16. BIN
      iconfont/iconfont.ttf
  17. BIN
      iconfont/iconfont.woff
  18. BIN
      images/face.jpg
  19. BIN
      images/favicon.ico
  20. BIN
      images/favicon_ab.ico
  21. 16 0
      index.html
  22. 153 0
      js/LodopFuncs.js
  23. 215 0
      js/a.js
  24. 1 0
      js/ajaxhook.min.js
  25. 435 0
      js/config.js
  26. 411 0
      js/layui-xtree.js
  27. 170 0
      js/layuiPlugins/cascade.js
  28. 141 0
      js/layuiPlugins/cascade_bak.js
  29. 2182 0
      js/layuiPlugins/dltable.js
  30. 1216 0
      js/layuiPlugins/eleTree.js
  31. 1733 0
      js/layuiPlugins/formSelects-v4.js
  32. 79 0
      js/layuiPlugins/inputTags.css
  33. 29 0
      js/layuiPlugins/inputTags.html
  34. 128 0
      js/layuiPlugins/inputTags.js
  35. 412 0
      js/layuiPlugins/layui-xtree.js
  36. 167 0
      js/layuiPlugins/md5.js
  37. 332 0
      js/layuiPlugins/step.js
  38. 3 0
      js/layuiPlugins/treeGrid.css
  39. 23 0
      js/layuiPlugins/treeGrid.js
  40. 4028 0
      js/layuiPlugins/treeSelect.js
  41. 18 0
      js/layuiPlugins/treetable-lay/treetable.css
  42. 206 0
      js/layuiPlugins/treetable-lay/treetable.js
  43. 18 0
      js/layuiPlugins/treetable.css
  44. 204 0
      js/layuiPlugins/treetable.js
  45. 58 0
      js/leftNav.js
  46. 98 0
      js/main.js
  47. 167 0
      js/md5.js
  48. 160 0
      layui/css/eleTree.css
  49. 158 0
      layui/css/formSelects-v4.css
  50. 1 0
      layui/css/layui.css
  51. 1 0
      layui/css/layui.mobile.css
  52. 2 0
      layui/css/modules/code.css
  53. 1 0
      layui/css/modules/laydate/default/laydate.css
  54. BIN
      layui/css/modules/laydate/icon.png
  55. 1 0
      layui/css/modules/laydate/laydate.css
  56. BIN
      layui/css/modules/layer/default/icon-ext.png
  57. BIN
      layui/css/modules/layer/default/icon.png
  58. 1 0
      layui/css/modules/layer/default/layer.css
  59. BIN
      layui/css/modules/layer/default/loading-0.gif
  60. BIN
      layui/css/modules/layer/default/loading-1.gif
  61. BIN
      layui/css/modules/layer/default/loading-2.gif
  62. 134 0
      layui/css/step.css
  63. BIN
      layui/font/iconfont.eot
  64. 25 0
      layui/font/iconfont.svg
  65. BIN
      layui/font/iconfont.ttf
  66. BIN
      layui/font/iconfont.woff
  67. BIN
      layui/images/face/0.gif
  68. BIN
      layui/images/face/1.gif
  69. BIN
      layui/images/face/10.gif
  70. BIN
      layui/images/face/11.gif
  71. BIN
      layui/images/face/12.gif
  72. BIN
      layui/images/face/13.gif
  73. BIN
      layui/images/face/14.gif
  74. BIN
      layui/images/face/15.gif
  75. BIN
      layui/images/face/16.gif
  76. BIN
      layui/images/face/17.gif
  77. BIN
      layui/images/face/18.gif
  78. BIN
      layui/images/face/19.gif
  79. BIN
      layui/images/face/2.gif
  80. BIN
      layui/images/face/20.gif
  81. BIN
      layui/images/face/21.gif
  82. BIN
      layui/images/face/22.gif
  83. BIN
      layui/images/face/23.gif
  84. BIN
      layui/images/face/24.gif
  85. BIN
      layui/images/face/25.gif
  86. BIN
      layui/images/face/26.gif
  87. BIN
      layui/images/face/27.gif
  88. BIN
      layui/images/face/28.gif
  89. BIN
      layui/images/face/29.gif
  90. BIN
      layui/images/face/3.gif
  91. BIN
      layui/images/face/30.gif
  92. BIN
      layui/images/face/31.gif
  93. BIN
      layui/images/face/32.gif
  94. BIN
      layui/images/face/33.gif
  95. BIN
      layui/images/face/34.gif
  96. BIN
      layui/images/face/35.gif
  97. BIN
      layui/images/face/36.gif
  98. BIN
      layui/images/face/37.gif
  99. BIN
      layui/images/face/38.gif
  100. BIN
      layui/images/face/39.gif

+ 29 - 0
404.html

@@ -0,0 +1,29 @@
+<!doctype html>
+<html>
+
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+	<title>404</title>
+	<style>
+		body {
+			background-color: #444;
+			font-size: 14px;
+		}
+
+		h3 {
+			font-size: 60px;
+			color: #eee;
+			text-align: center;
+			padding-top: 30px;
+			font-weight: normal;
+		}
+	</style>
+</head>
+
+<body>
+	<h3>404,您请求的文件不存在!</h3>
+</body>
+
+</html>

File diff suppressed because it is too large
+ 11 - 0
css/animate.min.css


+ 127 - 0
css/common.css

@@ -0,0 +1,127 @@
+/* 公用的 */
+html {
+  color: #333;
+}
+.layui-fluid {
+  padding: 15px;
+}
+.layui-layout {
+  background-color: #fff;
+  padding: 15px;
+  border-radius: 2px;
+}
+.layui-card .layui-tab-brief .layui-tab-title li {
+  line-height: 42px;
+}
+.layui-card .layui-tab .layui-tab-content {
+  padding: 15px;
+}
+.layui-layer-btn {
+  padding: 20px 0 !important;
+  margin-bottom: 0;
+}
+.layui-layer-btn .layui-btn {
+  height: 32px;
+  line-height: 32px;
+  padding: 0 15px;
+}
+
+/* 二级tab */
+.type-tab-brief .layui-tab-title {
+  /* border: none; */
+}
+.type-tab-brief .layui-tab-title .layui-this {
+  color: #009688;
+}
+.type-tab-brief .layui-tab-title .layui-this:after {
+  /* border: none; */
+}
+.layui-card .type-tab-brief .layui-tab-content {
+  padding: 10px 0 0;
+  border: none;
+  border: 1px solid #e6e6e6;
+  border-top: none;
+}
+
+/* 搜索样式 */
+.searching {
+  display: flex;
+  align-items: center;
+}
+.searching .search-box {
+  position: relative;
+  padding-right: 5px;
+}
+.searching .search-box .layui-icon-search {
+  position: absolute;
+  left: 10px;
+  top: 7px;
+}
+.searching .search-box .search-input {
+  padding-left: 35px;
+}
+
+/* 滚动条 */
+::-webkit-scrollbar-thumb {
+  background-color: rgba(50, 50, 50, 0.6);
+}
+::-webkit-scrollbar-track {
+  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
+  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
+  background-color: #f5f5f5;
+}
+::-webkit-scrollbar {
+  width: 6px;
+  height: 6px;
+  background-color: #f5f5f5;
+}
+
+.layui-btn-more {
+  position: absolute;
+  top: 5px;
+  right: 10px;
+  padding: 0 8px;
+  border-radius: 4px;
+  background-color: #fff;
+}
+.type-list {
+  border: 1px solid #e6e6e6;
+  border-radius: 5px 0 0 5px;
+  height: calc(100vh - 100px);
+  overflow-y: auto;
+}
+.type-list li {
+  border-bottom: 1px solid #ddd;
+  height: 40px;
+  line-height: 40px;
+  padding: 0 15px;
+  cursor: pointer;
+}
+.type-list li:last-child {
+  border: none;
+}
+.type-list li.active {
+  background-color: #f2f2f2;
+}
+.type-list li.active span {
+  color: #000;
+}
+.type-list li span {
+  font-size: 15px;
+}
+.l-border {
+  border: 1px solid #e6e6e6;
+}
+.r-border {
+  border: 1px solid #e6e6e6;
+}
+.layui-top {
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+}
+
+.layui-top-header {
+  border-left: 4px solid #1e9fff;
+  padding-left: 10px;
+}

+ 127 - 0
css/font_eolqem241z66flxr.css

@@ -0,0 +1,127 @@
+@font-face {
+  font-family: 'iconfont';
+  src: url('//at.alicdn.com/t/font_eolqem241z66flxr.eot?t=1494568861820'); /* IE9*/
+  src: url('//at.alicdn.com/t/font_eolqem241z66flxr.eot?t=1494568861820#iefix')
+      format('embedded-opentype'),
+    /* IE6-IE8 */
+      url('//at.alicdn.com/t/font_eolqem241z66flxr.woff?t=1494568861820')
+      format('woff'),
+    /* chrome, firefox */
+      url('//at.alicdn.com/t/font_eolqem241z66flxr.ttf?t=1494568861820')
+      format('truetype'),
+    /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
+      url('//at.alicdn.com/t/font_eolqem241z66flxr.svg?t=1494568861820#iconfont')
+      format('svg'); /* iOS 4.1- */
+}
+
+.iconfont {
+  font-family: 'iconfont' !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+.icon-zhanghu:before {
+  content: '\e605';
+}
+
+.icon-lock1:before {
+  content: '\e622';
+}
+
+.icon-erweima:before {
+  content: '\e62d';
+}
+
+.icon-xinlangweibo:before {
+  content: '\e63d';
+}
+
+.icon-qq:before {
+  content: '\e63e';
+}
+
+.icon-icon:before {
+  content: '\e609';
+}
+
+.icon-edit:before {
+  content: '\e602';
+}
+
+.icon-computer:before {
+  content: '\e645';
+}
+
+.icon-text:before {
+  content: '\e64d';
+}
+
+.icon-loginout:before {
+  content: '\e608';
+}
+
+.icon-shuaxin1:before {
+  content: '\e648';
+}
+
+.icon-shezhi1:before {
+  content: '\e64a';
+}
+
+.icon-gonggao:before {
+  content: '\e614';
+}
+
+.icon-wenben:before {
+  content: '\e600';
+}
+
+.icon-dengji3:before {
+  content: '\e61e';
+}
+
+.icon-dengji1:before {
+  content: '\e628';
+}
+
+.icon-dengji2:before {
+  content: '\e629';
+}
+
+.icon-dengji4:before {
+  content: '\e62b';
+}
+
+.icon-dengji5:before {
+  content: '\e62c';
+}
+
+.icon-dengji6:before {
+  content: '\e62e';
+}
+
+.icon-new1:before {
+  content: '\e610';
+}
+
+.icon-link:before {
+  content: '\e657';
+}
+
+.icon-lingsheng:before {
+  content: '\e601';
+}
+
+.icon-star:before {
+  content: '\e783';
+}
+
+.icon-dongtaifensishu:before {
+  content: '\e603';
+}
+
+.icon-weather:before {
+  content: '\e89e';
+}

+ 21 - 0
css/images.css

@@ -0,0 +1,21 @@
+.layui-flow-more{ clear: both; margin-top: 20px; }
+#Images li{ width:19%; margin:0.5% 0.5%; float: left; overflow:hidden;}
+#Images li img{ width:100%; }
+#Images li .operate{ display: block; height: 40px; width:100%; background:#f4f5f9; }
+#Images li .operate .check{ float:left; margin-left:11px; height:18px; padding:11px 0; }
+#Images li .operate .img_del{ float:right; margin:7px 11px 0 0; font-size: 22px; cursor:pointer; }
+#Images li .operate .img_del:hover{ color:#f00; }
+
+/*适配*/
+@media screen and (max-width:1050px){
+	/*用户信息*/
+	#Images li{ width:24%;}
+}
+@media screen and (max-width: 750px){
+	/*用户信息*/
+	#Images li{ width:49%;}
+}
+@media screen and (max-width:432px){
+	/*用户信息*/
+	#Images li{ width:99%;}
+}

+ 82 - 0
css/inputTags.css

@@ -0,0 +1,82 @@
+/*
+* @Author: layui-2
+* @Date:   2018-08-31 11:40:53
+* @Last Modified by:   xuzhiwen
+* @Last Modified time: 2018-09-07 15:26:19
+*/
+em{
+  font-style: normal;
+}
+#tags
+{
+    width: 406px;
+    margin:10px 0;
+    padding: 9px;
+    color: #777;
+    border: 1px solid #d5d5d5;
+    background-color: #fff;
+}
+
+#tags span{
+    font-size: 12px;
+    font-weight: normal;
+    line-height: 16px;
+    position: relative;
+    display: inline-block;
+    height: 16px;
+    margin-right: 3px;
+    margin-bottom: 3px;
+    padding: 4px 22px 5px 9px;
+    cursor: pointer;
+    transition: all .2s ease 0s;
+    vertical-align: baseline;
+    white-space: nowrap;
+    color: #fff;
+    background-color: #009688;
+    text-shadow: 1px 1px 1px rgba(0, 0, 0, .15);
+}
+#tags .close{
+    font-size: 12px;
+    font-weight: bold;
+    line-height: 20px;
+    position: absolute;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    float: none;
+    width: 18px;
+    padding: 0;
+    cursor: pointer;
+    text-align: center;
+    opacity: 1;
+    color: #fff;
+    border: 0 none;
+    background: transparent none repeat scroll 0 0;
+    text-shadow: none;
+}
+#tags .close:hover{
+  background: #ffb800;
+}
+#inputTags[type='text'],
+#inputTags[type='text']:focus{
+    line-height: 25px;
+    display: inline;
+    width: 150px;
+    margin: 0;
+    padding: 0 6px;
+    border: 0 none;
+    outline: 0 none;
+    box-shadow: none;
+}
+
+.albtn{
+    line-height: 30px;
+    display: block;
+    width: 100px;
+    height: 30px;
+    margin: 0 auto;
+    cursor: pointer;
+    text-align: center;
+    color: #fff;
+    background: #ffb800;
+}

+ 142 - 0
css/main.css

@@ -0,0 +1,142 @@
+/*公共样式*/
+.main_body{ min-width:320px; }
+.layui-elem-quote.title{ padding:10px 15px; margin-bottom:0; }
+.layui-tab-more{ position: relative; z-index: 99; background:#fff; }
+.layui-layer-tab .layui-layer-title span.layui-layer-tabnow{ height:42px !important; }
+.layui-layer-tab .layui-layer-title span{ min-width:45px !important; }
+
+.layui-side-menu{background-color: #393D49;}
+.layui-side-menu .layui-nav .layui-nav-item>a, .layui-side-menu .layui-nav-tree .layui-nav-child a{padding-top: 4px; padding-bottom: 4px;}
+.layui-side-menu .layui-nav .layui-nav-item a {height: 40px;line-height: 40px;padding-left: 45px;padding-right: 30px;}
+.layui-side-menu .layui-nav .layui-nav-item .layui-icon {position: absolute; top: 50%; left: 20px; margin-top: -19px;}
+
+/*模拟加载层图标样式*/
+.layui-layer-dialog .layui-layer-content .layui-layer-ico16{ background-size:100% 100% !important; }
+
+/*样式改变的过渡*/
+.logo,.top_menu .layui-nav-item[pc],.component,.top_menu .layui-nav-item[mobile],.layui-nav,.layui-layout-admin .layui-main,.site-mobile .layui-side,.layui-layout-admin .layui-side,.site-mobile .site-tree-mobile,.layui-body,.layui-layout-admin .layui-footer,.layui-layout-admin .layui-side,.panel,.panel .panel_icon i{ transition: all 0.3s ease-in-out;-webkit-transition: all 0.3s ease-in-out;-o-transition: all 0.3s ease-in-out;-moz-transition: all 0.3s ease-in-out;-ms-transition: all 0.3s ease-in-out; }
+
+
+.logo{ color: #fff; float: left; line-height:60px; font-size:20px; padding:0 10px; text-align: center; margin-right: 15px; }
+.logo:hover{ color: #fff;}
+.weather{ color:#fff; float:left; margin:15px 0 0 50px;}
+.component{ float: left; width:200px; height:30px; margin-top: 15px; position: relative;}
+.component .layui-input{ height:30px; line-height: 30px; font-size:12px; border:none; transition: all 0.3s; }
+.component .layui-input:focus{ background:#fff; color:#000; }
+.component .layui-form-select dl{ top:33px; background:#fff; }
+.component .layui-form-select .layui-edge,.top_menu .layui-nav-item[mobile]{ display:none; }
+.component .layui-icon{ position: absolute; right:8px; top:8px; color:#000; }
+
+/*顶部右侧导航*/
+.top_menu{ position:absolute; right:0; background:none }
+.layui-tab-title li .layui-tab-close:hover{border-radius: 50%}
+.layadmin-pagetabs{box-shadow: 0 1px 2px 0 rgba(0,0,0,.05); background-color: #fff;}
+.layadmin-pagetabs .layui-tab-title{z-index: 1; }
+
+/*左侧用户头像*/
+.layui-layout-admin .layui-side{ left:0; }
+.user-photo{width: 200px; height: 120px; padding-top: 15px; padding-bottom: 5px;}
+.user-photo a.img{ display: block; width: 76px; height: 76px; margin: 0 auto; margin-bottom: 15px;}
+.user-photo a.img img{ display: block; border: none; width: 100%; height: 100%; border-radius: 50%; -webkit-border-radius: 50%; -moz-border-radius: 50%; border: 4px solid #44576b;}
+.user-photo p{ display: block; width: 100%; height: 25px; color: #ffffff; text-align: center; font-size: 12px; white-space: nowrap;line-height: 25px; overflow: hidden;}
+/*左侧导航重定义*/
+.layui-nav-item a cite{ padding:0 5px; }
+.layui-nav-tree .layui-nav-child a{ padding-left: 40px; }
+.layui-nav-tree .layui-nav-child a:hover{ background-color:#4E5465; }
+.layui-nav-tree .layui-nav-child dd.layui-this a:hover{ background-color:#009688; }
+
+/*右侧body*/
+#top_tabs_box{ padding-right:102px; height:40px;z-index: 1;}
+#top_tabs{ position: absolute; border-bottom:none;}
+/*多窗口页面操作下拉*/
+.closeBox{ position:absolute; right:0; padding: 0; background-color:#fff !important; color:#000; border-left:1px solid #e2e2e2;}
+.closeBox .layui-nav-item{ line-height:39px; }
+.closeBox .layui-nav-item a,.closeBox .layui-nav-item a:hover{ color:#666; padding: 0 12px;}
+.closeBox .layui-nav-child{ top: 40px; left: auto; right: 0;}
+.closeBox .layui-nav-bar{ display:none; }
+.closeBox .icon-caozuo{ font-size: 16px; color: #666; padding-right: 5px}
+.closeBox .layui-nav-child dd.layui-this a{background-color: #fff; color: #666;}
+
+.layui-body{overflow:hidden;}
+.layui-tab-content{ height:100%; padding:0; }
+.layui-tab-item{ position: absolute; top: 41px; bottom:0; left: 0; right: 0; padding: 0; margin: 0;-webkit-overflow-scrolling: touch;}
+.layui-body{ border-left: 2px solid #1AA094;}
+.marg0{ margin:0; }
+/* .layui-tab-title .layui-this{ border-top:#1AA094; color:#fff; } */
+.layui-tab-title .layui-this,.layui-tab-title li:hover{background-color: #f6f6f6;}
+.layui-tab-title .layui-this:after{content: ''; position: absolute; top: 0; z-index: 1; left: 0; width: 100%; height: 2px; border-radius: 0; background-color: #1AA094; transition: all .3s; -webkit-transition: all .3s; border: none;}
+.layui-tab-title li {min-width: 0; line-height: 39px; max-width: 160px; text-overflow: ellipsis; overflow: hidden; border-right: 1px solid #f6f6f6; vertical-align: top;}
+.layui-tab-title li cite{ font-style: normal; padding-left:5px; }
+.clildFrame.layui-tab-content{ padding-right: 0; }
+.clildFrame.layui-tab-content iframe{ width: 100%; height: 100%; border:none; min-width: 320px; }
+/*main.html*/
+.row,.col,.panel_word,.panel_icon{ box-sizing:border-box; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; -o-box-sizing:border-box;}
+.row{ margin-left:-10px; overflow:hidden;}
+.col{ padding-left:10px;}
+.panel{float: left; text-align: center; width:16.666%; min-width:210px; margin-bottom: 10px;}
+.panel_box a{display:block; background-color:#f2f2f2; border-radius:5px; overflow:hidden; }
+.panel_icon{ width:40%; display: inline-block; padding:22px 0; background-color:#54ade8;float:left;}
+.panel_icon i{ font-size:3em; color:#fff;}
+.panel a:hover .panel_icon i{ display:inline-block; transform:rotate(360deg); -webkit-transform:rotate(360deg); -moz-transform:rotate(360deg); -o-transform:rotate(360deg); -ms-transform:rotate(360deg);}
+.panel_word{ width:60%; display: inline-block; float:right; margin-top: 22px; }
+.panel_word span{ font-size:25px; display:block; height:30px; line-height:30px; }
+.allNews em{ font-style:normal; font-size:16px;display: block; }
+.panel_box a .allNews cite{ display:none; }
+.panel_box a cite{ font-size:16px; display: block; font-style:normal; }
+.sysNotice{ width:50%; float: left; }
+.sysNotice .layui-elem-quote{ line-height:26px; position: relative;}
+.sysNotice .layui-table{ margin-top:0; border-left:5px solid #e2e2e2; }
+.sysNotice .title .icon-new1{ position: absolute; top:8px; margin-left: 10px; color:#f00; font-size:25px; }
+
+/*锁屏*/
+.admin-header-lock{width: 320px; height: 170px; padding: 20px; position: relative; text-align: center;}
+.admin-header-lock-img{width: 60px; height: 60px; margin: 0 auto;}
+.admin-header-lock-img img{width: 60px; height: 60px; border-radius: 100%;}
+.admin-header-lock-name{color: #009688;margin: 8px 0 15px 0;}
+.input_btn{ overflow: hidden; margin-bottom: 10px; }
+.admin-header-lock-input{width: 170px; color: #fff;background-color: #009688; float: left; margin:0 10px 0 40px; border:none;}
+.admin-header-lock-input::-webkit-input-placeholder {color:#fff;}
+.admin-header-lock-input::-moz-placeholder {color:#fff;}
+.admin-header-lock-input::-ms-input-placeholder {color:#fff;}
+.admin-header-lock-input:-moz-placeholder {color:#fff;}
+#unlock{ float: left; }
+#lock-box p{ color:#e60000; }
+
+/*底部*/
+.footer{ text-align: center; font-size:12px; border-left: 2px solid #1AA094; background-color: #fff !important; box-shadow: 0 1px 2px 0 rgba(0,0,0,.1); border-top: 1px solid rgb(230, 230, 230); z-index: 1002;}
+.layui-layout-admin .layui-body{bottom: 0;}
+.layui-layout-admin .layui-footer{height: 30px; line-height: 30px}
+
+/*响应式*/
+@media screen and (max-width:1282px){
+	.panel{ width:33.3333%; }
+}
+@media screen and (max-width:1050px){
+	.layui-nav.top_menu .layui-nav-item a{ padding:0 10px; }
+	/*天气信息*/
+	.weather[pc]{ display: none !important; }
+	.sysNotice{ width:100%; }
+}
+@media screen and (max-width: 750px){
+	.logo{ padding:0;}
+	.top_menu .layui-nav-item[pc],.component,.site-mobile .site-tree-mobile{ display: none !important; }
+	.top_menu .layui-nav-item.showNotice[pc]{ display:inline-block !important; }
+	.top_menu .layui-nav-item[mobile]{ display:inline-block; }
+	.layui-nav.top_menu,.layui-nav.top_menu .layui-nav-item a{ padding:0 10px; }
+	.layui-layout-admin .layui-main{ margin-right: 0; }
+	
+	/*左侧导航*/
+	.layui-layout-admin .layui-side{ left:-260px; }
+	.site-mobile .layui-side{ left: 0; z-index:9999; }
+	.site-tree-mobile {display: block!important; position: fixed; z-index: 100000; bottom: 15px; left: 15px; width: 50px; height: 50px; line-height: 50px; border-radius: 2px; text-align: center; background-color: rgba(0,0,0,.7); color: #fff;}
+	.site-mobile .site-mobile-shade { content: ''; position: fixed; top: 0; bottom: 0; left: 0; right: 0; background-color: rgba(0,0,0,.8); z-index: 999;}
+
+	/*layui-body*/
+	.panel{ width:50%; }
+
+	.layui-body,.layui-layout-admin .layui-footer{ left:0; }
+}
+@media screen and (max-width:432px){
+	.top_menu .layui-nav-item.showNotice[pc]{ display:none !important; }
+	.panel{ width:100%; }
+}

+ 15 - 0
css/message.css

@@ -0,0 +1,15 @@
+.selectMsg{ width:110px; margin-right: 15px; }
+
+.msg_info,.msg_time,.msg_reply,.msg_opr{min-height:50px; text-align:center;}
+.msg_info{text-align:left; position: relative; }
+.msg_info>img{ position: absolute; left:10px; top:10px; cursor:pointer; }
+.msg_info .user_info{ padding-left:55px; line-height:25px; }
+.msg_info .user_info h2{ color:#222; cursor:pointer; }
+.msg_info .user_info h2:hover{ color:#1AA094;}
+.msg_info .user_info p{ color:#8d8d8d; }
+.msg_reply{ color:#e15f63; }
+.msg_opr .layui-btn{ margin:2px 5px; }
+
+/*回复*/
+.replay_edit{ overflow: hidden; margin-bottom:20px; }
+.replay_edit a{margin-top: 10px; width:100px; float:right;}

+ 8 - 0
css/news.css

@@ -0,0 +1,8 @@
+.news_search{ padding:10px 10px; }
+.news_search .layui-inline{ margin:5px 5px 5px 0; }
+.layui-table,.layui-table th{ text-align:center; }
+.news_list .layui-btn,.news_list .layui-btn+.layui-btn{ margin:2px 5px; }
+.news_list .layui-form-switch{ margin-top:0; }
+
+/*分页*/
+#page{ text-align:right; }

+ 38 - 0
css/systemTree.css

@@ -0,0 +1,38 @@
+.region, .role, .system{
+    height: calc(100vh - 122px);
+    overflow-y: auto;
+}
+.layui-card-header{
+    padding: 10px 15px;
+    border-bottom: 1px solid #e6e6e6;
+    text-align: center
+}
+.layui-card-header .layui-btn{
+    width: 150px;
+    height: 32px
+}
+.layui-card-body{
+    padding: 0 15px;
+}
+.layui-bot-ul .li-item{
+    display: flex; 
+    padding: 12px 15px;
+    border-bottom: 1px solid #e6e6e6;
+    cursor: pointer;
+    align-items: center;
+}
+.layui-bot-ul .li-item.active{ background-color: #f5f5f5}
+.layui-bot-ul .li-item:hover{ background-color: #f5f5f5}
+.layui-bot-ul .li-item:hover .bot-btn-group{display: flex;}
+.layui-bot-ul .li-item.active .li-item-left h4{color: #1E9FFF}
+.layui-bot-ul .li-item-left h4{font-size: 15px; font-weight: normal; }
+.layui-bot-ul .li-item-left p{font-size: 14px; color: #999; margin-top: 6px}
+.bot-btn-group{
+    display: flex;
+    display: none;
+}
+.bot-btn-group li{cursor: pointer}
+.bot-btn-group li i{font-size: 16px; padding: 5px 3px; color: #000;}
+.layui-bot-ul .group{margin-bottom: 15px}
+.layui-bot-ul .group .li-group-top{padding: 15px; margin-bottom: 10px; border-bottom: 1px solid #e6e6e6; display: flex; align-items: center}
+.layui-bot-ul .group .li-group-top h4{font-size: 15px; margin-top: 8px; font-weight: normal; flex: 1; color: #000}

+ 28 - 0
css/user.css

@@ -0,0 +1,28 @@
+form input.layui-input[disabled]{ background:#f2f2f2; color:#595963!important; }
+.user_left{ width:45%; float: left; margin:20px 0 0 5%; }
+.user_right{ width:25%; float: left; margin:20px 0 0 5%; text-align: center; }
+.user_right p{ margin:10px 0 25px; font-size: 12px; text-align: center; color: #FF5722;}
+.user_right img#userFace{ width:200px; height:200px; }
+.layui-table,.layui-table th{ text-align:center; }
+
+/*用户列表*/
+.news_list .layui-btn,.news_list .layui-btn+.layui-btn{ margin:2px 5px; }
+#page{ text-align:right; }
+
+
+/*适配*/
+@media screen and (max-width:1050px){
+	/*用户信息*/
+	.user_left,.user_right,.changePwd{ width:100%; float:none; margin-left: 0; }
+	.user_right{ margin-bottom: 20px; }
+}
+@media screen and (max-width: 750px){
+	/*用户信息*/
+	.user_left,.user_right,.changePwd{ width:100%; float:none; margin-left: 0; }
+	.user_right{ margin-bottom: 20px; }
+}
+@media screen and (max-width:432px){
+	/*用户信息*/
+	.user_left,.user_right,.changePwd{ width:100%; float:none; margin-left: 0; }
+	.user_right{ margin-bottom: 20px; }
+}

File diff suppressed because it is too large
+ 4 - 0
iconfont/iconfont.css


BIN
iconfont/iconfont.eot


File diff suppressed because it is too large
+ 0 - 0
iconfont/iconfont.js


File diff suppressed because it is too large
+ 31 - 0
iconfont/iconfont.svg


BIN
iconfont/iconfont.ttf


BIN
iconfont/iconfont.woff


BIN
images/face.jpg


BIN
images/favicon.ico


BIN
images/favicon_ab.ico


+ 16 - 0
index.html

@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+	<meta charset="utf-8" />
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	<title>林产品溯源管理系统</title>
+</head>
+
+<body>
+	<script type="text/javascript">
+		window.location.href = "login/index.html?ver=" + new Date().getTime();
+	</script>
+</body>
+
+</html>

+ 153 - 0
js/LodopFuncs.js

@@ -0,0 +1,153 @@
+//==本JS是加载Lodop插件及CLodop服务的综合示例,可直接使用,建议看懂后融进自己页面程序==
+
+var CreatedOKLodopObject, CLodopIsLocal, CLodopJsState;
+
+
+//==判断是否需要CLodop(那些不支持插件的浏览器):==
+function needCLodop() {
+    try {
+        var ua = navigator.userAgent;
+        if (ua.match(/Windows\sPhone/i))
+            return true;
+        if (ua.match(/iPhone|iPod|iPad/i))
+            return true;
+        if (ua.match(/Android/i))
+            return true;
+        if (ua.match(/Edge\D?\d+/i))
+            return true;
+
+        var verTrident = ua.match(/Trident\D?\d+/i);
+        var verIE = ua.match(/MSIE\D?\d+/i);
+        var verOPR = ua.match(/OPR\D?\d+/i);
+        var verFF = ua.match(/Firefox\D?\d+/i);
+        var x64 = ua.match(/x64/i);
+        if ((!verTrident) && (!verIE) && (x64))
+            return true;
+        else if (verFF) {
+            verFF = verFF[0].match(/\d+/);
+            if ((verFF[0] >= 41) || (x64))
+                return true;
+        } else if (verOPR) {
+            verOPR = verOPR[0].match(/\d+/);
+            if (verOPR[0] >= 32)
+                return true;
+        } else if ((!verTrident) && (!verIE)) {
+            var verChrome = ua.match(/Chrome\D?\d+/i);
+            if (verChrome) {
+                verChrome = verChrome[0].match(/\d+/);
+                if (verChrome[0] >= 41)
+                    return true;
+            }
+        }
+        return false;
+    } catch (err) {
+        return true;
+    }
+}
+
+//==引用CLodop的主JS,用双端口8000和18000(以防其中一个被占):==
+if (needCLodop()) {
+    var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
+    
+    var JS1 = document.createElement("script");
+    JS1.src = "http://localhost:8000/CLodopfuncs.js?priority=1";
+    head.insertBefore(JS1, head.firstChild);
+
+    var JS2 = document.createElement("script");
+    JS2.src = "http://localhost:18000/CLodopfuncs.js?priority=0";
+    head.insertBefore(JS2, head.firstChild);
+
+    CLodopIsLocal = !!((JS1.src + JS2.src).match(/\/\/localho|\/\/127.0.0./i));
+
+    if (JS1.attachEvent) {
+    	CLodopJsState = "loading";
+        var onChange = function(){ 
+	     if (window.event.srcElement.readyState == 'loaded')               
+	     CLodopJsState = "complete";
+	};
+	JS1.attachEvent('onreadystatechange',onChange);
+	JS2.attachEvent('onreadystatechange',onChange);
+    }
+}
+
+//==获取LODOP对象主过程,判断是否安装、需否升级:==
+function getLodop(oOBJECT, oEMBED) {
+    var strHtmInstall = "<br><font color='#FF00FF'>打印控件未安装!点击这里<a href='install_lodop32.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。</font>";
+    var strHtmUpdate = "<br><font color='#FF00FF'>打印控件需要升级!点击这里<a href='install_lodop32.exe' target='_self'>执行升级</a>,升级后请重新进入。</font>";
+    var strHtm64_Install = "<br><font color='#FF00FF'>打印控件未安装!点击这里<a href='install_lodop64.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。</font>";
+    var strHtm64_Update = "<br><font color='#FF00FF'>打印控件需要升级!点击这里<a href='install_lodop64.exe' target='_self'>执行升级</a>,升级后请重新进入。</font>";
+    var strHtmFireFox = "<br><br><font color='#FF00FF'>(注意:如曾安装过Lodop旧版附件npActiveXPLugin,请在【工具】->【附加组件】->【扩展】中先卸它)</font>";
+    var strHtmChrome = "<br><br><font color='#FF00FF'>(如果此前正常,仅因浏览器升级或重安装而出问题,需重新执行以上安装)</font>";
+    var strCLodopInstall_1 = "<br><font color='#FF00FF'>Web打印服务未安装启动,点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>下载执行安装</a>";
+    var strCLodopInstall_2 = "<br>(若此前已安装过,可<a href='CLodop.protocol:setup' target='_self'>点这里直接再次启动</a>)";
+    var strCLodopInstall_3 = ",成功后请刷新本页面。</font>";
+    var strCLodopUpdate = "<br><font color='#FF00FF'>Web打印服务CLodop需升级!点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>执行升级</a>,升级后请刷新页面。</font>";
+    var LODOP;
+    try {
+        var ua = navigator.userAgent;
+        var isIE = !!(ua.match(/MSIE/i)) || !!(ua.match(/Trident/i));
+        if (needCLodop()) {
+            try {
+                LODOP = getCLodop();
+            } catch (err) {}
+            if (!LODOP && (document.readyState !== "complete" || (isIE  && CLodopJsState == "loading")) ) {
+                alert("网页还没下载完毕,请稍等一下再操作.");
+                return;
+            }
+            if (!LODOP) {
+                document.body.innerHTML = strCLodopInstall_1 + (CLodopIsLocal ? strCLodopInstall_2 : "") + strCLodopInstall_3 + document.body.innerHTML;                
+                return;
+            } else {
+                if (CLODOP.CVERSION < "3.0.9.3") {
+                    document.body.innerHTML = strCLodopUpdate + document.body.innerHTML;
+                }
+                if (oEMBED && oEMBED.parentNode)
+                    oEMBED.parentNode.removeChild(oEMBED);
+                if (oOBJECT && oOBJECT.parentNode)
+                    oOBJECT.parentNode.removeChild(oOBJECT);
+            }
+        } else {
+            var is64IE = isIE && !!(ua.match(/x64/i));
+            //==如果页面有Lodop就直接使用,否则新建:==
+            if (oOBJECT || oEMBED) {
+                if (isIE)
+                    LODOP = oOBJECT;
+                else
+                    LODOP = oEMBED;
+            } else if (!CreatedOKLodopObject) {
+                LODOP = document.createElement("object");
+                LODOP.setAttribute("width", 0);
+                LODOP.setAttribute("height", 0);
+                LODOP.setAttribute("style", "position:absolute;left:0px;top:-100px;width:0px;height:0px;");
+                if (isIE)
+                    LODOP.setAttribute("classid", "clsid:2105C259-1E0C-4534-8141-A753534CB4CA");
+                else
+                    LODOP.setAttribute("type", "application/x-print-lodop");
+                document.documentElement.appendChild(LODOP);
+                CreatedOKLodopObject = LODOP;
+            } else
+                LODOP = CreatedOKLodopObject;
+            //==Lodop插件未安装时提示下载地址:==
+            if ((!LODOP) || (!LODOP.VERSION)) {
+                if (ua.indexOf('Chrome') >= 0)
+                    document.body.innerHTML = strHtmChrome + document.body.innerHTML;
+                if (ua.indexOf('Firefox') >= 0)
+                    document.body.innerHTML = strHtmFireFox + document.body.innerHTML;
+                document.body.innerHTML = (is64IE ? strHtm64_Install : strHtmInstall) + document.body.innerHTML;
+                return LODOP;
+            }
+        }
+        if (LODOP.VERSION < "6.2.2.6") {
+            if (!needCLodop())
+                document.body.innerHTML = (is64IE ? strHtm64_Update : strHtmUpdate) + document.body.innerHTML;
+        }
+        //===如下空白位置适合调用统一功能(如注册语句、语言选择等):==
+
+
+
+        //=======================================================
+        return LODOP;
+    } catch (err) {
+        alert("getLodop出错:" + err);
+    }
+}

+ 215 - 0
js/a.js

@@ -0,0 +1,215 @@
+define(['jquery', 'foxui', 'tpl'], function ($, FoxUI, tpl) {
+    window.FoxUI = FoxUI;
+    var defaults = {baseUrl: '', siteUrl: '', staticUrl: '../addons/ewei_shopv2/static/'};
+    var core = {options: {}};
+    core.init = function (options) {
+        this.options = $.extend({}, defaults, options || {})
+    };
+    core.toQueryPair = function (key, value) {
+        if (typeof value == 'undefined') {
+            return key
+        }
+        return key + '=' + encodeURIComponent(value === null ? '' : String(value))
+    };
+    core.number_format = function (number, fix) {
+        var fix = arguments[1] ? arguments[1] : 2;
+        var fh = ',';
+        var jg = 3;
+        var str = '';
+        number = number.toFixed(fix);
+        zsw = number.split('.')[0];
+        xsw = number.split('.')[1];
+        zswarr = zsw.split('');
+        for (var i = 1; i <= zswarr.length; i++) {
+            str = zswarr[zswarr.length - i] + str;
+            if (i % jg == 0) {
+                str = fh + str;
+            }
+        }
+        str = (zsw.length % jg == 0) ? str.substr(1) : str;
+        zsw = str + '.' + xsw;
+        return zsw
+    };
+    core.toQueryString = function (obj) {
+        var ret = [];
+        for (var key in obj) {
+            key = encodeURIComponent(key);
+            var values = obj[key];
+            if (values && values.constructor == Array) {
+                var queryValues = [];
+                for (var i = 0, len = values.length, value; i < len; i++) {
+                    value = values[i];
+                    queryValues.push(this.toQueryPair(key, value))
+                }
+                ret = ret.concat(queryValues)
+            } else {
+                ret.push(this.toQueryPair(key, values))
+            }
+        }
+        return ret.join('&')
+    };
+    core.getUrl = function (routes, params, full) {
+        routes = routes.replace(/\//ig, ".");
+        var url = this.options.baseUrl.replace('ROUTES', routes);
+        if (params) {
+            if (typeof(params) == 'object') {
+                url += "&" + this.toQueryString(params)
+            } else if (typeof(params) == 'string') {
+                url += "&" + params
+            }
+        }
+        return full ? this.options.siteUrl + 'app/' + url : url
+    };
+    core.json = function (routes, args, callback, hasloading, ispost) {
+        var url = ispost ? this.getUrl(routes) : this.getUrl(routes, args);
+        var op = {
+            url: url, type: ispost ? 'post' : 'get', dataType: 'json', cache: false, beforeSend: function () {
+                if (hasloading) {
+                    FoxUI.loader.show('mini')
+                }
+            }, error: function (a) {
+                /*alert(JSON.stringify(a));*/
+                if (hasloading) {
+                    FoxUI.loader.hide()
+                }
+            }
+        };
+        if (args && ispost) {
+            op.data = args
+        }
+        if (callback) {
+            op.success = function (data) {
+                if (hasloading) {
+                    FoxUI.loader.hide()
+                }
+                callback(data)
+            }
+        }
+        $.ajax(op)
+    };
+    core.post = function (routes, args, callback, hasloading) {
+        this.json(routes, args, callback, hasloading, true)
+    };
+    core.html = function (routes, args, callback, hasloading, async) {
+        if (typeof async === undefined) {
+            async = true
+        }
+        var op = {
+            url: this.getUrl(routes, args),
+            type: 'get',
+            cache: false,
+            dataType: 'html',
+            async: async,
+            beforeSend: function () {
+                if (hasloading) {
+                    FoxUI.loader.show('mini')
+                }
+            },
+            error: function () {
+                core.removeLoading();
+                if (hasloading) {
+                    FoxUI.loader.hide()
+                }
+            }
+        };
+        if (callback) {
+            op.success = function (html) {
+                if (hasloading) {
+                    FoxUI.loader.hide()
+                }
+                callback(html)
+            }
+        }
+        $.ajax(op)
+    };
+    core.tpl = function (containerid, templateid, data, append) {
+        if (typeof append === undefined) {
+            append = false
+        }
+        var html = tpl(templateid, data);
+        if (append) {
+            $(containerid).append(html)
+        } else {
+            $(containerid).html(html)
+        }
+        setTimeout(function () {
+            $(containerid).closest('.fui-content').lazyload('render')
+        }, 10)
+    };
+    core.getNumber = function (str) {
+        str = $.trim(str);
+        if (str == '') {
+            return 0
+        }
+        return parseFloat(str.replace(',', ''))
+    };
+    core.showIframe = function (url) {
+        var if_w = "100%";
+        var if_h = $(document.body).height();
+        $("<iframe width='" + if_w + "' height='" + if_h + "' id='mainFrame' name='mainFrame' style='position:absolute;z-index:4;'  frameborder='no' marginheight='0' marginwidth='0' ></iframe>").prependTo('body');
+        var st = document.documentElement.scrollTop || document.body.scrollTop;
+        var sl = document.documentElement.scrollLeft || document.body.scrollLeft;
+        var ch = document.documentElement.clientHeight;
+        var cw = document.documentElement.clientWidth;
+        var objH = $("#mainFrame").height();
+        var objW = $("#mainFrame").width();
+        var objT = Number(st) + (Number(ch) - Number(objH)) / 2;
+        var objL = Number(sl) + (Number(cw) - Number(objW)) / 2;
+        $("#mainFrame").css('left', objL);
+        $("#mainFrame").css('top', objT);
+        $("#mainFrame").attr("src", url)
+    };
+    core.getDistanceByLnglat = function (lng1, lat1, lng2, lat2) {
+        function rad(d) {
+            return d * Math.PI / 180.0
+        }
+
+        var rad1 = rad(lat1), rad2 = rad(lat2);
+        var a = rad1 - rad2, b = rad(lng1) - rad(lng2);
+        var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(rad1) * Math.cos(rad2) * Math.pow(Math.sin(b / 2), 2)));
+        s = s * 6378137.0;
+        s = Math.round(s * 10000) / 10000000;
+        return s
+    };
+    core.showImages = function(imgClass){
+        var ua = navigator.userAgent.toLowerCase();
+        var isWX = ua.match(/MicroMessenger/i) == "micromessenger";
+        var z = [];
+        $(imgClass).each(function() {
+            var img = $(this).attr("data-lazy");
+            z.push(img?img:$(this).attr("src"));
+        });
+        var current;
+        if (isWX) {
+            $(imgClass).unbind('click').click(function(e) {
+                e.preventDefault();
+                var startingIndex = $(imgClass).index($(e.currentTarget));
+                var current = null;
+                $(imgClass).each(function(B, A) {
+                    if (B === startingIndex) {
+                        current = $(A).attr("data-lazy")?$(A).attr("data-lazy"):$(A).attr("src");
+                    }
+                });
+                WeixinJSBridge.invoke("imagePreview", {
+                    current: current,
+                    urls: z
+                });
+            });
+        }
+    };
+    core.ish5app = function () {
+        var userAgent = navigator.userAgent;
+        if (userAgent.indexOf('CK 2.0') > -1){
+            return true;
+        }
+        return false;
+    };
+    core.isWeixin = function () {
+        var ua = navigator.userAgent.toLowerCase();
+        var isWX = ua.match(/MicroMessenger/i) == "micromessenger";
+        return isWX;
+    };
+
+    window.core = core;
+    return core
+});

+ 1 - 0
js/ajaxhook.min.js

@@ -0,0 +1 @@
+!function(t){function r(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var n={};return r.m=t,r.c=n,r.p="",r(0)}([function(t,r,n){n(1)(window)},function(t,r){t.exports=function(t){t.hookAjax=function(t){function r(t){return function(){return this.hasOwnProperty(t+"_")?this[t+"_"]:this.xhr[t]}}function n(r){return function(n){var i=this.xhr,o=this;return 0!=r.indexOf("on")?void(this[r+"_"]=n):void(t[r]?i[r]=function(){t[r](o)||n.apply(i,arguments)}:i[r]=n)}}function i(r){return function(){var n=[].slice.call(arguments);if(!t[r]||!t[r].call(this,n,this.xhr))return this.xhr[r].apply(this.xhr,n)}}return window._ahrealxhr=window._ahrealxhr||XMLHttpRequest,XMLHttpRequest=function(){this.xhr=new window._ahrealxhr;for(var t in this.xhr){var o="";try{o=typeof this.xhr[t]}catch(t){}"function"===o?this[t]=i(t):Object.defineProperty(this,t,{get:r(t),set:n(t)})}},window._ahrealxhr},t.unHookAjax=function(){window._ahrealxhr&&(XMLHttpRequest=window._ahrealxhr),window._ahrealxhr=void 0},t.default=t}}]);

+ 435 - 0
js/config.js

@@ -0,0 +1,435 @@
+var SYS_VER = parseInt(Math.random() * 10000000000);
+function resetButton(menus, $) {
+	var menuId = location.href.substring(location.href.indexOf("id=") + 3, location.href.indexOf("id=") + 35);
+	for (var i = 0; i < menus.length; i++) {
+		for (var j = 0; j < menus[i].subMenuList.length; j++) {
+			if (menuId == menus[i].subMenuList[j].id) {
+				var rights = menus[i].subMenuList[j].subMenuList;
+				for (var k = 0; k < rights.length; k++) {
+					if (rights[k].isChecked == 0) {
+						$(rights[k].authStr.substring(rights[k].authStr.lastIndexOf(":") + 1) + "-btn-0").hide();
+					}
+					else {
+						$(rights[k].authStr.substring(rights[k].authStr.lastIndexOf(":") + 1) + "-btn-0").show();
+					}
+				}
+				break;
+			}
+		}
+	}
+}
+function loadJS(url) {
+	document.write("<scirpt src='" + url + "?ver=" + SYS_VER + "'></scirpt>")
+}
+!(function (win) {
+	"use strict";
+	window.hywa = {
+		config: {
+			href: 'http://172.16.90.64:21009/',
+			imgbyapplets: 'http://47.98.47.246:8310',
+			port: {
+				login: '/web/user/login', //登录
+				loginOut: "/web/user/logout", //退出
+				changePassword: "/web/user/edit", //修改密码
+
+				userList: "/web/user/searchByPage", //列表
+				add_user: "/web/user/add", //添加
+				edit_user: "/web/user/edit", //修改
+				delete_user: "/web/user/del", //删除
+				select_user: "/web/user/searchById", //查询单个
+				forbidUser: '/web/user/forbidden', //禁止用户
+				restPwd: "/web/user/restPwd",//重置密码
+				//首页
+				select_searchByPage: "/web/feedback/searchByPage",//评价明细列表
+				del_feedback: "/web/feedback/batchDel",//删除评价
+				qurey_echartTotal: "/web/code/record/statOneYear", //扫码图标统计
+				query_listTotal: "/web/code/record/statYesterdayAndAllTime", //获取文字数统计
+				//角色设置
+				roleList: "/web/role/searchByPage", //获取角色列表
+				add_role: "/web/role/add", //新增角色
+				edit_role: "/web/role/edit", //修改角色
+				delete_role: "/web/role/del", //修改角色
+				select_role: "/web/role/searchById", //通过ID获取角色详细信息
+				role_getAuth: "/web/role/searchRoleAuthInfo",//查询角色权限
+				role_saveAuth: "/web/role/distrRoleAuthInfo",//保存企业授权信息
+				//经销商管理
+				dealerList: "/web/goods/dealer/searchByPage",
+				add_dealer: "/web/goods/dealer/add",
+				select_dealer: "/web/goods/dealer/findById",
+				edit_dealer: "/web/goods/dealer/edit",
+				delete_dealer: "/web/goods/dealer/delete",
+				selectPId_dealer: "/web/goods/dealer/getCode",
+				//企业
+				orgList: "/web/org/searchByPage", //列表
+				add_org: "/web/org/add", //添加
+				edit_org: "/web/org/edit", //修改
+				delete_org: "/web/org/del", //删除
+				select_org: "/web/org/searchById", //查询单个
+				select_Info_org: "/web/org/searchOrgInfo",//查询推广企业信息
+				edit_Info_org: "/web/org/editExtendInfo",//企业推广保存
+				org_getAuth: "/web/org/searchAuthInfo",//拉取企业授权信息
+				org_saveAuth: "/web/org/distrOrgAuthInfo",//保存企业授权信息
+				add_org_user: '/web/org/addOrgUser',//添加企业管理用户
+
+				//产地
+				regionList: "/web/goods/field/searchByPage", //列表
+				add_region: "/web/goods/field/add", //添加
+				edit_region: "/web/goods/field/edit", //修改
+				delete_region: "/web/goods/field/del", //删除
+				select_region: "/web/goods/field/searchById", //查询单个
+				rnlist_region: "/web/goods/field/getBaseList",
+				areaSearch: "/web/goods/field/getAreaInfo",//地址查询
+				getOrchardList: "/web/goods/field/getOrchardList", // 获取原料生产数据
+
+				//产品信息
+				pdinfoList: "/web/goods/batch/searchByPage", //列表
+				add_pdinfo: "/web/goods/batch/add", //添加
+				add_rawMaterialInfo: "/web/inputs/save",//修改模式 - 添加原料项
+				del_rawMaterialInfo: "/web/inputs/del",//修改模式 - 删除原料项
+				add_produceProcessInfo: "/web/normal/save",//修改模式 - 添加生成过程项
+				edit_produceProcessInfo: "/web/normal/edit",//修改模式 - 修改生成过程项
+				del_produceProcessInfo: "/web/normal/del",//修改模式 - 删除生成过程项
+				add_processingCirculationInfo: "/web/normal/save",//修改模式 - 添加加工流通过程项
+				edit_processingCirculationInfo: "/web/normal/edit",//修改模式 - 修改加工流通过程项
+				del_processingCirculationInfo: "/web/normal/del",//修改模式 - 删除加工流通过程项
+				edit_pdinfo: "/web/goods/batch/edit", //修改
+				delete_pdinfo: "/web/goods/batch/del", //删除
+				select_pdinfo: "/web/goods/batch/searchById", //查询单个
+				pdinfo2List: "/web/goods/searchByPage", //列表
+				add_pdinfo2: "/web/goods/add", //添加
+				edit_pdinfo2: "/web/goods/edit", //修改
+				delete_pdinfo2: "/web/goods/del", //删除
+				select_pdinfo2: "/web/goods/searchById", //查询单个
+				pdinfo_qrcode: "/web/goods/batch/batchGoodsQRCode",//产品批次生成溯源码
+
+				//溯源码管理
+				qrcodeList: "/web/code/record/searchByPage", //列表
+				view_qrcode: "/web/code/record/searchDetailById", //查看
+				drop_qrcode: "/web/code/record/forbiddenCodeInfo", //废弃
+				export_qrcode: "/web/code/record/exportDetailRecord", //导出
+				delete_qrcode: "/web/code/record/delByPhysical", //删除
+				drop_single: "/web/code/info/forbidden",//废弃单个溯源码
+				show_codeDetail: "/web/code/record/showDetail",//溯源码预览
+				print_qrcode: "/web/code/info/getPrintDetail", //溯源码打印
+				setPrint_done: "/web/code/info/updateQRIsPrint",//标记已打印二维码
+				//系统日志
+				menuList: "/log/queryFuncName",//获取菜单列表
+				logList: "/log/queryAll",//获取日志列表
+				show_menu: "/menu/search", //查看权限菜单树
+				get_menuList: "/menu/menuAllTree", //查看菜单列表
+				select_menu: "/menu/search", //查看菜单详细,ID条件
+				update_menu: "/menu", //菜单新增修改
+
+				// 权限
+				roleListUrl: '/role/getAll',
+				roleFormUrl: '/role',
+				roleByid: '/role/findById',
+				menuListUrl: '/menu/getMenuByRole',
+				menuFormUrl: '/menu/saveRoleMenu',
+				systemListUrl: '/system/find',//系统维护查询
+				systemFormUrl: '/system',//系统维护保存
+				uploadImage: "/web/normal/uploadPics",
+			}
+		},
+		sessionTable: {
+			tableName: 'system',
+			userData: 'userData'
+		},
+		jumpPage: {
+			home: "../pages/?ver=" + SYS_VER,
+			login: "../../?ver=" + SYS_VER
+		},
+		codeVerify: {
+			405: function () {
+				console.log('logout')
+				//top.location.href = window.hywa.jumpPage.login;
+				return true;
+			},
+			404: function () {
+				// top.location.href = window.hywa.jumpPage.login;
+				return true;
+			},
+			500: function () {
+				//top.location.href = window.hywa.jumpPage.login;
+				return true;
+			},
+			1004: function () {//认证失败
+				top.location.href = window.hywa.jumpPage.login;
+				return true;
+			},
+			2010: function () {//不能修改删除自己
+				return false;
+			},
+			2011: function () {//不能对超级管理员进行操作
+				return false;
+			},
+			1002: function () {//密码错误
+				return false;
+			},
+			3003: function () {//修改前后密码不能相同
+				return false;
+			},
+			3004: function () {//修改前后密码不能相同
+				return false;
+			},
+			2006: function () {//文件上传失败
+				return false;
+			},
+			2002: function () {//参数不能为空
+				return false;
+			},
+			2003: function () {//类型被引用,请先删除引用
+				return false;
+			},
+			2004: function () {
+				return false;
+			},
+			2005: function () {//文件不能为空
+				return false;
+			},
+			3009: function () {
+				return false;
+			},
+			3008: function () {
+				return false;
+			},
+			3011: function () {
+				return false;
+			},
+			3017: function () {
+				return true;
+			},
+			3013: function () {
+				return false;
+			},
+			3019: function () {
+				return false;
+			},
+			3036: function () {
+				return false;
+			},
+			3037: function () {
+				return false;
+			},
+			3038: function () {
+				return false;
+			},
+			3039: function () {
+				return false;
+			},
+			3070: function () {
+				return false;
+			},
+			default: function () {
+				return false;
+			}
+		}
+	};
+
+	win.hijack = function () {
+		var _this = this;
+		layui.use(['layer'], function () {
+			_this.layer = layui.layer;
+		});
+		_this.json = {
+			code: -404,
+			msg: "返回数据格式错误",
+			count: 0,
+			data: []
+		};
+	};
+	win.hijack.prototype.onload = function (xhr) {
+		var _this = this;
+		if (xhr.readyState === 4) { // 成功完成
+			// 判断响应结果:
+			if (xhr.status === 200) {
+				//layer.close(xhr.xhr.lay_loading);
+				xhr.responseText = JSON.stringify(_this.changeJSON(xhr.responseText).json);
+				switch (_this.json.code) {
+					case 0:
+						// return _this.okMsg(_this.json.msg);
+						return false;
+					default:
+						return _this.errorMsg(_this.json.code, _this.json.msg);
+				};
+			} else {
+				return _this.errorMsg(xhr.status);
+			}
+		} else if (xhr.readyState === 1) {
+			xhr.setRequestHeader('x-requested-with', "XMLHttpRequest");
+		} else {
+
+		}
+	};
+	win.hijack.prototype.open = function (arg, xhr) {
+		var _this = this;
+		_this.url = location.searchObj(arg[1]);
+		_this.url.pageNum = _this.url.page - 0;
+		_this.url.pageSize = _this.url.limit - 0;
+		_this.url.pageNum || (delete _this.url.pageNum);
+		_this.url.pageSize || (delete _this.url.pageSize);
+
+		_this.url.pageNum && (delete _this.url.page);
+		_this.url.pageSize && (delete _this.url.limit);
+		arg[1] = _this.changeUrl(_this.url, arg[1].split('?')[0]).url;
+	};
+	win.hijack.prototype.changeUrl = function (obj, url) {
+		var _this = this;
+		_this.url = (_this.httpVerify(url) ? (function () {
+			return _this.httpVerify(hywa.config.port[url]) ? hywa.config.href + hywa.config.port[url] : hywa.config.port[url];
+		})() : url);
+		_this.url += "?";
+		for (var i in obj) {
+			_this.url += i + "=" + obj[i] + "&";
+		}
+		_this.url = _this.url.substr(0, _this.url.length - 1);
+		return this;
+	};
+	win.hijack.prototype.httpVerify = function (url) {
+		return (url.substr(0, 5) != 'http:' && url.substr(0, 6) != 'https:' && url.substr(0, 2) != '//');
+	};
+	win.hijack.prototype.changeJSON = function (json) {
+		var _this = this;
+		try {
+			json = JSON.parse(json);
+			if (json.retHead) {
+				_this.json.code = json.retHead.errCode;
+				_this.json.msg = json.retHead.errMsg || "不知道怎么了!!!";
+				_this.json.count = json.retHead.total || 0;
+			} else {
+
+			}
+			if (JSON.stringify(json.retBody) == '{}') {
+				json.retBody = []
+			}
+			if (json.retBody && !!json.retBody.list && !!json.retBody.list.length) {
+				_this.json.count = _this.json.count || json.retBody.total || 0;
+				_this.json.data = json.retBody.list || [];
+				_this.json.button = json.buttonRep || {};
+				if (JSON.stringify(_this.json.button) != '{}') {
+					(function addRgt(data, rgt) {
+						for (let i = 0; i < data.length; i++) {
+							data[i] = Object.assign(data[i], rgt);
+							if (data[i].children)
+								addRgt(data[i].children, rgt);
+						}
+					})(_this.json.data, _this.json.button);
+					for (let i = 0; i < _this.json.data.length; i++) {
+						_this.json.data[i] = Object.assign(_this.json.data[i], _this.json.button);
+					}
+				}
+			} else if (json.retBody != "null" && !!json.retBody && Array.isArray(json.retBody.list) && !json.retBody.total) {
+				_this.json.data = [];
+				_this.json.button = json.buttonRep || {};
+				if (JSON.stringify(_this.json.button) != '{}') {
+					(function addRgt(data, rgt) {
+						for (let i = 0; i < data.length; i++) {
+							data[i] = Object.assign(data[i], rgt);
+							if (data[i].children)
+								addRgt(data[i].children, rgt);
+						}
+					})(_this.json.data, _this.json.button);
+					for (let i = 0; i < _this.json.data.length; i++) {
+						_this.json.data[i] = Object.assign(_this.json.data[i], _this.json.button);
+					}
+				}
+			} else {
+				_this.json.data = Array.isArray(json.retBody) ? (function () {
+					_this.json.count = _this.json.count || json.retBody.length;
+					return json.retBody;
+				})() : (json.retBody != 'null' ? [json.retBody] : []);
+			}
+		} catch (e) {
+			_this.json = {
+				code: -404,
+				msg: "返回数据格式错误",
+				count: 0,
+				data: []
+			};
+		}
+		return this;
+	};
+	win.hijack.prototype.errorMsg = function (code, msg) {
+		var _this = this;
+		_this.layer.msg("(" + code + ") " + (msg || "服务器通讯不畅!"), {
+			icon: 2,
+			time: 3000
+		});
+		return (window.hywa.codeVerify[(code - 0 || 'default')] || window.hywa.codeVerify['default'])();
+	};
+	win.hijack.prototype.okMsg = function (msg) {
+		var _this = this;
+		_this.layer.msg(msg, {
+			icon: 1,
+			time: 800
+		});
+		return false;
+	};
+	win.hijack.prototype.setRequestHeader = function (xhr) {
+		var _this = this;
+		if (typeof xhr.RequestHeader == 'undefined') {
+			xhr.RequestHeader = true;
+			var token = layui.sessionData(window.hywa.sessionTable.tableName);
+			JSON.stringify(token) != '{}' && xhr.setRequestHeader('accessToken', token.token);
+		}
+	};
+	var hook = new hijack();
+	hookAjax({
+		//拦截函数
+		open: function (arg) {
+			return hook.open(arg, this.xhr);
+		},
+		//拦截回调
+		onreadystatechange: function (xhr) {
+			// console.log(xhr.readyState)
+			return hook.onload(xhr);
+		},
+		onload: function (xhr) {
+			return hook.onload(xhr);
+		},
+		setRequestHeader: function (h, xhr) {
+			// console.log("加头",JSON.stringify(xhr));
+			hook.setRequestHeader(xhr);
+		}
+	});
+})(window);
+/**
+ * 时间格式化
+ */
+Date.prototype.format = function (format) {
+
+	var date = {
+		"M+": this.getMonth() + 1,
+		"d+": this.getDate(),
+		"h+": this.getHours(),
+		"m+": this.getMinutes(),
+		"s+": this.getSeconds(),
+		"q+": Math.floor((this.getMonth() + 3) / 3),
+		"S+": this.getMilliseconds()
+	};
+	if (/(y+)/i.test(format)) {
+		format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
+	}
+	for (var k in date) {
+		if (new RegExp("(" + k + ")").test(format)) {
+			format = format.replace(RegExp.$1, RegExp.$1.length == 1 ?
+				date[k] : ("00" + date[k]).substr(("" + date[k]).length));
+		}
+	}
+	return format;
+}
+/**
+ * URL参数转换为对象
+ */
+Location.prototype.searchObj = function (url) {
+	var obj = {};
+	var arr = (url || this.search).match(/[?&][^?&]+=[^?&]+/g);
+	if (arr) {
+		arr.forEach(function (item) {
+			var tempArr = item.substring(1).split('=');
+			obj[decodeURIComponent(tempArr[0])] = decodeURIComponent(tempArr[1]);
+			length++;
+		});
+	}
+	return obj;
+}

+ 411 - 0
js/layui-xtree.js

@@ -0,0 +1,411 @@
+//**********************************
+//**   本插件依赖 贤心 layui form模块   
+//**   由 小巷 制作 QQ:151446298    
+//**   版本3.0 时间 2018-01-10 20:48 
+//**********************************
+
+//构造
+function layuiXtree(options) {
+    var _this = this;
+    _this._containerid = options.elem;
+    _this.tool = options.tool;
+	_this.checkbox = options.checkbox;
+    typeof options.toolbar == 'function' && (_this.toolbar = options.toolbar);
+    _this._container = document.getElementById(options.elem); //容器
+    _this._container.style.minHeight = "100px";
+    _this._options = options;
+    _this.Loading(options);
+}
+
+//封装IE8 Class选择
+layuiXtree.prototype.getByClassName = function (cn) {
+    if (document.getElementsByClassName) return this._container.getElementsByClassName(cn);
+    var _xlist = this._container.childNodes;
+    var _xtemp = new Array();
+    for (var i = 0; i < _xlist.length; i++) {
+        var _xchild = _xlist[i];
+        var _xclassNames = _xchild.getAttribute('class').split(' ');
+        for (var j = 0; j < _xclassNames.length; j++) {
+            if (_xclassNames[j] == cn) {
+                _xtemp.push(_xchild);
+                break;
+            }
+        }
+    }
+    return _xtemp;
+}
+
+//在一个对象下面找子级
+layuiXtree.prototype.getChildByClassName = function (obj, cn) {
+    var _xlist = obj.childNodes;
+    var _xtemp = new Array();
+    for (var i = 0; i < _xlist.length; i++) {
+        var _xchild = _xlist[i];
+        var _xclassNames = _xchild.getAttribute('class').split(' ');
+        for (var j = 0; j < _xclassNames.length; j++) {
+            if (_xclassNames[j] == cn) {
+                _xtemp.push(_xchild);
+                break;
+            }
+        }
+    }
+    return _xtemp;
+}
+
+//加载特效,且获取数据
+layuiXtree.prototype.Loading = function (options) {
+    var _this = this;
+    _this.xloading = document.createElement("span"); //创建加载对象
+    _this.xloading.setAttribute('class', 'layui-icon layui-anim layui-anim-rotate layui-anim-loop');
+    _this.xloading.innerHTML = '&#xe63e;';
+    _this.xloading.style.fontSize = "50px";
+    _this.xloading.style.color = "#009688";
+    _this.xloading.style.fontWeight = "bold";
+    _this.xloading.style.marginLeft = _this._container.offsetWidth / 2 - 25 + 'px';
+    _this.xloading.style.marginTop = _this._container.offsetHeight / 2 - 50 + 'px';
+    _this._container.innerHTML = '';
+    _this._container.appendChild(_this.xloading); //加载显示
+    if (typeof (options.data) == 'object') {
+        _this._dataJson = options.data;
+        _this.Initial(options);
+        return;
+    }
+
+    //如果是字符串url,进行异步加载
+    var obj = new XMLHttpRequest();
+    obj.open('get', options.data, true);
+    obj.onreadystatechange = function () {
+        if (obj.readyState == 4 && obj.status == 200 || obj.status == 304) { //回调成功
+            if (JSON.parse(obj.responseText).menu) {
+                _this._dataJson = eval('(' + obj.responseText + ')').menu;
+                //_this._dataJson = eval('(' + JSON.parse(obj.responseText).menu + ')'); //将返回的数据转为json
+            }
+            _this.Initial(options);
+        }
+    };
+    obj.send();
+}
+
+//data验证后的数据初始化
+layuiXtree.prototype.Initial = function (o) {
+    var _this = this;
+    _this._form = o.form; //layui from对象
+    _this._domStr = ""; //结构字符串
+    _this._isopen = o.isopen != null ? o.isopen : true;
+    if (o.color == null) o.color = {
+        open: '#2F4056',
+        close: '#2F4056',
+        end: '#2F4056'
+    }; //图标颜色
+    _this._iconOpenColor = o.color.open != null ? o.color.open : "#2F4056";
+    _this._iconCloseColor = o.color.close != null ? o.color.close : "#2F4056";
+    _this._iconEndColor = o.color.end != null ? o.color.end : "#2F4056";
+    if (o.icon == null) o.icon = {
+        open: '&#xe625;',
+        close: '&#xe623;',
+        end: '&#xe621;'
+    }; //图标样式
+    _this._iconOpen = o.icon.open != null ? o.icon.open : '&#xe625;';
+    _this._iconClose = o.icon.close != null ? o.icon.close : '&#xe623;';
+    _this._iconEnd = o.icon.end != null ? o.icon.end : '&#xe621;';
+    _this._click = o.click != null ? o.click : function () {};
+    _this._ckall = o.ckall != null ? o.ckall : false; //全选是否启用
+    _this._ckallSuccess = o.ckallback != null ? o.ckallback : function () {}; //全选回调
+    _this.CreateCkAll();
+    _this.dataBind(_this._dataJson);
+    _this.Rendering();
+}
+
+//全选框
+layuiXtree.prototype.CreateCkAll = function () {
+    var _this = this;
+    if (_this._ckall) {
+        _this._domStr += '<div class="layui-xtree-item">';
+        _this._domStr +=
+            '<input type="checkbox" class="layui-xtree-checkbox layui-xtree-ckall" title="全选" lay-skin="primary" lay-filter="xtreeckall' +
+            _this._containerid + '">';
+        _this._domStr += '</div>';
+    }
+}
+
+//生产结构
+layuiXtree.prototype.dataBind = function (d) {
+    var _this = this;
+    if (d.length > 0) {
+        for (i in d) {
+            var xtree_isend = '';
+            var xtree_ischecked = '';
+            var xtree_isdisabled = d[i].disabled ? ' disabled="disabled" ' : '';
+            _this._domStr += '<div class="layui-xtree-item">';
+            if (!d[i].childrenMenu) {
+                d[i].childrenMenu = [];
+            }
+            if (d[i].childrenMenu.length > 0)
+                _this._domStr += '<i class="layui-icon layui-xtree-icon" data-xtree="' + (_this._isopen ? '1' : '0') +
+                '">' + (_this._isopen ? _this._iconOpen : _this._iconClose) + '</i>';
+            else {
+                _this._domStr += '<i class="layui-icon layui-xtree-icon-null">' + (d[i].icon || _this._iconEnd) +
+                    '</i>';
+                xtree_isend = 'data-xend="1"';
+                xtree_ischecked = !!d[i].roleId ? ' checked ' : '';
+                xtree_isdisabled = d[i].disabled ? ' disabled="disabled" ' : '';
+            }
+            if (!!_this.checkbox) {
+                _this._domStr += '<input type="checkbox" class="layui-xtree-checkbox" ' + xtree_isend +
+                    xtree_ischecked +
+                    xtree_isdisabled + ' value="' + d[i].id + '" title="' + d[i].name +
+                    '" lay-skin="primary" lay-filter="xtreeck' + _this._containerid + '">';
+            }else{
+				_this._domStr += '<div class="layui-inline" style="margin-top: 10px;margin-bottom:0;"><span>'+d[i].name+'</span></div>';
+			}
+            if (!!_this.tool) {
+                _this._domStr +=
+                    '<div class="layui-inline" style="margin-top: 10px;margin-bottom:0;"><a class="layui-btn layui-btn-xs" name="tree_event" event="edit"id="' +
+                    d[i].id +
+                    '">修改</a><a class="layui-btn layui-btn-danger layui-btn-xs" name="tree_event" event="del" id="' +
+                    d[i].id + '">删除</a></div>';
+            }
+            _this.dataBind(d[i].childrenMenu);
+            _this._domStr += '</div>';
+        }
+    }
+}
+//工具栏监听回调
+layuiXtree.prototype.toolbar = function (obj) {
+    
+}
+//通过ID获取
+layuiXtree.prototype.idGetObj = function (id) {
+    var _this = this;
+    var obj = {};
+    (function get(d) {
+        if (d.length > 0) {
+            for (i in d) {
+                if (!d[i].childrenMenu) {
+                    d[i].childrenMenu = [];
+                }
+                if (d[i].id == id) {
+                    obj = d[i];
+                }
+                get(d[i].childrenMenu);
+            }
+        }
+    })(_this._dataJson);
+    return obj;
+}
+//渲染呈现
+layuiXtree.prototype.Rendering = function () {
+    var _this = this;
+    _this._container.innerHTML = _this._domStr;
+    _this._domStr = "";
+
+    //检查选中状态
+    var xtree_ckitems = _this.getByClassName('layui-xtree-checkbox');
+    for (var i = 0; i < xtree_ckitems.length; i++) {
+        if (xtree_ckitems[i].getAttribute('data-xend') == '1' && xtree_ckitems[i].checked) {
+            _this.ParentCheckboxChecked(xtree_ckitems[i]);
+        }
+    }
+
+    _this._form.render('checkbox'); //layui渲染
+    //绑定工具条事件
+    var tree_event = document.getElementsByName('tree_event');
+    for (var tr_i in tree_event) {
+        tree_event[tr_i].onclick = function (e) {
+            _this.toolbar({
+                event: this.getAttribute('event'),
+                data: _this.idGetObj(this.id)
+            });
+        };
+    }
+
+    var xtree_items = _this.getByClassName('layui-xtree-item');
+    var xtree_icons = _this.getByClassName('layui-xtree-icon');
+    var xtree_nullicons = _this.getByClassName('layui-xtree-icon-null');
+
+    for (var i = 0; i < xtree_items.length; i++) {
+        if (xtree_items[i].parentNode == _this._container)
+            xtree_items[i].style.margin = '5px 0 0 10px';
+        else {
+            xtree_items[i].style.margin = '5px 0 0 45px';
+            if (!_this._isopen) xtree_items[i].style.display = 'none';
+        }
+    }
+
+    for (var i = 0; i < xtree_icons.length; i++) {
+        xtree_icons[i].style.position = "relative";
+        xtree_icons[i].style.top = "3px";
+        xtree_icons[i].style.margin = "0 5px 0 0";
+        xtree_icons[i].style.fontSize = "18px";
+        xtree_icons[i].style.color = _this._isopen ? _this._iconOpenColor : _this._iconCloseColor;
+        xtree_icons[i].style.cursor = "pointer";
+
+        xtree_icons[i].onclick = function () {
+            var xtree_chi = this.parentNode.childNodes;
+            if (this.getAttribute('data-xtree') == 1) {
+                for (var j = 0; j < xtree_chi.length; j++) {
+                    if (xtree_chi[j].getAttribute('class') == 'layui-xtree-item')
+                        xtree_chi[j].style.display = 'none';
+                }
+                this.setAttribute('data-xtree', '0')
+                this.innerHTML = _this._iconClose;
+                this.style.color = _this._iconCloseColor;
+            } else {
+                for (var j = 0; j < xtree_chi.length; j++) {
+                    if (xtree_chi[j].getAttribute('class') == 'layui-xtree-item')
+                        xtree_chi[j].style.display = 'block';
+                }
+                this.setAttribute('data-xtree', '1')
+                this.innerHTML = _this._iconOpen;
+                this.style.color = _this._iconOpenColor;
+            }
+        }
+    }
+
+    for (var i = 0; i < xtree_nullicons.length; i++) {
+        xtree_nullicons[i].style.position = "relative";
+        xtree_nullicons[i].style.top = "3px";
+        xtree_nullicons[i].style.margin = "0 5px 0 0";
+        xtree_nullicons[i].style.fontSize = "18px";
+        xtree_nullicons[i].style.color = _this._iconEndColor;
+    }
+
+    _this._form.on('checkbox(xtreeck' + _this._containerid + ')', function (da) {
+        //获取当前点击复选框的容器下面的所有子级容器 
+        var xtree_chis = da.elem.parentNode.getElementsByClassName('layui-xtree-item');
+        //遍历它们,选中状态与它们的父级一致(类似全选功能)
+        for (var i = 0; i < xtree_chis.length; i++) {
+            if (!_this.getChildByClassName(xtree_chis[i], 'layui-xtree-checkbox')[0].disabled) {
+                _this.getChildByClassName(xtree_chis[i], 'layui-xtree-checkbox')[0].checked = da.elem.checked;
+                if (da.elem.checked) _this.getChildByClassName(xtree_chis[i], 'layui-xtree-checkbox')[0].nextSibling
+                    .classList.add('layui-form-checked');
+                else _this.getChildByClassName(xtree_chis[i], 'layui-xtree-checkbox')[0].nextSibling.classList
+                    .remove('layui-form-checked');
+            }
+        }
+        _this.ParendCheck(da.elem);
+        _this._click(da);
+    });
+
+    var _xtree_disableds = _this.getByClassName('layui-disabled');
+    for (var i = 0; i < _xtree_disableds.length; i++) {
+        _xtree_disableds[i].getElementsByTagName('span')[0].style.color = "#B5B5B5";
+    }
+
+    //全选按钮
+    if (_this._ckall) {
+        _this._form.on('checkbox(xtreeckall' + _this._containerid + ')', function (data) {
+            var xtree_allck = data.elem.parentNode.parentNode.getElementsByClassName('layui-form-checkbox');
+            for (var i = 0; i < xtree_allck.length; i++) {
+                if (xtree_allck[i].getAttribute('class').indexOf('layui-checkbox-disbaled') == -1) {
+                    if (data.elem.checked) {
+                        xtree_allck[i].classList.add('layui-form-checked');
+                    } else {
+                        xtree_allck[i].classList.remove('layui-form-checked');
+                    }
+                    xtree_allck[i].parentNode.getElementsByClassName('layui-xtree-checkbox')[0].checked =
+                        data.elem.checked;
+                }
+            }
+            _this._ckallSuccess();
+        });
+    }
+}
+
+//更新渲染
+layuiXtree.prototype.render = function () {
+    var _this = this;
+    _this.Loading(_this._options);
+}
+
+//子节点选中改变,父节点更改自身状态
+layuiXtree.prototype.ParendCheck = function (ckelem) {
+    var _this = this;
+    var xtree_p = ckelem.parentNode.parentNode;
+    if (xtree_p.getAttribute('class') == 'layui-xtree-item') {
+        var xtree_all = _this.getChildByClassName(xtree_p, 'layui-xtree-item');
+        var xtree_count = 0;
+
+        for (var i = 0; i < xtree_all.length; i++) {
+            if (_this.getChildByClassName(xtree_all[i], 'layui-xtree-checkbox')[0].checked) {
+                xtree_count++;
+            }
+        }
+
+        if (xtree_count <= 0) {
+            _this.getChildByClassName(xtree_p, 'layui-xtree-checkbox')[0].checked = false;
+            _this.getChildByClassName(xtree_p, 'layui-xtree-checkbox')[0].nextSibling.classList.remove(
+                'layui-form-checked');
+        } else {
+            _this.getChildByClassName(xtree_p, 'layui-xtree-checkbox')[0].checked = true;
+            _this.getChildByClassName(xtree_p, 'layui-xtree-checkbox')[0].nextSibling.classList.add(
+                'layui-form-checked');
+        }
+        this.ParendCheck(_this.getChildByClassName(xtree_p, 'layui-xtree-checkbox')[0]);
+    }
+}
+
+//渲染之前按照选中的末级去改变父级选中状态
+layuiXtree.prototype.ParentCheckboxChecked = function (e) {
+    var _this = this;
+    if (e.parentNode.parentNode.getAttribute('class') == 'layui-xtree-item') {
+        var _pe = _this.getChildByClassName(e.parentNode.parentNode, 'layui-xtree-checkbox')[0];
+        _pe.checked = true;
+        _this.ParentCheckboxChecked(_pe);
+    }
+}
+
+//获取全部选中的末级checkbox对象
+layuiXtree.prototype.GetChecked = function () {
+    var _this = this;
+    var arr = new Array();
+    var arrIndex = 0;
+    var cks = _this.getByClassName('layui-xtree-checkbox');
+    for (var i = 0; i < cks.length; i++) {
+        if (cks[i].checked && cks[i].getAttribute('data-xend') == '1') {
+            arr[arrIndex] = cks[i];
+            arrIndex++;
+        }
+    }
+    return arr;
+}
+//获取全部选中的checkbox对象value
+layuiXtree.prototype.GetCheckedVal = function () {
+    var _this = this;
+    var arr = new Array();
+    var arrIndex = 0;
+    var cks = _this.getByClassName('layui-xtree-checkbox');
+    for (var i = 0; i < cks.length; i++) {
+        if (cks[i].checked) {
+            arr[arrIndex] = cks[i].value;
+            arrIndex++;
+        }
+    }
+    return arr;
+}
+
+//获取全部的原始checkbox对象
+layuiXtree.prototype.GetAllCheckBox = function () {
+    var _this = this;
+    var arr = new Array();
+    var arrIndex = 0;
+    var cks = _this.getByClassName('layui-xtree-checkbox');
+    for (var i = 0; i < cks.length; i++) {
+        arr[arrIndex] = cks[i];
+        arrIndex++;
+    }
+    return arr;
+}
+
+//根据值来获取其父级的checkbox原dom对象
+layuiXtree.prototype.GetParent = function (a) {
+    var _this = this;
+    var cks = _this.getByClassName('layui-xtree-checkbox');
+    for (var i = 0; i < cks.length; i++) {
+        if (cks[i].value == a) {
+            if (cks[i].parentNode.parentNode.getAttribute('id') == _this._container.getAttribute('id')) return null;
+            return _this.getChildByClassName(cks[i].parentNode.parentNode, 'layui-xtree-checkbox')[0];
+        }
+    }
+    return null;
+}

+ 170 - 0
js/layuiPlugins/cascade.js

@@ -0,0 +1,170 @@
+/**
+ * 请求接口格式
+ * {
+ }
+ */
+layui.define(['jquery', 'form', 'layer'], function (exports) {
+	var $ = layui.jquery,
+		form = layui.form,
+		layer = layui.layer;
+	var Class = function (obj) {
+		var _this = this;
+		_this.elem = obj.elem || 'body'; //级联容器
+		_this.url = obj.url || {}; //级联接口
+		_this.formParm = []; //表单参数名
+		typeof obj.url == 'object' && ($.each(obj.url, function (key, value) {
+			_this.formParm.push(key);
+		}));
+		_this.listParamName = obj.listParamName || {
+			valueName: 'id',
+			name: 'name'
+		};
+		_this.width = {};
+		_this.placeholder = {};
+		_this.box = $('body'); //子集容器
+		_this.boxs = []; //所有子集
+		_this.title = obj.title || null; //标题
+		_this.hostParm = { //默认请求参数名
+			idName: 'id',
+			rowsName: 'limit'
+		};
+		_this.valObj = {}; //初始值对象
+		_this[_this.hostParm['rowsName']] = obj[_this.hostParm['rowsName']] || 10000; //请求条数
+		for (var i in obj.hostParm) { //自定义请求参数名
+			_this.hostParm[i] = obj.hostParm[i];
+		}
+		_this.data = {}; //默认请求参数
+		_this.data[_this.hostParm['rowsName']] = _this[_this.hostParm['rowsName']]; //赋值参数
+		_this.verify = obj.verify || {};
+
+		$.extend(this, obj);
+		_this.init(); //初始化
+	};
+	/**
+	 *返回当前元素在数组中的下标 
+	 * @param {Object} val
+	 */
+	Class.prototype.indexOf = function (arr, val) {
+		for (var i = 0; i < arr.length; i++) {
+			if (arr[i] == val) return i;
+		}
+		return -1;
+	};
+	/**
+	 * 初始化父下拉列表
+	 */
+	Class.prototype.init = function () {
+		var _this = this;
+		//select 容器
+		_this.box = $('<div class="layui-input-inline"></div>');
+		//初始化值
+		if(JSON.stringify(_this.valObj) != '{}'){
+			_this.val();
+		}
+		//渲染首下拉框
+		_this.element(_this.formParm[0]);
+	};
+	Class.prototype.element = function (name, code, callback) {
+		var _this = this;
+		//验证子接口配置
+		if (!_this.url[name]) {
+			// layer.msg("没有配置下级接口",{icon:2,time:600});
+			return _this;
+		}
+		//获取设置默认子集请求参数(子集合父id)
+		_this.data[_this.hostParm['idName']] = code || null;
+		//设置默认请求页码
+		_this.data['page'] = _this.data['page'] || 1;
+		$.ajax({
+			url: _this.url[name],
+			data: _this.data,
+			success: function (res) {
+				//指定select唯一ID
+				let select_id = "select_"+_this.___id;
+				//获取当前级联字段下标
+				let subscript = _this.indexOf(_this.formParm, name);
+				// _this.thanName(name);
+				//保存当前select对象
+				_this.boxs[subscript] = $(_this.selectHtml(select_id, name, res));
+				//往select容器添加包装好的select对象
+				$(_this.elem).append(_this.boxs[subscript]);
+				//绑定select点击事件
+				_this.event(name,select_id);
+				//执行赋值回调函数
+				!!callback && callback(name, select_id);
+				typeof _this.valObj[name] != 'undefined' && ($("#" + select_id+name).val(_this.valObj[name]));
+				form.render();
+			}
+		});
+	};
+	/**
+	 * 包装Html
+	 */
+	Class.prototype.selectHtml = function (select_id, name, res) {
+		var _this = this;
+		var html = '<div class="layui-input-inline" style="width:'+(this.width[name] || "auto")+';"><select name="' + name + '" lay-verify="' + this.verify[name] +
+			'" lay-filter="' + select_id+name + '" id="' +
+			select_id+name + '"><option value="">'+(this.placeholder[name] || '请选择')+'</option>';
+		for (let xyz = 0; xyz < res.data.length; xyz++) {
+			html += '<option value="' + res.data[xyz][_this.listParamName['valueName']] + '">' + res.data[xyz][_this.listParamName[
+				'name']] + '</option>';
+		}
+		return (html + '</select></div>');
+	};
+	Class.prototype.event = function (name,select_id) {
+		var _this = this;
+		var x = _this.indexOf(_this.formParm, name);
+		form.on("select(" + select_id+name + ")", function (obj) {
+			_this.removeBox(x);
+			if(!obj.value){
+				return false;
+			};
+			_this.element(_this.formParm[x - 0 + 1], obj.value);
+			_this.click(obj);
+			return false;
+		});
+	};
+	Class.prototype.click = function (obj) {
+
+	};
+	Class.prototype.removeBox = function (i) {
+		var _this = this;
+		for (var x = i + 1; x < _this.boxs.length; x++) {
+			_this.boxs[x].remove();
+		}
+	};
+	Class.prototype.thanName = function (name) {
+		for (let i = 0; i < this.boxs.length; i++) {
+			if (this.boxs[i][0].firstChild && this.boxs[i][0].firstChild.name == name) {
+				this.boxs[i].remove();
+			}
+		}
+	};
+	/**
+	 * 初始值
+	 */
+	Class.prototype.val = function (obj) {
+		var _this = this;
+		$.extend(_this.valObj, obj);
+		(function temp(i) {
+			if (_this.valObj[_this.formParm[i + 1]]) {
+				_this.element(_this.formParm[i - 0 + 1], _this.valObj[_this.formParm[i]], function (name, select_id) {
+					if (i == -1) {
+						_this.removeBox(i);
+					}
+					temp(++i);
+				});
+			}
+		})(-1);
+		return _this;
+	};
+	var cascade = {};
+	cascade.render = function (e) {
+		e.___id = this.id = (this.id || 0) - 0 + 1;
+		var i = new Class(e = e || {});
+		t = $(e.elem);
+
+		return t[0] ? i : layui.hint().error("layui.cascade 没有找到" + e.elem + "元素");
+	};
+	exports('cascade', cascade);
+});

+ 141 - 0
js/layuiPlugins/cascade_bak.js

@@ -0,0 +1,141 @@
+/**
+ * 请求接口格式
+ * {
+	
+ }
+ */
+layui.define(['jquery', 'form', 'layer'], function (exports) {
+	/**
+	 *返回当前元素在数组中的下标 
+	 * @param {Object} val
+	 */
+	Array.prototype.indexOf = function (val) {
+		for (var i = 0; i < this.length; i++) {
+			if (this[i] == val) return i;
+		}
+		return -1;
+	};
+	var $ = layui.jquery,
+		form = layui.form,
+		layer = layui.layer;
+	var Class = function (obj) {
+		var _this = this;
+		_this.elem = obj.elem || 'body';//级联容器
+		_this.url = obj.url || {};//级联接口
+		_this.formParm = [];//表单参数名
+		typeof obj.url == 'object' && ($.each(obj.url, function (key, value) {
+			_this.formParm.push(key);
+		}));
+		_this.box = $('body');//子集容器
+		_this.boxs = [];//所有子集
+		_this.title = obj.title || null;//标题
+		_this.hostParm = {//默认请求参数名
+			idName: 'id',
+			rowsName: 'rows'
+		};
+		_this.valObj = {};//初始值对象
+		_this[_this.hostParm['rowsName']] = obj[_this.hostParm['rowsName']] || 10000;//请求条数
+		for (var i in obj.hostParm) {//自定义请求参数名
+			_this.hostParm[i] = obj.hostParm[i];
+		}
+		_this.data = {};//默认请求参数
+		_this.data[_this.hostParm['rowsName']] = _this[_this.hostParm['rowsName']];//赋值参数
+		_this.verify = obj.verify || {};
+
+		$.extend(this, obj);
+		_this.init();//初始化
+	};
+	/**
+	 * 初始化父下拉列表
+	 */
+	Class.prototype.init = function () {
+		var _this = this;
+		_this.box = $('<div class="layui-form-item"></div>');//select 容器
+		_this.title && (_this.box.append('<label class="layui-form-label">' + _this.title + '</label>'));//是否显示标题
+		//初始化值
+		if(JSON.stringify(_this.valObj) != '{}'){
+			_this.val();
+		}
+		_this.element(_this.formParm[0]);
+	};
+	Class.prototype.element = function (name, code,callback) {
+		var _this = this;
+		if (!_this.url[name]) {
+			// layer.msg("没有配置下级接口",{icon:2,time:600});
+			return _this;
+		}
+		_this.data[_this.hostParm['idName']] = code || null;
+		$.ajax({
+			url: _this.url[name],
+			data: _this.data,
+			async: 'false',
+			success: function (res) {
+				var select_id = "select_" + new Date().getTime();
+				_this.boxs[_this.formParm.indexOf(name)] = $(_this.selectHtml(select_id, name, res));
+				_this.box.append(_this.boxs[_this.formParm.indexOf(name)]);//往select容器添加包装好的select对象
+				$(_this.elem).append(_this.box);//追加到表单容器
+				_this.event(name);//绑定事件
+				//执行赋值回调函数
+				!!callback && callback(name, select_id);
+				typeof _this.valObj[name] != 'undefined' && ($("#" + select_id).val(_this.valObj[name]));
+				form.render();
+			}
+		});
+	};
+	/**
+	 * 包装Html
+	 */
+	Class.prototype.selectHtml = function (select_id, name, res) {
+		this.tempSelectId = new Date().getTime();
+		var html = '<div class="layui-input-inline"><select lay-search name="' + name + '" lay-verify="' + this.verify[name] + '" lay-filter="' + name + this.tempSelectId + '" id="' +
+			select_id + '"><option value="">请选择……</option>';
+		for (var xyz in res.data) {
+			html += '<option value="' + res.data[xyz].id + '">' + res.data[xyz].name + '</option>';
+		}
+		return (html + '</select></div>');
+	};
+	Class.prototype.event = function (name) {
+		var _this = this;
+		var x = _this.formParm.indexOf(name);
+		form.on("select(" + name + this.tempSelectId + ")", function (obj) {
+			_this.removeBox(x);
+			_this.element(_this.formParm[x - 0 + 1], obj.value);
+			_this.click(obj);
+			return false;
+		});
+	};
+	Class.prototype.click = function (obj) {
+
+	};
+	Class.prototype.removeBox = function (i) {
+		var _this = this;
+		for (var x = i + 1; x < _this.boxs.length; x++) {
+			_this.boxs[x].remove();
+		}
+	};
+	/**
+	 * 初始值
+	 */
+	Class.prototype.val = function (obj) {
+		var _this = this;
+		$.extend(_this.valObj, obj);
+		(function temp(i) {
+			if (_this.valObj[_this.formParm[i + 1]]) {
+				_this.element(_this.formParm[i - 0 + 1], _this.valObj[_this.formParm[i]], function (name, select_id) {
+					if (i == -1) {
+						_this.removeBox(i);
+					}
+					temp(++i);
+				});
+			}
+		})(-1);
+		return _this;
+	};
+	var cascade = {};
+	cascade.render = function (e) {
+		var i = new Class(e = e || {});
+		t = $(e.elem);
+		return t[0] ? i : layui.hint().error("layui.cascade 没有找到" + e.elem + "元素");
+	};
+	exports('cascade', cascade);
+});

+ 2182 - 0
js/layuiPlugins/dltable.js

@@ -0,0 +1,2182 @@
+/**
+ @Name:dl table 操作
+ @Author:lrd
+ */
+
+layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
+    "use strict";
+    var $ = layui.$
+        ,laytpl = layui.laytpl
+        ,laypage = layui.laypage
+        ,layer = layui.layer
+        ,form = layui.form
+        ,hint = layui.hint()
+        ,device = layui.device()
+
+        //外部接口
+        ,table = {
+            claObj:{}//全部的class对象map
+            ,obj:{}//额外保存的数据
+            ,config: {//全局配置项
+                checkName: 'LAY_CHECKED' //是否选中状态的字段名
+                ,indexName: 'LAY_TABLE_INDEX' //下标索引名
+            }
+            /**
+             * 缓存数据
+             *
+             * 结构图示
+             * cache{}                  缓存(对象)
+             *      key['data']{}       全部数据缓存(对象)
+             *          key[list][]     列表数据对象(数组)
+             *          key[map]{}      列表数据Map对象(Map
+             *          key[treeList][] 树状结构的对象(数组)
+             *      key['cla']{}        全部已初始化过的Calss对象类(注意渲染是异步执行)
+             *          key['claIds'][] 全部已经吊用过初始化方法的表格类
+             *          key[claObjs]{key[tableId]}  全部已经初始化好的cla对象
+             *
+             */
+            ,cache: {
+                tableId:{
+                    data:{
+                        list:[]//列表数据
+                        ,map:{}//列表数据以idField或唯一值作为key的Map数据
+                        ,treeList:[]//树状数据
+                    }
+                }
+                ,cla:{
+                    claIds:{
+                        tableId:true
+                    }
+                    ,claObjs:{
+                        tableId:{}
+                    }
+                }
+                ,selectcode:{//数据字典缓存
+                    demokey:[
+                        {
+                            key:{value:''}
+                        }
+                        ]
+                }
+            }
+            ,index: layui.table ? (layui.table.index + 10000) : 0
+            /**
+             * 设置全局项
+             * @param options
+             * @return {table}
+             */
+            ,set: function(options){
+                var that = this;
+                that.config = $.extend({}, that.config, options);
+                return that;
+            }
+            /**
+             * 事件监听
+             * @param events
+             * @param callback
+             * @return {*}
+             */
+            ,on: function(events, callback){
+                return layui.onevent.call(this, MOD_NAME, events, callback);
+            }
+            ,getClass:function (tableId) {
+                return table.cache.cla.claObjs[tableId];;
+            }
+            ,pushClass:function (tableId,that) {
+                table.cache.cla.claObjs[tableId]=that;
+            }
+            ,isCalss:function (tableId) {
+                var ids=this.cache.cla.claIds||{};
+                return  ids.hasOwnProperty(tableId)||false;
+            }
+            ,isClassYes:function (tableId) {
+                var ids=this.cache.cla.claIds||{};
+                return ids[tableId]||false;
+            }
+            ,pushClassIds:function (tableId,is) {
+                this.cache.cla.claIds[tableId]=is;
+            }
+            ,setObj:function (tableId,key,o) {
+                if(!this.obj[tableId])this.obj[tableId]={};
+                this.obj[tableId][key]=o;
+            }
+            ,getObj:function (tableId, key) {
+                return this.obj[tableId]?this.obj[tableId][key]:null;
+            }
+            /**
+             * 获取列表数据
+             */
+            ,getDataList:function (tableId) {
+                if(table.cache[tableId]){
+                    return table.cache[tableId].data.list;
+                }
+                return [];
+            }
+            /**
+             * 设置列表数据
+             */
+            ,setDataList:function (tableId, list) {
+                if(!table.cache[tableId])table.cache[tableId]={};
+                if(!table.cache[tableId].data)table.cache[tableId].data={};
+                if(!table.cache[tableId].data.list)table.cache[tableId].data.list=[];
+                table.cache[tableId].data.list=list;
+            }
+            /**
+             * 获取列表数据
+             */
+            ,getDataMap:function (tableId) {
+                if(table.cache[tableId]){
+                    return table.cache[tableId].data.map;
+                }
+                return {};
+            }
+            /**
+             * 设置列表数据
+             */
+            ,setDataMap:function (tableId, map) {
+                if(!table.cache[tableId])table.cache[tableId]={};
+                if(!table.cache[tableId].data)table.cache[tableId].data={};
+                if(!table.cache[tableId].data.map)table.cache[tableId].data.map={};
+                table.cache[tableId].data.map=map;
+            }
+            /**
+             * 获取树状数据
+             */
+            ,getDataTreeList:function (tableId) {
+                if(table.cache[tableId]){
+                    return table.cache[tableId].data.treeList;
+                }
+                return [];
+            }
+            /**
+             * 设置树状数据
+             */
+            ,setDataTreeList:function (tableId, treeList) {
+                if(!table.cache[tableId])table.cache[tableId]={};
+                if(!table.cache[tableId].data)table.cache[tableId].data={};
+                if(!table.cache[tableId].data.treeList)table.cache[tableId].data.treeList={};
+                table.cache[tableId].data.treeList=treeList;
+            }
+            /**
+             * 初始化
+             * @param filter
+             * @param settings
+             * @return {table}
+             */
+            ,init:function (filter, settings) {
+                settings = settings || {};
+                var that = this
+                    ,elemTable = filter ? $('table[lay-filter="'+ filter +'"]') : $(ELEM + '[lay-data]')
+                    ,errorTips = 'Table element property lay-data configuration item has a syntax error: ';
+                //遍历数据表格
+                elemTable.each(function(){
+                    var othis = $(this), tableData = othis.attr('lay-data');
+                    try{
+                        tableData = new Function('return '+ tableData)();
+                    } catch(e){
+                        hint.error(errorTips + tableData)
+                    }
+                    var cols = [], options = $.extend({
+                        elem: this
+                        ,cols: []
+                        ,data: []
+                        ,skin: othis.attr('lay-skin') //风格
+                        ,size: othis.attr('lay-size') //尺寸
+                        ,even: typeof othis.attr('lay-even') === 'string' //偶数行背景
+                    }, table.config, settings, tableData);
+
+                    filter && othis.hide();
+
+                    //获取表头数据
+                    othis.find('thead>tr').each(function(i){
+                        options.cols[i] = [];
+                        $(this).children().each(function(ii){
+                            var th = $(this), itemData = th.attr('lay-data');
+
+                            try{
+                                itemData = new Function('return '+ itemData)();
+                            } catch(e){
+                                return hint.error(errorTips + itemData)
+                            }
+
+                            var row = $.extend({
+                                title: th.text()
+                                ,colspan: th.attr('colspan') || 0 //列单元格
+                                ,rowspan: th.attr('rowspan') || 0 //行单元格
+                            }, itemData);
+
+                            if(row.colspan < 2) cols.push(row);
+                            options.cols[i].push(row);
+                        });
+                    });
+
+                    //获取表体数据
+                    othis.find('tbody>tr').each(function(i1){
+                        var tr = $(this), row = {};
+                        //如果定义了字段名
+                        tr.children('td').each(function(i2, item2){
+                            var td = $(this)
+                                ,field = td.data('field');
+                            if(field){
+                                return row[field] = td.html();
+                            }
+                        });
+                        //如果未定义字段名
+                        layui.each(cols, function(i3, item3){
+                            var td = tr.children('td').eq(i3);
+                            row[item3.field] = td.html();
+                        });
+                        options.data[i1] = row;
+                    });
+                    table.render(options);
+                });
+
+                return that;
+            }
+            /**
+             * 渲染入口方法(核心入口)
+             */
+            ,render:function (options) {
+                table.pushClassIds(options.id);
+                var inst = new Class(options);
+                return thisTable.call(inst);
+            }
+            /**
+             * 对应的表格加载完成后执行
+             * @param tableId
+             * @param fn
+             */
+            ,ready:function (tableId,fn) {
+                var is=false;
+                var myDate=new Date();
+                function isReady() {
+                    if(tableId){
+                        var that=table.getClass(tableId);
+                        if(that&&that.hasOwnProperty('layBody')){
+                            fn(that);
+                            is=true;
+                        }else{
+                            var myDate2=new Date();
+                            var i=myDate2.getTime()-myDate.getTime();
+                            if(i<=(1000*10)&&!is){//大于10秒退出
+                                setTimeout(isReady,50);
+                            }
+                        }
+                    }
+                }
+                if(tableId&&fn){
+                    setTimeout(isReady,50);
+                }
+            }
+            /**
+             * 获取表格选中记录
+             * @param tableId
+             * @return {{data: Array, isAll: boolean}}
+             */
+            ,checkStatus:function (tableId) {
+                var nums = 0
+                    ,invalidNum = 0
+                    ,arr = []
+                    ,data = table.getDataList(tableId) || [];
+                //计算全选个数
+                layui.each(data, function(i, item){
+                    if(item.constructor === Array){
+                        invalidNum++; //无效数据,或已删除的
+                        return;
+                    }
+                    if(item[table.config.checkName]){
+                        nums++;
+                        arr.push(table.clearCacheKey(item));
+                    }
+                });
+                return {
+                    data: arr //选中的数据
+                    ,isAll: data.length ? (nums === (data.length - invalidNum)) : false //是否全选
+                };
+            }
+            /**
+             * 设置表格复选状态
+             * @param tableId
+             * @param value     此值存在时为设置操作
+             * @returns {*}
+             */
+            ,setCheckStatus:function(tableId, fildName, ids){
+                var retObj=null;
+                var that=table.getClass(tableId)
+                    ,invalidNum = 0
+                    ,arr = []
+                    ,data = table.getDataList(tableId) || []
+                    ,childs = that.layBody.find('input[name="layTableCheckbox"]')//复选框
+                ;
+                if(fildName&&ids){//设置选中
+                    var idsarr=ids.split(',');
+                    idsarr.forEach(function (o) {
+                        // console.log(o);
+                        var temo=null;
+                        data.forEach(function (e) {
+                            var b1=e[fildName]+"";
+                            var b2=o+"";
+                            if(b1==b2){
+                                temo=e;
+                                return;
+                            };
+                        });
+                        if(temo){
+                            var v=temo[table.config.indexName];
+                            that.layBody.find('input[name="layTableCheckbox"][value="'+v+'"]').prop("checked",true);
+                            that.setCheckData(v, true);
+                        }
+                    });
+                    that.syncCheckAll();
+                    that.renderForm('checkbox');
+                }
+                return retObj;
+            }
+            /**
+             * 表格单选状态
+             * @param tableId
+             * @param value     此值存在时为设置操作
+             * @returns {*}
+             */
+            ,radioStatus:function (tableId) {
+                var retObj=null;
+                var nums = 0
+                    ,invalidNum = 0
+                    ,arr = []
+                    ,data = table.getDataList(tableId) || [];
+                var v=$("input[name='"+TABLE_RADIO_ID+tableId+"']:checked").val();
+                v=parseInt(v);
+                data.forEach(function (e) {
+                    if(e[table.config.indexName]==v){
+                        retObj=e;
+                        return;
+                    };
+                });
+                return retObj;
+            }
+            /**
+             * 设置表格单选状态
+             * @param tableId
+             * @param value     此值存在时为设置操作
+             * @returns {*}
+             */
+            ,setRadioStatus:function (tableId,fildName,value) {
+                var retObj=null;
+                var nums = 0
+                    ,invalidNum = 0
+                    ,arr = []
+                    ,data = table.getDataList(tableId) || [];
+
+                if(fildName&&value){//设置选中
+                    data.forEach(function (e) {
+                        var b1=e[fildName]+"";
+                        var b2=value+"";
+                        if(b1==b2){
+                            retObj=e;
+                            return;
+                        };
+                    });
+
+                    if(retObj){
+                        var v=retObj[table.config.indexName];
+                        $("input:radio[name='"+TABLE_RADIO_ID+tableId+"'][value='"+v+"']").prop("checked",true);
+                        form.render('radio');
+                    }
+                }
+                return retObj;
+            }
+            /**
+             * 清除临时Key
+             * @param data
+             * @return {*}
+             */
+            ,clearCacheKey:function (data) {
+                data = $.extend({}, data);
+                delete data[table.config.checkName];
+                delete data[table.config.indexName];
+                return data;
+            }
+            /**
+             * 刷新数据
+             * @param id
+             * @param options
+             * @return {*}
+             */
+            ,query:function (tableId, options) {
+                var that= table.getClass(tableId);
+                that.renderTdCss();
+                that.pullData(that.page, that.loading());
+            }
+            /**
+             * 此方法为整体重新渲染(重量级刷新方法)
+             * @param id
+             * @param options
+             */
+            ,reload:function (tableId, options) {
+                var config = thisTable.config[tableId];
+                options = options || {};
+                if(!config) return hint.error('The ID option was not found in the table instance');
+                if(options.data && options.data.constructor === Array) delete config.data;
+                return table.render($.extend(true, {}, config, options));
+            }
+            /**
+             * 添加一行或多行数据
+             * @param tableId   表格id
+             * @param index     在第几个位置插入(从0开始)
+             * @param data      数据
+             * @returns {*}
+             */
+            ,addRow:function (tableId, index, data) {
+                var that=table.getClass(tableId)
+                    ,options=that.config
+                    ,invalidNum = 0
+                    ,arr = []
+                    ,list = table.getDataList(tableId) || [];
+                //插入到父节点后面
+                list.splice(index,0,data);//更新缓存
+                table.restNumbers(list);//重置下标
+                that.resetData(list);
+                //如果是树状则处理数据
+                if(options.isTree) {
+                    //处理父级
+                    var uo=that.treeFindUpData(data);
+                    if(uo) {
+                        that.treeNodeOpen(uo, true);//展开节点
+                        that.renderTreeConvertShowName(uo);
+                    }
+                }
+                //生成html
+                var tds=that.renderTr(data,data[table.config.indexName]);
+                var trs='<tr data-index="'+ data[table.config.indexName] +'"'+that.renderTrUpids(data)+'>'+ tds.join('') + '</tr>';
+                if(index==0){//在第一个位置插入
+                    var  tbody=that.layBody.find('table tbody');
+                    $(tbody).prepend(trs);
+                    that.layBody.find(".layui-none").remove();
+                }else{
+                    var o=that.layBody.find('[data-index='+(index-1)+']');//父节点dom树
+                    $(o).after(trs);
+                }
+                that.renderPage(that.config.page.count+1);//分页渲染
+                that.restNumbers();
+            }
+            /**
+             * 删除一行或多行数据
+             * (如果是树状则删除自己和子节点)
+             * @param tableId
+             * @param data(1、数组;2、对象)
+             */
+            ,delRow:function (tableId, data) {
+                //1、页面清除 2、缓存清除
+                var that=table.getClass(tableId)
+                    ,options=that.config
+                    ,list=table.getDataList(tableId);
+                var sonList=[];//需要删除的数据
+                var delIds={};//需要删除的数据map
+                var delDatas=[];
+                if(!that||!data)return;
+                if(table.kit.isArray(data)){//是数组,删除多个
+                    delDatas=data;
+                }else{
+                    delDatas[0]=data;
+                }
+                sonList=options.isTree?table.treeFindSonList(that.config.id,delDatas):delDatas;
+                //页面元素处理
+                sonList.forEach(function (temo) {
+                    var index=temo[table.config.indexName];
+                    delIds[index]=index;//设置代删除的id集合
+                    var tr = that.layBody.find('tr[data-index="'+ index +'"]');
+                    tr.remove();
+                });
+                //数据处理
+                that.restNumbers();
+                var newList=[];//重构一个新的数组
+                for (var i=0,len=list.length;i<len;i++) {
+                    var isP=true;
+                    var temo1=null;
+                    sonList.forEach(function (temo) {
+                        if (temo[table.config.indexName] === list[i][table.config.indexName]) {
+                            isP = false;
+                        }
+                    });
+                    if(isP){
+                        newList.push(list[i]);
+                    }
+                }
+                table.restNumbers(newList);
+                that.resetData(newList);//更新缓存数据
+                if(options.page)that.renderPage(that.config.page.count-Object.keys(delIds).length);//分页渲染
+            }
+            ,restNumbers:function (list) {
+                if(!list)return;
+                var i=0;
+                list.forEach(function (o) {
+                    o[table.config.indexName]=i;
+                    i++;
+                });
+            }
+            /**
+             * 获取全部需要子节点对象集合
+             * @param data(数组或对象)
+             */
+            ,treeFindSonList:function (tableId,data) {
+                var that=table.getClass(tableId);
+                if(!that||!data)return [];
+                var delDatas=[];
+                var sonList=[];//需要删除的数据
+                var delIds={};//需要删除的数据map
+                if(table.kit.isArray(data)){//是数组,删除多个
+                    delDatas=data;
+                }else{
+                    delDatas[0]=data;
+                }
+                delDatas.forEach(function (temo) {
+                    if(temo.children.length>0){
+                        var temSonList=that.treeFindSonData(temo);
+                        temSonList.forEach(function (temii) {
+                            if(!delIds[temii[table.config.indexName]]){
+                                sonList.push(temii);
+                                delIds[temii[table.config.indexName]]=temii[table.config.indexName];
+                            }
+                        });
+                    }
+                    sonList.push(temo);
+                    delIds[temo[table.config.indexName]]=temo[table.config.indexName];
+                });
+                return sonList;
+            }
+            /**
+             * 获取全部需要子节点id集合
+             * @param data(数组或对象)
+             */
+            ,treeFindSonIds:function (tableId,data) {
+                var delIds=[];
+                var sonList=table.treeFindSonList(tableId,data);
+                sonList.forEach(function (temo) {
+                    delIds.push([table.config.indexName]);
+                });
+                return delIds;
+            }
+            /**
+             * 获取全部的id字段集合
+              * @param tableId
+             * @param data
+             * @returns {Array}
+             */
+            ,treeFindSonIdFields:function (tableId,data) {
+                var idField=[];
+                var that=table.getClass(tableId);
+                var sonList=table.treeFindSonList(tableId,data);
+                sonList.forEach(function (temo) {
+                    idField.push(temo[that.config.idField]);
+                });
+                return idField;
+            }
+            /**
+             * 工具方法对象
+             */
+            ,kit:{
+                isArray:function (o) {
+                    return Object.prototype.toString.call(o) === '[object Array]';
+                }
+            }
+        }
+        //操作当前实例
+        ,thisTable = function(){
+            var that = this
+                ,options = that.config
+                ,id = options.id;
+            id && (thisTable.config[id] = options);
+            return {
+                reload: function(options){
+                    that.reload.call(that, options);
+                }
+                ,config: options
+            }
+        }
+        //字符常量
+        ,MOD_NAME = 'dltable', ELEM = '.layui-table', THIS = 'layui-this', SHOW = 'layui-show', HIDE = 'layui-hide', DISABLED = 'layui-disabled', NONE = 'layui-none'
+        ,ELEM_VIEW = 'layui-table-view', ELEM_HEADER = '.layui-table-header', ELEM_BODY = '.layui-table-body', ELEM_MAIN = '.layui-table-main', ELEM_FIXED = '.layui-table-fixed', ELEM_FIXL = '.layui-table-fixed-l', ELEM_FIXR = '.layui-table-fixed-r', ELEM_TOOL = '.layui-table-tool', ELEM_PAGE = '.layui-table-page', ELEM_SORT = '.layui-table-sort', ELEM_EDIT = 'layui-table-edit', ELEM_HOVER = 'layui-table-hover'
+        ,TABLE_RADIO_ID='table_radio_'
+        ,ELEM_FILTER='.layui-table-filter'
+        ,TREE_ID='treeId',TREE_UPID='treeUpId',TREE_SHOW_NAME='treeShowName',TREE_KEY_MAP='tree_key_map'
+        //thead区域模板
+        ,TPL_HEADER = function(options){
+            var rowCols = '{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}';
+            options = options || {};
+            return ['<table cellspacing="0" cellpadding="0" border="0" class="layui-table" '
+                ,'{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>'
+                ,'<thead>'
+                ,'{{# layui.each(d.data.cols, function(i1, item1){ }}'
+                ,'<tr>'
+                    ,'{{# layui.each(item1, function(i2, item2){ }}'
+                        ,'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}'
+                        ,'{{# if(item2.fixed === "right"){ right = true; } }}'
+                        ,function(){
+                            if(options.fixed && options.fixed !== 'right'){
+                                return '{{# if(item2.fixed && item2.fixed !== "right"){ }}';
+                            }
+                            if(options.fixed === 'right'){
+                                return '{{# if(item2.fixed === "right"){ }}';
+                            }
+                            return '';
+                        }()
+                        ,'<th data-field="{{ item2.field||i2 }}" {{# if(item2.minWidth){ }}data-minwidth="{{item2.minWidth}}"{{# } }} '+ rowCols +' {{# if(item2.unresize){ }}data-unresize="true"{{# } }}>'
+                        ,'<div class="layui-table-cell laytable-cell-'
+                        ,'{{# if(item2.colspan > 1){ }}'
+                        ,'group'
+                        ,'{{# } else { }}'
+                        ,'{{d.index}}-{{item2.field || i2}}'
+                        ,'{{# if(item2.type !== "normal"){ }}'
+                        ,' laytable-cell-{{ item2.type }}'
+                        ,'{{# } }}'
+                        ,'{{# } }}'
+                        ,'" {{#if(item2.align){}}align="{{item2.align}}"{{#}}}>'
+                        ,'{{# if(item2.type === "checkbox"){ }}' //复选框
+                        ,'<input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-filter="layTableAllChoose" {{# if(item2[d.data.checkName]){ }}checked{{# }; }}>'
+                        ,'{{# } else { }}'
+                        ,'<span>{{item2.title||""}}</span>'
+                        ,'{{# if(!(item2.colspan > 1) && item2.sort){ }}'
+                        ,'<span class="layui-table-sort layui-inline"><i class="layui-edge layui-table-sort-asc"></i><i class="layui-edge layui-table-sort-desc"></i></span>'
+                        ,'{{# } }}'
+                        ,'{{# } }}'
+                        ,'</div>'
+                        ,'</th>'
+                        ,(options.fixed ? '{{# }; }}' : '')
+                    ,'{{# }); }}'
+                ,'</tr>'
+                ,'{{# }); }}'
+                ,'</thead>'
+                ,'</table>'].join('');
+        }
+        /**
+         * 行内过滤区域
+         */
+        ,TPL_FILTER = function(options){
+        }
+        //tbody区域模板
+        ,TPL_BODY = ['<table cellspacing="0" cellpadding="0" border="0" class="layui-table" '
+            ,'{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>'
+            ,'<tbody></tbody>'
+            ,'</table>'].join('')
+        //主模板
+        ,TPL_MAIN = ['<div class="layui-form layui-border-box {{d.VIEW_CLASS}}" lay-filter="LAY-table-{{d.index}}" style="{{# if(d.data.width){ }}width:{{d.data.width}}px;{{# } }} {{# if(d.data.height){ }}height:{{d.data.height}}px;{{# } }}">'
+
+            ,'{{# if(d.data.toolbar){ }}'
+            ,'<div class="layui-table-tool"></div>'
+            ,'{{# } }}'
+
+            ,'<div class="layui-table-box">'
+            ,'{{# var left, right; }}'
+            ,'<div class="layui-table-header">'
+            ,TPL_HEADER()
+            ,'</div>'
+            ,'<div class="layui-table-filter">'
+            ,TPL_FILTER()
+            ,'</div>'
+            ,'<div class="layui-table-body layui-table-main">'
+            ,TPL_BODY
+            ,'</div>'
+
+            ,'{{# if(left){ }}'
+            ,'<div class="layui-table-fixed layui-table-fixed-l">'
+            ,'<div class="layui-table-header">'
+            ,TPL_HEADER({fixed: true})
+            ,'</div>'
+            ,'<div class="layui-table-body">'
+            ,TPL_BODY
+            ,'</div>'
+            ,'</div>'
+            ,'{{# }; }}'
+
+            ,'{{# if(right){ }}'
+            ,'<div class="layui-table-fixed layui-table-fixed-r">'
+            ,'<div class="layui-table-header">'
+            ,TPL_HEADER({fixed: 'right'})
+            ,'<div class="layui-table-mend"></div>'
+            ,'</div>'
+            ,'<div class="layui-table-body">'
+            ,TPL_BODY
+            ,'</div>'
+            ,'</div>'
+            ,'{{# }; }}'
+            ,'</div>'
+
+            ,'{{# if(d.data.page){ }}'
+            ,'<div class="layui-table-page">'
+            ,'<div id="layui-table-page{{d.index}}"></div>'
+            ,'</div>'
+            ,'{{# } }}'
+
+            /*,'<style>'
+            ,'{{# layui.each(d.data.cols, function(i1, item1){'
+            ,'layui.each(item1, function(i2, item2){ }}'
+            ,'.laytable-cell-{{d.index}}-{{item2.field||i2}}{ '
+            ,'{{# if(item2.width){ }}'
+            ,'width: {{item2.width}}px;'
+            ,'{{# } }}'
+            ,' }'
+            ,'{{# });'
+            ,'}); }}'
+            ,'</style>'*/
+            ,'</div>'].join('')
+        ,_WIN = $(window)
+        ,_DOC = $(document)
+
+        //构造器
+        ,Class = function(options){
+            var that = this;
+            that.index = ++table.index;
+            that.config = $.extend({}, that.config, table.config, options);
+            that.render();
+            table.pushClass(options.id,that);
+        };
+
+    //默认配置
+    Class.prototype.config = {
+        limit: 10 //每页显示的数量
+        ,loading: true //请求数据时,是否显示loading
+        ,cellMinWidth: 60 //所有单元格默认最小宽度
+        ,text: {
+            none: '无数据'
+        }
+        ,isFilter:false//是否开启行内过滤
+        ,method:'post'//默认以post方式请求后台
+    };
+    //表格渲染
+    Class.prototype.render = function(){
+        var that = this
+            ,options = that.config;
+        options.elem = $(options.elem);
+        options.where = options.where || {};
+        options.id = options.id || options.elem.attr('id');
+        //请求参数的自定义格式
+        options.request = $.extend({
+            pageName: 'page'
+            ,limitName: 'limit'
+        }, options.request)
+        //响应数据的自定义格式
+        options.response = $.extend({
+            statusName: 'code'
+            ,statusCode: 0
+            ,msgName: 'msg'
+            ,dataName: 'data'
+            ,countName: 'count'
+        }, options.response);
+        //如果 page 传入 laypage 对象
+        if(typeof options.page === 'object'){
+            options.limit = options.page.limit || options.limit;
+            options.limits = options.page.limits || options.limits;
+            that.page = options.page.curr = options.page.curr || 1;
+            delete options.page.elem;
+            delete options.page.jump;
+        }
+        if(!options.elem[0]) return that;
+        that.setArea(); //动态分配列宽高
+        //开始插入替代元素
+        var othis = options.elem
+            ,hasRender = othis.next('.' + ELEM_VIEW)
+
+            //主容器
+            ,reElem = that.elem = $(laytpl(TPL_MAIN).render({
+                VIEW_CLASS: ELEM_VIEW
+                ,data: options
+                ,index: that.index //索引
+            }));
+        options.index = that.index;
+        //生成替代元素
+        hasRender[0] && hasRender.remove(); //如果已经渲染,则Rerender
+        othis.after(reElem);
+        that.renderTdCss();
+        //各级容器
+        that.layHeader = reElem.find(ELEM_HEADER);  //表头
+        that.layMain = reElem.find(ELEM_MAIN);//内容区域
+        that.layBody = reElem.find(ELEM_BODY);//内容区域
+        that.layFixed = reElem.find(ELEM_FIXED);//浮动区域
+        that.layFixLeft = reElem.find(ELEM_FIXL);//左浮动
+        that.layFixRight = reElem.find(ELEM_FIXR);//有浮动
+        that.layTool = reElem.find(ELEM_TOOL);//工具栏区域
+        that.layPage = reElem.find(ELEM_PAGE);//分页区域
+        that.layFilter=reElem.find(ELEM_FILTER);//行内过滤条件区域
+        that.layTool.html(
+            laytpl($(options.toolbar).html()||'').render(options)
+        );
+        if(options.height) that.fullSize(); //设置body区域高度
+        //如果多级表头,则填补表头高度
+        if(options.cols.length > 1){
+            var th = that.layFixed.find(ELEM_HEADER).find('th');
+            th.height(that.layHeader.height() - 1 - parseFloat(th.css('padding-top')) - parseFloat(th.css('padding-bottom')));
+        }
+        //渲染过滤区域
+        if(options.isFilter){
+            that.layFilter.html(
+                that.renderFilter()
+            );
+        }
+        //请求数据
+        that.pullData(that.page);
+        that.events();
+    };
+    //根据列类型,定制化参数
+    Class.prototype.initOpts = function(item){
+        var that = this,
+            options = that.config
+            ,initWidth = {
+                checkbox: 48
+                ,space: 15
+                ,numbers: 40
+            };
+
+        //让 type 参数兼容旧版本
+        if(item.checkbox) item.type = "checkbox";
+        if(item.space) item.type = "space";
+        if(!item.type) item.type = "normal";
+
+        if(item.type !== "normal"){
+            item.unresize = true;
+            item.width = item.width || initWidth[item.type];
+        }
+
+        if(options.isFilter){//开启行内过滤
+            if(item.isFilter!=false){
+                item.isFilter=true;
+            }
+        }
+    };
+    //动态分配列宽高
+    Class.prototype.setArea = function(){
+        var that = this,
+            options = that.config
+            ,colNums = 0 //列个数
+            ,autoColNums = 0 //自动列宽的列个数
+            ,autoWidth = 0 //自动列分配的宽度
+            ,countWidth = 0 //所有列总宽度和
+            ,cntrWidth = options.width ||function(){ //获取容器宽度
+                //如果父元素宽度为0(一般为隐藏元素),则继续查找上层元素,直到找到真实宽度为止
+                var getWidth = function(parent){
+                    var width, isNone;
+                    parent = parent || options.elem.parent()
+                    width = parent.width();
+                    try {
+                        isNone = parent.css('display') === 'none';
+                    } catch(e){}
+                    if(parent[0] && (!width || isNone)) return getWidth(parent.parent());
+                    return width;
+                };
+                return getWidth();
+            }();
+        //统计列个数
+        that.eachCols(function(){
+            colNums++;
+        });
+        //减去边框差
+        cntrWidth = cntrWidth - function(){
+            return (options.skin === 'line' || options.skin === 'nob') ? 2 : colNums + 1;
+        }();
+        //遍历所有列
+        layui.each(options.cols, function(i1, item1){
+            layui.each(item1, function(i2, item2){
+                var width;
+                if(!item2){
+                    item1.splice(i2, 1);
+                    return;
+                }
+                that.initOpts(item2);
+                width = item2.width || 0;
+                if(item2.colspan > 1) return;
+                if(/\d+%$/.test(width)){
+                    item2.width = width = Math.floor((parseFloat(width) / 100) * cntrWidth);
+                } else if(item2._is_width_dev||!width){ //列宽未填写
+                    item2._is_width_dev=true;//采用默认宽度的列
+                    item2.width = width = 0;
+                    autoColNums++;
+                }
+                countWidth = countWidth + width;
+            });
+        });
+        that.autoColNums = autoColNums; //记录自动列数
+        //如果未填充满,则将剩余宽度平分。否则,给未设定宽度的列赋值一个默认宽
+        (cntrWidth > countWidth && autoColNums) && (
+            autoWidth = (cntrWidth - countWidth) / autoColNums
+        );
+        layui.each(options.cols, function(i1, item1){
+            layui.each(item1, function(i2, item2){
+                var minWidth = item2.minWidth || options.cellMinWidth;
+                if(item2.colspan > 1) return;
+                if(item2.width === 0){
+                    item2.width = Math.floor(autoWidth >= minWidth ? autoWidth : minWidth); //不能低于设定的最小宽度
+                }
+            });
+        });
+
+        //高度铺满:full-差距值
+        var th=that.getParentDivHeight(options.id);
+        that.fullHeightGap=0;
+        if(options.height){
+            if(/^full-\d+$/.test(options.height)){
+                that.fullHeightGap = options.height.split('-')[1];
+            }
+        }
+        options.height = th - that.fullHeightGap;
+
+        layui.each(options.cols, function(i1, item1){
+            layui.each(item1, function(i2, item2){
+            })
+        });
+    };
+    /**
+     * 表格获取父容器高度
+     * @param tableId
+     */
+    Class.prototype.getParentDivHeight = function(tableId){
+        var th=$("#"+tableId).parent().height();
+        return th;
+    };
+    //表格重载
+    Class.prototype.reload = function(options){
+        var that = this;
+        if(that.config.data && that.config.data.constructor === Array) delete that.config.data;
+        that.config = $.extend({}, that.config, options);
+        //获取行内过滤的值
+        that.render();
+    };
+    //页码
+    Class.prototype.page = 1;
+    /**
+     * 重置下标(插入删除等操作)
+     * 1、data-index中的下标
+     * 2、tr中data的值
+     * 3、下标字段的值
+     * @param list
+     */
+    Class.prototype.restNumbers=function(){
+        var that = this
+            ,options = that.config;
+        var  trs=that.layBody.find('table tbody tr');
+        var i=0;
+        trs.each(function (o) {
+            $(this).attr("data-index",i);
+            $(this).find(".laytable-cell-numbers p").text(i+1);
+            $(this).data('index',i);
+            i++;
+        });
+    }
+    /**
+     * 重置当前表格的数据(1、普通列表;2树状表格)
+     * 将列表数据转成树形结构和符合table展示的列表
+     * @param list          列表数据
+     * @param field_Id      树形结构主键字段
+     * @param field_upId    树形结构上级字段
+     * @returns {Array}     [0]表格列表  [1]树形结构
+     */
+    Class.prototype.resetData=function(list) {
+        var that = this
+            ,options = that.config;
+        var datas=[];
+        var treeList=[];
+        var tableList=[];
+        var map={};//列表map,fieldId为key
+        datas.push(tableList);//table结构
+        datas.push(treeList)//tree树结构
+        datas.push(map)//data数据 map结构
+        if(list==null||list.length<=0)return datas;
+        //设置默认参数
+        for (var i = 0; i < list.length; i++) {
+            var n = list[i];
+            if(options.isTree){
+                if(!n.hasOwnProperty("is_open")){//如果不存在该属性则默认为true
+                    n.is_open=true;
+                }
+                if(!n.hasOwnProperty("is_show")){//如果不存在该属性则默认为true
+                    n.is_show=true;
+                }
+            }
+        }
+        if(options.isTree){//树状
+            var field_Id=options[TREE_ID];
+            var field_upId=options[TREE_UPID];
+            //处理树结构
+            var fa = function(upId) {
+                var _array = [];
+                for (var i = 0; i < list.length; i++) {
+                    var n = list[i];
+                    if (n[field_upId] === upId) {
+                        n.children = fa(n[field_Id]);
+                        _array.push(n);
+                    }
+                }
+                return _array;
+            }
+            treeList=fa(list[0][field_upId],"");//递归
+            //处理表格结构
+            var fa2=function (l,level,upids) {
+                for (var i = 0; i < l.length; i++) {
+                    var n = l[i];
+                    n.level=level;//设置当前层级
+                    n.upIds=upids;
+                    tableList.push(n);
+                    if (n.children&&n.children.length>0) {
+                        fa2(n.children,1+level,upids+"_"+n[field_Id]+"_");
+                    }
+                }
+                return;
+            }
+            fa2(treeList,1,"");
+        }
+        else{
+            tableList=list;
+        }
+        //设置map数据集合
+        tableList.forEach(function (o) {
+            map[o[field_Id]]=o;
+        });
+        //设置到内存中去
+        table.setDataList(that.config.id,tableList);
+        table.setDataTreeList(that.config.id,treeList);
+        table.setDataMap(that.config.id,map);
+        return datas;
+    }
+    /**
+     * 根据id从表格数据中获取对象
+     * @param data
+     * @param field_Id
+     * @param field_upId
+     * @returns {Array}
+     */
+    Class.prototype.treeFindDataById=function(u_Id) {
+        var that = this
+            ,options = that.config;
+        var e=null;
+        var list=table.getDataList(that.key);
+        var key=options[TREE_ID];
+        list.forEach(function (o) {
+             if(o[key]==u_Id){
+                 e=o;
+                 return;
+             }
+        });
+        return e;
+    }
+    /**
+     * 获取父节点
+     * @param u_Id
+     */
+    Class.prototype.treeFindUpData=function(o){
+        var uOjb=null;
+        var that = this
+            ,options = that.config;
+        //处理父级
+        var key=options[TREE_UPID];//父节点key名称
+        var mapData=table.getDataMap(that.config.id);//获取map形式对象集合
+        uOjb=mapData[o[key]];
+        return uOjb;
+    }
+    /**
+     * 根据父id获取全部的叶子节点(递归)
+     * @param o 数据对象
+     * @return {string}
+     */
+    Class.prototype.treeFindSonData=function (data) {
+        var objs=[];
+        function f(o) {
+            if(o.children.length>0){
+                o.children.forEach(function (i) {
+                    objs.push(i);
+                    if(i.children.length>0){
+                        f(i);
+                    }
+                });
+            }
+        }f(data);
+        return objs;
+    };
+    /**
+     * 叶子节点显示转换
+     * @param o             数据
+     * @param fieldName     树显示列名
+     * @returns {string}
+     */
+    Class.prototype.treeConvertShowName=function (o) {
+        var that = this
+            ,options = that.config;
+        var isTreeNode=(o.children&&o.children.length>0);
+        var temhtml='<div style="float: left;height: 28px;line-height: 28px;padding-left: '+
+            function () {
+                if(isTreeNode){
+                    return '5px'
+                }else{
+                    return '21px'
+                }
+            }()
+            +'">'
+            +function () {//位移量
+                var nbspHtml="<i>"//一次位移
+                for(var i=1;i<o.level;i++) {
+                    nbspHtml = nbspHtml + "&nbsp;&nbsp;&nbsp;&nbsp;";
+                }
+                nbspHtml=nbspHtml+"</i>";
+                return nbspHtml;
+            }()
+            +function () {//图标或占位符
+                var temTreeHtml='';
+                if(isTreeNode)temTreeHtml='<i class="layui-icon layui-tree-head">&#xe625;</i> ';
+                return temTreeHtml;
+            }()
+            +'</div>';
+        return temhtml;
+    };
+    /**
+     * 节点的展开或折叠
+     * @param o         节点数据(树状表格)
+     * @param is_open    展开(true)或折叠(false
+     *
+     * 每个节点有两种状态,
+     * 1、打开状态(is_open)   打开状态只需在点击瞬间控制,其他时候不需要变动
+     * 2、显示状态(显示或隐藏) 显示状态根据父级节点控制,父级节点是显示并且打开状态的则显示,否则不显示,但不影响其打开状态
+     */
+    Class.prototype.treeNodeOpen=function (o,is_open) {
+        var that = this
+            ,options = that.config
+            ,tr = that.layBody.find('tr[data-index="'+ o[table.config.indexName] +'"]');
+        o.is_open=is_open;
+        //处理树结构
+        var fa = function(e) {
+            if(e.children&&e.children.length>0){
+                var temList=e.children;
+                for (var i = 0; i < temList.length; i++) {
+                    var n = temList[i];
+                    if(o.is_open){//打开状态的,关闭
+                        if(e.is_open&&e.is_show){//该节点显示
+                            var temo=that.layBody.find('tr[data-index="'+ n[table.config.indexName] +'"]');
+                            temo.show();
+                            n.is_show=true;
+                        }
+                    }else{
+                        var temo=that.layBody.find('tr[data-index="'+ n[table.config.indexName] +'"]');
+                        temo.hide();
+                        n.is_show=false;
+                    }
+                    fa(n);
+                }
+            }
+        }
+        fa(o);
+        //处理图标
+        var dbClickI=tr.find('.layui-tree-head');
+        if(o.is_open){//打开状态
+            dbClickI.html('&#xe625;');
+        }else{
+            dbClickI.html('&#xe623;');
+        }
+    };
+    //获得数据
+    Class.prototype.pullData = function(curr, loadIndex){
+        var that = this
+            ,options = that.config
+            ,request = options.request
+            ,response = options.response
+            ,sort = function(){
+            if(typeof options.initSort === 'object'){
+                that.sort(options.initSort.field, options.initSort.type);
+            }
+        };
+        that.startTime = new Date().getTime(); //渲染开始时间
+        if(options.url){ //Ajax请求
+            var params = {};
+            params[request.pageName] = curr;
+            params[request.limitName] = options.limit;
+            //行内过滤条件
+            var list=that.layFilter.find("[name^='filter_']");
+            layui.each(list,function (i, o) {
+               params[o.name]=$(o).val();
+            });
+            $.ajax({
+                type: options.method || 'get'
+                ,url: options.url
+                ,data: $.extend(params, options.where)
+                ,dataType: 'json'
+                ,success: function(res){
+                    if(res.data.length){
+                        let arr = [],obj = res.data;
+                        (function objArr(obj,id) {
+                            for (let i in obj) {
+                                obj[i].myid = id+i;
+                                obj[i].myPid = id;
+                                if (obj[i].childMenus != null) {
+                                    objArr(obj[i].childMenus,id+i);
+                                    obj[i].childMenus = null;
+                                    arr.push(obj[i]);
+                                } else {
+                                    arr.push(obj[i]);
+                                }
+                            }
+                        })(obj,'#');
+    
+                        res.data = arr.reverse();
+                        console.log(res.data);
+                        res.is = true;
+                        res.count = res.data.length;
+                    }else{
+                        res.data[0] = {name:"无数据",myid:'0',myPid:'0',id:'0'};
+                    }
+                    that.resetData(res.data);
+                    res.data=table.getDataList(options.id);
+                    if(res[response.statusName] != response.statusCode){
+                        that.renderForm();
+                        that.layMain.html('<div class="'+ NONE +'">'+ (res[response.msgName] || '返回的数据状态异常') +'</div>');
+                    } else {
+                        that.renderData(res, curr, res[response.countName]), sort();
+                        options.time = (new Date().getTime() - that.startTime) + ' ms'; //耗时(接口请求+视图渲染)
+                    }
+                    loadIndex && layer.close(loadIndex);
+                    typeof options.done === 'function' && options.done(res, curr, res[response.countName]);
+
+                }
+                ,error: function(e, m){
+                    that.layMain.html('<div class="'+ NONE +'">数据接口请求异常</div>');
+                    that.renderForm();
+                    loadIndex && layer.close(loadIndex);
+                }
+            });
+        } else if(options.data && options.data.constructor === Array){ //已知数据
+            var res = {},startLimit = curr*options.limit - options.limit
+            res[response.dataName] = options.data.concat().splice(startLimit, options.limit);
+            res[response.countName] = options.data.length;
+            that.renderData(res, curr, options.data.length), sort();
+            typeof options.done === 'function' && options.done(res, curr, res[response.countName]);
+        }
+    };
+    //遍历表头
+    Class.prototype.eachCols = function(callback){
+        var cols = $.extend(true, [], this.config.cols)
+            ,arrs = [], index = 0;
+
+        //重新整理表头结构
+        layui.each(cols, function(i1, item1){
+            layui.each(item1, function(i2, item2){
+                //如果是组合列,则捕获对应的子列
+                if(item2.colspan > 1){
+                    var childIndex = 0;
+                    index++
+                    item2.CHILD_COLS = [];
+                    layui.each(cols[i1 + 1], function(i22, item22){
+                        if(item22.PARENT_COL || childIndex == item2.colspan) return;
+                        item22.PARENT_COL = index;
+                        item2.CHILD_COLS.push(item22);
+                        childIndex = childIndex + (item22.colspan > 1 ? item22.colspan : 1);
+                    });
+                }
+                if(item2.PARENT_COL) return; //如果是子列,则不进行追加,因为已经存储在父列中
+                arrs.push(item2)
+            });
+        });
+
+        //重新遍历列,如果有子列,则进入递归
+        var eachArrs = function(obj){
+            layui.each(obj || arrs, function(i, item){
+                if(item.CHILD_COLS) return eachArrs(item.CHILD_COLS);
+                callback(i, item);
+            });
+        };
+
+        eachArrs();
+    };
+
+    /**
+     * 渲染节点显示
+     * @param callback
+     */
+    Class.prototype.renderTreeConvertShowName = function(o){
+        var that = this
+            ,options = that.config
+            ,m=options.elem
+            ,hasRender = m.next('.' + ELEM_VIEW);
+        var temhtml=that.treeConvertShowName(o);
+        var temdiv=that.layBody.find('tr[data-index="'+ o[table.config.indexName] +'"]').find('td[data-field='+options[TREE_SHOW_NAME]+']').find('.layui-table-cell');
+        $(temdiv).find('div').remove();
+        $(temdiv).prepend(temhtml);
+    }
+    /**
+     * 渲染表格单元格样式(宽度样式设置)
+     * @param callback
+     */
+    Class.prototype.renderTdCss = function(){
+        var that = this
+            ,options = that.config
+            ,m=options.elem
+            ,hasRender = m.next('.' + ELEM_VIEW);
+        var id=that.index+'_dltable_td_style';
+        hasRender.find("#"+id).remove();
+        var styel='<style id="'+id+'">'
+            +function () {
+                var ret="";
+                layui.each(that.config.cols,function (i1, item1) {
+                    layui.each(item1, function(i2, item2){
+                        ret+='.laytable-cell-'+that.index+'-'+(item2.field||i2)+'{' +
+                            'width:'+(item2.width?item2.width+"px":"0px")
+                            +'}';
+                    });
+                });
+                return ret;
+            }()+'</style>';
+        hasRender.append(styel);
+    }
+    /**
+     * 生成单元格
+     * @param obj       行数据
+     * @param numbers   下标
+     * @param cols      列定义数据
+     * @param i3        第几列
+     */
+    Class.prototype.renderTrUpids=function (obj) {
+        var that = this
+            ,options = that.config;
+        var tree_upid_key=options[TREE_UPID];
+        var upids=' upids="'+obj["upIds"]+'" ';
+        var u_id=' u_id="'+obj[tree_upid_key]+'" '
+        var ret=options.isTree?u_id:'';
+        return ret;
+    }
+    /**
+     * 生成单元格
+     * @param obj       行数据
+     * @param numbers   下标
+     * @param cols      列定义数据
+     * @param i3        第几列
+     */
+    Class.prototype.renderTd=function (param) {
+        var that = this
+            ,options = that.config;
+        var cols=param.cols;
+        var obj=param.obj;
+        var numbers=param.numbers;
+        var i3=param.i3;
+
+        var field = cols.field || i3, content = obj[field]||''
+            ,cell = that.getColElem(that.layHeader, field);
+
+        var treeImgHtml='';
+        if(options.isTree){
+            if(options.treeShowName==cols.field){
+                treeImgHtml=that.treeConvertShowName(obj);
+            }
+        }
+        //td内容
+        var td = ['<td data-field="'+ field +'" '+ function(){
+            var attr = [];
+            if(cols.edit) attr.push('data-edit="'+ cols.edit +'"'); //是否允许单元格编辑
+            if(cols.align) attr.push('align="'+ cols.align +'"'); //对齐方式
+            if(cols.templet) attr.push('data-content="'+ content +'"'); //自定义模板
+            if(cols.toolbar) attr.push('data-off="true"'); //自定义模板
+            if(cols.event) attr.push('lay-event="'+ cols.event +'"'); //自定义事件
+            if(cols.style) attr.push('style="'+ cols.style +'"'); //自定义样式
+            if(cols.minWidth) attr.push('data-minwidth="'+ cols.minWidth +'"'); //单元格最小宽度
+            return attr.join(' ');
+        }() +'>'
+            ,'<div class="layui-table-cell laytable-cell-'+ function(){ //返回对应的CSS类标识
+                var str = (options.index + '-' + field);
+                return cols.type === 'normal' ? str
+                    : (str + ' laytable-cell-' + cols.type);
+            }() +'">'+treeImgHtml+'<p style="width: auto;height: 100%;">'+ function(){
+                var tplData = $.extend(true, {
+                    LAY_INDEX: numbers
+                }, obj);
+                //渲染复选框列视图
+                if(cols.type === 'checkbox'){
+                    return '<input type="checkbox" name="layTableCheckbox" value="'+tplData[table.config.indexName]+'" lay-skin="primary" '+ function(){
+                            var checkName = table.config.checkName;
+                            //如果是全选
+                            if(cols[checkName]){
+                                obj[checkName] = cols[checkName];
+                                return cols[checkName] ? 'checked' : '';
+                            }
+                            return tplData[checkName] ? 'checked' : '';
+                        }() +'>';
+                } else if(cols.type === 'numbers'){ //渲染序号
+                    return numbers;
+                }else if(cols.type === 'drop'){//下拉框
+                    var rowsField=dl.ui.table.drop.findFieldObj(options.cols[0],field);
+                    if(rowsField&&rowsField['drop']){
+                        var o=dl.cache.code.get(rowsField.drop);
+                        return dl.ui.table.drop.findDropLable(rowsField.drop,content);
+                    }
+                }else if(cols.type === 'radio'){//单选
+                    return '<input type="radio" name="'+TABLE_RADIO_ID+options.id+'" value="'+tplData[table.config.indexName]+'" checked="">';
+                }
+
+                //解析工具列模板
+                if(cols.toolbar){
+                    return laytpl($(cols.toolbar).html()||'').render(tplData);
+                }
+
+                return cols.templet ? function(){
+                    return typeof cols.templet === 'function'
+                        ? cols.templet(tplData)
+                        : laytpl($(cols.templet).html() || String(content)).render(tplData)
+                }() : content;
+            }()
+            ,'</p></div></td>'].join('');
+
+        return td;
+    }
+    /**
+     * 生成tr中的一行
+     * @param obj            行数据
+     * @param numbers          行号
+     * @returns {*}
+     */
+    Class.prototype.renderTr=function (obj,numbers) {
+        var that = this
+            ,options = that.config;
+        var tds= [];
+        that.eachCols(function(i3, cols){//cols列定义
+            var field = cols.field || i3, content = obj[field]
+                ,cell = that.getColElem(that.layHeader, field);
+            if(content === undefined || content === null) content = '';
+            if(cols.colspan > 1) return;
+            //td内容
+            var td = that.renderTd({
+                'obj':obj,'numbers':numbers,'cols':cols,'i3':i3
+            });
+            tds.push(td);
+            // if(item3.fixed && item3.fixed !== 'right') tds_fixed.push(td);
+            // if(item3.fixed === 'right') tds_fixed_r.push(td);
+        });
+        return tds;
+    };
+    /**
+     * 表格数据部分渲染入口
+     * @param res
+     * @param curr
+     * @param count
+     * @param sort
+     */
+    Class.prototype.renderData = function(res, curr, count, sort){
+        var that = this
+            ,options = that.config
+            ,data = res[options.response.dataName] || []
+            ,trs = []
+            ,trs_fixed = []
+            ,trs_fixed_r = []
+            //渲染视图
+            ,render = function(){ //后续性能提升的重点
+                if(!sort && that.sortKey){
+                    return that.sort(that.sortKey.field, that.sortKey.sort, true);
+                }
+                layui.each(data, function(i1, obj){
+                    var tds = [], tds_fixed = [], tds_fixed_r = []
+                        ,numbers = i1 + options.limit*(curr - 1) + 1; //序号
+                    if(obj.length === 0) return;
+                    if(!sort){
+                        obj[table.config.indexName] = i1;
+                    }
+                    tds=that.renderTr(obj,numbers);
+                    trs.push('<tr data-index="'+ i1 +'" '+that.renderTrUpids(obj)+'>'+ tds.join('') + '</tr>');
+
+                    trs_fixed.push('<tr data-index="'+ i1 +'">'+ tds_fixed.join('') + '</tr>');
+                    trs_fixed_r.push('<tr data-index="'+ i1 +'">'+ tds_fixed_r.join('') + '</tr>');
+                });
+
+                //if(data.length === 0) return;
+
+                that.layBody.scrollTop(0);
+                that.layMain.find('.'+ NONE).remove();
+                that.layMain.find('tbody').html(trs.join(''));
+                that.layFixLeft.find('tbody').html(trs_fixed.join(''));
+                that.layFixRight.find('tbody').html(trs_fixed_r.join(''));
+
+                that.renderForm();
+                that.syncCheckAll();
+                that.haveInit ? that.scrollPatch() : setTimeout(function(){
+                    that.scrollPatch();
+                }, 50);
+                that.haveInit = true;
+                layer.close(that.tipsIndex);
+            };
+        that.key = options.id || options.index;
+        // table.cache[that.key] = data; //记录数据
+        table.setDataList(that.key,data);
+        //显示隐藏分页栏
+        that.layPage[data.length === 0 && curr == 1 ? 'addClass' : 'removeClass'](HIDE);
+        //排序
+        if(sort){
+            return render();
+        }
+        if(data.length === 0){
+            that.renderForm();
+            that.layFixed.remove();
+            that.layMain.find('tbody').html('');
+            that.layMain.find('.'+ NONE).remove();
+            return that.layMain.append('<div class="'+ NONE +'">'+ options.text.none +'</div>');
+        }
+        render();
+        that.renderPage(count);//分页渲染
+        //calss加载完成
+        table.pushClassIds(options.id,true);
+
+        layui.each(options.cols, function(i1, item1){
+            layui.each(item1, function(i2, item2){
+            })
+        });
+    };
+    /**
+     * 渲染分页
+     */
+    Class.prototype.renderPage=function (count) {
+        var that = this
+            ,options = that.config;
+        //同步分页状态
+        if(options.page){
+            options.page = $.extend({
+                elem: 'layui-table-page' + options.index
+                ,count: count
+                ,limit: options.limit
+                ,limits: options.limits || [10,15,20,30,40,50,60,70,80,90]
+                ,groups: 3
+                ,layout: ['prev', 'page', 'next', 'skip', 'count', 'limit']
+                ,prev: '<i class="layui-icon">&#xe603;</i>'
+                ,next: '<i class="layui-icon">&#xe602;</i>'
+                ,jump: function(obj, first){
+                    if(!first){
+                        //分页本身并非需要做以下更新,下面参数的同步,主要是因为其它处理统一用到了它们
+                        //而并非用的是 options.page 中的参数(以确保分页未开启的情况仍能正常使用)
+                        that.page = obj.curr; //更新页码
+                        options.limit = obj.limit; //更新每页条数
+                        that.pullData(obj.curr, that.loading());
+                    }
+                }
+            }, options.page);
+            options.page.count = count; //更新总条数
+            laypage.render(options.page);
+        }
+    };
+    /**
+     * 过滤区域的渲染
+     */
+    Class.prototype.renderFilter = function(){
+        var that = this
+            ,options = that.config
+            ,VIEW_CLASS=ELEM_VIEW
+            ,index=that.index; //索引
+        var v = [];
+        v.push('<form method="post"  id="'+options.id+'_filter_form">');
+        v.push('<table cellspacing="0" cellpadding="0" border="0" class="layui-table"><thead><tr>');
+        layui.each(options.cols,function (i, o) {
+            layui.each(o, function(i2, item2){
+                var field=item2.field||i2;
+                var minW=item2.minWidth?"data-minwidth='"+item2.minWidth+"'":"";
+                var rowCols=item2.colspan?'colspan="'+item2.colspan+'"':'';
+                var rowspan=item2.rowspan?'rowspan="'+item2.rowspan+'"':'';
+                var unresize=item2.unresize?'data-unresize="true"':'';
+                v.push('<th data-field="'+field+'"'+minW+rowCols+rowspan +unresize+'>');
+                v.push('<div class="layui-table-cell laytable-cell-'+function () {
+                    var tem="";
+                    if (item2.colspan > 1) {
+                        tem='group';
+                    }else{
+                        tem=index+"-"+field;
+                        if(item2.type !== "normal"){
+                            tem+=" laytable-cell-"+item2.type;
+                        }
+                    }
+                    return tem;
+                }()+'">');
+                if(!item2.isFilter||!item2.field){//不开启行内过滤或没有列名
+                    v.push('');
+                }else{
+                    v.push('<input class="layui-input '+ ELEM_EDIT +'" id="filter_'+item2.field+'" name="filter_'+item2.field+'">');
+                }
+                v.push('</div></th>');
+
+            });
+        });
+        v.push('</tr></thead></table>');
+        v.push('</form>');
+        return v.join('');
+    };
+    //找到对应的列元素
+    Class.prototype.getColElem = function(parent, field){
+        var that = this
+            ,options = that.config;
+        return parent.eq(0).find('.laytable-cell-'+ (options.index + '-' + field) + ':eq(0)');
+    };
+    //渲染表单
+    Class.prototype.renderForm = function(type){
+        form.render(type, 'LAY-table-'+ this.index);
+    }
+    //数据排序
+    Class.prototype.sort = function(th, type, pull, formEvent){
+        var that = this
+            ,field
+            ,res = {}
+            ,options = that.config
+            ,filter = options.elem.attr('lay-filter')
+            ,data = table.getDataList(that.key), thisData;
+
+        //字段匹配
+        if(typeof th === 'string'){
+            that.layHeader.find('th').each(function(i, item){
+                var othis = $(this)
+                    ,_field = othis.data('field');
+                if(_field === th){
+                    th = othis;
+                    field = _field;
+                    return false;
+                }
+            });
+        }
+
+        try {
+            var field = field || th.data('field');
+
+            //如果欲执行的排序已在状态中,则不执行渲染
+            if(that.sortKey && !pull){
+                if(field === that.sortKey.field && type === that.sortKey.sort){
+                    return;
+                }
+            }
+
+            var elemSort = that.layHeader.find('th .laytable-cell-'+ options.index +'-'+ field).find(ELEM_SORT);
+            that.layHeader.find('th').find(ELEM_SORT).removeAttr('lay-sort'); //清除其它标题排序状态
+            elemSort.attr('lay-sort', type || null);
+            that.layFixed.find('th')
+        } catch(e){
+            return hint.error('Table modules: Did not match to field');
+        }
+
+        //记录排序索引和类型
+        that.sortKey = {
+            field: field
+            ,sort: type
+        };
+
+        if(type === 'asc'){ //升序
+            thisData = layui.sort(data, field);
+        } else if(type === 'desc'){ //降序
+            thisData = layui.sort(data, field, true);
+        } else { //清除排序
+            thisData = layui.sort(data, table.config.indexName);
+            delete that.sortKey;
+        }
+
+        res[options.response.dataName] = thisData;
+        that.renderData(res, that.page, that.count, true);
+
+        if(formEvent){
+            layui.event.call(th, MOD_NAME, 'sort('+ filter +')', {
+                field: field
+                ,type: type
+            });
+        }
+    };
+    //请求loading
+    Class.prototype.loading = function(){
+        var that = this
+            ,options = that.config;
+        if(options.loading && options.url){
+            return layer.msg('数据请求中', {
+                icon: 16
+                ,offset: [
+                    that.elem.offset().top + that.elem.height()/2 - 35 - _WIN.scrollTop() + 'px'
+                    ,that.elem.offset().left + that.elem.width()/2 - 90 - _WIN.scrollLeft() + 'px'
+                ]
+                ,time: -1
+                ,anim: -1
+                ,fixed: false
+            });
+        }
+    };
+    //同步选中值状态
+    Class.prototype.setCheckData = function(index, checked){
+        var that = this
+            ,options = that.config
+            ,thisData = table.getDataList(that.key);
+        if(!thisData[index]) return;
+        if(thisData[index].constructor === Array) return;
+        thisData[index][options.checkName] = checked;
+    };
+    //同步全选按钮状态
+    Class.prototype.syncCheckAll = function(){
+        var that = this
+            ,options = that.config
+            ,checkAllElem = that.layHeader.find('input[name="layTableCheckbox"]')
+            ,syncColsCheck = function(checked){
+            that.eachCols(function(i, item){
+                if(item.type === 'checkbox'){
+                    item[options.checkName] = checked;
+                }
+            });
+            return checked;
+        };
+
+        if(!checkAllElem[0]) return;
+
+        if(table.checkStatus(that.key).isAll){
+            if(!checkAllElem[0].checked){
+                checkAllElem.prop('checked', true);
+                that.renderForm('checkbox');
+            }
+            syncColsCheck(true);
+        } else {
+            if(checkAllElem[0].checked){
+                checkAllElem.prop('checked', false);
+                that.renderForm('checkbox');
+            }
+            syncColsCheck(false);
+        }
+    };
+    //获取cssRule
+    Class.prototype.getCssRule = function(field, callback){
+        var that = this
+            ,style = that.elem.find('style')[0]
+            ,sheet = style.sheet || style.styleSheet || {}
+            ,rules = sheet.cssRules || sheet.rules;
+        layui.each(rules, function(i, item){
+            if(item.selectorText === ('.laytable-cell-'+ that.index +'-'+ field)){
+                return callback(item), true;
+            }
+        });
+    };
+    /**
+     * 窗体变化自适应
+     */
+    Class.prototype.resize = function(){
+        var that = this;
+        //根据父窗体高度设置table的高度
+        // 1、table自身顶级容器高度(layui-table-view)
+        // 2、内容区域高度(layui-table-main)
+        that.setArea();
+        that.fullSize();//高度控制
+        //宽度控制(最后一行)
+        that.resizeWidth();
+        that.scrollPatch();
+    };
+    /**
+     * 重新渲染宽度
+     */
+    Class.prototype.resizeWidth = function(){
+        var that = this;
+        that.renderTdCss();
+    };
+    //铺满表格主体高度
+    Class.prototype.fullSize = function(){
+        var that = this
+            ,options = that.config
+            ,height = options.height, bodyHeight;
+
+        height = that.getParentDivHeight(options.id) - that.fullHeightGap;
+        height = '100%';
+        that.elem.css('height', height);
+
+        //tbody区域高度
+        // bodyHeight = parseFloat(height) - parseFloat(that.layHeader.height()) - 1;//原本代码
+        var theader=options.isFilter?76:38;//没有行内过滤区域
+        bodyHeight = parseFloat(height) - theader - 1;//###注意:现在写死表头固定高度为38px,即不支持多表头方式(在tab方式下无法获取正确的高度,待处理)
+        if(options.toolbar){
+            bodyHeight = bodyHeight - that.layTool.outerHeight();
+        }
+        if(options.page){
+            bodyHeight = bodyHeight - that.layPage.outerHeight() - 1;
+        }
+        // that.layMain.css('height', bodyHeight);
+        // console.log(bodyHeight,that.layHeader.height());
+    };
+    //获取滚动条宽度
+    Class.prototype.getScrollWidth = function(elem){
+        var width = 0;
+        if(elem){
+            width = elem.offsetWidth - elem.clientWidth;
+        } else {
+            elem = document.createElement('div');
+            elem.style.width = '100px';
+            elem.style.height = '100px';
+            elem.style.overflowY = 'scroll';
+
+            document.body.appendChild(elem);
+            width = elem.offsetWidth - elem.clientWidth;
+            document.body.removeChild(elem);
+        }
+        return width;
+    };
+    //滚动条补丁
+    Class.prototype.scrollPatch = function(){
+        var that = this
+            ,layMainTable = that.layMain.children('table')
+            ,scollWidth = that.layMain.width() - that.layMain.prop('clientWidth') //纵向滚动条宽度
+            ,scollHeight = that.layMain.height() - that.layMain.prop('clientHeight') //横向滚动条高度
+            ,getScrollWidth = that.getScrollWidth(that.layMain[0]) //获取主容器滚动条宽度,如果有的话
+            ,outWidth = layMainTable.outerWidth() - that.layMain.width(); //表格内容器的超出宽度
+
+        //如果存在自动列宽,则要保证绝对填充满,并且不能出现横向滚动条
+        if(that.autoColNums && outWidth < 5 && !that.scrollPatchWStatus){
+            var th = that.layHeader.eq(0).find('thead th:last-child')
+                ,field = th.data('field');
+            that.getCssRule(field, function(item){
+                var width = item.style.width || th.outerWidth();
+                item.style.width = (parseFloat(width) - getScrollWidth - outWidth) + 'px';
+                //二次校验,如果仍然出现横向滚动条
+                if(that.layMain.height() - that.layMain.prop('clientHeight') > 0){
+                    item.style.width = parseFloat(item.style.width) - 1 + 'px';
+                }
+                that.scrollPatchWStatus = true;
+            });
+        }
+        if(scollWidth && scollHeight){
+            if(that.elem.find('.layui-table-patch').length<=0){
+                var patchElem = $('<th class="layui-table-patch"><div class="layui-table-cell"></div></th>'); //补丁元素
+                patchElem.find('div').css({
+                    width: scollWidth
+                });
+                that.layHeader.eq(0).find('thead tr').append(patchElem);
+                //that.layFilter.find('table thead tr').append(patchElem);
+            }
+        } else {
+            that.layFilter.eq(0).find('.layui-table-patch').remove();
+            that.layHeader.eq(0).find('.layui-table-patch').remove();
+        }
+        //固定列区域高度
+        var mainHeight = that.layMain.height()
+            ,fixHeight = mainHeight - scollHeight;
+        that.layFixed.find(ELEM_BODY).css('height', layMainTable.height() > fixHeight ? fixHeight : 'auto');
+        //表格宽度小于容器宽度时,隐藏固定列
+        that.layFixRight[outWidth > 0 ? 'removeClass' : 'addClass'](HIDE);
+        //操作栏
+        that.layFixRight.css('right', scollWidth - 1);
+    };
+    //事件处理
+    Class.prototype.events = function(){
+        var that = this
+            ,options = that.config
+            ,_BODY = $('body')
+            ,dict = {}
+            ,th = that.layHeader.find('th')
+            ,resizing
+            ,ELEM_CELL = '.layui-table-cell'
+            ,filter = options.elem.attr('lay-filter')
+            ,layFilter=that.layFilter.find("[name^='filter_']")//行内过滤元素
+            ;
+
+        //行内过滤
+        layFilter.on('keyup',function () {
+            that.page=1;
+            that.pullData(that.page, that.loading());
+        });
+
+
+        //拖拽调整宽度
+        th.on('mousemove', function(e){
+            var othis = $(this)
+                ,oLeft = othis.offset().left
+                ,pLeft = e.clientX - oLeft;
+            if(othis.attr('colspan') > 1 || othis.data('unresize') || dict.resizeStart){
+                return;
+            }
+            dict.allowResize = othis.width() - pLeft <= 10; //是否处于拖拽允许区域
+            _BODY.css('cursor', (dict.allowResize ? 'col-resize' : ''));
+        }).on('mouseleave', function(){
+            var othis = $(this);
+            if(dict.resizeStart) return;
+            _BODY.css('cursor', '');
+        }).on('mousedown', function(e){
+            var othis = $(this);
+            if(dict.allowResize){
+                var field = othis.data('field');
+                e.preventDefault();
+                dict.resizeStart = true; //开始拖拽
+                dict.offset = [e.clientX, e.clientY]; //记录初始坐标
+
+                that.getCssRule(field, function(item){
+                    var width = item.style.width || othis.outerWidth();
+                    dict.rule = item;
+                    dict.ruleWidth = parseFloat(width);
+                    dict.minWidth = othis.data('minwidth') || options.cellMinWidth;
+                });
+            }
+        });
+        //拖拽中
+        _DOC.on('mousemove', function(e){
+            if(dict.resizeStart){
+                e.preventDefault();
+                if(dict.rule){
+                    var setWidth = dict.ruleWidth + e.clientX - dict.offset[0];
+                    if(setWidth < dict.minWidth) setWidth = dict.minWidth;
+                    dict.rule.style.width = setWidth + 'px';
+                    layer.close(that.tipsIndex);
+                }
+                resizing = 1
+            }
+        }).on('mouseup', function(e){
+            if(dict.resizeStart){
+                dict = {};
+                _BODY.css('cursor', '');
+                that.scrollPatch();
+            }
+            if(resizing === 2){
+                resizing = null;
+            }
+        });
+
+        //排序
+        th.on('click', function(){
+            var othis = $(this)
+                ,elemSort = othis.find(ELEM_SORT)
+                ,nowType = elemSort.attr('lay-sort')
+                ,type;
+
+            if(!elemSort[0] || resizing === 1) return resizing = 2;
+
+            if(nowType === 'asc'){
+                type = 'desc';
+            } else if(nowType === 'desc'){
+                type = null;
+            } else {
+                type = 'asc';
+            }
+            that.sort(othis, type, null, true);
+        }).find(ELEM_SORT+' .layui-edge ').on('click', function(e){
+            var othis = $(this)
+                ,index = othis.index()
+                ,field = othis.parents('th').eq(0).data('field')
+            layui.stope(e);
+            if(index === 0){
+                that.sort(field, 'asc', null, true);
+            } else {
+                that.sort(field, 'desc', null, true);
+            }
+        });
+
+        /**
+         * 树形节点点击事件(隐藏展开下级节点)
+         */
+        that.elem.on('click', 'i.layui-tree-head', function(){
+            var othis = $(this)
+                ,index = othis.parents('tr').eq(0).data('index')
+                ,tr = that.layBody.find('tr[data-index="'+ index +'"]')
+                ,options=that.config
+                ,tree_id=options[TREE_ID]
+                ,datas=table.getDataList(that.key);//数据
+            var o=datas[index];
+            that.treeNodeOpen(o,!o.is_open);
+        });
+
+        //复选框选择
+        that.elem.on('click', 'input[name="layTableCheckbox"]+', function(){
+            var checkbox = $(this).prev()
+                ,childs = that.layBody.find('input[name="layTableCheckbox"]')
+                ,index = checkbox.parents('tr').eq(0).data('index')
+                ,checked = checkbox[0].checked
+                ,isAll = checkbox.attr('lay-filter') === 'layTableAllChoose';
+
+            //全选
+            if(isAll){
+                childs.each(function(i, item){
+                    item.checked = checked;
+                    that.setCheckData(i, checked);
+                });
+                that.syncCheckAll();
+                that.renderForm('checkbox');
+            } else {
+                that.setCheckData(index, checked);
+                that.syncCheckAll();
+            }
+            layui.event.call(this, MOD_NAME, 'checkbox('+ filter +')', {
+                checked: checked
+                ,data: table.getDataList(that.key) ? (table.getDataList(that.key)[index] || {}) : {}
+                ,type: isAll ? 'all' : 'one'
+            });
+        });
+
+        //行事件
+        that.layBody.on('mouseenter', 'tr', function(){
+            var othis = $(this)
+                ,index = othis.index();
+            that.layBody.find('tr:eq('+ index +')').addClass(ELEM_HOVER)
+        })
+        that.layBody.on('mouseleave', 'tr', function(){
+            var othis = $(this)
+                ,index = othis.index();
+            that.layBody.find('tr:eq('+ index +')').removeClass(ELEM_HOVER)
+        });
+
+
+//单元格编辑
+        that.layBody.on('change', '.'+ELEM_EDIT, function(){
+            var othis = $(this)
+                ,value = this.value
+                ,field = othis.parent().data('field')
+                ,index = othis.parents('tr').eq(0).data('index')
+                ,data = table.getDataList(that.key)[index];
+            data[field] = value; //更新缓存中的值
+            layui.event.call(this, MOD_NAME, 'edit('+ filter +')', {
+                value: value
+                ,data: data
+                ,field: field
+            });
+        });
+
+        that.layBody.on('blur', '.'+ELEM_EDIT, function(){//单元格失去焦点
+            var templet
+                ,othis = $(this)
+                ,field = othis.parent().data('field')
+                ,index = othis.parents('tr').eq(0).data('index')
+                ,editType = othis.parent().data('edit')
+                ,data = table.getDataList(that.key)[index];
+            var  options = that.config;
+            that.eachCols(function(i, item){
+                if(item.field == field && item.templet){
+                    templet = item.templet;
+                }
+            });
+            var value="";
+            if(editType === 'select') { //选择框
+                var rowsField=dl.ui.table.drop.findFieldObj(options.cols[0],field);
+                if(rowsField&&rowsField['drop']){
+                    var o=dl.cache.code.get(rowsField.drop);
+                    value=dl.ui.table.drop.findDropLable(rowsField.drop,this.value);
+                }
+                othis.parent().find(ELEM_CELL+' p').html(
+                    templet ? laytpl($(templet).html() || value).render(data) : value
+                );
+            } else {//输入框
+                othis.parent().find(ELEM_CELL+' p').html(
+                    templet ? laytpl($(templet).html() || this.value).render(data) : this.value
+                );
+            }
+            othis.parent().data('content', this.value);
+            othis.remove();
+        });
+
+        //单元格事件
+        that.layBody.on('click', 'td div.layui-table-cell p', function(){
+            var othis = $(this).parent().parent()
+                ,field = othis.data('field')
+                ,editType = othis.data('edit')
+                ,index = othis.parents('tr').eq(0).data('index')
+                ,data = table.getDataList(that.key)[index]
+                ,elemCell = othis.children(ELEM_CELL);
+            var  options = that.config;
+            layer.close(that.tipsIndex);
+            if(othis.data('off')) return;
+
+            //显示编辑表单
+            if(editType){
+                if(editType === 'select') { //选择框
+                    var dropName=othis.data('drop');
+                    var rowsField=dl.ui.table.drop.findFieldObj(options.cols[0],field);
+                    var o=dl.cache.code.get(rowsField.drop);
+                    var html='';
+                    var scv=o.syscodevaluecache;
+                    for(var i in scv){
+                        var isSelected="";
+                        if(scv[i].scv_value==data[field]){
+                            isSelected="selected='selected'";
+                        }
+                        //选中
+                        html+='<option '+isSelected+'  value="'+scv[i].scv_value+'">'+scv[i].scv_show_name+'</option>'
+                    }
+                    var select = $('<select class="'+ ELEM_EDIT +'" lay-ignore>' +
+                        html+
+                        '</select>');
+                    othis.find('.'+ELEM_EDIT)[0] || othis.append(select);
+                } else { //输入框
+                    var input = $('<input class="layui-input '+ ELEM_EDIT +'">');
+                    input[0].value = $.trim($(this).text());//  othis.data('content') || elemCell.text();
+                    othis.find('.'+ELEM_EDIT)[0] || othis.append(input);
+                    input.focus();
+                }
+                return;
+            }
+
+            //如果出现省略,则可查看更多
+            if(elemCell.find('.layui-form-switch,.layui-form-checkbox')[0]) return; //限制不出现更多(暂时)
+            if(Math.round(elemCell.prop('scrollWidth')) > Math.round(elemCell.outerWidth())){
+                that.tipsIndex = layer.tips([
+                    '<div class="layui-table-tips-main" style="margin-top: -'+ (elemCell.height() + 16) +'px;'+ function(){
+                        if(options.size === 'sm'){
+                            return 'padding: 4px 15px; font-size: 12px;';
+                        }
+                        if(options.size === 'lg'){
+                            return 'padding: 14px 15px;';
+                        }
+                        return '';
+                    }() +'">'
+                    ,elemCell.html()
+                    ,'</div>'
+                    ,'<i class="layui-icon layui-table-tips-c">&#x1006;</i>'
+                ].join(''), elemCell[0], {
+                    tips: [3, '']
+                    ,time: -1
+                    ,anim: -1
+                    ,maxWidth: (device.ios || device.android) ? 300 : 600
+                    ,isOutAnim: false
+                    ,skin: 'layui-table-tips'
+                    ,success: function(layero, index){
+                        layero.find('.layui-table-tips-c').on('click', function(){
+                            layer.close(index);
+                        });
+                    }
+                });
+            }
+        });
+
+        //工具条操作事件
+        that.layBody.on('click', '*[lay-event]', function(){
+            var othis = $(this)
+                ,index = othis.parents('tr').eq(0).data('index')
+                ,tr = that.layBody.find('tr[data-index="'+ index +'"]')
+                ,ELEM_CLICK = 'layui-table-click'
+                ,list = table.getDataList(that.key)
+                ,data = table.getDataList(that.key)[index];
+            layui.event.call(this, MOD_NAME, 'tool('+ filter +')', {
+                data: data//table.clearCacheKey(data)
+                ,event: othis.attr('lay-event')
+                ,tr: tr
+                ,del: function(){
+                    table.delRow(options.id,data);
+                }
+                ,update: function(fields){
+                    fields = fields || {};
+                    layui.each(fields, function(key, value){
+                        if(key in data){
+                            var templet, td = tr.children('td[data-field="'+ key +'"]');
+                            data[key] = value;
+                            that.eachCols(function(i, item2){
+                                if(item2.field == key && item2.templet){
+                                    templet = item2.templet;
+                                }
+                            });
+                            td.children(ELEM_CELL).html(
+                                templet ? laytpl($(templet).html() || value).render(data) : value
+                            );
+                            td.data('content', value);
+                        }
+                    });
+                }
+            });
+            tr.addClass(ELEM_CLICK).siblings('tr').removeClass(ELEM_CLICK);
+        });
+
+        //同步滚动条
+        that.layMain.on('scroll', function(){
+            var othis = $(this)
+                ,scrollLeft = othis.scrollLeft()
+                ,scrollTop = othis.scrollTop();
+
+            that.layHeader.scrollLeft(scrollLeft);
+            that.layFixed.find(ELEM_BODY).scrollTop(scrollTop);
+
+            layer.close(that.tipsIndex);
+        });
+
+        _WIN.on('resize', function(){ //自适应
+            that.resize();
+        });
+    };
+
+
+    //表格重载
+    thisTable.config = {};
+    //自动完成渲染
+    table.init();
+   // layui.link("//" + location.host + '/js/layuiPlugins/treeGrid.css');//引入css
+    exports(MOD_NAME, table);
+});

+ 1216 - 0
js/layuiPlugins/eleTree.js

@@ -0,0 +1,1216 @@
+/**
+ * 基于layui的tree重写
+ * author: hsianglee
+ * 最近修改时间: 2019/01/07
+ */
+
+layui.define(["jquery","laytpl"], function (exports) {
+    var $ = layui.jquery;
+    var laytpl = layui.laytpl;
+    var hint = layui.hint();
+
+    var MOD_NAME="eleTree";
+
+    //外部接口
+    var eleTree={
+        //事件监听
+        on: function(events, callback){
+            return layui.onevent.call(this, MOD_NAME, events, callback);
+        },
+        render: function(options) {
+            var inst = new Class(options);
+            return thisTree.call(inst);
+        }
+    }
+
+    var thisTree=function() {
+        var _self=this;
+        var options = _self.config;
+
+        // 暴漏外面的方法
+        return {
+            // 接收两个参数,1. 节点 key 2. 节点数据的数组
+            updateKeyChildren: function(key,data) {
+                if(options.data.length===0) return;
+                return _self.updateKeyChildren.call(_self,key,data);
+            },
+            updateKeySelf: function(key,data) {
+                if(options.data.length===0) return;
+                return _self.updateKeySelf.call(_self,key,data);
+            },
+            remove: function(key) {
+                if(options.data.length===0) return;
+                return _self.remove.call(_self,key);
+            },
+            append: function(key,data) {
+                if(options.data.length===0) return;
+                return _self.append.call(_self,key,data);
+            },
+            insertBefore: function(key,data) {
+                if(options.data.length===0) return;
+                return _self.insertBefore.call(_self,key,data);
+            },
+            insertAfter: function(key,data) {
+                if(options.data.length===0) return;
+                return _self.insertAfter.call(_self,key,data);
+            },
+            // 接收两个 boolean 类型的参数,1. 是否只是叶子节点,默认值为 false 2. 是否包含半选节点,默认值为 false
+            getChecked: function(leafOnly, includeHalfChecked) {
+                if(options.data.length===0) return;
+                return _self.getChecked.call(_self,leafOnly, includeHalfChecked);
+            },
+            // 接收勾选节点数据的数组
+            setChecked: function(data) {
+                if(options.data.length===0) return;
+                return _self.setChecked.call(_self,data);
+            },
+            // 取消选中
+            unCheckNodes: function() {
+                if(options.data.length===0) return;
+                return _self.unCheckNodes.call(_self);
+            },
+            expandAll: function() {
+                options.elem.children(".eleTree-node").children(".eleTree-node-group").empty();
+                _self.expandAll.call(_self,options.data,[],1,true);
+                _self.unCheckNodes();
+                _self.defaultChecked();
+            },
+            unExpandAll: function() {
+                return _self.unExpandAll.call(_self);
+            },
+            reload: function(options) {
+                return _self.reload.call(_self,options);
+            },
+            search: function(value) {
+                return _self.search.call(_self,value);
+            }
+        }
+    }
+
+    // 模板渲染
+    var TPL_ELEM=function(options,floor,parentStatus) {
+        return [
+            '{{# for(var i=0;i<d.length;i++){ }}',
+            '<div class="eleTree-node" data-'+options.request.key+'="{{d[i]["'+options.request.key+'"]}}" eletree-floor="'+floor+'" style="display: none;">',
+            '<div class="eleTree-node-content" style="padding-left: '+(options.indent*floor)+'px;">',
+            '<span class="eleTree-node-content-icon">',
+            '<i class="layui-icon layui-icon-triangle-r ',
+            function() {
+                if(options.lazy){
+                    var str=[
+                        '{{# if(!d[i]["'+options.request.isLeaf+'"]){ }}',
+                        'lazy-icon" ></i>',
+                        '{{# }else{ }}',
+                        'leaf-icon" style="color: transparent;" ></i>',
+                        '{{# } }}'
+                    ].join("");
+                    return str;
+                }
+                return ['{{# if(!d[i]["'+options.request.children+'"] || d[i]["'+options.request.children+'"].length===0){ }}',
+                    'leaf-icon" style="color: transparent;"',
+                    '{{# } }}',
+                    '"></i>'
+                ].join("");
+            }(),
+            '</span>',
+            function() {
+                if(options.showCheckbox){
+                    var status="";
+                    if(parentStatus==="1"){
+                        status='"1" checked';
+                    }else if(parentStatus==="2"){
+                        status='"2"';
+                    }else{
+                        status='"0"';
+                    }
+                    return [
+                        '{{# if(d[i]["'+options.request.checked+'"]) { }}',
+                        '<input type="checkbox" name="eleTree-node" eleTree-status="1" checked class="eleTree-hideen ',
+                        '{{# }else{ }}',
+                        '<input type="checkbox" name="eleTree-node" eleTree-status='+status+' class="eleTree-hideen ',
+                        '{{# } }}',
+
+                        '{{# if(d[i]["'+options.request.disabled+'"]) { }}',
+                        'eleTree-disabled',
+                        '{{# } }}',
+                        '" />'
+                    ].join("");
+                }
+                return ''
+            }(),
+            '<span class="eleTree-node-content-label">{{d[i]["'+options.request.name+'"]}}</span>',
+            '</div>',
+            '<div class="eleTree-node-group">',
+            '</div>',
+            '</div>',
+            '{{# } }}'
+        ].join("");
+    }
+
+    var TPL_NoText=function() {
+        return '<h3 class="eleTree-noText" style="text-align: center;height: 30px;line-height: 30px;color: #888;">{{d.emptText}}</h3>';
+    }
+
+    var Class=function(options) {
+        options.response=$.extend({}, this.config.response, options.response);
+        options.request=$.extend({}, this.config.request, options.request);
+        this.config = $.extend({}, this.config, options);
+        this.prevClickEle=null;
+        this.addKeyIndex=20181201;
+        this.nameIndex=1;
+        this.render();
+    };
+
+    Class.prototype={
+        constructor: Class,
+        config: {
+            elem: "",
+            data: [],
+            emptText: "暂无数据",        // 内容为空的时候展示的文本
+            renderAfterExpand: true,    // 是否在第一次展开某个树节点后才渲染其子节点
+            highlightCurrent: false,    // 是否高亮当前选中节点,默认值是 false。
+            defaultExpandAll: false,    // 是否默认展开所有节点
+            expandOnClickNode: true,    // 是否在点击节点的时候展开或者收缩节点, 默认值为 true,如果为 false,则只有点箭头图标的时候才会展开或者收缩节点。
+            checkOnClickNode: false,    // 是否在点击节点的时候选中节点,默认值为 false,即只有在点击复选框时才会选中节点。
+            defaultExpandedKeys: [],    // 默认展开的节点的 key 的数组
+            autoExpandParent: true,     // 展开子节点的时候是否自动展开父节点
+            showCheckbox: false,        // 节点是否可被选择
+            checkStrictly: false,       // 在显示复选框的情况下,是否严格的遵循父子不互相关联的做法,默认为 false
+            defaultCheckedKeys: [],     // 默认勾选的节点的 key 的数组
+            accordion: false,           // 是否每次只打开一个同级树节点展开(手风琴效果)
+            indent: 16,                 // 相邻级节点间的水平缩进,单位为像素
+            lazy: false,                // 是否懒加载子节点,需与 load 方法结合使用
+            load: function() {},        // 加载子树数据的方法,仅当 lazy 属性为true 时生效
+            draggable: false,           // 是否开启拖拽节点功能
+            contextmenuList: [],        // 启用右键菜单,支持的操作有:"copy","add","edit","remove"
+            searchNodeMethod: null,     // 对树节点进行筛选时执行的方法,返回 true 表示这个节点可以显示,返回 false 则表示这个节点会被隐藏
+
+            method: "get",
+            url: "",
+            contentType: "",
+            headers: {},
+            done: null,
+
+            response: {
+                statusName: "code",
+                statusCode: 0,
+                dataName: "data"
+            },
+            request: {
+                name: "label",
+                key: "id",
+                children: "children",
+                disabled: "disabled",
+                checked: "checked",
+                isLeaf: "isLeaf"
+            }
+        },
+        render: function() {
+            if(this.config.indent>30){
+                this.config.indent=30;
+            }else if(this.config.indent<10){
+                this.config.indent=10;
+            }
+            var options=this.config;
+            options.where=options.where || {};
+            if(!options.elem) return hint.error("缺少elem参数");
+            options.elem=typeof options.elem === "string" ? $(options.elem) : options.elem;
+            this.filter=options.elem.attr("lay-filter");
+            // load加载框
+            options.elem.append('<div class="eleTree-loadData"><i class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"></i></div>')
+
+            // 判断加载方式
+            if(options.data.length===0){
+                this.ajaxGetData();
+            }else{
+                this.renderData();
+            }
+        },
+        renderData: function() {
+            var options=this.config;
+            // 渲染第一层
+            laytpl(TPL_ELEM(options,0)).render(options.data, function(string){
+                options.elem.html(string).children().show();
+            });
+            // 懒加载 > 展开所有 > 初始展开项 > 初始渲染所有子节点 > 初始选中项 > 每次点击只渲染当前层(默认)
+            // 判断所有dom是否全部加载
+            if(!options.lazy){
+                if(!options.renderAfterExpand || options.defaultExpandAll || options.defaultExpandedKeys.length>0 || options.defaultCheckedKeys.length>0){
+                    this.expandAll(options.data,[],1);
+                }
+            }
+
+            this.eleTreeEvent();
+            this.checkboxRender();
+            this.checkboxEvent();
+            this.defaultChecked();
+            this.nodeEvent();
+            this.rightClickMenu();
+            if(!options.checkStrictly){
+                this.checkboxInit();
+            }
+        },
+        ajaxGetData: function() {
+            var options=this.config;
+            var _self=this;
+            if(!options.url) {
+                laytpl(TPL_NoText()).render(options, function(string){
+                    options.elem.html(string);
+                });
+                return;
+            }
+            var data = $.extend({}, options.where);
+            if(options.contentType && options.contentType.indexOf("application/json") == 0){ //提交 json 格式
+                data = JSON.stringify(data);
+            }
+
+            $.ajax({
+                type: options.method || 'get'
+                ,url: options.url
+                ,contentType: options.contentType
+                ,data: data
+                ,dataType: 'json'
+                ,headers: options.headers || {}
+                ,success: function(res){
+                    if(res[options.response.statusName] != options.response.statusCode || !res[options.response.dataName]){
+                        hint.error("请检查数据格式是否符合规范");
+                        typeof options.done === 'function' && options.done(res);
+                        return;
+                    }
+                    options.data=res[options.response.dataName];
+                    _self.renderData();
+                    typeof options.done === 'function' && options.done(res);
+                }
+            });
+        },
+        reload: function(options) {
+            var _self=this;
+            if(this.config.data && this.config.data.constructor === Array) this.config.data=[];
+            this.config = $.extend({}, this.config, options);
+            $(this.config.elem).off();  // 取消事件绑定,防止多次绑定事件
+            // reload记录选中的数据
+            // this.getChecked().forEach(function(val) {
+            //     if($.inArray(val.key,this.config.defaultCheckedKeys)===-1){
+            //         this.config.defaultCheckedKeys.push(val.key);
+            //     }
+            // },this);
+            return eleTree.render(this.config)
+        },
+        // 下拉
+        eleTreeEvent: function() {
+            var _self=this;
+            var options=this.config;
+            // 下拉
+            var expandOnClickNode=options.expandOnClickNode?".eleTree-node-content":".eleTree-node-content>.eleTree-node-content-icon";
+            options.elem.on("click",expandOnClickNode,function(e) {
+                e.stopPropagation();
+                var eleTreeNodeContent=$(this).parent(".eleTree-node").length===0?$(this).parent(".eleTree-node-content"):$(this);
+                var eleNode=eleTreeNodeContent.parent(".eleTree-node");
+                var sibNode=eleTreeNodeContent.siblings(".eleTree-node-group");
+                var el=eleTreeNodeContent.children(".eleTree-node-content-icon").children(".layui-icon");
+
+                // 添加active背景
+                if(_self.prevClickEle) _self.prevClickEle.removeClass("eleTree-node-content-active");
+                if(options.highlightCurrent) eleTreeNodeContent.addClass("eleTree-node-content-active");
+                _self.prevClickEle=eleTreeNodeContent;
+
+
+
+                if(el.hasClass("icon-rotate")){
+                    // 合并
+                    sibNode.children(".eleTree-node:not(.eleTree-search-hide)").hide("fast");
+                    el.removeClass("icon-rotate");
+                    return;
+                }
+
+                if(sibNode.children(".eleTree-node").length===0){
+                    var floor=Number(eleNode.attr("eletree-floor"))+1;
+
+                    var data=_self.reInitData(eleNode);
+                    var d=data.currentData;
+                    // 是否懒加载
+                    if(options.lazy && el.hasClass("lazy-icon")){
+                        el.removeClass("layui-icon-triangle-r").addClass("layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop");
+                        options.load(d,function(getData) {
+                            d[options.request.children]=getData;
+                            var eletreeStatus=eleTreeNodeContent.children("input.eleTree-hideen").attr("eletree-status");
+                            if(d[options.request.children] && d[options.request.children].length>0){
+                                laytpl(TPL_ELEM(options,floor,eletreeStatus)).render(d[options.request.children], function(string){
+                                    sibNode.append(string).children().show("fast");
+                                });
+                            }else{
+                                el.css("color","transparent").addClass("leaf-icon");
+                            }
+                            el.removeClass("lazy-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop").addClass("layui-icon-triangle-r icon-rotate");
+                            _self.checkboxRender();
+
+                            // 懒加载子元素选择祖父(待写)
+                        })
+                    }else{
+                        var eletreeStatus=eleTreeNodeContent.children("input.eleTree-hideen").attr("eletree-status");
+                        d[options.request.children] && d[options.request.children].length>0 && laytpl(TPL_ELEM(options,floor,eletreeStatus)).render(d[options.request.children], function(string){
+                            sibNode.append(string);
+                        });
+
+                        // 选择祖父
+                        var eleNode1=sibNode.children(".eleTree-node").eq(0);
+                        if(eleNode1.length===0){
+                            _self.checkboxRender();
+                            return;
+                        }
+                        var siblingNode1=eleNode1.siblings(".eleTree-node");
+                        var item1=eleNode1.children(".eleTree-node-content").children(".eleTree-hideen").get(0);
+                        _self.selectParents(item1,eleNode1,siblingNode1);
+                        _self.checkboxRender();
+                    }
+                }
+                // 显示隐藏没有搜索类的
+                sibNode.children(".eleTree-node:not(.eleTree-search-hide)").show("fast");
+                el.addClass("icon-rotate");
+                // 手风琴效果
+                if(options.accordion){
+                    var node=eleTreeNodeContent.parent(".eleTree-node").siblings(".eleTree-node");
+                    node.children(".eleTree-node-group").children(".eleTree-node:not(.eleTree-search-hide)").hide("fast");
+                    node.children(".eleTree-node-content").children(".eleTree-node-content-icon").children(".layui-icon").removeClass("icon-rotate");
+                }
+            })
+        },
+        // checkbox选中
+        checkboxEvent: function() {
+            var options=this.config;
+            var _self=this;
+            var checkOnClickNode=options.checkOnClickNode?".eleTree-node-content":".eleTree-checkbox";
+            // input添加属性eleTree-status:即input的三种状态,"0":未选中,"1":选中,"2":子孙部分选中
+            options.elem.on("click",checkOnClickNode,function(e,type) {
+                e.stopPropagation();
+                var eleTreeNodeContent=$(this).parent(".eleTree-node").length===0?$(this).parent(".eleTree-node-content"):$(this);
+                var checkbox=eleTreeNodeContent.children(".eleTree-checkbox");
+                if(checkbox.hasClass("eleTree-checkbox-disabled")) return;
+                // 获取点击所在数据
+                var node=eleTreeNodeContent.parent(".eleTree-node");
+                // var d=_self.reInitData(node).currentData;
+                // 实际的input
+                var inp=checkbox.siblings(".eleTree-hideen").get(0);
+                var childNode=eleTreeNodeContent.siblings(".eleTree-node-group").find("input[name='eleTree-node']");
+
+                // 添加active背景
+                if(_self.prevClickEle) _self.prevClickEle.removeClass("eleTree-node-content-active");
+                if(options.highlightCurrent) eleTreeNodeContent.addClass("eleTree-node-content-active");
+                _self.prevClickEle=eleTreeNodeContent;
+
+                if(!inp){
+                    return;
+                }
+
+                if(inp.checked){
+                    // 反选自身
+                    $(inp).prop("checked",false).attr("eleTree-status","0");
+                    // 点击祖父层选中子孙层
+                    if(!options.checkStrictly){
+                        childNode.prop("checked",false);
+                        childNode.attr("eleTree-status","0");
+                    }
+
+                }else{
+                    // 反选自身
+                    $(inp).prop("checked",true).attr("eleTree-status","1");
+                    // 点击祖父层选中子孙层
+                    if(!options.checkStrictly){
+                        childNode.prop("checked",true).attr("eleTree-status","1");
+                    }
+                }
+
+                var eleNode=eleTreeNodeContent.parent(".eleTree-node");
+                // 点击子孙层选中祖父层(递归)
+                if(!options.checkStrictly){
+                    var siblingNode=eleNode.siblings(".eleTree-node");
+                    // 点击子孙层选中祖父层(递归)
+                    _self.selectParents(inp,eleNode,siblingNode);
+                }
+
+                _self.checkboxRender();
+
+                if(type==="default") return;
+                layui.event.call(inp, MOD_NAME, 'nodeChecked('+ _self.filter +')', {
+                    node: eleNode,
+                    data: _self.reInitData(eleNode),
+                    isChecked: inp.checked
+                });
+            })
+        },
+        // 对后台数据有 checked:true 的默认选中项渲染父子层
+        checkboxInit: function() {
+            var options=this.config;
+            var _self=this;
+            options.elem.find("input[eleTree-status='1']").each(function(index,item) {
+                var checkboxEl=$(item).siblings(".eleTree-checkbox");
+                var childNode=checkboxEl.parent(".eleTree-node-content").siblings(".eleTree-node-group").find("input[name='eleTree-node']");
+                // 选择当前
+                checkboxEl.addClass("eleTree-checkbox-checked");
+                checkboxEl.children("i").addClass("layui-icon-ok").removeClass("eleTree-checkbox-line");
+                // 选择子孙
+                childNode.prop("checked","checked").attr("eleTree-status","1");
+                childNode.siblings(".eleTree-checkbox").addClass("eleTree-checkbox-checked");
+                childNode.siblings(".eleTree-checkbox").children("i").addClass("layui-icon-ok").removeClass("eleTree-checkbox-line");
+
+                // 选择祖父
+                var eleNode=checkboxEl.parent(".eleTree-node-content").parent(".eleTree-node");
+                var siblingNode=eleNode.siblings(".eleTree-node");
+                _self.selectParents(item,eleNode,siblingNode);
+            })
+            _self.checkboxRender();
+        },
+        // 通过子元素选中祖父元素
+        selectParents: function(inp,eleNode,siblingNode) {
+            // inp: 实际input(dom元素)
+            // eleNode: input父层类(.eleTree-node)
+            // siblingNode: 父层同级兄弟
+            while (Number(eleNode.attr("eletree-floor"))!==0) {
+                // 同级input状态存入数组
+                var arr=[];
+                arr.push($(inp).attr("eleTree-status"));
+                siblingNode.each(function(index,item) {
+                    var siblingIsChecked=$(item).children(".eleTree-node-content").children("input[name='eleTree-node']").attr("eleTree-status");
+                    arr.push(siblingIsChecked);
+                })
+                // 父元素的实际input
+                var parentInput=eleNode.parent(".eleTree-node-group").siblings(".eleTree-node-content").children("input[name='eleTree-node']");
+                // 父元素的checkbox替代
+                var parentCheckbox=parentInput.siblings(".eleTree-checkbox");
+                // 子都选中则选中父
+                if(arr.every(function(val) {
+                        return val==="1";
+                    })){
+                    parentInput.prop("checked",true).attr("eleTree-status","1");
+                }
+                // 子有一个未选中则checkbox第三种状态
+                if(arr.some(function(val) {
+                        return val==="0" || val==="2";
+                    })){
+                    parentInput.attr("eleTree-status","2");
+                }
+                // 子全部未选中则取消父选中(并且取消第三种状态)
+                if(arr.every(function(val) {
+                        return val==="0";
+                    })){
+                    parentInput.prop("checked",false);
+                    parentInput.attr("eleTree-status","0");
+                }
+
+                var parentNode=eleNode.parents("[eletree-floor='"+(Number(eleNode.attr("eletree-floor"))-1)+"']");
+                var parentCheckbox=parentNode.children(".eleTree-node-content").children("input[name='eleTree-node']").get(0);
+                var parentSiblingNode=parentNode.siblings(".eleTree-node");
+                eleNode=parentNode;
+                inp=parentCheckbox;
+                siblingNode=parentSiblingNode;
+            }
+        },
+        // 初始展开所有
+        expandAll: function(data,arr,floor,isMethodsExpandAll) {
+            var options=this.config;
+            var _self=this;
+            data.forEach(function(val,index) {
+                arr.push(index);
+                if(val[options.request.children] && val[options.request.children].length>0){
+                    var el=options.elem.children(".eleTree-node").eq(arr[0]).children(".eleTree-node-group");
+                    for(var i=1;i<arr.length;i++){
+                        el=el.children(".eleTree-node").eq(arr[i]).children(".eleTree-node-group");
+                    }
+                    laytpl(TPL_ELEM(options,floor)).render(val[options.request.children], function(string){
+                        el.append(string);
+                        // 判断是否展开所有
+                        if(options.defaultExpandAll || isMethodsExpandAll){
+                            el.siblings(".eleTree-node-content").children(".eleTree-node-content-icon").children(".layui-icon").addClass("icon-rotate");
+                            el.children().show();
+                        }else if(options.defaultExpandedKeys.length>0) {
+                            // 展开指定id项
+                            var id=el.parent(".eleTree-node").attr("data-"+options.request.key);
+                            id=isNaN(id) ? id : Number(id);
+                            if($.inArray(id,options.defaultExpandedKeys)!==-1){
+                                el.siblings(".eleTree-node-content").children(".eleTree-node-content-icon").children(".layui-icon").addClass("icon-rotate");
+                                el.children().show();
+                                // 展开子项是否继续展开祖父项
+                                if(options.autoExpandParent){
+                                    var eleP=el.parent(".eleTree-node[data-"+options.request.key+"]").parents(".eleTree-node");
+                                    eleP.each(function(i,item) {
+                                        if($(item).attr("data-"+options.request.key)){
+                                            $(item).children(".eleTree-node-group").siblings(".eleTree-node-content").children(".eleTree-node-content-icon").children(".layui-icon").addClass("icon-rotate");
+                                            $(item).children(".eleTree-node-group").children().show();
+                                        }
+                                    })
+                                }
+                            }
+                        }
+                    });
+                    floor++;
+                    _self.expandAll(val[options.request.children],arr,floor,isMethodsExpandAll);
+                    floor--;
+                }
+                // 重置数组索引
+                arr.pop();
+            })
+
+
+        },
+        // 初始默认选中
+        defaultChecked: function() {
+            var options=this.config;
+            if(options.defaultCheckedKeys.length===0){
+                return false;
+            }
+            // 判断是否父子无关
+            if(options.checkStrictly){
+                options.defaultCheckedKeys.forEach(function(val,index) {
+                    var nodeContent=options.elem.find("[data-"+options.request.key+"='"+val+"']").children(".eleTree-node-content");
+                    // 如果当前没选中则选中
+                    if(nodeContent.children(".eleTree-hideen").prop("checked")===false){
+                        nodeContent.children(".eleTree-checkbox").trigger("click",["default"]);
+                    }
+                })
+                return false;
+            }
+            // 父元素优先
+            var arr=$.extend([],options.defaultCheckedKeys);
+            options.defaultCheckedKeys.forEach(function(val,index) {
+                options.elem.find("[data-"+options.request.key+"='"+val+"']").find("[data-"+options.request.key+"]").each(function(i,item) {
+                    var id=$(item).attr("data-"+options.request.key);
+                    id=isNaN(id) ? id : Number(id);
+                    var isInArrayIndex=$.inArray(id,arr);
+                    if(isInArrayIndex!==-1){
+                        arr.splice(isInArrayIndex,1);
+                    }
+                })
+            })
+            arr.forEach(function(val,index) {
+                var nodeContent=options.elem.find("[data-"+options.request.key+"='"+val+"']").children(".eleTree-node-content");
+                // 如果当前没选中则选中
+                if(nodeContent.children(".eleTree-hideen").prop("checked")===false){
+                    nodeContent.children(".eleTree-checkbox").trigger("click",["default"]);
+                }
+            })
+        },
+        // 自定义checkbox解析
+        checkboxRender: function() {
+            var options=this.config;
+            options.elem.find(".eleTree-checkbox").remove();
+            options.elem.find("input.eleTree-hideen[type=checkbox]").each(function(index,item){
+                if($(item).hasClass("eleTree-disabled")){
+                    $(item).after('<div class="eleTree-checkbox eleTree-checkbox-disabled"><i class="layui-icon"></i></div>');
+                }else{
+                    $(item).after('<div class="eleTree-checkbox"><i class="layui-icon"></i></div>');
+                }
+
+                var checkbox=$(item).siblings(".eleTree-checkbox");
+                if($(item).attr("eletree-status")==="1"){
+                    checkbox.addClass("eleTree-checkbox-checked");
+                    checkbox.children("i").addClass("layui-icon-ok").removeClass("eleTree-checkbox-line");
+                }else if($(item).attr("eletree-status")==="0"){
+                    checkbox.removeClass("eleTree-checkbox-checked");
+                    checkbox.children("i").removeClass("layui-icon-ok eleTree-checkbox-line");
+                }else if($(item).attr("eletree-status")==="2"){
+                    checkbox.addClass("eleTree-checkbox-checked");
+                    checkbox.children("i").removeClass("layui-icon-ok").addClass("eleTree-checkbox-line");
+                }
+
+            })
+        },
+        // 通过dom节点找对应数据
+        reInitData: function(node) {
+            var options=this.config;
+            var i=node.index();
+            var floor=Number(node.attr("eletree-floor"));
+            var arr=[];     // 节点对应的index
+            while (floor>=0) {
+                arr.push(i);
+                floor=floor-1;
+                node=node.parents("[eletree-floor='"+floor+"']");
+                i=node.index();
+            }
+            arr=arr.reverse();
+            var oData=this.config.data;
+            // 当前节点的父节点数据
+            var parentData=oData[arr[0]];
+            // 当前节点的data数据
+            var d = oData[arr[0]];
+            for(var i = 1; i<arr.length; i++){
+                d = d[options.request.children]?d[options.request.children][arr[i]]:d;
+            }
+            for(var i = 1; i<arr.length-1; i++){
+                parentData = parentData[options.request.children]?parentData[options.request.children][arr[i]]:parentData;
+            }
+
+            return {
+                currentData: d,
+                parentData: {
+                    data: parentData,
+                    childIndex: arr[arr.length-1]
+                },
+                index: arr
+            }
+        },
+        // 通过key查找数据
+        keySearchToOpera: function(key,callback) {
+            var options=this.config;
+            var _self=this;
+            // 查找数据
+            var fn=function(data) {
+                var obj={
+                    i: 0,
+                    len: data.length
+                }
+                for(;obj.i<obj.len;obj.i++){
+                    if(data[obj.i][options.request.key]!==key){
+                        if(data[obj.i][options.request.children] && data[obj.i][options.request.children].length>0){
+                            fn(data[obj.i][options.request.children]);
+                        }
+                    }else{
+                        callback(data,obj);
+                    }
+                }
+            }
+            fn(options.data);
+        },
+        updateKeyChildren: function(key,data) {
+            var options=this.config;
+            var node=options.elem.find("[data-"+options.request.key+"='"+key+"']");
+            var floor=Number(node.attr("eletree-floor"))+1;
+            var _self=this;
+
+            this.keySearchToOpera(key,function(d,obj) {
+                // 数据更新
+                d[obj.i][options.request.children]=data;
+                // dom更新
+                node.length!==0 && laytpl(TPL_ELEM(options,floor)).render(data, function(string){
+                    $(node).children(".eleTree-node-group").empty().append(string);
+                    options.defaultExpandAll && $(node).children(".eleTree-node-group").children().show();
+                });
+                _self.unCheckNodes();
+                _self.defaultChecked();
+            });
+        },
+        updateKeySelf: function(key,data) {
+            var options=this.config;
+            var node=options.elem.find("[data-"+options.request.key+"='"+key+"']").children(".eleTree-node-content");
+            var floor=Number(node.attr("eletree-floor"))+1;
+            data[options.request.name] && node.children(".eleTree-node-content-label").text(data[options.request.name]);
+            data[options.request.disabled] && node.children(".eleTree-hideen").addClass("eleTree-disabled")
+                .siblings(".eleTree-checkbox").addClass("eleTree-checkbox-disabled");
+            // 数据更新
+            var getData=this.keySearchToOpera(key,function(d,obj) {
+                data[options.request.key]=d[obj.i][options.request.key];
+                data[options.request.children]=d[obj.i][options.request.children];
+                d[obj.i]=$.extend({},d[obj.i],data);
+                console.log(options.data);
+            });
+        },
+        remove: function(key) {
+            var options=this.config;
+            var node=options.elem.find("[data-"+options.request.key+"='"+key+"']");
+            var pElem=node.parent(".eleTree-node-group");
+            // 数据删除
+            this.keySearchToOpera(key,function(data,obj) {
+                data.splice(obj.i,1);
+                obj.i--;
+                obj.len--;
+
+                node.length!==0 && options.elem.find("[data-"+options.request.key+"='"+key+"']").remove();
+                if(pElem.children(".eleTree-node").length===0){
+                    pElem.siblings(".eleTree-node-content").children(".eleTree-node-content-icon").children(".layui-icon").css("color", "transparent");
+                }
+            });
+            this.unCheckNodes();
+            this.defaultChecked();
+        },
+        append: function(key,data) {
+            var options=this.config;
+            var node=options.elem.find("[data-"+options.request.key+"='"+key+"']");
+            var floor=Number(node.attr("eletree-floor"))+1;
+            // 数据更新
+            this.keySearchToOpera(key,function(d,obj) {
+                if(d[obj.i][options.request.children]){
+                    d[obj.i][options.request.children].push(data);
+                }else{
+                    d[obj.i][options.request.children]=[data];
+                }
+                var arr=d[obj.i][options.request.children];
+                // 添加之后长度为1,则原来没有三角,添加三角
+                if(arr.length===1){
+                    node.children(".eleTree-node-content").find(".eleTree-node-content-icon .layui-icon").removeAttr("style").addClass("icon-rotate");
+                }
+                var len=arr.length;
+                var eletreeStatus=node.children(".eleTree-node-content").children("input.eleTree-hideen").attr("eletree-status");
+                eletreeStatus=eletreeStatus==="2" ? "0" : eletreeStatus;
+                node.length!==0 && laytpl(TPL_ELEM(options,floor,eletreeStatus)).render([arr[len-1]], function(string){
+                    node.children(".eleTree-node-group").append(string).children().show();
+                });
+            });
+            this.checkboxRender();
+        },
+        insertBefore: function(key,data) {
+            var options=this.config;
+            var node=options.elem.find("[data-"+options.request.key+"='"+key+"']");
+            var floor=Number(node.attr("eletree-floor"));
+            // 数据更新
+            this.keySearchToOpera(key,function(d,obj) {
+                d.splice(obj.i,0,data);
+                obj.i++;
+                obj.len++;
+                var eletreeStatus=node.parent(".eleTree-node-group").length===0 ? "0" : node.parent(".eleTree-node-group").parent(".eleTree-node")
+                        .children(".eleTree-node-content").children("input.eleTree-hideen").attr("eletree-status");
+                eletreeStatus=eletreeStatus==="2" ? "0" : eletreeStatus;
+                node.length!==0 && laytpl(TPL_ELEM(options,floor,eletreeStatus)).render([data], function(string){
+                    node.before(string).prev(".eleTree-node").show();
+                });
+            });
+            this.checkboxRender();
+        },
+        insertAfter: function(key,data) {
+            var options=this.config;
+            var node=options.elem.find("[data-"+options.request.key+"='"+key+"']");
+            var floor=Number(node.attr("eletree-floor"));
+            // 数据更新
+            this.keySearchToOpera(key,function(d,obj) {
+                d.splice(obj.i+1,0,data);
+                obj.i++;
+                obj.len++;
+                var eletreeStatus=node.parent(".eleTree-node-group").length===0 ? "0" : node.parent(".eleTree-node-group").parent(".eleTree-node")
+                        .children(".eleTree-node-content").children("input.eleTree-hideen").attr("eletree-status");
+                eletreeStatus=eletreeStatus==="2" ? "0" : eletreeStatus;
+                node.length!==0 && laytpl(TPL_ELEM(options,floor,eletreeStatus)).render([data], function(string){
+                    $(node).after(string).next(".eleTree-node").show();
+                });
+            });
+            this.checkboxRender();
+            // if(!options.lazy){
+            //     if(!options.renderAfterExpand || options.defaultExpandAll || options.defaultExpandedKeys.length>0){
+            //         this.expandAll(options.data,[],1);
+            //     }
+            // }
+        },
+        getChecked: function(leafOnly, includeHalfChecked) {
+            var options=this.config
+                ,el
+                ,arr=[];
+            leafOnly=leafOnly || false;
+            includeHalfChecked=includeHalfChecked || false;
+            if(leafOnly){
+                el=options.elem.find(".layui-icon.leaf-icon").parent(".eleTree-node-content-icon")
+                    .siblings("input.eleTree-hideen[eletree-status='1']");
+            }else if(includeHalfChecked){
+                el=options.elem.find("input.eleTree-hideen[eletree-status='1'],input.eleTree-hideen[eletree-status='2']");
+            }else{
+                el=options.elem.find("input.eleTree-hideen[eletree-status='1']");
+            }
+            el.each(function(index,item) {
+                var obj={};
+                var id=$(item).parent(".eleTree-node-content").parent(".eleTree-node").attr("data-"+options.request.key);
+                id=isNaN(id) ? id : Number(id);
+                obj[options.request.key]=id;
+                obj.elem=item;
+                obj.othis=$(item).siblings(".eleTree-checkbox").get(0)
+                arr.push(obj);
+            })
+            return arr;
+        },
+        setChecked: function(arr) {
+            var options=this.config;
+            this.unCheckNodes();
+            arr.forEach(function(val) {
+                if($.inArray(val,options.defaultCheckedKeys)===-1){
+                    options.defaultCheckedKeys.push(val);
+                }
+            })
+            this.defaultChecked();
+        },
+        unCheckNodes: function() {
+            var options=this.config;
+            options.elem.find("input.eleTree-hideen[eletree-status='1'],input.eleTree-hideen[eletree-status='2']").each(function(index,item) {
+                $(item).attr("eletree-status","0").prop("checked",false);
+            });
+            this.checkboxRender();
+        },
+        unExpandAll: function() {
+            var options=this.config;
+            options.elem.find(".layui-icon.icon-rotate").removeClass("icon-rotate")
+                .parent(".eleTree-node-content-icon").parent(".eleTree-node-content")
+                .siblings(".eleTree-node-group").children(".eleTree-node").hide();
+        },
+        // 节点事件
+        nodeEvent: function() {
+            var _self=this;
+            var options=this.config;
+            // 节点被点击的回调事件
+            options.elem.on("click",".eleTree-node-content",function(e) {
+                var eleNode=$(this).parent(".eleTree-node");
+                $("#tree-menu").hide().remove();
+                layui.event.call(eleNode, MOD_NAME, 'nodeClick('+ _self.filter +')', {
+                    node: eleNode,
+                    data: _self.reInitData(eleNode),
+                    event: e
+                });
+            })
+            // 节点右键的回调事件
+            options.elem.on("contextmenu",".eleTree-node-content",function(e) {
+                var eleNode=$(this).parent(".eleTree-node");
+                layui.event.call(eleNode, MOD_NAME, 'nodeContextmenu('+ _self.filter +')', {
+                    node: eleNode,
+                    data: _self.reInitData(eleNode),
+                    event: e
+                });
+            })
+            // 节点被拖拽的回调事件
+            options.draggable && options.elem.on("mousedown",".eleTree-node-content",function(e) {
+                var time=0;
+                var eleNode=$(this).parent(".eleTree-node");
+                var eleFloor=Number(eleNode.attr("eletree-floor"));
+                var groupNode=eleNode.parent(".eleTree-node-group");
+
+                e.stopPropagation();
+                options.elem.css("user-select","none");
+                var cloneNode=eleNode.clone(true);
+                var temNode=eleNode.clone(true);
+
+                var x=e.clientX-options.elem.offset().left;
+                var y=e.clientY-options.elem.offset().top;
+                options.elem.append(cloneNode);
+                cloneNode.css({
+                    "display": "none",
+                    "opacity": 0.7,
+                    "position": "absolute",
+                    "background-color": "#f5f5f5",
+                    "width": "100%"
+                })
+
+                var currentData=_self.reInitData(eleNode);
+
+                var isStop=false;
+
+                $(document).on("mousemove",function(e) {
+                    // t为了区别click事件
+                    time++;
+                    if(time>2){
+                        var xx=e.clientX-options.elem.offset().left+10;
+                        var yy=e.clientY-options.elem.offset().top+$(document).scrollTop()-5;   // 加上浏览器滚动高度
+
+                        cloneNode.css({
+                            display: "block",
+                            left: xx+"px",
+                            top: yy+"px"
+                        })
+                    }
+                }).on("mouseup",function(e) {
+                    $(document).off("mousemove").off("mouseup");
+                    var target=$(e.target).parents(".eleTree-node").eq(0);
+                    cloneNode.remove();
+                    options.elem.css("user-select","auto");
+
+
+                    // 当前点击的是否时最外层
+                    var isCurrentOuterMost=eleNode.parent().get(0).isEqualNode(options.elem.get(0))
+                    // 目标是否时最外层
+                    var isTargetOuterMost=$(e.target).get(0).isEqualNode(options.elem.get(0))
+                    if(isTargetOuterMost){
+                        target=options.elem;
+                    }
+                    // 判断是否超出边界
+                    if(target.parents(options.elem).length===0 && !isTargetOuterMost){
+                        return;
+                    }
+                    // 判断初始与结束是否是同一个节点
+                    if(target.get(0).isEqualNode(eleNode.get(0))){
+                        return;
+                    }
+                    // 判断是否是父节点放到子节点
+                    var tFloor=target.attr("eletree-floor");
+                    var isInChild=false;
+                    eleNode.find("[eletree-floor='"+tFloor+"']").each(function() {
+                        if(this.isEqualNode(target.get(0))){
+                            isInChild=true;
+                        }
+                    })
+                    if(isInChild){
+                        return;
+                    }
+
+                    var targetData=_self.reInitData(target);
+                    layui.event.call(target, MOD_NAME, 'nodeDrag('+ _self.filter +')', {
+                        current: {
+                            node: eleNode,
+                            data: currentData
+                        },
+                        target: {
+                            node: target,
+                            data: targetData
+                        },
+                        stop: function() {
+                            isStop=true;
+                        }
+                    });
+                    // 拖拽是否取消
+                    if(isStop){
+                        return false;
+                    }
+
+                    // 数据更改
+                    var currList=currentData.parentData.data[options.request.children]
+                    var currIndex=currentData.parentData.childIndex
+                    var currData=currentData.currentData;
+                    var tarData=targetData.currentData;
+                    // 当前是否是最外层
+                    isCurrentOuterMost ? options.data.splice(currIndex,1) : currList.splice(currIndex,1)
+                    // 目标是否是最外层
+                    isTargetOuterMost ? options.data.push(currData) : (function() {
+                            !tarData[options.request.children] ? tarData[options.request.children]=[] : "";
+                            tarData[options.request.children].push(currData);
+                        })()
+
+                    // dom互换
+                    eleNode.remove();
+                    // 最外层判断
+                    if(isTargetOuterMost){
+                        target.append(temNode);
+                        var floor=0;
+                    }else{
+                        target.children(".eleTree-node-group").append(temNode);
+                        var floor=Number(target.attr("eletree-floor"))+1;
+                    }
+                    // 加floor和padding
+                    temNode.attr("eletree-floor",String(floor));
+                    temNode.children(".eleTree-node-content").css("padding-left",floor*options.indent+"px");
+                    // 通过floor差值计算子元素的floor
+                    var countFloor=eleFloor-floor;
+                    temNode.find(".eleTree-node").each(function(index,item) {
+                        var f=Number($(item).attr("eletree-floor"))-countFloor;
+                        $(item).attr("eletree-floor",String(f));
+                        $(item).children(".eleTree-node-content").css("padding-left",f*options.indent+"px");
+                    })
+                    // 原dom去三角
+                    var leaf=groupNode.children(".eleTree-node").length===0;
+                    leaf && groupNode.siblings(".eleTree-node-content")
+                        .children(".eleTree-node-content-icon").children(".layui-icon")
+                        .removeClass("icon-rotate").css("color","transparent");
+                    // 当前的增加三角
+                    var cLeaf=target.children(".eleTree-node-group").children(".eleTree-node").length===0;
+                    !cLeaf && target.children(".eleTree-node-content")
+                        .children(".eleTree-node-content-icon").children(".layui-icon")
+                        .addClass("icon-rotate").removeAttr("style");
+
+                    _self.unCheckNodes();
+                    _self.defaultChecked();
+
+                })
+            })
+        },
+        rightClickMenu: function() {
+            var _self=this;
+            var options=this.config;
+            if(options.contextmenuList.length<=0){
+                return;
+            }
+            $(document).on("click",function() {
+                $("#tree-menu").hide().remove();
+            });
+            var menuStr=['<ul id="tree-menu">'
+                ,$.inArray("copy",options.contextmenuList)!==-1?'<li class="copy"><a href="javascript:;">复制</a></li>':''
+                ,$.inArray("add",options.contextmenuList)!==-1?'<li class="add"><a href="javascript:;">新增</a></li>'+
+                    '<li class="insertBefore"><a href="javascript:;">插入节点前</a></li>'+
+                    '<li class="insertAfter"><a href="javascript:;">插入节点后</a></li>'+
+                    '<li class="append"><a href="javascript:;">插入子节点</a></li>' : ""
+                ,$.inArray("edit",options.contextmenuList)!==-1?'<li class="edit"><a href="javascript:;">修改</a></li>':''
+                ,$.inArray("remove",options.contextmenuList)!==-1?'<li class="remove"><a href="javascript:;">删除</a></li>':''
+                ,'</ul>'].join("");
+            this.treeMenu=$(menuStr);
+            options.elem.off("contextmenu").on("contextmenu",".eleTree-node-content",function(e) {
+                var that=this;
+                e.stopPropagation();
+                e.preventDefault();
+                // 添加active背景
+                if(_self.prevClickEle) _self.prevClickEle.removeClass("eleTree-node-content-active");
+                $(this).addClass("eleTree-node-content-active");
+                var eleNode=$(this).parent(".eleTree-node");
+                var nodeData=_self.reInitData(eleNode);
+
+                // 菜单位置
+                $(document.body).after(_self.treeMenu);
+                $("#tree-menu li.insertBefore,#tree-menu li.insertAfter,#tree-menu li.append").hide();
+                $("#tree-menu li.copy,#tree-menu li.add,#tree-menu li.edit,#tree-menu li.remove").show();
+                $("#tree-menu").css({
+                    left: e.pageX,
+                    top: e.pageY
+                }).show();
+                // 复制
+                $("#tree-menu li.copy").off().on("click",function() {
+                    var el = $(that).children(".eleTree-node-content-label").get(0);
+                    var selection = window.getSelection();
+                    var range = document.createRange();
+                    range.selectNodeContents(el);
+                    selection.removeAllRanges();
+                    selection.addRange(range);
+                    document.execCommand('Copy', 'false', null);
+                    selection.removeAllRanges();
+                });
+                // 新增
+                $("#tree-menu li.add").off().on("click",function(e) {
+                    e.stopPropagation();
+                    $(this).hide().siblings("li.copy,li.edit,li.remove").hide();
+                    $(this).siblings(".append,li.insertAfter,li.insertBefore").show();
+                })
+                // 添加的默认数据
+                var obj={};
+                obj[options.request.key]=_self.addKeyIndex;
+                obj[options.request.name]="未命名"+_self.nameIndex;
+
+                var arr=["Append","InsertBefore","InsertAfter"];
+                arr.forEach(function(val) {
+                    var s=val[0].toLocaleLowerCase()+val.slice(1,val.length);
+                    $("#tree-menu li."+s).off().on("click",function(e) {
+                        var node=$(that).parent(".eleTree-node");
+                        var key=node.attr("data-"+options.request.key);
+                        key=isNaN(key) ? key : Number(key);
+                        var isStop=false;
+                        var s=val[0].toLocaleLowerCase()+val.slice(1,val.length);
+                        layui.event.call(node, MOD_NAME, 'node'+val+'('+ _self.filter +')', {
+                            node: node,
+                            data: nodeData.currentData,
+                            // 重新设置数据
+                            setData: function(o) {
+                                _self[s](key,$.extend({},obj,o));
+                                isStop=true;
+                            },
+                            // 停止添加
+                            stop: function() {
+                                isStop=true;
+                            }
+                        });
+                        if(isStop) return;
+                        _self[s](key,obj)
+                        _self.nameIndex++;
+                        _self.addKeyIndex++;
+                    })
+                })
+
+                // 编辑
+                $("#tree-menu li.edit").off().on("click",function(e) {
+                    e.stopPropagation();
+                    $("#tree-menu").hide().remove();
+                    var node=$(that).parent(".eleTree-node");
+                    var key=node.attr("data-"+options.request.key);
+                    key=isNaN(key) ? key : Number(key);
+                    var label=$(that).children(".eleTree-node-content-label").hide();
+                    var text=label.text();
+                    var inp="<input type='text' value='"+text+"' class='eleTree-node-content-input' />";
+                    label.after(inp);
+                    label.siblings(".eleTree-node-content-input").focus().select().off().on("blur",function() {
+                        var val=$(this).val();
+                        var isStop=false;
+                        var inpThis=this;
+                        layui.event.call(node, MOD_NAME, 'nodeEdit('+ _self.filter +')', {
+                            node: node,
+                            value: val,
+                            data: nodeData.currentData,
+                            // 停止添加
+                            stop: function() {
+                                isStop=true;
+                                $(inpThis).siblings(".eleTree-node-content-label").show();
+                                $(inpThis).remove();
+                            }
+                        });
+                        if(isStop) return;
+                        // 修改数据
+                        _self.reInitData(eleNode).currentData[options.request.name]=val;
+                        // 修改dom
+                        $(this).siblings(".eleTree-node-content-label").text(val).show();
+                        $(this).remove();
+                    }).on("mousedown",function(e) {
+                        // 防止input拖拽
+                        e.stopPropagation();
+                    })
+                })
+                // 删除
+                $("#tree-menu li.remove").off().on("click",function(e) {
+                    var node=$(that).parent(".eleTree-node");
+                    var key=node.attr("data-"+options.request.key);
+                    key=isNaN(key) ? key : Number(key);
+                    var isStop=false;
+                    layui.event.call(node, MOD_NAME, 'nodeRemove('+ _self.filter +')', {
+                        node: node,
+                        data: nodeData.currentData,
+                        // 停止添加
+                        stop: function() {
+                            isStop=true;
+                        }
+                    });
+                    if(isStop) return;
+                    _self.remove(key);
+                })
+
+                _self.prevClickEle=$(this);
+            })
+        },
+        search: function(value) {
+            var options=this.config;
+            if(!options.searchNodeMethod || typeof options.searchNodeMethod !== "function"){
+                return;
+            }
+            var data=options.data;
+            // 数据递归
+            var traverse=function(data) {
+                data.forEach(function(val,index) {
+                    // 所有查找到的节点增加属性
+                    val.visible=options.searchNodeMethod(value,val);
+                    if(val[options.request.children] && val[options.request.children].length>0){
+                        traverse(val[options.request.children]);
+                    }
+                    //如果当前节点属性为隐藏,判断其子节点是否有显示的,如果有,则当前节点改为显示
+                    if(!val.visible){
+                        let childSomeShow = false;
+                        if(val[options.request.children] && val[options.request.children].length>0){
+                            childSomeShow=val[options.request.children].some(function(v,i) {
+                                return v.visible;
+                            })
+                        }
+                        val.visible = childSomeShow;
+                    }
+                    // 通过节点的属性,显示隐藏各个节点,并添加删除搜索类
+                    var el=options.elem.find("[data-"+options.request.key+"='"+val[options.request.key]+"']");
+                    if(val.visible){
+                        el.removeClass("eleTree-search-hide");
+                        // 判断父节点是否展开,如果父节点没有展开,则子节点也不要显示
+                        var parentEl=el.parent(".eleTree-node-group").parent(".eleTree-node");
+                        var isParentOpen=parentEl.children(".eleTree-node-content").children(".eleTree-node-content-icon").children(".layui-icon.layui-icon-triangle-r").hasClass("icon-rotate")
+                        if((parentEl.length>0 && isParentOpen) || parentEl.length===0){
+                            el.show();
+                        }
+                    }else{
+                        el.hide().addClass("eleTree-search-hide");
+                    }
+                    // 删除子层属性
+                    if(val[options.request.children] && val[options.request.children].length>0){
+                        val[options.request.children].forEach(function(v,i) {
+                            delete v.visible;
+                        })
+                    }
+                })
+            }
+            traverse(data);
+            // 删除最外层属性
+            var arr=[];
+            data.forEach(function(val) {
+                arr.push(val.visible);
+                delete val.visible;
+            })
+            // 如果第一层的所有的都隐藏,则显示文本
+            if(arr.every(function(v) {
+                    return v===false;
+                })){
+                laytpl(TPL_NoText()).render(options, function(string){
+                    options.elem.append(string);
+                });
+            }else{
+                options.elem.children(".eleTree-noText").remove();
+            }
+        }
+    }
+
+    exports(MOD_NAME,eleTree);
+})

+ 1733 - 0
js/layuiPlugins/formSelects-v4.js

@@ -0,0 +1,1733 @@
+/**
+ * name: formSelects
+ * 基于Layui Select多选
+ * version: 4.0.0.0817
+ * http://sun.faysunshine.com/layui/formSelects-v4/dist/formSelects-v4.js
+ */
+(function(layui, window, factory) {
+	if(typeof exports === 'object') { // 支持 CommonJS
+		module.exports = factory();
+	} else if(typeof define === 'function' && define.amd) { // 支持 AMD
+		define(factory);
+	} else if(window.layui && layui.define) { //layui加载
+		layui.define(['jquery'], function(exports) {
+			exports('formSelects', factory());
+		});
+	} else {
+		window.formSelects = factory();
+	}
+})(typeof layui == 'undefined' ? null : layui, window, function() {
+	let v = '4.0.0.0817',
+		NAME = 'xm-select',
+		PNAME = 'xm-select-parent',
+		INPUT = 'xm-select-input',
+		TDIV = 'xm-select--suffix',
+		THIS = 'xm-select-this',
+		LABEL = 'xm-select-label',
+		SEARCH = 'xm-select-search',
+		SEARCH_TYPE = 'xm-select-search-type',
+		SHOW_COUNT = 'xm-select-show-count',
+		CREATE = 'xm-select-create',
+		CREATE_LONG = 'xm-select-create-long',
+		MAX = 'xm-select-max',
+		SKIN = 'xm-select-skin',
+		DIRECTION = "xm-select-direction",
+		HEIGHT = 'xm-select-height',
+		DISABLED = 'xm-dis-disabled',
+		DIS = 'xm-select-dis',
+		TEMP = 'xm-select-temp',
+		RADIO = 'xm-select-radio',
+		LINKAGE= 'xm-select-linkage',
+		DL = 'xm-select-dl',
+		DD_HIDE = 'xm-select-hide',
+		HIDE_INPUT = 'xm-hide-input',
+		SANJIAO = 'xm-select-sj',
+		ICON_CLOSE = 'xm-icon-close',
+		FORM_TITLE = 'xm-select-title',
+		FORM_SELECT = 'xm-form-select',
+		FORM_SELECTED = 'xm-form-selected',
+		FORM_NONE = 'xm-select-none',
+		FORM_EMPTY = 'xm-select-empty',
+		FORM_INPUT = 'xm-input',
+		FORM_DL_INPUT = 'xm-dl-input',
+		FORM_SELECT_TIPS = 'xm-select-tips',
+		CHECKBOX_YES = 'xm-iconfont',
+		FORM_TEAM_PID = 'XM_PID_VALUE',
+		CZ = 'xm-cz',
+		CZ_GROUP = 'xm-cz-group',
+		TIPS = '请选择',
+		data = {},
+		events = {
+			on: {},
+			endOn: {},
+			filter: {},
+			maxTips: {},
+			opened: {},
+			closed: {}
+		},
+		ajax = {
+			type: 'get',
+			header: {
+
+			},
+			first: true,
+			data: {},
+			searchUrl: '',
+			searchName: 'keyword',
+			searchVal: null,
+			keyName: 'name',
+			keyVal: 'value',
+			keySel: 'selected',
+			keyDis: 'disabled',
+			keyChildren: 'children',
+			dataType: '',
+			delay: 500,
+			beforeSuccess: null,
+			success: null,
+			error: null,
+			beforeSearch: null,
+			response: {
+				statusCode: 0,
+				statusName: 'code',
+				msgName: 'msg',
+				dataName: 'data'
+			},
+			tree: {
+				nextClick: function(id, item, callback){
+					callback([]);
+				},
+				folderChoose: true,
+				lazy: true
+			}
+		},
+		quickBtns = [
+			{icon: 'xm-iconfont icon-quanxuan', name: '全选', click: function(id, cm){
+				cm.selectAll(id, true, true);
+			}},
+			{icon: 'xm-iconfont icon-qingkong', name: '清空', click: function(id, cm){
+				cm.removeAll(id, true, true);
+			}},
+			{icon: 'xm-iconfont icon-fanxuan', name: '反选', click: function(id, cm){
+				cm.reverse(id, true, true);
+			}},
+			{icon: 'xm-iconfont icon-pifu', name: '换肤', click: function(id, cm){
+				cm.skin(id);
+			}}
+		],
+		$ = window.$ || (window.layui && window.layui.jquery),
+		$win = $(window),
+		ajaxs = {},
+		fsConfig = {},
+		fsConfigs = {},
+		FormSelects = function(options) {
+			this.config = {
+				name: null, //xm-select="xxx"
+				max: null,
+				maxTips: (id, vals, val, max) => {
+					let ipt = $(`[xid="${this.config.name}"]`).prev().find(`.${NAME}`);
+					if(ipt.parents('.layui-form-item[pane]').length) {
+						ipt = ipt.parents('.layui-form-item[pane]');
+					}
+					ipt.attr('style', 'border-color: red !important');
+					setTimeout(() => {
+						ipt.removeAttr('style');
+					}, 300);
+				},
+				init: null, //初始化的选择值,
+				on: null, //select值发生变化
+				opened: null,
+				closed: null,
+				filter: (id, inputVal, val, isDisabled) => {
+					return val.name.indexOf(inputVal) == -1;
+				},
+				clearid: -1,
+				direction: 'auto',
+				height: null,
+				isEmpty: false,
+				btns: [quickBtns[0], quickBtns[1], quickBtns[2]],
+				searchType: 0,
+				create: (id, name) => {
+					return Date.now();
+				},
+				template: (name, value, selected, disabled) => {
+					return name;
+				},
+				showCount: 0,
+				isCreate: false,
+				placeholder: TIPS,
+				clearInput: false,
+			};
+			this.select = null;
+			this.values = [];
+			$.extend(this.config, options, {
+				searchUrl: options.isSearch ? options.searchUrl : null,
+				placeholder: options.optionsFirst ? (
+					options.optionsFirst.value ? TIPS : (options.optionsFirst.innerHTML || TIPS)
+				) : TIPS,
+				btns: options.radio ? [quickBtns[1]] : [quickBtns[0], quickBtns[1], quickBtns[2]],
+			}, fsConfigs[options.name] || fsConfig);
+			if(isNaN(this.config.showCount) || this.config.showCount <= 0) {
+ 				this.config.showCount = 19921012;
+ 			}
+		};
+	
+	//一些简单的处理方法
+	let Common = function(){
+		this.appender();
+		this.on();
+		this.onreset();
+	};
+	
+	Common.prototype.appender = function(){//针对IE做的一些拓展
+		//拓展Array map方法
+		if(!Array.prototype.map){Array.prototype.map=function(i,h){var b,a,c,e=Object(this),f=e.length>>>0;if(h){b=h}a=new Array(f);c=0;while(c<f){var d,g;if(c in e){d=e[c];g=i.call(b,d,c,e);a[c]=g}c++}return a}};
+		
+		//拓展Array foreach方法
+		if(!Array.prototype.forEach){Array.prototype.forEach=function forEach(g,b){var d,c;if(this==null){throw new TypeError("this is null or not defined")}var f=Object(this);var a=f.length>>>0;if(typeof g!=="function"){throw new TypeError(g+" is not a function")}if(arguments.length>1){d=b}c=0;while(c<a){var e;if(c in f){e=f[c];g.call(d,e,c,f)}c++}}};
+	
+		//拓展Array filter方法
+ 		if(!Array.prototype.filter){Array.prototype.filter=function(b){if(this===void 0||this===null){throw new TypeError()}var f=Object(this);var a=f.length>>>0;if(typeof b!=="function"){throw new TypeError()}var e=[];var d=arguments[1];for(var c=0;c<a;c++){if(c in f){var g=f[c];if(b.call(d,g,c,f)){e.push(g)}}}return e}};
+	}
+	
+	Common.prototype.init = function(target){
+		//初始化页面上已有的select
+		$((target ? target : `select[${NAME}]`)).each((index, select) => {
+			let othis = $(select),
+				id = othis.attr(NAME),
+				hasLayuiRender = othis.next(`.layui-form-select`),
+ 				hasRender = othis.next(`.${PNAME}`),
+ 				options = {
+ 					name: id,
+ 					disabled: select.disabled,
+ 					max: othis.attr(MAX) - 0,
+ 					isSearch: othis.attr(SEARCH) != undefined,
+ 					searchUrl: othis.attr(SEARCH),
+ 					isCreate: othis.attr(CREATE) != undefined,
+ 					radio: othis.attr(RADIO) != undefined,
+ 					skin: othis.attr(SKIN),
+ 					direction: othis.attr(DIRECTION),
+ 					optionsFirst: select.options[0],
+ 					height: othis.attr(HEIGHT),
+ 					formname: othis.attr('name') || othis.attr('_name'),
+ 					layverify: othis.attr('lay-verify') || othis.attr('_lay-verify'),
+ 					layverType: othis.attr('lay-verType'),
+ 					searchType: othis.attr(SEARCH_TYPE) == 'dl' ? 1 : 0,
+ 					showCount: othis.attr(SHOW_COUNT) - 0,
+ 				},
+				value = othis.find('option[selected]').toArray().map((option) => {//获取已选中的数据
+					return {
+						name: option.innerHTML,
+						value: option.value,
+					}
+				}),
+				fs = new FormSelects(options);
+			
+			fs.values = value;
+			
+			if(fs.config.init) {
+				fs.values = fs.config.init.map(item => {
+					if(typeof item == 'object') {
+						return item;
+					}
+					return {
+						name: othis.find(`option[value="${item}"]`).text(),
+						value: item
+					}
+				}).filter(item => {
+					return item.name;
+				});
+				fs.config.init = fs.values.concat([]);
+			}else{
+				fs.config.init = value.concat([]);
+			}
+			
+			!fs.values && (fs.values = []);
+
+			data[id] = fs;
+
+			//先取消layui对select的渲染
+			hasLayuiRender[0] && hasLayuiRender.remove();
+			hasRender[0] && hasRender.remove();
+
+			//构造渲染div
+			let dinfo = this.renderSelect(id, fs.config.placeholder, select); 
+			let heightStyle = !fs.config.height || fs.config.height == 'auto' ? '' : `xm-hg style="height: 34px;"`;
+			let inputHtml = [
+				`<div class="${LABEL}">`,
+					`<input type="text" fsw class="${FORM_INPUT} ${INPUT}" ${fs.config.isSearch ? '' : 'style="display: none;"'} autocomplete="off" debounce="0" />`,
+				`</div>`
+			];
+			let reElem =
+				$(`<div class="${FORM_SELECT}" ${SKIN}="${fs.config.skin}">
+					<input class="${HIDE_INPUT}" value="" name="${fs.config.formname}" lay-verify="${fs.config.layverify}" lay-verType="${fs.config.layverType}" type="text" style="position: absolute;bottom: 0; z-index: -1;width: 100%; height: 100%; border: none; opacity: 0;"/>
+					<div class="${FORM_TITLE} ${fs.config.disabled ? DIS : ''}">
+						<div class="${FORM_INPUT} ${NAME}" ${heightStyle}>
+							${inputHtml.join('')}
+							<i class="${SANJIAO}"></i>
+						</div>
+						<div class="${TDIV}">
+							<input type="text" autocomplete="off" placeholder="${fs.config.placeholder}" readonly="readonly" unselectable="on" class="${FORM_INPUT}">
+						</div>
+						<div></div>
+					</div>
+					<dl xid="${id}" class="${DL} ${fs.config.radio ? RADIO:''}">${dinfo}</dl>
+				</div>`);
+				
+			var $parent = $(`<div class="${PNAME}" FS_ID="${id}"></div>`);
+ 			$parent.append(reElem)
+ 			othis.after($parent);
+ 			othis.attr('lay-ignore', '');
+ 			othis.removeAttr('name') && othis.attr('_name', fs.config.formname);
+ 			othis.removeAttr('lay-verify') && othis.attr('_lay-verify', fs.config.layverify);
+			
+			//如果可搜索, 加上事件
+			if(fs.config.isSearch){
+				ajaxs[id] = $.extend({}, ajax, {searchUrl: fs.config.searchUrl}, ajaxs[id]);
+				$(document).on('input', `div.${PNAME}[FS_ID="${id}"] .${INPUT}`, (e) => {
+					this.search(id, e, fs.config.searchUrl);
+				});
+				if(fs.config.searchUrl){//触发第一次请求事件
+					this.triggerSearch(reElem, true);
+				}
+			}else{//隐藏第二个dl
+				reElem.find(`dl dd.${FORM_DL_INPUT}`).css('display', 'none');
+			}
+		});
+	}
+	
+	Common.prototype.search = function(id, e, searchUrl, call){
+		let input;
+		if(call){
+			input = call;
+		}else{
+			input = e.target;
+			let keyCode = e.keyCode;
+			if(keyCode === 9 || keyCode === 13 || keyCode === 37 || keyCode === 38 || keyCode === 39 || keyCode === 40) {
+				return false;
+			}
+		}
+		let inputValue = $.trim(input.value);
+		//过滤一下tips
+		this.changePlaceHolder($(input));
+		
+		let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax;
+		searchUrl = ajaxConfig.searchUrl || searchUrl;
+		let fs = data[id],
+			isCreate = fs.config.isCreate,
+			reElem = $(`dl[xid="${id}"]`).parents(`.${FORM_SELECT}`);
+		//如果开启了远程搜索
+		if(searchUrl){
+			if(ajaxConfig.searchVal){
+				inputValue = ajaxConfig.searchVal;
+				ajaxConfig.searchVal = '';
+			}
+			if(!ajaxConfig.beforeSearch || (ajaxConfig.beforeSearch && ajaxConfig.beforeSearch instanceof Function && ajaxConfig.beforeSearch(id, searchUrl, inputValue))){
+				let delay = ajaxConfig.delay;
+				if(ajaxConfig.first){
+					ajaxConfig.first = false;
+					delay = 10;
+				}
+				clearTimeout(fs.clearid);
+				fs.clearid = setTimeout(() => {
+					reElem.find(`dl > *:not(.${FORM_SELECT_TIPS})`).remove();
+					reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text('请求中');
+					this.ajax(id, searchUrl, inputValue, false, null, true);
+				}, delay);
+			}
+		}else{
+			reElem.find(`dl .${DD_HIDE}`).removeClass(DD_HIDE);
+			//遍历选项, 选择可以显示的值
+			reElem.find(`dl dd:not(.${FORM_SELECT_TIPS})`).each((idx, item) => {
+				let _item = $(item);
+				let searchFun = events.filter[id] || data[id].config.filter;
+				if(searchFun && searchFun(id, inputValue, this.getItem(id, _item), _item.hasClass(DISABLED)) == true){
+					_item.addClass(DD_HIDE);
+				}
+			});
+			//控制分组名称
+			reElem.find('dl dt').each((index, item) => {
+				if(!$(item).nextUntil('dt', `:not(.${DD_HIDE})`).length) {
+					$(item).addClass(DD_HIDE);
+				}
+			});
+			//动态创建
+			this.create(id, isCreate, inputValue);
+			let shows = reElem.find(`dl dd:not(.${FORM_SELECT_TIPS}):not(.${DD_HIDE})`);
+			if(!shows.length){
+				reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text('无匹配项');
+			}else{
+				reElem.find(`dd.${FORM_NONE}`).removeClass(FORM_EMPTY);
+			}
+		}
+	}
+	
+	Common.prototype.isArray = function(obj){
+		return Object.prototype.toString.call(obj) == "[object Array]";
+	}
+	
+	Common.prototype.triggerSearch = function(div, isCall){
+		(div ? [div] : $(`.${FORM_SELECT}`).toArray()).forEach((reElem, index) => {
+			reElem = $(reElem);
+			let id = reElem.find('dl').attr('xid')
+			if((id && data[id] && data[id].config.isEmpty) || isCall){
+				this.search(id, null, null, data[id].config.searchType == 0 ? reElem.find(`.${LABEL} .${INPUT}`) : reElem.find(`dl .${FORM_DL_INPUT} .${INPUT}`));
+			}
+		});
+	}
+	
+	Common.prototype.clearInput = function(id){
+		let div = $(`.${PNAME}[fs_id="${id}"]`);
+		let input = data[id].config.searchType == 0 ? div.find(`.${LABEL} .${INPUT}`) : div.find(`dl .${FORM_DL_INPUT} .${INPUT}`);
+		input.val('');
+	}
+	
+	Common.prototype.ajax = function(id, searchUrl, inputValue, isLinkage, linkageWidth, isSearch, successCallback, isReplace){
+		let reElem = $(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`);
+		if(!reElem[0] || !searchUrl){
+			return ;
+		}
+		let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax;
+		let ajaxData = $.extend(true, {}, ajaxConfig.data);
+		ajaxData[ajaxConfig.searchName] = inputValue;
+		//是否需要对ajax添加随机时间
+		//ajaxData['_'] = Date.now();
+		$.ajax({
+			type: ajaxConfig.type,
+			headers: ajaxConfig.header,
+			url: searchUrl,
+			data: ajaxConfig.dataType == 'json' ? JSON.stringify(ajaxData) : ajaxData,
+			success: (res) => {
+				if(typeof res == 'string'){
+					res = JSON.parse(res);
+				}
+				ajaxConfig.beforeSuccess && ajaxConfig.beforeSuccess instanceof Function && (res = ajaxConfig.beforeSuccess(id, searchUrl, inputValue, res));
+				if(this.isArray(res)){
+					let newRes = {};
+ 					newRes[ajaxConfig.response.statusName] = ajaxConfig.response.statusCode;
+ 					newRes[ajaxConfig.response.msgName] = "";
+ 					newRes[ajaxConfig.response.dataName] = res;
+ 					res = newRes;
+				}
+				if(res[ajaxConfig.response.statusName] != ajaxConfig.response.statusCode) {
+ 					reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text(res[ajaxConfig.response.msgName]);
+ 				}else{
+					reElem.find(`dd.${FORM_NONE}`).removeClass(FORM_EMPTY);
+					this.renderData(id, res[ajaxConfig.response.dataName], isLinkage, linkageWidth, isSearch, isReplace);
+ 					data[id].config.isEmpty = res[ajaxConfig.response.dataName].length == 0;
+				}
+ 				successCallback && successCallback(id);
+				ajaxConfig.success && ajaxConfig.success instanceof Function && ajaxConfig.success(id, searchUrl, inputValue, res);
+			},
+			error: (err) => {
+				reElem.find(`dd[lay-value]:not(.${FORM_SELECT_TIPS})`).remove();
+				reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text('服务异常');
+				ajaxConfig.error && ajaxConfig.error instanceof Function && ajaxConfig.error(id, searchUrl, inputValue, err);
+			}
+		});
+	}
+	
+	Common.prototype.renderData = function(id, dataArr, linkage, linkageWidth, isSearch, isReplace){
+		if(linkage){//渲染多级联动
+			this.renderLinkage(id, dataArr, linkageWidth);
+			return;
+		}
+		if(isReplace){
+			this.renderReplace(id, dataArr);
+			return;
+		}
+		
+		let reElem = $(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`);
+		let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax;
+		let pcInput = reElem.find(`.${TDIV} input`);
+
+		dataArr = this.exchangeData(id, dataArr);
+		let values = [];
+		reElem.find('dl').html(this.renderSelect(id, pcInput.attr('placeholder') || pcInput.attr('back'), dataArr.map((item) => {
+			let itemVal = $.extend({}, item, {
+				innerHTML: item[ajaxConfig.keyName],
+				value: item[ajaxConfig.keyVal],
+				sel: item[ajaxConfig.keySel],
+				disabled: item[ajaxConfig.keyDis],
+				type: item.type,
+				name: item[ajaxConfig.keyName]
+			});
+			if(itemVal.sel){
+				values.push(itemVal);
+			}
+			return itemVal;
+		})));
+
+		let label = reElem.find(`.${LABEL}`);
+		let dl = reElem.find('dl[xid]');
+		if(isSearch){//如果是远程搜索, 这里需要判重
+			let oldVal = data[id].values;
+			oldVal.forEach((item, index) => {
+				dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS);
+			});
+			values.forEach((item, index) => {
+				if(this.indexOf(oldVal, item) == -1){
+					this.addLabel(id, label, item);
+					dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS);
+					oldVal.push(item);
+				}
+			});
+		}else{
+			values.forEach((item, index) => {
+				this.addLabel(id, label, item);
+				dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS);
+			});
+			data[id].values = values;
+		}
+		this.commonHandler(id, label);
+	}
+	
+	Common.prototype.renderLinkage = function(id, dataArr, linkageWidth){
+		let result = [],
+			index = 0,
+			temp = {"0": dataArr},
+			ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax;
+		db[id] = {};
+		do{
+			let group = result[index ++] = [],
+				_temp = temp;
+			temp = {};
+			$.each(_temp, (pid, arr) => {
+				$.each(arr, (idx, item) => {
+					let val = {
+						pid: pid,
+						name: item[ajaxConfig.keyName],
+						value: item[ajaxConfig.keyVal],
+					};
+					db[id][val.value] = $.extend(item, val);
+					group.push(val);
+					let children = item[ajaxConfig.keyChildren];
+					if(children && children.length){
+						temp[val.value] = children;
+					}
+				});
+			});
+		}while(Object.getOwnPropertyNames(temp).length);
+		
+		let reElem = $(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`);
+		let html = ['<div class="xm-select-linkage">'];
+		
+		$.each(result, (idx, arr) => {
+			let groupDiv = [`<div style="left: ${(linkageWidth-0) * idx}px;" class="xm-select-linkage-group xm-select-linkage-group${idx + 1} ${idx != 0 ? 'xm-select-linkage-hide':''}">`];
+			$.each(arr, (idx2, item) => {
+				let span = `<li title="${item.name}" pid="${item.pid}" xm-value="${item.value}"><span>${item.name}</span></li>`;
+				groupDiv.push(span);
+			});
+			groupDiv.push(`</div>`);
+			html = html.concat(groupDiv);
+		});
+		html.push('<div style="clear: both; height: 288px;"></div>');
+		html.push('</div>');
+		reElem.find('dl').html(html.join(''));
+		reElem.find(`.${INPUT}`).css('display', 'none');//联动暂时不支持搜索
+	}
+	
+	Common.prototype.renderReplace = function(id, dataArr){
+		let dl = $(`.${PNAME} dl[xid="${id}"]`);
+		let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax;
+
+		dataArr = this.exchangeData(id, dataArr);
+		db[id] = dataArr;
+		
+		let html = dataArr.map((item) => {
+			let itemVal = $.extend({}, item, {
+				innerHTML: item[ajaxConfig.keyName],
+				value: item[ajaxConfig.keyVal],
+				sel: item[ajaxConfig.keySel],
+				disabled: item[ajaxConfig.keyDis],
+				type: item.type,
+				name: item[ajaxConfig.keyName]
+			});
+			return this.createDD(id, itemVal);
+		}).join('');
+		
+		dl.find(`dd:not(.${FORM_SELECT_TIPS}),dt:not([style])`).remove();
+		dl.find(`dt[style]`).after($(html));
+	}
+
+	Common.prototype.exchangeData = function(id, arr){//这里处理树形结构
+	    let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax;
+	    let childrenName = ajaxConfig['keyChildren'];
+	    let disabledName = ajaxConfig['keyDis'];
+		db[id] = {};
+	    let result = this.getChildrenList(arr, childrenName, disabledName, [], false);
+        return result;
+	}
+
+	Common.prototype.getChildrenList = function(arr, childrenName, disabledName, pid, disabled){
+	    let result = [], offset = 0;
+	    for(let a = 0; a < arr.length; a ++){
+            let item = arr[a];
+            if(item.type && item.type == 'optgroup'){
+            	result.push(item);
+            	continue;
+            }else{
+            	offset ++;
+            }
+            let parentIds = pid.concat([]);
+            parentIds.push(`${offset - 1}_E`);
+            item[FORM_TEAM_PID] = JSON.stringify(parentIds);
+            item[disabledName] = item[disabledName] || disabled;
+            result.push(item);
+            let child = item[childrenName];
+            if(child && common.isArray(child) && child.length){
+            	item['XM_TREE_FOLDER'] = true;
+                let pidArr = parentIds.concat([]);
+                let childResult = this.getChildrenList(child, childrenName, disabledName, pidArr, item[disabledName]);
+                result = result.concat(childResult);
+            }
+        }
+        return result;
+	}
+
+	Common.prototype.create = function(id, isCreate, inputValue){
+		if(isCreate && inputValue){
+			let fs = data[id],
+				dl = $(`[xid="${id}"]`),
+				tips=  dl.find(`dd.${FORM_SELECT_TIPS}.${FORM_DL_INPUT}`),
+				tdd = null,
+				temp = dl.find(`dd.${TEMP}`);
+			dl.find(`dd:not(.${FORM_SELECT_TIPS}):not(.${TEMP})`).each((index, item) => {
+				if(inputValue == $(item).find('span').attr('name')){
+					tdd = item;
+				}
+			});
+			if(!tdd){//如果不存在, 则创建
+				let val = fs.config.create(id, inputValue);
+				if(temp[0]){
+					temp.attr('lay-value', val);
+					temp.find('span').text(inputValue);
+					temp.find('span').attr("name", inputValue);
+					temp.removeClass(DD_HIDE);
+				}else{
+					tips.after($(this.createDD(id, {
+						name: inputValue,
+						innerHTML: inputValue,
+						value: val
+					}, `${TEMP} ${CREATE_LONG}`)));
+				}
+			}
+		}else{
+			$(`[xid=${id}] dd.${TEMP}`).remove();
+		}
+	}
+	
+	Common.prototype.createDD = function(id, item, clz){
+		let name = $.trim(item.innerHTML);
+		db[id][item.value] = $(item).is('option') ? {name: name, value: item.value} : item;
+		let template = data[id].config.template(name);
+		let pid = item[FORM_TEAM_PID];
+		pid ? (pid = JSON.parse(pid)) : (pid = [-1]);
+		let attr = pid[0] == -1 ? '' : `tree-id="${pid.join('-')}" tree-folder="${!!item['XM_TREE_FOLDER']}"`;
+		return `<dd lay-value="${item.value}" class="${item.disabled ? DISABLED : ''} ${clz ? clz : ''}" ${attr}>
+					<div class="xm-unselect xm-form-checkbox ${item.disabled ? DISABLED : ''}"  style="margin-left: ${(pid.length - 1) * 30}px">
+						<i class="${CHECKBOX_YES}"></i>
+						<span name="${name}">${template}</span>
+					</div>
+				</dd>`;
+	}
+	
+	Common.prototype.createQuickBtn = function(obj, right){
+		return `<div class="${CZ}" method="${obj.name}" title="${obj.name}" ${right ? 'style="margin-right: ' + right + '"': ''}><i class="${obj.icon}"></i><span>${obj.name}</span></div>`
+	}
+	
+	Common.prototype.renderBtns = function(id, show, right){
+		let quickBtn = [];
+		let dl = $(`dl[xid="${id}"]`);
+		quickBtn.push(`<div class="${CZ_GROUP}" show="${show}" style="max-width: ${dl.prev().width() - 54}px;">`);
+		$.each(data[id].config.btns, (index, item) => {
+			quickBtn.push(this.createQuickBtn(item, right));
+		});
+		quickBtn.push(`</div>`);
+		quickBtn.push(this.createQuickBtn({icon: 'xm-iconfont icon-caidan', name: ''}));
+		return quickBtn.join('');
+	}
+	
+	Common.prototype.renderSelect = function(id, tips, select){
+		db[id] = {};
+		let arr = [];
+		if(data[id].config.btns.length){
+			setTimeout(() => {
+				let dl = $(`dl[xid="${id}"]`);
+				dl.parents(`.${FORM_SELECT}`).attr(SEARCH_TYPE, data[id].config.searchType);
+				dl.find(`.${CZ_GROUP}`).css('max-width', `${dl.prev().width() - 54}px`);
+			}, 10)
+			arr.push([
+				`<dd lay-value="" class="${FORM_SELECT_TIPS}" style="background-color: #FFF!important;">`,
+					this.renderBtns(id, null, '30px'),
+				`</dd>`,
+				`<dd lay-value="" class="${FORM_SELECT_TIPS} ${FORM_DL_INPUT}" style="background-color: #FFF!important;">`,
+					`<i class="xm-iconfont icon-sousuo"></i>`,
+					`<input type="text" class="${FORM_INPUT} ${INPUT}" placeholder="请搜索"/>`,
+				`</dd>`
+			].join(''));
+		}else{
+			arr.push(`<dd lay-value="" class="${FORM_SELECT_TIPS}">${tips}</dd>`);
+		}
+		if(this.isArray(select)){
+			$(select).each((index, item) => {
+				if(item){
+					if(item.type && item.type === 'optgroup') {
+						arr.push(`<dt>${item.name}</dt>`);
+					} else {
+						arr.push(this.createDD(id, item));
+					}
+				}
+			});
+		}else{
+			$(select).find('*').each((index, item) => {
+				if(item.tagName.toLowerCase() == 'option' && index == 0 && !item.value){
+					return ;
+				}
+				if(item.tagName.toLowerCase() === 'optgroup') {
+					arr.push(`<dt>${item.label}</dt>`);
+				} else {
+					arr.push(this.createDD(id, item));
+				}
+			});
+		}
+		arr.push('<dt style="display:none;"> </dt>');
+		arr.push(`<dd class="${FORM_SELECT_TIPS} ${FORM_NONE} ${arr.length === 2 ? FORM_EMPTY:''}">没有选项</dd>`);
+		return arr.join('');
+	}
+	
+	Common.prototype.on = function(){//事件绑定
+		this.one();
+		
+		$(document).on('click', (e) => {
+			if(!$(e.target).parents(`.${FORM_TITLE}`)[0]){//清空input中的值
+				$(`.${PNAME} dl .${DD_HIDE}`).removeClass(DD_HIDE);
+				$(`.${PNAME} dl dd.${FORM_EMPTY}`).removeClass(FORM_EMPTY);
+				$(`.${PNAME} dl dd.${TEMP}`).remove();
+				$.each(data, (key, fs) => {
+					this.clearInput(key);
+					if(!fs.values.length){
+						this.changePlaceHolder($(`div[FS_ID="${key}"] .${LABEL}`));
+					}
+				});
+			}
+			$(`.${PNAME} .${FORM_SELECTED}`).each((index, item) => {
+				this.changeShow($(item).find(`.${FORM_TITLE}`), false);
+			}) ;
+		});
+	}
+	
+	Common.prototype.calcLabelLeft = function(label, w, call){
+		let pos = this.getPosition(label[0]);
+    	pos.y = pos.x + label[0].clientWidth;
+    	let left = label[0].offsetLeft;
+    	if(!label.find('span').length){
+    		left = 0;
+    	}else if(call){//校正归位
+    		let span = label.find('span:last');
+    		span.css('display') == 'none' ? (span = span.prev()[0]) : (span = span[0]);
+			let spos = this.getPosition(span);
+			spos.y = spos.x + span.clientWidth;
+			
+			if(spos.y > pos.y){
+				left = left - (spos.y - pos.y) - 5;
+			}else{
+				left = 0;
+			}
+    	}else{
+	    	if(w < 0){
+				let span = label.find(':last');
+				span.css('display') == 'none' ? (span = span.prev()[0]) : (span = span[0]);
+				let spos = this.getPosition(span);
+				spos.y = spos.x + span.clientWidth;
+				if(spos.y > pos.y){
+					left -= 10;
+				}
+	    	}else{
+				if(left < 0){
+					left += 10;
+				}
+				if(left > 0){
+					left = 0;
+				}
+	    	}
+    	}
+    	label.css('left', left + 'px');
+	}
+	
+	Common.prototype.one = function(target){//一次性事件绑定
+		$(target ? target : document).off('click', `.${FORM_TITLE}`).on('click', `.${FORM_TITLE}`, (e) => {
+			let othis = $(e.target),
+				title = othis.is(FORM_TITLE) ? othis : othis.parents(`.${FORM_TITLE}`),
+				dl = title.next(),
+				id = dl.attr('xid');
+			
+			//清空非本select的input val
+			$(`dl[xid]`).not(dl).each((index, item) => {
+				this.clearInput($(item).attr('xid'));
+			});
+			$(`dl[xid]`).not(dl).find(`dd.${DD_HIDE}`).removeClass(DD_HIDE);
+			
+			//如果是disabled select
+			if(title.hasClass(DIS)){
+				return false;
+			}
+			//如果点击的是右边的三角或者只读的input
+			if(othis.is(`.${SANJIAO}`) || othis.is(`.${INPUT}[readonly]`)){
+				this.changeShow(title, !title.parents(`.${FORM_SELECT}`).hasClass(FORM_SELECTED));
+				return false;
+			}
+			//如果点击的是input的右边, focus一下
+			if(title.find(`.${INPUT}:not(readonly)`)[0]){
+				let input = title.find(`.${INPUT}`),
+					epos = {x: e.pageX, y: e.pageY},
+					pos = this.getPosition(title[0]),
+					width = title.width();
+				while(epos.x > pos.x){
+					if($(document.elementFromPoint(epos.x, epos.y)).is(input)){
+						input.focus();
+						this.changeShow(title, true);
+						return false;
+					}
+					epos.x -= 50;
+				}
+			}
+			
+			//如果点击的是可搜索的input
+			if(othis.is(`.${INPUT}`)){
+				this.changeShow(title, true);
+				return false;
+			}
+			//如果点击的是x按钮
+			if(othis.is(`i[fsw="${NAME}"]`)){
+				let val = this.getItem(id, othis),
+				dd = dl.find(`dd[lay-value='${val.value}']`);
+				if(dd.hasClass(DISABLED)){//如果是disabled状态, 不可选, 不可删
+					return false;
+				}
+				this.handlerLabel(id, dd, false, val);
+				return false;
+			}
+			
+			this.changeShow(title, !title.parents(`.${FORM_SELECT}`).hasClass(FORM_SELECTED));
+			return false;
+		});
+		$(target ? target : document).off('click', `dl.${DL}`).on('click', `dl.${DL}`, (e) => {
+			let othis = $(e.target);
+			if(othis.is(`.${LINKAGE}`) || othis.parents(`.${LINKAGE}`)[0]){//linkage的处理
+				othis = othis.is('li') ? othis : othis.parents('li');
+				let group = othis.parents('.xm-select-linkage-group'),
+					id = othis.parents('dl').attr('xid');
+				if(!id){
+					return false;
+				}
+				//激活li
+				group.find('.xm-select-active').removeClass('xm-select-active');
+				othis.addClass('xm-select-active');
+				//激活下一个group, 激活前显示对应数据
+				group.nextAll('.xm-select-linkage-group').addClass('xm-select-linkage-hide');
+				let nextGroup = group.next('.xm-select-linkage-group');
+				nextGroup.find('li').addClass('xm-select-linkage-hide');
+				nextGroup.find(`li[pid="${othis.attr('xm-value')}"]`).removeClass('xm-select-linkage-hide');
+				//如果没有下一个group, 或没有对应的值
+				if(!nextGroup[0] || nextGroup.find(`li:not(.xm-select-linkage-hide)`).length == 0){
+					let vals = [],
+						index = 0,
+						isAdd = !othis.hasClass('xm-select-this');
+					if(data[id].config.radio){
+						othis.parents('.xm-select-linkage').find('.xm-select-this').removeClass('xm-select-this');
+					}
+					do{
+						vals[index ++] = {
+							name: othis.find('span').text(),
+							value: othis.attr('xm-value')
+						}
+						othis = othis.parents('.xm-select-linkage-group').prev().find(`li[xm-value="${othis.attr('pid')}"]`);			
+					}while(othis.length);
+					vals.reverse();
+					let val = {
+						name: vals.map((item) => {
+								return item.name;
+							}).join('/'),
+						value: vals.map((item) => {
+								return item.value;
+							}).join('/'),
+					}
+					this.handlerLabel(id, null, isAdd, val);
+				}else{
+					nextGroup.removeClass('xm-select-linkage-hide');
+				}
+				return false;
+			}
+			
+			if(othis.is('dl')){
+				return false;
+			}
+			
+			if(othis.is('dt')){
+				othis.nextUntil(`dt`).each((index, item) => {
+					item = $(item);
+					if(item.hasClass(DISABLED) || item.hasClass(THIS)){
+												
+					}else{
+						item.find('i:not(.icon-expand)').click();
+					}
+				});
+				return false;
+			}
+			let dd = othis.is('dd') ? othis : othis.parents('dd');
+			let id = dd.parent('dl').attr('xid');
+			
+			if(dd.hasClass(DISABLED)){//被禁用选项的处理
+				return false;
+			}
+			
+			//菜单功效
+			if(othis.is('i.icon-caidan')){
+				let opens = [], closes = [];
+				othis.parents('dl').find('dd[tree-folder="true"]').each((index, item) => {
+					$(item).attr('xm-tree-hidn') == undefined ? opens.push(item) : closes.push(item); 
+				});
+				let arr = closes.length ? closes : opens;
+				arr.forEach(item => item.click());
+				return false;
+			}
+			//树状结构的选择
+			let treeId = dd.attr('tree-id');
+			if(treeId){
+				//忽略右边的图标
+				if(othis.is('i:not(.icon-expand)')){
+					this.handlerLabel(id, dd, !dd.hasClass(THIS));
+					return false;
+				}
+				let ajaxConfig = ajaxs[id] || ajax;
+				let treeConfig = ajaxConfig.tree;
+				let childrens = dd.nextAll(`dd[tree-id^="${treeId}"]`);
+				if(childrens && childrens.length){
+					let len = childrens[0].clientHeight;
+					len ? (
+						this.addTreeHeight(dd, len),
+						len = 0
+					) : (
+						len = dd.attr('xm-tree-hidn') || 36, 
+						dd.removeAttr('xm-tree-hidn'),
+						dd.find('>i').remove(),
+						(childrens = childrens.filter((index, item) => $(item).attr('tree-id').split('-').length - 1 == treeId.split('-').length))
+					);
+					childrens.animate({
+						height: len
+					}, 150)
+					return false;
+				}else{
+					if(treeConfig.nextClick && treeConfig.nextClick instanceof Function){
+						treeConfig.nextClick(id, this.getItem(id, dd), (res) => {
+							if(!res || !res.length){
+								this.handlerLabel(id, dd, !dd.hasClass(THIS));
+							}else{
+								dd.attr('tree-folder', 'true');
+								let ddChilds = [];
+								res.forEach((item, idx) => {
+									item.innerHTML = item[ajaxConfig.keyName];
+									item[FORM_TEAM_PID] = JSON.stringify(treeId.split('-').concat([idx]));
+									ddChilds.push(this.createDD(id, item));
+									db[id][item[ajaxConfig.keyVal]] = item;
+								});
+								dd.after(ddChilds.join(''));
+							}
+						});
+						return false;
+					}
+				}
+			}
+			
+			if(dd.hasClass(FORM_SELECT_TIPS)){//tips的处理
+				let btn = othis.is(`.${CZ}`) ? othis : othis.parents(`.${CZ}`);
+				if(!btn[0]){
+					return false;
+				}
+				let method = btn.attr('method');
+				let obj = data[id].config.btns.filter(bean => bean.name == method)[0];
+				obj && obj.click && obj.click instanceof Function && obj.click(id, this);
+				return false;
+			}
+			this.handlerLabel(id, dd, !dd.hasClass(THIS));
+			return false;
+		});
+	}
+	
+	Common.prototype.addTreeHeight = function(dd, len){
+		let treeId = dd.attr('tree-id');
+		let childrens = dd.nextAll(`dd[tree-id^="${treeId}"]`);
+		if(childrens.length){
+			dd.append('<i class="xm-iconfont icon-expand"></i>');		
+			dd.attr('xm-tree-hidn', len);
+			childrens.each((index, item) => {
+				let that = $(item);
+				this.addTreeHeight(that, len);
+			})
+		}
+	}
+	
+	let db = {};
+	Common.prototype.getItem = function(id, value){
+		if(value instanceof $){
+			if(value.is(`i[fsw="${NAME}"]`)){
+				let span = value.parent();
+				return db[id][value] || {
+					name: span.find('font').text(),
+					value: span.attr('value')
+				}
+			}
+			let val = value.attr('lay-value');
+			return !db[id][val] ? (db[id][val] = {
+				name: value.find('span[name]').attr('name'),
+				value: val
+			}) : db[id][val];
+		}else if(typeof(value) == 'string' && value.indexOf('/') != -1){
+			return db[id][value] || {
+				name: this.valToName(id, value),
+				value: value
+			}
+		}
+		return db[id][value];
+	}
+	
+	Common.prototype.linkageAdd = function(id, val){
+		let dl = $(`dl[xid="${id}"]`);
+		dl.find('.xm-select-active').removeClass('xm-select-active');
+		let vs = val.value.split('/');
+		let pid, li, index = 0;
+		let lis = [];
+		do{
+			pid = vs[index];
+			li = dl.find(`.xm-select-linkage-group${index + 1} li[xm-value="${pid}"]`);
+			li[0] && lis.push(li);
+			index ++;
+		}while(li.length && pid != undefined);
+		if(lis.length == vs.length){
+			$.each(lis, (idx, item) => {
+				item.addClass('xm-select-this');
+			});
+		}
+	}
+	
+	Common.prototype.linkageDel = function(id, val){
+		let dl = $(`dl[xid="${id}"]`);
+		let vs = val.value.split('/');
+		let pid, li, index = vs.length - 1;
+		do{
+			pid = vs[index];
+			li = dl.find(`.xm-select-linkage-group${index + 1} li[xm-value="${pid}"]`);
+			if(!li.parent().next().find(`li[pid=${pid}].xm-select-this`).length){
+				li.removeClass('xm-select-this');
+			}
+			index --;
+		}while(li.length && pid != undefined);
+	}
+	
+	Common.prototype.valToName = function(id, val){
+		let dl = $(`dl[xid="${id}"]`);
+		let vs = (val + "").split('/');
+		if(!vs.length){
+			return null;
+		}
+		let names = [];
+		$.each(vs, (idx, item) => {
+			let name = dl.find(`.xm-select-linkage-group${idx + 1} li[xm-value="${item}"] span`).text();
+			names.push(name);
+		});
+		return names.length == vs.length ? names.join('/') : null;
+	}
+	
+	Common.prototype.commonHandler = function(key, label){
+		if(!label || !label[0]){
+			return ;
+		}
+		this.checkHideSpan(key, label);
+		//计算input的提示语
+		this.changePlaceHolder(label);
+		//计算高度
+		this.retop(label.parents(`.${FORM_SELECT}`));
+		this.calcLabelLeft(label, 0, true);
+		//表单默认值
+		this.setHidnVal(key, label);
+		//title值
+		label.parents(`.${FORM_TITLE} .${NAME}`).attr('title', data[key].values.map((val) => {
+			return val.name;
+		}).join(','));
+	}
+	
+	Common.prototype.initVal = function(id){
+		let target = {};
+		if(id){
+			target[id] = data[id];
+		}else{
+			target = data;
+		}
+		$.each(target, (key, val) => {
+			let values = val.values,		
+				div = $(`dl[xid="${key}"]`).parent(),
+				label = div.find(`.${LABEL}`),
+				dl = div.find('dl');
+			dl.find(`dd.${THIS}`).removeClass(THIS);
+			
+			let _vals = values.concat([]);
+			_vals.concat([]).forEach((item, index) => {
+				this.addLabel(key, label, item);
+				dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS);
+			});
+			if(val.config.radio){
+				_vals.length && values.push(_vals[_vals.length - 1]);
+			}
+			this.commonHandler(key, label);
+		});
+	}
+	
+	Common.prototype.setHidnVal = function(key, label) {
+ 		if(!label || !label[0]) {
+ 			return;
+ 		}
+ 		label.parents(`.${PNAME}`).find(`.${HIDE_INPUT}`).val(data[key].values.map((val) => {
+ 			return val.value;
+ 		}).join(','));
+ 	}
+	
+	Common.prototype.handlerLabel = function(id, dd, isAdd, oval, notOn){
+		let div = $(`[xid="${id}"]`).prev().find(`.${LABEL}`),
+			val = dd && this.getItem(id, dd),
+			vals = data[id].values,
+			on = data[id].config.on || events.on[id],
+			endOn = data[id].config.endOn || events.endOn[id];
+		if(oval){
+			val = oval;
+		}
+		let fs = data[id];
+		if(isAdd && fs.config.max && fs.values.length >= fs.config.max){
+			let maxTipsFun = events.maxTips[id] || data[id].config.maxTips;
+ 			maxTipsFun && maxTipsFun(id, vals.concat([]), val, fs.config.max);
+			return ;
+		}
+		if(!notOn){
+			if(on && on instanceof Function && on(id, vals.concat([]), val, isAdd, dd && dd.hasClass(DISABLED)) == false) {
+				return ;
+			}
+		}
+		let dl = $(`dl[xid="${id}"]`);
+		isAdd ? (
+			(dd && dd[0] ? (
+				dd.addClass(THIS), 
+				dd.removeClass(TEMP)
+			) : (
+				dl.find('.xm-select-linkage')[0] && this.linkageAdd(id, val)
+			)),
+			this.addLabel(id, div, val),
+			vals.push(val)
+		) : (
+			(dd && dd[0] ? (
+				dd.removeClass(THIS)
+			) : (
+				dl.find('.xm-select-linkage')[0] && this.linkageDel(id, val)
+			)),
+			this.delLabel(id, div, val),
+			this.remove(vals, val)
+		);
+		if(!div[0]) return ;
+		//单选选完后直接关闭选择域
+		if(fs.config.radio){
+			this.changeShow(div, false);
+		}
+		//移除表单验证的红色边框
+		div.parents(`.${FORM_TITLE}`).prev().removeClass('layui-form-danger');
+		
+		//清空搜索值
+		fs.config.clearInput && this.clearInput(id);
+		
+		this.commonHandler(id, div);
+		
+		!notOn && endOn && endOn instanceof Function && endOn(id, vals.concat([]), val, isAdd, dd && dd.hasClass(DISABLED));
+	}
+	
+	Common.prototype.addLabel = function(id, div, val){
+		if(!val) return ;
+		let tips = `fsw="${NAME}"`;
+		let [$label, $close] = [
+			$(`<span ${tips} value="${val.value}"><font ${tips}>${val.name}</font></span>`), 
+			$(`<i ${tips} class="xm-iconfont icon-close"></i>`)
+		];
+		$label.append($close);
+		//如果是radio模式
+		let fs = data[id];
+		if(fs.config.radio){
+			fs.values.length = 0;
+			$(`dl[xid="${id}"]`).find(`dd.${THIS}:not([lay-value="${val.value}"])`).removeClass(THIS);
+			div.find('span').remove();
+		}
+		//如果是固定高度
+		div.find('input').css('width', '50px');
+		div.find('input').before($label);
+	}
+	
+	Common.prototype.delLabel = function(id, div, val){
+		if(!val) return ;
+		div.find(`span[value="${val.value}"]:first`).remove();
+	}
+	
+	Common.prototype.checkHideSpan = function(id, div){
+		let parentHeight = div.parents(`.${NAME}`)[0].offsetHeight + 5;
+		div.find('span.xm-span-hide').removeClass('xm-span-hide');
+		div.find('span[style]').remove();
+		
+		let count = data[id].config.showCount;
+		div.find('span').each((index, item) => {
+			if(index >= count){
+				$(item).addClass('xm-span-hide');
+			}
+		});
+		
+		let prefix = div.find(`span:eq(${count})`);
+		prefix[0] && prefix.before($(`<span style="padding-right: 6px;" fsw="${NAME}"> + ${div.find('span').length - count}</span>`))
+	}
+	
+	Common.prototype.retop = function(div){//计算dl显示的位置
+		let dl = div.find('dl'),
+			top = div.offset().top + div.outerHeight() + 5 - $win.scrollTop(),
+            dlHeight = dl.outerHeight();
+		let up = div.hasClass('layui-form-selectup') || dl.css('top').indexOf('-') != -1 || (top + dlHeight > $win.height() && top >= dlHeight);
+		div = div.find(`.${NAME}`);
+		
+		let fs = data[dl.attr('xid')];
+		let base = dl.parents('.layui-form-pane')[0] && dl.prev()[0].clientHeight > 38 ? 14 : 10;
+		if((fs && fs.config.direction == 'up') || up){
+			up = true;
+			if((fs && fs.config.direction == 'down')){
+				up = false;
+			}
+		}
+		let reHeight = div[0].offsetTop + div.height() + base;
+		if(up) {
+			dl.css({
+				top: 'auto',
+				bottom: reHeight + 3 + 'px',
+			});
+		} else {
+			dl.css({
+				top: reHeight + 'px',
+				bottom: 'auto'
+			});
+		}
+	}
+	
+	Common.prototype.changeShow = function(children, isShow){//显示于隐藏
+		$('.layui-form-selected').removeClass('layui-form-selected');
+		let top = children.parents(`.${FORM_SELECT}`),
+			realShow = top.hasClass(FORM_SELECTED),
+			id = top.find('dl').attr('xid');
+		$(`.${PNAME} .${FORM_SELECT}`).not(top).removeClass(FORM_SELECTED);
+		if(isShow){
+			this.retop(top);
+			top.addClass(FORM_SELECTED);
+			top.find(`.${INPUT}`).focus();
+			if(!top.find(`dl dd[lay-value]:not(.${FORM_SELECT_TIPS})`).length){
+				top.find(`dl .${FORM_NONE}`).addClass(FORM_EMPTY);
+			}
+		}else{
+			top.removeClass(FORM_SELECTED);
+			this.clearInput(id);
+			top.find(`dl .${FORM_EMPTY}`).removeClass(FORM_EMPTY);
+			top.find(`dl dd.${DD_HIDE}`).removeClass(DD_HIDE);
+			top.find(`dl dd.${TEMP}`).remove();
+			//计算ajax数据是否为空, 然后重新请求数据
+			if(id && data[id] && data[id].config.isEmpty){
+				this.triggerSearch(top);
+			}
+			this.changePlaceHolder(top.find(`.${LABEL}`));
+		}
+		if(isShow != realShow){
+			let openFun = data[id].config.opened || events.opened[id];
+			isShow && openFun && openFun instanceof Function && openFun(id);
+			let closeFun = data[id].config.closed || events.closed[id];
+			!isShow && closeFun && closeFun instanceof Function && closeFun(id);
+		}
+	}
+	
+	Common.prototype.changePlaceHolder = function(div){//显示于隐藏提示语
+		//调整pane模式下的高度
+		let title = div.parents(`.${FORM_TITLE}`);
+		title[0] || (title = div.parents(`dl`).prev());
+		if(!title[0]){
+			return ;
+		}
+		
+		let id = div.parents(`.${PNAME}`).find(`dl[xid]`).attr('xid');
+		if(data[id] && data[id].config.height){//既然固定高度了, 那就看着办吧
+						
+		}else{
+			let height = title.find(`.${NAME}`)[0].clientHeight;
+			title.css('height' , (height > 36 ? height + 4 : height) + 'px');
+			//如果是layui pane模式, 处理label的高度
+			let label = title.parents(`.${PNAME}`).parent().prev();
+			if(label.is('.layui-form-label') && title.parents('.layui-form-pane')[0]){
+				height = height > 36 ? height + 4 : height;
+				title.css('height' , height + 'px');
+				label.css({
+					height: height + 2 + 'px',
+					lineHeight: (height - 18) + 'px'
+				})
+			}
+		}
+		
+		let input = title.find(`.${TDIV} input`),
+			isShow = !div.find('span:last')[0] && !title.find(`.${INPUT}`).val();
+		if(isShow){
+			let ph = input.attr('back');
+			input.removeAttr('back');
+			input.attr('placeholder', ph);
+		}else{
+			let ph = input.attr('placeholder');
+			input.removeAttr('placeholder');
+			input.attr('back', ph)
+		}
+	}
+	
+	Common.prototype.indexOf = function(arr, val){
+		for(let i = 0; i < arr.length; i++) {
+			if(arr[i].value == val || arr[i].value == (val ? val.value : val) || arr[i] == val || JSON.stringify(arr[i]) == JSON.stringify(val)) {
+				return i;
+			}
+		}
+		return -1;
+	}
+	
+	Common.prototype.remove = function(arr, val){
+		let idx = this.indexOf(arr, val ? val.value : val);
+		if(idx > -1) {
+			arr.splice(idx, 1);
+			return true;
+		}
+		return false;
+	}
+	
+	Common.prototype.selectAll = function(id, isOn, skipDis){
+		let dl = $(`[xid="${id}"]`);
+		if(!dl[0]){
+			return ;
+		}
+		if(dl.find('.xm-select-linkage')[0]){
+			return ;
+		}
+		dl.find(`dd[lay-value]:not(.${FORM_SELECT_TIPS}):not(.${THIS})${skipDis ? ':not(.'+DISABLED+')' :''}`).each((index, item) => {
+			item = $(item);
+			let val = this.getItem(id, item);
+			this.handlerLabel(id, dl.find(`dd[lay-value="${val.value}"]`), true, val, !isOn);
+		});
+	}
+	
+	Common.prototype.removeAll = function(id, isOn, skipDis){
+		let dl = $(`[xid="${id}"]`);
+		if(!dl[0]){
+			return ;
+		}
+		if(dl.find('.xm-select-linkage')[0]){//针对多级联动的处理
+			data[id].values.concat([]).forEach((item, idx) => {
+				let vs = item.value.split('/');
+				let pid, li, index = 0;
+				do{
+					pid = vs[index ++];
+					li = dl.find(`.xm-select-linkage-group${index}:not(.xm-select-linkage-hide) li[value="${pid}"]`);
+					li.click();
+				}while(li.length && pid != undefined);
+			});
+			return ;
+		}
+		data[id].values.concat([]).forEach((item, index) => {
+			if(skipDis && dl.find(`dd[lay-value="${item.value}"]`).hasClass(DISABLED)){
+				
+			}else{
+				this.handlerLabel(id, dl.find(`dd[lay-value="${item.value}"]`), false, item, !isOn);
+			}
+		});
+	}
+	
+	Common.prototype.reverse = function(id, isOn, skipDis){
+		let dl = $(`[xid="${id}"]`);
+		if(!dl[0]){
+			return ;
+		}
+		if(dl.find('.xm-select-linkage')[0]){
+			return ;
+		}
+		dl.find(`dd[lay-value]:not(.${FORM_SELECT_TIPS})${skipDis ? ':not(.'+DISABLED+')' :''}`).each((index, item) => {
+			item = $(item);
+			let val = this.getItem(id, item);
+			this.handlerLabel(id, dl.find(`dd[lay-value="${val.value}"]`), !item.hasClass(THIS), val, !isOn);
+		});
+	}
+	
+	Common.prototype.skin = function(id){
+		let skins = ['default' ,'primary', 'normal', 'warm', 'danger'];
+		let skin = skins[Math.floor(Math.random() * skins.length)];
+		$(`dl[xid="${id}"]`).parents(`.${PNAME}`).find(`.${FORM_SELECT}`).attr('xm-select-skin', skin);
+		this.check(id) && this.commonHandler(id, $(`dl[xid="${id}"]`).parents(`.${PNAME}`).find(`.${LABEL}`));
+	}
+	
+	Common.prototype.getPosition = function(e){
+		let x = 0, y = 0;
+        while (e != null) {
+            x += e.offsetLeft;
+            y += e.offsetTop;
+            e = e.offsetParent;
+        }
+        return { x: x, y: y };
+	};
+	
+	Common.prototype.onreset = function(){//监听reset按钮, 然后重置多选
+		$(document).on('click', '[type=reset]', (e) => {
+			$(e.target).parents('form').find(`.${PNAME} dl[xid]`).each((index, item) => {
+				let id = item.getAttribute('xid'),
+					dl = $(item),
+					dd,
+					temp = {};
+				common.removeAll(id);
+				data[id].config.init.forEach((val, idx) => {
+					if(val && (!temp[val] || data[id].config.repeat) && (dd = dl.find(`dd[lay-value="${val.value}"]`))[0]){
+						common.handlerLabel(id, dd, true);
+						temp[val] = 1;
+					}
+				});
+			})
+		});
+	}
+	
+	Common.prototype.bindEvent = function(name, id, fun){
+		if(id && id instanceof Function){
+			fun = id;
+			id = null;
+		}
+		if(fun && fun instanceof Function){
+			if(!id){
+				$.each(data, (id, val) => {
+					data[id] ? (data[id].config[name] = fun) : (events[name][id] = fun)				
+				})
+			}else{
+				data[id] ? (data[id].config[name] = fun, delete events[name][id]) : (events[name][id] = fun)
+			}
+		}
+	}
+	
+	Common.prototype.check = function(id, notAutoRender){
+		if($(`dl[xid="${id}"]`).length) {
+			return true;
+		}else if($(`select[xm-select="${id}"]`).length){
+			if(!notAutoRender){
+				this.render(id, $(`select[xm-select="${id}"]`));
+				return true;
+			}
+		}else{
+			delete data[id];
+			return false;
+		}
+	}
+	
+	Common.prototype.render = function(id, select){
+		common.init(select);
+		common.one($(`dl[xid="${id}"]`).parents(`.${PNAME}`));
+		common.initVal(id);
+	}
+	
+	Common.prototype.log = function(obj){
+		
+	}
+	
+	let Select4 = function(){
+		this.v = v;
+		this.render();
+	};
+	let common = new Common();
+	
+	Select4.prototype.value = function(id, type, isAppend){
+		if(typeof id != 'string'){
+			return [];
+		}
+		let fs = data[id];
+		if(!common.check(id)){
+			return [];
+		}
+		if(typeof type == 'string' || type == undefined){
+			let arr = fs.values.concat([]) || [];
+			if(type == 'val') {
+				return arr.map((val) => {
+					return val.value;
+				});
+			}
+			if(type == 'valStr') {
+				return arr.map((val) => {
+					return val.value;
+				}).join(',');
+			}
+			if(type == 'name') {
+				return arr.map((val) => {
+					return val.name;
+				});
+			}
+			if(type == 'nameStr') {
+				return arr.map((val) => {
+					return val.name;
+				}).join(',');
+			}
+			return arr;
+		}
+		if(common.isArray(type)) {
+			let dl = $(`[xid="${id}"]`),
+				temp = {},
+				dd,
+				isAdd = true;
+			if(isAppend == false){//删除传入的数组
+				isAdd = false;
+			}else if(isAppend == true){//追加模式
+				isAdd = true;
+			}else{//删除原有的数据
+				common.removeAll(id);
+			}
+			if(isAdd){
+				fs.values.forEach((val, index) => {
+					temp[val.value] = 1;
+				});
+			}
+			type.forEach((val, index) => {
+				if(val && (!temp[val] || fs.config.repeat)){
+					if((dd = dl.find(`dd[lay-value="${val}"]`))[0]){
+						common.handlerLabel(id, dd, isAdd, null, true);
+						temp[val] = 1;
+					}else{
+						let name = common.valToName(id, val);						
+						if(name){
+							common.handlerLabel(id, dd, isAdd, common.getItem(id, val), true);
+							temp[val] = 1;
+						}
+					}
+				}
+			});
+		}
+	}
+	
+	Select4.prototype.on = function(id, fun, isEnd) {
+		common.bindEvent(isEnd ? 'endOn' : 'on', id, fun);
+		return this;
+	}
+	
+	Select4.prototype.filter = function(id, fun){
+		common.bindEvent('filter', id, fun);
+		return this;
+	}
+	
+	Select4.prototype.maxTips = function(id, fun){
+		common.bindEvent('maxTips', id, fun);
+		return this;
+	}
+	
+	Select4.prototype.opened = function(id, fun){
+		common.bindEvent('opened', id, fun);
+		return this;
+	}
+	
+	Select4.prototype.closed = function(id, fun){
+		common.bindEvent('closed', id, fun);
+		return this;
+	}
+	
+	Select4.prototype.config = function(id, config, isJson){
+		if(id && typeof id == 'object'){
+			isJson = config == true;
+			config = id;
+			id = null;
+		}
+		if(config && typeof config== 'object'){
+			if(isJson){
+				config.header || (config.header = {});
+				config.header['Content-Type'] = 'application/json; charset=UTF-8';
+				config.dataType = 'json';
+			}
+			id ? (
+				ajaxs[id] = $.extend(true, {}, ajaxs[id] || ajax, config), !common.check(id) && this.render(id),
+				data[id] && config.direction && (data[id].config.direction = config.direction),
+				data[id] && config.clearInput && (data[id].config.clearInput = true),
+				config.searchUrl && data[id] && common.triggerSearch($(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`), true)
+			) : (
+				$.extend(true, ajax, config),
+				$.each(ajaxs, (key, item) => {
+					$.extend(true, item, config)
+				})
+			);
+		}
+		return this;
+	}
+	
+	Select4.prototype.render = function(id, options){
+		if(id && typeof id == 'object'){
+			options = id;
+			id = null;
+		}
+		let config = options ? {
+			init: options.init,
+			disabled: options.disabled,
+			max: options.max,
+			isSearch: options.isSearch,
+			searchUrl: options.searchUrl,
+			isCreate: options.isCreate,
+			radio: options.radio,
+			skin: options.skin,
+			direction: options.direction,
+			height: options.height,
+			formname: options.formname,
+			layverify: options.layverify,
+			layverType: options.layverType,
+			showCount: options.showCount,
+			placeholder: options.placeholder,
+			create: options.create,
+			filter: options.filter,
+			maxTips: options.maxTips,
+			on: options.on,
+			on: options.on,
+			opened: options.opened,
+			closed: options.closed,
+			template: options.template,
+			clearInput: options.clearInput,
+		} : {};
+		
+		options && options.searchType != undefined && (config.searchType = options.searchType == 'dl' ? 1 : 0);
+		
+		if(id){
+			fsConfigs[id] = {};
+			$.extend(fsConfigs[id], data[id] ? data[id].config : {}, config);
+		}else{
+			$.extend(fsConfig, config);
+		}
+
+		($(`select[${NAME}="${id}"]`)[0] ? $(`select[${NAME}="${id}"]`) : $(`select[${NAME}]`)).each((index, select) => {
+			let sid = select.getAttribute(NAME);
+			common.render(sid, select);
+			setTimeout(() => common.setHidnVal(sid, $(`select[xm-select="${sid}"] + div.${PNAME} .${LABEL}`)), 10);
+		});
+		return this;
+	}
+	
+	Select4.prototype.disabled = function(id){
+		let target = {};
+		id ? (common.check(id) && (target[id] = data[id])) : (target = data);
+		
+		$.each(target, (key, val) => {
+			$(`dl[xid="${key}"]`).prev().addClass(DIS);
+		});
+		return this;
+	}
+	
+	Select4.prototype.undisabled = function(id){
+		let target = {};
+		id ? (common.check(id) && (target[id] = data[id])) : (target = data);
+		
+		$.each(target, (key, val) => {
+			$(`dl[xid="${key}"]`).prev().removeClass(DIS);
+		});
+		return this;
+	}
+	
+	Select4.prototype.data = function(id, type, config){
+		if(!id || !type || !config){
+			common.log(`id: ${id} param error !!!`)
+			return this;
+		}
+		if(!common.check(id)){
+			common.log(`id: ${id} not render !!!`)
+			return this;
+		}
+		this.value(id, []);
+		this.config(id, config);
+		if(type == 'local'){
+			common.renderData(id, config.arr, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100');
+		}else if(type == 'server'){
+			common.ajax(id, config.url, config.keyword, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100');
+		}
+		return this;
+	}
+	
+	Select4.prototype.btns = function(id, btns, config){
+		if(id && common.isArray(id)){
+			btns = id;
+			id = null;
+		}
+		if(!btns || !common.isArray(btns)) {
+			return this;
+		};
+		let target = {};
+		id ? (common.check(id) && (target[id] = data[id])) : (target = data);
+		
+		btns = btns.map((obj) => {
+			if(typeof obj == 'string'){
+				if(obj == 'select'){
+					return quickBtns[0];
+				}
+				if(obj == 'remove'){
+					return quickBtns[1];
+				}
+				if(obj == 'reverse'){
+					return quickBtns[2];
+				}
+				if(obj == 'skin'){
+					return quickBtns[3];
+				}
+			}
+			return obj;
+		});
+		
+		$.each(target, (key, val) => {
+			val.config.btns = btns;
+			let dd = $(`dl[xid="${key}"]`).find(`.${FORM_SELECT_TIPS}:first`);
+			if(btns.length){
+				let show = config && config.show && (config.show == 'name' || config.show == 'icon') ? config.show : '';
+				let html = common.renderBtns(key, show, config && config.space ? config.space : '30px');
+				dd.html(html);
+			}else{
+				let pcInput = dd.parents(`.${FORM_SELECT}`).find(`.${TDIV} input`);
+				let html = pcInput.attr('placeholder') || pcInput.attr('back');
+				dd.html(html);
+				dd.removeAttr('style');
+			}
+		});
+		
+		return this;
+	}
+	
+	Select4.prototype.search = function(id, val){
+		if(id && common.check(id)){
+			ajaxs[id] = $.extend(true, {}, ajaxs[id] || ajax, {
+				first: true,
+				searchVal: val
+			});
+			common.triggerSearch($(`dl[xid="${id}"]`).parents(`.${FORM_SELECT}`), true);
+		}
+		return this;
+	}
+	
+	Select4.prototype.replace = function(id, type, config){
+		if(!id || !type || !config){
+			common.log(`id: ${id} param error !!!`)
+			return this;
+		}
+		if(!common.check(id, true)){
+			common.log(`id: ${id} not render !!!`)
+			return this;
+		}
+		let oldVals = this.value(id, 'val');
+		this.value(id, []);
+		this.config(id, config);
+		if(type == 'local'){
+			common.renderData(id, config.arr, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100', false, true);
+			this.value(id, oldVals, true);
+		}else if(type == 'server'){
+			common.ajax(id, config.url, config.keyword, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100', false, (id) => {
+				this.value(id, oldVals, true);
+			}, true);
+		}
+	}
+	
+	return new Select4();
+});

+ 79 - 0
js/layuiPlugins/inputTags.css

@@ -0,0 +1,79 @@
+/*
+* @Author: layui-2
+* @Date:   2018-08-31 11:40:53
+* @Last Modified by:   xuzhiwen
+* @Last Modified time: 2018-09-07 15:26:19
+*/
+em{
+  font-style: normal;
+}
+#tags
+{
+    padding-top: 10px;
+    color: #777;
+    border: 1px solid #d5d5d5;
+    background-color: #fff;
+}
+
+#tags span{
+    font-size: 12px;
+    font-weight: normal;
+    line-height: 16px;
+    position: relative;
+    display: inline-block;
+    height: 16px;
+    margin: 3px;
+    padding: 4px 22px 5px 9px;
+    cursor: pointer;
+    transition: all .2s ease 0s;
+    vertical-align: baseline;
+    white-space: nowrap;
+    color: #fff;
+    background-color: #009688;
+    text-shadow: 1px 1px 1px rgba(0, 0, 0, .15);
+}
+#tags .close{
+    font-size: 12px;
+    font-weight: bold;
+    line-height: 20px;
+    position: absolute;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    float: none;
+    width: 18px;
+    padding: 0;
+    cursor: pointer;
+    text-align: center;
+    opacity: 1;
+    color: #fff;
+    border: 0 none;
+    background: transparent none repeat scroll 0 0;
+    text-shadow: none;
+}
+#tags .close:hover{
+  background: #ffb800;
+}
+#inputTags[type='text'],
+#inputTags[type='text']:focus{
+    line-height: 25px;
+    display: inline;
+    width: 150px;
+    margin: 0;
+    padding: 0 6px;
+    border: 0 none;
+    outline: 0 none;
+    box-shadow: none;
+}
+
+.albtn{
+    line-height: 30px;
+    display: block;
+    width: 100px;
+    height: 30px;
+    margin: 0 auto;
+    cursor: pointer;
+    text-align: center;
+    color: #fff;
+    background: #ffb800;
+}

+ 29 - 0
js/layuiPlugins/inputTags.html

@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <title>Document</title>
+  <meta charset="utf-8">
+  <link rel="stylesheet" type="text/css" href="../../layui/css/layui.css">
+</head>
+<body>
+  <div class="tags" id="tags">
+    <input type="text" name="" id="inputTags" placeholder="回车生成标签" autocomplete="off">
+  </div>
+  <script type="text/javascript" src="../../layui/layui.js"></script>
+  <script type="text/javascript">
+    layui.use(['inputTags'],function(){
+      var inputTags = layui.inputTags;
+      inputTags.render({
+        elem:'#inputTags',
+        content: ['标题一','标题二'],
+        aldaBtn: true,
+        done: function(value){
+          console.log(value)
+        }
+      })      
+      
+    })
+  </script>
+</body>
+</html>

+ 128 - 0
js/layuiPlugins/inputTags.js

@@ -0,0 +1,128 @@
+/*
+* @Author: layui-2
+* @Date:   2018-08-31 11:40:42
+* @Last Modified by:   layui-2
+* @Last Modified time: 2018-09-04 14:44:38
+*/
+layui.define(['jquery','layer'],function(exports){
+  "use strict";
+  var $ = layui.jquery,layer = layui.layer
+  
+
+  //外部接口
+  ,inputTags = {
+    config: {}
+
+    //设置全局项
+    ,set: function(options){
+      var that = this;
+      that.config = $.extend({}, that.config, options);
+      return that;
+    }
+
+    // 事件监听
+    ,on: function(events, callback){
+      return layui.onevent.call(this, MOD_NAME, events, callback)
+    }
+    
+  }
+
+   //操作当前实例
+  ,thisinputTags = function(){
+    var that = this
+    ,options = that.config;
+
+    return {
+      config: options
+    }
+  }
+
+  //字符常量
+  ,MOD_NAME = 'inputTags'
+
+
+  // 构造器
+  ,Class = function(options){
+    var that = this;
+    that.config = $.extend({}, that.config, inputTags.config, options);
+    that.render();
+  };
+
+   //默认配置
+  Class.prototype.config = {
+    close: false  //默认:不开启关闭按钮
+    ,theme: ''   //背景:颜色
+    ,content: [] //默认标签
+    ,aldaBtn: false //默认配置
+  };
+
+  // 初始化
+  Class.prototype.init = function(){
+    var that = this
+    ,spans = ''
+    ,options = that.config
+    ,span = document.createElement("span"),
+    spantext = $(span).text("获取全部数据").addClass('albtn');
+    if(options.aldaBtn){
+      //$('body').append(spantext)
+    }
+    
+    $.each(options.content,function(index,item){
+      spans +='<span><em>'+item+'</em><button type="button" class="close">×</button></span>';
+      // $('<div class="layui-flow-more"><a href="javascript:;">'+ ELEM_TEXT +'</a></div>');
+    })
+    options.elem.before(spans)
+    that.events()
+  }
+
+  Class.prototype.render = function(){
+    var that = this
+    ,options = that.config
+    options.elem = $(options.elem);
+    that.enter()
+  };
+
+  // 回车生成标签
+  Class.prototype.enter = function() {
+      var that = this
+          , spans = ''
+          , options = that.config;
+      options.elem.focus();
+      options.elem.keypress(function (event) {
+          var keynum = (event.keyCode ? event.keyCode : event.which);
+          if (keynum == 32 || keynum==13) {
+              var $val = options.elem.val().trim();
+              if (!$val) return false;
+              if (options.content.indexOf($val) == -1) {
+                  options.content.push($val);
+                  that.render()
+                  spans = '<span><em>' + $val + '</em><button type="button" class="close">×</button></span>';
+                  options.elem.before(spans)
+              }
+              options.done && typeof options.done === 'function' && options.done(options.content);
+              options.elem.val('');
+              return false;
+          }
+      })
+  };
+  
+  //事件处理
+  Class.prototype.events = function(){
+     var that = this
+    ,options = that.config;
+    $('#tags').on('click','.close',function(){
+      var Thisremov = $(this).parent('span').remove(),
+      ThisText = $(Thisremov).find('em').text();
+      options.content.splice($.inArray(ThisText,options.content),1)
+	  options.del && typeof options.del === 'function' && options.del(options.content);
+    })
+  };
+
+  //核心入口
+  inputTags.render = function(options){
+    var inst = new Class(options);
+    inst.init();
+    return thisinputTags.call(inst);
+  };
+  exports('inputTags',inputTags);
+}).link('../../js/layuiPlugins/inputTags.css')

+ 412 - 0
js/layuiPlugins/layui-xtree.js

@@ -0,0 +1,412 @@
+//**********************************
+//**   本插件依赖 贤心 layui form模块   
+//**   由 小巷 制作 QQ:151446298    
+//**   版本3.0 时间 2018-01-10 20:48 
+//**********************************
+
+//构造
+function layuiXtree(options) {
+    var _this = this;
+    _this._containerid = options.elem;
+    _this.tool = options.tool;
+	_this.checkbox = options.checkbox;
+    typeof options.toolbar == 'function' && (_this.toolbar = options.toolbar);
+    _this._container = document.getElementById(options.elem); //容器
+    _this._container.style.minHeight = "100px";
+    _this._options = options;
+    _this.Loading(options);
+}
+
+//封装IE8 Class选择
+layuiXtree.prototype.getByClassName = function (cn) {
+    if (document.getElementsByClassName) return this._container.getElementsByClassName(cn);
+    var _xlist = this._container.childNodes;
+    var _xtemp = new Array();
+    for (var i = 0; i < _xlist.length; i++) {
+        var _xchild = _xlist[i];
+        var _xclassNames = _xchild.getAttribute('class').split(' ');
+        for (var j = 0; j < _xclassNames.length; j++) {
+            if (_xclassNames[j] == cn) {
+                _xtemp.push(_xchild);
+                break;
+            }
+        }
+    }
+    return _xtemp;
+}
+
+//在一个对象下面找子级
+layuiXtree.prototype.getChildByClassName = function (obj, cn) {
+    var _xlist = obj.childNodes;
+    var _xtemp = new Array();
+    for (var i = 0; i < _xlist.length; i++) {
+        var _xchild = _xlist[i];
+        var _xclassNames = _xchild.getAttribute('class').split(' ');
+        for (var j = 0; j < _xclassNames.length; j++) {
+            if (_xclassNames[j] == cn) {
+                _xtemp.push(_xchild);
+                break;
+            }
+        }
+    }
+    return _xtemp;
+}
+
+//加载特效,且获取数据
+layuiXtree.prototype.Loading = function (options) {
+    var _this = this;
+    _this.xloading = document.createElement("span"); //创建加载对象
+    _this.xloading.setAttribute('class', 'layui-icon layui-anim layui-anim-rotate layui-anim-loop');
+    _this.xloading.innerHTML = '&#xe63e;';
+    _this.xloading.style.fontSize = "50px";
+    _this.xloading.style.color = "#009688";
+    _this.xloading.style.fontWeight = "bold";
+    _this.xloading.style.marginLeft = _this._container.offsetWidth / 2 - 25 + 'px';
+    _this.xloading.style.marginTop = _this._container.offsetHeight / 2 - 50 + 'px';
+    _this._container.innerHTML = '';
+    _this._container.appendChild(_this.xloading); //加载显示
+    if (typeof (options.data) == 'object') {
+        _this._dataJson = options.data;
+        _this.Initial(options);
+        return;
+    }
+
+    //如果是字符串url,进行异步加载
+    var obj = new XMLHttpRequest();
+    obj.onreadystatechange = function () {
+        if (obj.readyState == 4 && obj.status == 200 || obj.status == 304) { //回调成功
+            if (JSON.parse(obj.responseText).data) {
+                _this._dataJson = eval('(' + obj.responseText + ')').data;
+                //_this._dataJson = eval('(' + JSON.parse(obj.responseText).menu + ')'); //将返回的数据转为json
+            }
+            _this.Initial(options);
+        }
+    };
+	obj.open('get', options.data, true);
+    obj.send();
+}
+
+//data验证后的数据初始化
+layuiXtree.prototype.Initial = function (o) {
+    var _this = this;
+    _this._form = o.form; //layui from对象
+    _this.checkedName = o.checkedName || 'roleId';
+    _this._domStr = ""; //结构字符串
+    _this._isopen = o.isopen != null ? o.isopen : true;
+    if (o.color == null) o.color = {
+        open: '#2F4056',
+        close: '#2F4056',
+        end: '#2F4056'
+    }; //图标颜色
+    _this._iconOpenColor = o.color.open != null ? o.color.open : "#2F4056";
+    _this._iconCloseColor = o.color.close != null ? o.color.close : "#2F4056";
+    _this._iconEndColor = o.color.end != null ? o.color.end : "#2F4056";
+    if (o.icon == null) o.icon = {
+        open: '&#xe625;',
+        close: '&#xe623;',
+        end: '&#xe621;'
+    }; //图标样式
+    _this._iconOpen = o.icon.open != null ? o.icon.open : '&#xe625;';
+    _this._iconClose = o.icon.close != null ? o.icon.close : '&#xe623;';
+    _this._iconEnd = o.icon.end != null ? o.icon.end : '&#xe621;';
+    _this._click = o.click != null ? o.click : function () {};
+    _this._ckall = o.ckall != null ? o.ckall : false; //全选是否启用
+    _this._ckallSuccess = o.ckallback != null ? o.ckallback : function () {}; //全选回调
+    _this.CreateCkAll();
+    _this.dataBind(_this._dataJson);
+    _this.Rendering();
+}
+
+//全选框
+layuiXtree.prototype.CreateCkAll = function () {
+    var _this = this;
+    if (_this._ckall) {
+        _this._domStr += '<div class="layui-xtree-item">';
+        _this._domStr +=
+            '<input type="checkbox" class="layui-xtree-checkbox layui-xtree-ckall" title="全选" lay-skin="primary" lay-filter="xtreeckall' +
+            _this._containerid + '">';
+        _this._domStr += '</div>';
+    }
+}
+
+//生产结构
+layuiXtree.prototype.dataBind = function (d) {
+    var _this = this;
+    if (d.length > 0) {
+        for (i in d) {
+            var xtree_isend = '';
+            var xtree_ischecked = '';
+            var xtree_isdisabled = d[i].disabled ? ' disabled="disabled" ' : '';
+            _this._domStr += '<div class="layui-xtree-item">';
+            if (!d[i].childMenus) {
+                d[i].childMenus = [];
+            }
+            if (d[i].childMenus.length > 0)
+                _this._domStr += '<i class="layui-icon layui-xtree-icon" data-xtree="' + (_this._isopen ? '1' : '0') +
+                '">' + (_this._isopen ? _this._iconOpen : _this._iconClose) + '</i>';
+            else {
+                _this._domStr += '<i class="layui-icon layui-xtree-icon-null">' + (d[i].icon || _this._iconEnd) +
+                    '</i>';
+                xtree_isend = 'data-xend="1"';
+                xtree_ischecked = !!d[i][_this.checkedName] ? ' checked ' : '';
+                xtree_isdisabled = d[i].disabled ? ' disabled="disabled" ' : '';
+            }
+            if (!!_this.checkbox) {
+                _this._domStr += '<input type="checkbox" class="layui-xtree-checkbox" ' + xtree_isend +
+                    xtree_ischecked +
+                    xtree_isdisabled + ' value="' + d[i].id + '" title="' + d[i].name +
+                    '" lay-skin="primary" lay-filter="xtreeck' + _this._containerid + '">';
+            }else{
+				_this._domStr += '<div class="layui-inline" style="margin-top: 10px;margin-bottom:0;"><span>'+d[i].name+'</span></div>';
+			}
+            if (!!_this.tool) {
+                _this._domStr +=
+                    '<div class="layui-inline" style="margin-top: 10px;margin-bottom:0;"><a class="layui-btn layui-btn-xs" name="tree_event" event="edit"id="' +
+                    d[i].id +
+                    '">修改</a><a class="layui-btn layui-btn-danger layui-btn-xs" name="tree_event" event="del" id="' +
+                    d[i].id + '">删除</a></div>';
+            }
+            _this.dataBind(d[i].childMenus);
+            _this._domStr += '</div>';
+        }
+    }
+}
+//工具栏监听回调
+layuiXtree.prototype.toolbar = function (obj) {
+    
+}
+//通过ID获取
+layuiXtree.prototype.idGetObj = function (id) {
+    var _this = this;
+    var obj = {};
+    (function get(d) {
+        if (d.length > 0) {
+            for (i in d) {
+                if (!d[i].childMenus) {
+                    d[i].childMenus = [];
+                }
+                if (d[i].id == id) {
+                    obj = d[i];
+                }
+                get(d[i].childMenus);
+            }
+        }
+    })(_this._dataJson);
+    return obj;
+}
+//渲染呈现
+layuiXtree.prototype.Rendering = function () {
+    var _this = this;
+    _this._container.innerHTML = _this._domStr;
+    _this._domStr = "";
+
+    //检查选中状态
+    var xtree_ckitems = _this.getByClassName('layui-xtree-checkbox');
+    for (var i = 0; i < xtree_ckitems.length; i++) {
+        if (xtree_ckitems[i].getAttribute('data-xend') == '1' && xtree_ckitems[i].checked) {
+            _this.ParentCheckboxChecked(xtree_ckitems[i]);
+        }
+    }
+
+    _this._form.render('checkbox'); //layui渲染
+    //绑定工具条事件
+    var tree_event = document.getElementsByName('tree_event');
+    for (var tr_i in tree_event) {
+        tree_event[tr_i].onclick = function (e) {
+            _this.toolbar({
+                event: this.getAttribute('event'),
+                data: _this.idGetObj(this.id)
+            });
+        };
+    }
+
+    var xtree_items = _this.getByClassName('layui-xtree-item');
+    var xtree_icons = _this.getByClassName('layui-xtree-icon');
+    var xtree_nullicons = _this.getByClassName('layui-xtree-icon-null');
+
+    for (var i = 0; i < xtree_items.length; i++) {
+        if (xtree_items[i].parentNode == _this._container)
+            xtree_items[i].style.margin = '5px 0 0 10px';
+        else {
+            xtree_items[i].style.margin = '5px 0 0 45px';
+            if (!_this._isopen) xtree_items[i].style.display = 'none';
+        }
+    }
+
+    for (var i = 0; i < xtree_icons.length; i++) {
+        xtree_icons[i].style.position = "relative";
+        xtree_icons[i].style.top = "3px";
+        xtree_icons[i].style.margin = "0 5px 0 0";
+        xtree_icons[i].style.fontSize = "18px";
+        xtree_icons[i].style.color = _this._isopen ? _this._iconOpenColor : _this._iconCloseColor;
+        xtree_icons[i].style.cursor = "pointer";
+
+        xtree_icons[i].onclick = function () {
+            var xtree_chi = this.parentNode.childNodes;
+            if (this.getAttribute('data-xtree') == 1) {
+                for (var j = 0; j < xtree_chi.length; j++) {
+                    if (xtree_chi[j].getAttribute('class') == 'layui-xtree-item')
+                        xtree_chi[j].style.display = 'none';
+                }
+                this.setAttribute('data-xtree', '0')
+                this.innerHTML = _this._iconClose;
+                this.style.color = _this._iconCloseColor;
+            } else {
+                for (var j = 0; j < xtree_chi.length; j++) {
+                    if (xtree_chi[j].getAttribute('class') == 'layui-xtree-item')
+                        xtree_chi[j].style.display = 'block';
+                }
+                this.setAttribute('data-xtree', '1')
+                this.innerHTML = _this._iconOpen;
+                this.style.color = _this._iconOpenColor;
+            }
+        }
+    }
+
+    for (var i = 0; i < xtree_nullicons.length; i++) {
+        xtree_nullicons[i].style.position = "relative";
+        xtree_nullicons[i].style.top = "6px";
+        xtree_nullicons[i].style.margin = "0 5px 0 0";
+        xtree_nullicons[i].style.fontSize = "18px";
+        xtree_nullicons[i].style.color = _this._iconEndColor;
+    }
+
+    _this._form.on('checkbox(xtreeck' + _this._containerid + ')', function (da) {
+        //获取当前点击复选框的容器下面的所有子级容器 
+        var xtree_chis = da.elem.parentNode.getElementsByClassName('layui-xtree-item');
+        //遍历它们,选中状态与它们的父级一致(类似全选功能)
+        for (var i = 0; i < xtree_chis.length; i++) {
+            if (!_this.getChildByClassName(xtree_chis[i], 'layui-xtree-checkbox')[0].disabled) {
+                _this.getChildByClassName(xtree_chis[i], 'layui-xtree-checkbox')[0].checked = da.elem.checked;
+                if (da.elem.checked) _this.getChildByClassName(xtree_chis[i], 'layui-xtree-checkbox')[0].nextSibling
+                    .classList.add('layui-form-checked');
+                else _this.getChildByClassName(xtree_chis[i], 'layui-xtree-checkbox')[0].nextSibling.classList
+                    .remove('layui-form-checked');
+            }
+        }
+        _this.ParendCheck(da.elem);
+        _this._click(da);
+    });
+
+    var _xtree_disableds = _this.getByClassName('layui-disabled');
+    for (var i = 0; i < _xtree_disableds.length; i++) {
+        _xtree_disableds[i].getElementsByTagName('span')[0].style.color = "#B5B5B5";
+    }
+
+    //全选按钮
+    if (_this._ckall) {
+        _this._form.on('checkbox(xtreeckall' + _this._containerid + ')', function (data) {
+            var xtree_allck = data.elem.parentNode.parentNode.getElementsByClassName('layui-form-checkbox');
+            for (var i = 0; i < xtree_allck.length; i++) {
+                if (xtree_allck[i].getAttribute('class').indexOf('layui-checkbox-disbaled') == -1) {
+                    if (data.elem.checked) {
+                        xtree_allck[i].classList.add('layui-form-checked');
+                    } else {
+                        xtree_allck[i].classList.remove('layui-form-checked');
+                    }
+                    xtree_allck[i].parentNode.getElementsByClassName('layui-xtree-checkbox')[0].checked =
+                        data.elem.checked;
+                }
+            }
+            _this._ckallSuccess();
+        });
+    }
+}
+
+//更新渲染
+layuiXtree.prototype.render = function () {
+    var _this = this;
+    _this.Loading(_this._options);
+}
+
+//子节点选中改变,父节点更改自身状态
+layuiXtree.prototype.ParendCheck = function (ckelem) {
+    var _this = this;
+    var xtree_p = ckelem.parentNode.parentNode;
+    if (xtree_p.getAttribute('class') == 'layui-xtree-item') {
+        var xtree_all = _this.getChildByClassName(xtree_p, 'layui-xtree-item');
+        var xtree_count = 0;
+
+        for (var i = 0; i < xtree_all.length; i++) {
+            if (_this.getChildByClassName(xtree_all[i], 'layui-xtree-checkbox')[0].checked) {
+                xtree_count++;
+            }
+        }
+
+        if (xtree_count <= 0) {
+            _this.getChildByClassName(xtree_p, 'layui-xtree-checkbox')[0].checked = false;
+            _this.getChildByClassName(xtree_p, 'layui-xtree-checkbox')[0].nextSibling.classList.remove(
+                'layui-form-checked');
+        } else {
+            _this.getChildByClassName(xtree_p, 'layui-xtree-checkbox')[0].checked = true;
+            _this.getChildByClassName(xtree_p, 'layui-xtree-checkbox')[0].nextSibling.classList.add(
+                'layui-form-checked');
+        }
+        this.ParendCheck(_this.getChildByClassName(xtree_p, 'layui-xtree-checkbox')[0]);
+    }
+}
+
+//渲染之前按照选中的末级去改变父级选中状态
+layuiXtree.prototype.ParentCheckboxChecked = function (e) {
+    var _this = this;
+    if (e.parentNode.parentNode.getAttribute('class') == 'layui-xtree-item') {
+        var _pe = _this.getChildByClassName(e.parentNode.parentNode, 'layui-xtree-checkbox')[0];
+        _pe.checked = true;
+        _this.ParentCheckboxChecked(_pe);
+    }
+}
+
+//获取全部选中的末级checkbox对象
+layuiXtree.prototype.GetChecked = function () {
+    var _this = this;
+    var arr = new Array();
+    var arrIndex = 0;
+    var cks = _this.getByClassName('layui-xtree-checkbox');
+    for (var i = 0; i < cks.length; i++) {
+        if (cks[i].checked && cks[i].getAttribute('data-xend') == '1') {
+            arr[arrIndex] = cks[i];
+            arrIndex++;
+        }
+    }
+    return arr;
+}
+//获取全部选中的checkbox对象value
+layuiXtree.prototype.GetCheckedVal = function () {
+    var _this = this;
+    var arr = new Array();
+    var arrIndex = 0;
+    var cks = _this.getByClassName('layui-xtree-checkbox');
+    for (var i = 0; i < cks.length; i++) {
+        if (cks[i].checked) {
+            arr[arrIndex] = cks[i].value;
+            arrIndex++;
+        }
+    }
+    return arr;
+}
+
+//获取全部的原始checkbox对象
+layuiXtree.prototype.GetAllCheckBox = function () {
+    var _this = this;
+    var arr = new Array();
+    var arrIndex = 0;
+    var cks = _this.getByClassName('layui-xtree-checkbox');
+    for (var i = 0; i < cks.length; i++) {
+        arr[arrIndex] = cks[i];
+        arrIndex++;
+    }
+    return arr;
+}
+
+//根据值来获取其父级的checkbox原dom对象
+layuiXtree.prototype.GetParent = function (a) {
+    var _this = this;
+    var cks = _this.getByClassName('layui-xtree-checkbox');
+    for (var i = 0; i < cks.length; i++) {
+        if (cks[i].value == a) {
+            if (cks[i].parentNode.parentNode.getAttribute('id') == _this._container.getAttribute('id')) return null;
+            return _this.getChildByClassName(cks[i].parentNode.parentNode, 'layui-xtree-checkbox')[0];
+        }
+    }
+    return null;
+}

+ 167 - 0
js/layuiPlugins/md5.js

@@ -0,0 +1,167 @@
+/**
+ * Des: MD5加密
+ * User: Yanbo
+ * Date: 2017-09-01
+ * Time: 10:50
+ * Mail: <a href="yanbo@hyphoneit.com">Yanbo</a>.
+ */
+;!function (win) {
+    'use strict';
+    layui.define(function (exports) {
+        var md5 = {
+            config: {
+                MOD_NAME: 'md5'
+            }
+            /**
+             * 对字符串进行MD5加密
+             * @param str 要加密的字符串
+             */
+            , calcMD5: function (str) {
+                var self = this
+                    , x = self.str2blksMD5(str)
+                    , a = 0x67452301
+                    , b = 0xEFCDAB89
+                    , c = 0x98BADCFE
+                    , d = 0x10325476;
+                for (var i = 0; i < x.length; i += 16) {
+                    var olda = a
+                        , oldb = b
+                        , oldd = d
+                        , oldc = c;
+                    a = self.ff(a, b, c, d, x[i + 0], 7, 0xD76AA478);
+                    d = self.ff(d, a, b, c, x[i + 1], 12, 0xE8C7B756);
+                    c = self.ff(c, d, a, b, x[i + 2], 17, 0x242070DB);
+                    b = self.ff(b, c, d, a, x[i + 3], 22, 0xC1BDCEEE);
+                    a = self.ff(a, b, c, d, x[i + 4], 7, 0xF57C0FAF);
+                    d = self.ff(d, a, b, c, x[i + 5], 12, 0x4787C62A);
+                    c = self.ff(c, d, a, b, x[i + 6], 17, 0xA8304613);
+                    b = self.ff(b, c, d, a, x[i + 7], 22, 0xFD469501);
+                    a = self.ff(a, b, c, d, x[i + 8], 7, 0x698098D8);
+                    d = self.ff(d, a, b, c, x[i + 9], 12, 0x8B44F7AF);
+                    c = self.ff(c, d, a, b, x[i + 10], 17, 0xFFFF5BB1);
+                    b = self.ff(b, c, d, a, x[i + 11], 22, 0x895CD7BE);
+                    a = self.ff(a, b, c, d, x[i + 12], 7, 0x6B901122);
+                    d = self.ff(d, a, b, c, x[i + 13], 12, 0xFD987193);
+                    c = self.ff(c, d, a, b, x[i + 14], 17, 0xA679438E);
+                    b = self.ff(b, c, d, a, x[i + 15], 22, 0x49B40821);
+
+                    a = self.gg(a, b, c, d, x[i + 1], 5, 0xF61E2562);
+                    d = self.gg(d, a, b, c, x[i + 6], 9, 0xC040B340);
+                    c = self.gg(c, d, a, b, x[i + 11], 14, 0x265E5A51);
+                    b = self.gg(b, c, d, a, x[i + 0], 20, 0xE9B6C7AA);
+                    a = self.gg(a, b, c, d, x[i + 5], 5, 0xD62F105D);
+                    d = self.gg(d, a, b, c, x[i + 10], 9, 0x02441453);
+                    c = self.gg(c, d, a, b, x[i + 15], 14, 0xD8A1E681);
+                    b = self.gg(b, c, d, a, x[i + 4], 20, 0xE7D3FBC8);
+                    a = self.gg(a, b, c, d, x[i + 9], 5, 0x21E1CDE6);
+                    d = self.gg(d, a, b, c, x[i + 14], 9, 0xC33707D6);
+                    c = self.gg(c, d, a, b, x[i + 3], 14, 0xF4D50D87);
+                    b = self.gg(b, c, d, a, x[i + 8], 20, 0x455A14ED);
+                    a = self.gg(a, b, c, d, x[i + 13], 5, 0xA9E3E905);
+                    d = self.gg(d, a, b, c, x[i + 2], 9, 0xFCEFA3F8);
+                    c = self.gg(c, d, a, b, x[i + 7], 14, 0x676F02D9);
+                    b = self.gg(b, c, d, a, x[i + 12], 20, 0x8D2A4C8A);
+
+                    a = self.hh(a, b, c, d, x[i + 5], 4, 0xFFFA3942);
+                    d = self.hh(d, a, b, c, x[i + 8], 11, 0x8771F681);
+                    c = self.hh(c, d, a, b, x[i + 11], 16, 0x6D9D6122);
+                    b = self.hh(b, c, d, a, x[i + 14], 23, 0xFDE5380C);
+                    a = self.hh(a, b, c, d, x[i + 1], 4, 0xA4BEEA44);
+                    d = self.hh(d, a, b, c, x[i + 4], 11, 0x4BDECFA9);
+                    c = self.hh(c, d, a, b, x[i + 7], 16, 0xF6BB4B60);
+                    b = self.hh(b, c, d, a, x[i + 10], 23, 0xBEBFBC70);
+                    a = self.hh(a, b, c, d, x[i + 13], 4, 0x289B7EC6);
+                    d = self.hh(d, a, b, c, x[i + 0], 11, 0xEAA127FA);
+                    c = self.hh(c, d, a, b, x[i + 3], 16, 0xD4EF3085);
+                    b = self.hh(b, c, d, a, x[i + 6], 23, 0x04881D05);
+                    a = self.hh(a, b, c, d, x[i + 9], 4, 0xD9D4D039);
+                    d = self.hh(d, a, b, c, x[i + 12], 11, 0xE6DB99E5);
+                    c = self.hh(c, d, a, b, x[i + 15], 16, 0x1FA27CF8);
+                    b = self.hh(b, c, d, a, x[i + 2], 23, 0xC4AC5665);
+
+                    a = self.ii(a, b, c, d, x[i + 0], 6, 0xF4292244);
+                    d = self.ii(d, a, b, c, x[i + 7], 10, 0x432AFF97);
+                    c = self.ii(c, d, a, b, x[i + 14], 15, 0xAB9423A7);
+                    b = self.ii(b, c, d, a, x[i + 5], 21, 0xFC93A039);
+                    a = self.ii(a, b, c, d, x[i + 12], 6, 0x655B59C3);
+                    d = self.ii(d, a, b, c, x[i + 3], 10, 0x8F0CCC92);
+                    c = self.ii(c, d, a, b, x[i + 10], 15, 0xFFEFF47D);
+                    b = self.ii(b, c, d, a, x[i + 1], 21, 0x85845DD1);
+                    a = self.ii(a, b, c, d, x[i + 8], 6, 0x6FA87E4F);
+                    d = self.ii(d, a, b, c, x[i + 15], 10, 0xFE2CE6E0);
+                    c = self.ii(c, d, a, b, x[i + 6], 15, 0xA3014314);
+                    b = self.ii(b, c, d, a, x[i + 13], 21, 0x4E0811A1);
+                    a = self.ii(a, b, c, d, x[i + 4], 6, 0xF7537E82);
+                    d = self.ii(d, a, b, c, x[i + 11], 10, 0xBD3AF235);
+                    c = self.ii(c, d, a, b, x[i + 2], 15, 0x2AD7D2BB);
+                    b = self.ii(b, c, d, a, x[i + 9], 21, 0xEB86D391);
+
+                    a = self.add(a, olda);
+                    b = self.add(b, oldb);
+                    c = self.add(c, oldc);
+                    d = self.add(d, oldd);
+                }
+                return self.rhex(a) + self.rhex(b) + self.rhex(c) + self.rhex(d);
+            }
+            /*
+             * Convert a string to a sequence of 16-word blocks, stored as an array.
+             * Append padding bits and the length, as described in the MD5 standard.
+             */
+            , str2blksMD5: function (str) {
+                var nblk = ((str.length + 8) >> 6) + 1
+                    , blks = new Array(nblk * 16);
+                for (var i = 0; i < nblk * 16; i++) blks[i] = 0;
+                for (var i = 0; i < str.length; i++)
+                    blks[i >> 2] |= str.charCodeAt(i) << ((i % 4) * 8);
+                blks[i >> 2] |= 0x80 << ((i % 4) * 8);
+                blks[nblk * 16 - 2] = str.length * 8;
+                return blks;
+            }
+            /*
+             * Add integers, wrapping at 2^32
+             */
+            , add: function (x, y) {
+                return ((x & 0x7FFFFFFF) + (y & 0x7FFFFFFF)) ^ (x & 0x80000000) ^ (y & 0x80000000);
+            }
+            /*
+             * Bitwise rotate a 32-bit number to the left
+             */
+            , rol: function (num, cnt) {
+                return (num << cnt) | (num >>> (32 - cnt));
+            }
+            /*
+             * These functions implement the basic operation for each round of the
+             * algorithm.
+             */
+            , cmn: function (q, a, b, x, s, t) {
+                var self = this;
+                return self.add(self.rol(self.add(self.add(a, q), self.add(x, t)), s), b);
+            }
+            , ff: function (a, b, c, d, x, s, t) {
+                var self = this;
+                return self.cmn((b & c) | ((~b) & d), a, b, x, s, t);
+            }
+            , gg: function (a, b, c, d, x, s, t) {
+                var self = this;
+                return self.cmn((b & d) | (c & (~d)), a, b, x, s, t);
+            }
+            , hh: function (a, b, c, d, x, s, t) {
+                var self = this;
+                return self.cmn(b ^ c ^ d, a, b, x, s, t);
+            }
+            , ii: function (a, b, c, d, x, s, t) {
+                var self = this;
+                return self.cmn(c ^ (b | (~d)), a, b, x, s, t);
+            }
+            , rhex: function (num) {
+                var hex_chr = '0123456789abcdef'
+                    , str = '';
+                for (var j = 0; j <= 3; j++)
+                    str += hex_chr.charAt((num >> (j * 8 + 4)) & 0x0F) + hex_chr.charAt((num >> (j * 8)) & 0x0F);
+                return str;
+            }
+        }
+            , _config = md5.config;
+        exports(_config.MOD_NAME, md5);
+    });
+}(window);

+ 332 - 0
js/layuiPlugins/step.js

@@ -0,0 +1,332 @@
+ /**
+ 
+ @Name : layui.step 基于layui的步骤条面板
+ @Author:hsianglee
+ @License:MIT
+ 
+ */
+
+layui.define(["jquery"], function (exports) {
+    var $ = layui.jquery;
+    
+    function Step(option) {
+        this.option=option;     // 获取传入的数据
+        this.elem=option.elem;
+        // this.methods=option.methods?option.methods:"";
+        this.title=option.title?option.title:[];
+        this.description=option.description?option.description:[];
+        this.canIconClick=option.canIconClick?option.canIconClick:false;
+        this.isOpenStepLevel=option.isOpenStepLevel?option.isOpenStepLevel:false;
+        this.len=0;   // 页面个数
+        this.currentStep=(option.currentStep && option.currentStep>=1)?option.currentStep:1;    // 当前走到第几步
+
+        this.disabledStep=[];
+
+        this.finalStep=1;       // 当前走到最远的步骤
+
+        this.parameterInit();
+        this.domRender();
+        this.init();
+        this.openStepLevel();
+        this.changeStep();
+    }
+
+    Step.prototype={
+        constructor: Step,
+        // 初始化参数数据
+        parameterInit: function() {
+            var self=this;
+            this.len=$(this.elem).find(".layui-step-content-item").length;   // 页面个数
+            // 不传title参数
+            if(this.title.length<=0){
+                $(this.elem).find(".layui-step-content-item").each(function(index,val) {
+                    self.title.push("第"+(index+1)+"步");
+                })
+            }
+            if(this.len!==this.title.length){
+                throw "title参数长度与页面长度不匹配";
+            }
+            // 不传description参数
+            if(this.description.length<=0){
+                $(this.elem).find(".layui-step-content-item").each(function(index,val) {
+                    self.description.push("");
+                })
+            }
+            if(this.len!==this.description.length){
+                throw "description参数长度与页面长度不匹配";
+            }
+            // 若当前步超过最大步,则默认为最后一步
+            this.currentStep=this.currentStep>=this.len?this.len:this.currentStep;
+        },
+        domRender: function() {
+            var self=this;
+            var titleStr='<div class="layui-step-title layui-clear">'+
+            '<div class="layui-step-title-item step-first" style="width: '+(100/this.len)+'%;">'+
+                '<div class="step-icon">'+
+                    '<i>1</i>'+
+                '</div>'+
+                '<div class="step-text">'+
+                    this.title[0]+
+                '</div>'+
+                '<div class="step-description">'+
+                    this.description[0]+
+                '</div>'+
+            '</div>';
+            for(var i=1;i<this.title.length-1;i++){
+                titleStr+='<div class="layui-step-title-item" style="width: '+(100/this.len)+'%;">'+
+                    '<div class="step-icon">'+
+                        '<i>'+(i+1)+'</i>'+
+                    '</div>'+
+                    '<div class="step-text">'+
+                        this.title[i]+
+                    '</div>'+
+                    '<div class="step-description">'+
+                        this.description[i]+
+                    '</div>'+
+                '</div>';
+            };
+            titleStr+='<div class="layui-step-title-item step-last" style="width: '+(100/this.len)+'%;">'+
+                    '<div class="step-icon">'+
+                        '<i>'+this.len+'</i>'+
+                    '</div>'+
+                    '<div class="step-text">'+
+                        this.title[this.title.length-1]+
+                    '</div>'+
+                    '<div class="step-description">'+
+                        this.description[this.title.length-1]+
+                    '</div>'+
+                '</div>'+
+            '</div>'
+            $(this.elem).prepend(titleStr);
+
+            // 生成三角
+            $(this.elem).find(".layui-step-content-item").each(function(index,val) {
+                $(this).append("<span class='content-item-before' style='left: calc("+((100/(self.len*2))+((100*index)/self.len))+"% - 10px);'></span>");
+            })
+        },
+        // 添加样式
+        init: function() {
+            var self=this;
+            this.disabledStep.forEach(function(val){
+                $(self.elem).find(".layui-step-title-item").eq(val-1).addClass("step-disabled");
+            })
+            
+            $(this.elem).find(".layui-step-title-item").eq(this.currentStep-1).addClass("step-current");
+            $(this.elem).find(".layui-step-content-item").eq(this.currentStep-1).show();
+            if(this.currentStep<2) return;
+            for(var i=this.currentStep-2;i>=0;i--){
+                $(this.elem).find(".layui-step-title-item").eq(i).addClass("step-finish");
+            }
+        },
+        // 恢复默认样式
+        reInit: function() {
+            $(this.elem).find(".layui-step-title-item").each(function(index,val) {
+                $(val).removeClass("step-disabled");
+            })
+            
+            $(this.elem).find(".layui-step-title-item").eq(this.currentStep-1).removeClass("step-current");
+            $(this.elem).find(".layui-step-content-item").eq(this.currentStep-1).hide();
+            if(this.currentStep<2) return;
+            for(var i=this.currentStep-2;i>=0;i--){
+                $(this.elem).find(".layui-step-title-item").eq(i).removeClass("step-finish");
+            }
+        },
+        // 给上面的icon添加事件
+        changeStep: function() {
+            var self=this;
+            this.canIconClick?(function() {
+                $(self.elem).on("click",".layui-step-title-item .step-icon",function() {
+                    var index=$(this).parent(".layui-step-title-item").index()+1;
+                    // 判断点击的是否为disabled
+                    if($.inArray(index, self.disabledStep) === -1){
+                        self.goStep(index);
+                    }
+                })
+            })():"";
+        },
+        // 是否严格按照步骤条顺序执行步骤
+        openStepLevel: function() {
+            var self=this;
+            this.isOpenStepLevel?(function() {
+                // 如果开启这一项,则默认关闭icon点击事件
+                self.canIconClick=false;
+                $(self.elem).off().on("click",".layui-step-title-item .step-icon",function() {
+                    var index=$(this).parent(".layui-step-title-item").index()+1;
+                    // 判断如果当前点击的步骤超过已走过的最大步,则不跳转
+                    if(index>self.finalStep){
+                        return;
+                    }
+                    // 判断点击的是否为disabled
+                    if($.inArray(index, self.disabledStep) === -1){
+                        self.goStep(index);
+                    }
+                })
+            })():"";
+        },
+        // 跳转第几步
+        goStep: function(i) {
+            if((i<1 || i>this.len)){
+                throw "goStep函数参数不在范围内";
+            }
+            // 判断当前页是否禁用,即i是否在数组中
+            if($.inArray(i, this.disabledStep) === -1){
+                this.reInit();
+                this.currentStep=i;
+                this.init();
+            }else{
+                throw "该页已禁用";
+            }
+        },
+        // 跳到第一步
+        goFirst: function() {
+            this.goStep(1);
+        },
+        // 跳到最后一步
+        goLast: function() {
+            this.goStep(this.len);
+            this.finalStep=this.len;
+            this.openStepLevel();
+        },
+        // 跳到上一步
+        prev: function () {
+            if(this.currentStep<=1){
+                return;
+            }
+            this.reInit();
+            // 先保存当前位置,若前面的全都已经禁用,则可以回到当前位置
+            var origin=this.currentStep;
+            this.PrevGo(origin);
+        },
+        PrevGo: function(origin) {
+            this.currentStep--;
+            // 判断前面的是否全都已经禁用
+            if(this.currentStep<1){
+                this.currentStep=origin;
+                this.init();
+                return;
+            }
+            // 判断当前页是否禁用
+            if($.inArray(this.currentStep, this.disabledStep) === -1){
+                this.init();
+            }else{
+                this.PrevGo(origin);
+            }
+        },
+        // 跳到下一部
+        next: function () {
+            if(this.currentStep>=this.len){
+                return;
+            }
+            this.reInit();
+            // 先保存当前位置,若后面的全都已经禁用,则可以回到当前位置
+            var origin=this.currentStep;
+            this.nextGo(origin);
+        },
+        nextGo: function(origin) {
+            if(this.currentStep===this.finalStep){
+                // 更新最远步
+                this.finalStep++;
+                this.openStepLevel();
+            }
+
+            this.currentStep++;
+            // 判断后面的是否全都已经禁用
+            if(this.currentStep>this.len){
+                this.currentStep=origin;
+                this.init();
+                return;
+            }
+            // 判断当前步是否禁用
+            if($.inArray(this.currentStep, this.disabledStep) === -1){
+                this.init();
+            }else{
+                this.nextGo(origin);
+            }
+        },
+        // 禁用某一步
+        disabled: function (j) {
+            if(j<=this.currentStep){
+                throw "已经走过的步骤不能禁用";
+            }
+            // 当前步不存在则加入数组,否存重复添加
+            if($.inArray(j,this.disabledStep)===-1){
+                this.disabledStep.push(j);
+            }
+            //默认为起始从第一步开始,若第一步为disabled,则从前往后找到第一个不是disabled的作为第一步
+            for(var i=this.currentStep;i<this.len;i++){
+                if($.inArray(i, this.disabledStep) === -1){
+                    this.reInit();
+                    this.currentStep=i;
+                    this.init();
+                    i=this.len+1;
+                }
+            }
+            
+        },
+        // 解除禁用
+        abled: function (j) {
+            if(j<=this.currentStep){
+                throw "已经走过的步骤不能解除禁用";
+            }
+            // 删除数组数据
+            var tem=this.disabledStep.concat();
+            if($.inArray(j, tem) !== -1){
+                this.disabledStep.splice($.inArray(j, tem),1);
+            }
+            this.reInit();
+            this.init();
+        }
+    }
+
+    var stepObj;    // new的对象,作为内部变量
+    var step={
+        option: "",
+        currentStep: 1,
+        render: function(option) {
+            var self=this;
+            this.option=option || {};
+
+            this.option.elem?"":(function() {
+                throw '缺少参数,需要传入elem元素';
+            })();
+
+            !$(this.option.elem)[0]?(function() {
+                throw '没有找到'+ self.option.elem +'元素';
+            })():"";
+
+            stepObj=new Step(this.option);
+            this.currentStep=stepObj.currentStep;
+        },
+        goStep: function(i) {
+            if(typeof i !== "number"){
+                throw 'goStep参数不合法';
+            }
+            stepObj.goStep(i);
+            this.currentStep=stepObj.currentStep;
+        },
+        goFirst: function() {
+            stepObj.goFirst();
+            this.currentStep=stepObj.currentStep;
+        },
+        goLast: function() {
+            stepObj.goLast();
+            this.currentStep=stepObj.currentStep;
+        },
+        prev: function() {
+            stepObj.prev();
+            this.currentStep=stepObj.currentStep;
+        },
+        next: function() {
+            stepObj.next();
+            this.currentStep=stepObj.currentStep;
+        },
+        disabled: function(i) {
+            stepObj.disabled(i);
+        },
+        abled: function(i) {
+            stepObj.abled(i);
+        }
+    }
+    
+    exports('step', step);
+})

+ 3 - 0
js/layuiPlugins/treeGrid.css

@@ -0,0 +1,3 @@
+.layui-tree-head{
+    cursor: pointer;
+}

+ 23 - 0
js/layuiPlugins/treeGrid.js

@@ -0,0 +1,23 @@
+/**
+
+ @Name:treeGrid树状表格
+ @Author:lrd
+ */
+layui.config({
+    base: "//" + location.host + '/js/layuiPlugins/'
+}).extend({
+    dltable:'dltable'
+}).define(['laytpl', 'laypage','dltable', 'layer', 'form'], function(exports){
+    "use strict";
+    var $ = layui.jquery;
+    var layer = layui.layer;
+    var dltable = layui.dltable;
+    var MOD_NAME='treeGrid';
+    var treeGrid=$.extend({},dltable);
+    treeGrid._render=treeGrid.render;
+    treeGrid.render=function(param){//重写渲染方法
+        param.isTree=true;//是树表格
+        treeGrid._render(param);
+    };
+    exports(MOD_NAME, treeGrid);
+});

File diff suppressed because it is too large
+ 4028 - 0
js/layuiPlugins/treeSelect.js


+ 18 - 0
js/layuiPlugins/treetable-lay/treetable.css

@@ -0,0 +1,18 @@
+.treeTable-empty {
+    width: 20px;
+    display: inline-block;
+}
+
+.treeTable-icon {
+    cursor: pointer;
+}
+
+.treeTable-icon .layui-icon-triangle-d:before {
+    content: "\e623";
+}
+
+.treeTable-icon.open .layui-icon-triangle-d:before {
+    content: "\e625";
+    background-color: transparent;
+}
+

+ 206 - 0
js/layuiPlugins/treetable-lay/treetable.js

@@ -0,0 +1,206 @@
+layui.define(['layer', 'table'], function (exports) {
+    var $ = layui.jquery;
+    var layer = layui.layer;
+    var table = layui.table;
+
+    var treetable = {
+        // 渲染树形表格
+        render: function (param) {
+            // 检查参数
+            if (!treetable.checkParam(param)) {
+                return;
+            }
+            // 获取数据
+            if (param.data) {
+                treetable.init(param, param.data);
+            } else {
+                $.getJSON(param.url, param.where, function (res) {
+                    treetable.init(param, res.data);
+                });
+            }
+        },
+        // 渲染表格
+        init: function (param, data) {
+            var mData = [];
+            var doneCallback = param.done;
+            var tNodes = data;
+            // 补上id和pid字段
+            for (var i = 0; i < tNodes.length; i++) {
+                var tt = tNodes[i];
+                if (!tt.id) {
+                    if (!param.treeIdName) {
+                        layer.msg('参数treeIdName不能为空', {icon: 5});
+                        return;
+                    }
+                    tt.id = tt[param.treeIdName];
+                }
+                if (!tt.pid) {
+                    if (!param.treePidName) {
+                        layer.msg('参数treePidName不能为空', {icon: 5});
+                        return;
+                    }
+                    tt.pid = tt[param.treePidName];
+                }
+            }
+
+            // 对数据进行排序
+            var sort = function (s_pid, data) {
+                for (var i = 0; i < data.length; i++) {
+                    if (data[i].pid == s_pid) {
+                        var len = mData.length;
+                        if (len > 0 && mData[len - 1].id == s_pid) {
+                            mData[len - 1].isParent = true;
+                        }
+                        mData.push(data[i]);
+                        sort(data[i].id, data);
+                    }
+                }
+            };
+            sort(param.treeSpid, tNodes);
+
+            // 重写参数
+            param.url = undefined;
+            param.data = mData;
+            param.page = {
+                count: param.data.length,
+                limit: param.data.length
+            };
+            param.cols[0][param.treeColIndex].templet = function (d) {
+                var mId = d.id;
+                var mPid = d.pid;
+                var isDir = d.isParent;
+                var emptyNum = treetable.getEmptyNum(mPid, mData);
+                var iconHtml = '';
+                for (var i = 0; i < emptyNum; i++) {
+                    iconHtml += '<span class="treeTable-empty"></span>';
+                }
+                if (isDir) {
+                    iconHtml += '<i class="layui-icon layui-icon-triangle-d"></i> <i class="layui-icon layui-icon-layer"></i>';
+                } else {
+                    iconHtml += '<i class="layui-icon layui-icon-file"></i>';
+                }
+                iconHtml += '&nbsp;&nbsp;';
+                var ttype = isDir ? 'dir' : 'file';
+                var vg = '<span class="treeTable-icon open" lay-tid="' + mId + '" lay-tpid="' + mPid + '" lay-ttype="' + ttype + '">';
+                return vg + iconHtml + d[param.cols[0][param.treeColIndex].field] + '</span>'
+            };
+
+            param.done = function (res, curr, count) {
+                $(param.elem).next().addClass('treeTable');
+                $('.treeTable .layui-table-page').css('display', 'none');
+                $(param.elem).next().attr('treeLinkage', param.treeLinkage);
+                // 绑定事件换成对body绑定
+                /*$('.treeTable .treeTable-icon').click(function () {
+                    treetable.toggleRows($(this), param.treeLinkage);
+                });*/
+                if (param.treeDefaultClose) {
+                    treetable.foldAll(param.elem);
+                }
+                if (doneCallback) {
+                    doneCallback(res, curr, count);
+                }
+            };
+
+            // 渲染表格
+            table.render(param);
+        },
+        // 计算缩进的数量
+        getEmptyNum: function (pid, data) {
+            var num = 0;
+            if (!pid) {
+                return num;
+            }
+            var tPid;
+            for (var i = 0; i < data.length; i++) {
+                if (pid == data[i].id) {
+                    num += 1;
+                    tPid = data[i].pid;
+                    break;
+                }
+            }
+            return num + treetable.getEmptyNum(tPid, data);
+        },
+        // 展开/折叠行
+        toggleRows: function ($dom, linkage) {
+            var type = $dom.attr('lay-ttype');
+            if ('file' == type) {
+                return;
+            }
+            var mId = $dom.attr('lay-tid');
+            var isOpen = $dom.hasClass('open');
+            if (isOpen) {
+                $dom.removeClass('open');
+            } else {
+                $dom.addClass('open');
+            }
+            $dom.closest('tbody').find('tr').each(function () {
+                var $ti = $(this).find('.treeTable-icon');
+                var pid = $ti.attr('lay-tpid');
+                var ttype = $ti.attr('lay-ttype');
+                var tOpen = $ti.hasClass('open');
+                if (mId == pid) {
+                    if (isOpen) {
+                        $(this).hide();
+                        if ('dir' == ttype && tOpen == isOpen) {
+                            $ti.trigger('click');
+                        }
+                    } else {
+                        $(this).show();
+                        if (linkage && 'dir' == ttype && tOpen == isOpen) {
+                            $ti.trigger('click');
+                        }
+                    }
+                }
+            });
+        },
+        // 检查参数
+        checkParam: function (param) {
+            if (!param.treeSpid && param.treeSpid != 0) {
+                layer.msg('参数treeSpid不能为空', {icon: 5});
+                return false;
+            }
+
+            if (!param.treeColIndex && param.treeColIndex != 0) {
+                layer.msg('参数treeColIndex不能为空', {icon: 5});
+                return false;
+            }
+            return true;
+        },
+        // 展开所有
+        expandAll: function (dom) {
+            $(dom).next('.treeTable').find('.layui-table-body tbody tr').each(function () {
+                var $ti = $(this).find('.treeTable-icon');
+                var ttype = $ti.attr('lay-ttype');
+                var tOpen = $ti.hasClass('open');
+                if ('dir' == ttype && !tOpen) {
+                    $ti.trigger('click');
+                }
+            });
+        },
+        // 折叠所有
+        foldAll: function (dom) {
+            $(dom).next('.treeTable').find('.layui-table-body tbody tr').each(function () {
+                var $ti = $(this).find('.treeTable-icon');
+                var ttype = $ti.attr('lay-ttype');
+                var tOpen = $ti.hasClass('open');
+                if ('dir' == ttype && tOpen) {
+                    $ti.trigger('click');
+                }
+            });
+        }
+    };
+
+    layui.link(layui.cache.base + 'treetable-lay/treetable.css');
+
+    // 给图标列绑定事件
+    $('body').on('click', '.treeTable .treeTable-icon', function () {
+        var treeLinkage = $(this).parents('.treeTable').attr('treeLinkage');
+        if ('true' == treeLinkage) {
+            treetable.toggleRows($(this), true);
+        } else {
+            treetable.toggleRows($(this), false);
+        }
+    });
+
+    exports('treetable', treetable);
+});

+ 18 - 0
js/layuiPlugins/treetable.css

@@ -0,0 +1,18 @@
+.treeTable-empty {
+    width: 20px;
+    display: inline-block;
+}
+
+.treeTable-icon {
+    cursor: pointer;
+}
+
+.treeTable-icon .layui-icon-triangle-d:before {
+    content: "\e623";
+}
+
+.treeTable-icon.open .layui-icon-triangle-d:before {
+    content: "\e625";
+    background-color: transparent;
+}
+

+ 204 - 0
js/layuiPlugins/treetable.js

@@ -0,0 +1,204 @@
+layui.define(['layer', 'table'], function (exports) {
+    var $ = layui.jquery;
+    var layer = layui.layer;
+    var table = layui.table;
+
+    var treetable = {
+        // 渲染树形表格
+        render: function (param) {
+            // 检查参数
+            if (!treetable.checkParam(param)) {
+                return;
+            }
+            // 获取数据
+            if (param.data) {
+                treetable.init(param, param.data);
+            } else {
+                $.getJSON(param.url, param.where, function (res) {
+                    treetable.init(param, res.data);
+                });
+            }
+        },
+        // 渲染表格
+        init: function (param, data) {
+            var mData = [];
+            var doneCallback = param.done;
+            var tNodes = data;
+            // 补上id和pid字段
+            for (var i = 0; i < tNodes.length; i++) {
+                var tt = tNodes[i];
+                if (!tt.id) {
+                    if (!param.treeIdName) {
+                        layer.msg('参数treeIdName不能为空', {icon: 5});
+                        return;
+                    }
+                    tt.id = tt[param.treeIdName];
+                }
+                if (!tt.pid) {
+                    if (!param.treePidName) {
+                        layer.msg('参数treePidName不能为空', {icon: 5});
+                        return;
+                    }
+                    tt.pid = tt[param.treePidName];
+                }
+            }
+
+            // 对数据进行排序
+            var sort = function (s_pid, data) {
+                for (var i = 0; i < data.length; i++) {
+                    if (data[i].pid == s_pid) {
+                        var len = mData.length;
+                        if (len > 0 && mData[len - 1].id == s_pid) {
+                            mData[len - 1].isParent = true;
+                        }
+                        mData.push(data[i]);
+                        sort(data[i].id, data);
+                    }
+                }
+            };
+            sort(param.treeSpid, tNodes);
+
+            // 重写参数
+            param.url = undefined;
+            param.data = mData;
+            param.page = {
+                count: param.data.length,
+                limit: param.data.length
+            };
+            param.cols[0][param.treeColIndex].templet = function (d) {
+                var mId = d.id;
+                var mPid = d.pid;
+                var isDir = d.isParent;
+                var emptyNum = treetable.getEmptyNum(mPid, mData);
+                var iconHtml = '';
+                for (var i = 0; i < emptyNum; i++) {
+                    iconHtml += '<span class="treeTable-empty"></span>';
+                }
+                if (isDir) {
+                    iconHtml += '<i class="layui-icon layui-icon-triangle-d"></i>';
+                }
+                iconHtml += '&nbsp;&nbsp;';
+                var ttype = isDir ? 'dir' : 'file';
+                var vg = '<span class="treeTable-icon open" lay-tid="' + mId + '" lay-tpid="' + mPid + '" lay-ttype="' + ttype + '">';
+                return vg + iconHtml + d[param.cols[0][param.treeColIndex].field] + '</span>'
+            };
+
+            param.done = function (res, curr, count) {
+                $(param.elem).next().addClass('treeTable');
+                $('.treeTable .layui-table-page').css('display', 'none');
+                $(param.elem).next().attr('treeLinkage', param.treeLinkage);
+                // 绑定事件换成对body绑定
+                /*$('.treeTable .treeTable-icon').click(function () {
+                    treetable.toggleRows($(this), param.treeLinkage);
+                });*/
+                if (param.treeDefaultClose) {
+                    treetable.foldAll(param.elem);
+                }
+                if (doneCallback) {
+                    doneCallback(res, curr, count);
+                }
+            };
+
+            // 渲染表格
+            table.render(param);
+        },
+        // 计算缩进的数量
+        getEmptyNum: function (pid, data) {
+            var num = 0;
+            if (!pid) {
+                return num;
+            }
+            var tPid;
+            for (var i = 0; i < data.length; i++) {
+                if (pid == data[i].id) {
+                    num += 1;
+                    tPid = data[i].pid;
+                    break;
+                }
+            }
+            return num + treetable.getEmptyNum(tPid, data);
+        },
+        // 展开/折叠行
+        toggleRows: function ($dom, linkage) {
+            var type = $dom.attr('lay-ttype');
+            if ('file' == type) {
+                return;
+            }
+            var mId = $dom.attr('lay-tid');
+            var isOpen = $dom.hasClass('open');
+            if (isOpen) {
+                $dom.removeClass('open');
+            } else {
+                $dom.addClass('open');
+            }
+            $dom.closest('tbody').find('tr').each(function () {
+                var $ti = $(this).find('.treeTable-icon');
+                var pid = $ti.attr('lay-tpid');
+                var ttype = $ti.attr('lay-ttype');
+                var tOpen = $ti.hasClass('open');
+                if (mId == pid) {
+                    if (isOpen) {
+                        $(this).hide();
+                        if ('dir' == ttype && tOpen == isOpen) {
+                            $ti.trigger('click');
+                        }
+                    } else {
+                        $(this).show();
+                        if (linkage && 'dir' == ttype && tOpen == isOpen) {
+                            $ti.trigger('click');
+                        }
+                    }
+                }
+            });
+        },
+        // 检查参数
+        checkParam: function (param) {
+            if (!param.treeSpid && param.treeSpid != 0) {
+                layer.msg('参数treeSpid不能为空', {icon: 5});
+                return false;
+            }
+
+            if (!param.treeColIndex && param.treeColIndex != 0) {
+                layer.msg('参数treeColIndex不能为空', {icon: 5});
+                return false;
+            }
+            return true;
+        },
+        // 展开所有
+        expandAll: function (dom) {
+            $(dom).next('.treeTable').find('.layui-table-body tbody tr').each(function () {
+                var $ti = $(this).find('.treeTable-icon');
+                var ttype = $ti.attr('lay-ttype');
+                var tOpen = $ti.hasClass('open');
+                if ('dir' == ttype && !tOpen) {
+                    $ti.trigger('click');
+                }
+            });
+        },
+        // 折叠所有
+        foldAll: function (dom) {
+            $(dom).next('.treeTable').find('.layui-table-body tbody tr').each(function () {
+                var $ti = $(this).find('.treeTable-icon');
+                var ttype = $ti.attr('lay-ttype');
+                var tOpen = $ti.hasClass('open');
+                if ('dir' == ttype && tOpen) {
+                    $ti.trigger('click');
+                }
+            });
+        }
+    };
+
+    layui.link(layui.cache.base + 'treetable-lay/treetable.css');
+
+    // 给图标列绑定事件
+    $('body').on('click', '.treeTable .treeTable-icon', function () {
+        var treeLinkage = $(this).parents('.treeTable').attr('treeLinkage');
+        if ('true' == treeLinkage) {
+            treetable.toggleRows($(this), true);
+        } else {
+            treetable.toggleRows($(this), false);
+        }
+    });
+
+    exports('treetable', treetable);
+});

+ 58 - 0
js/leftNav.js

@@ -0,0 +1,58 @@
+function navBar(data) {
+    var ulHtml = '<ul class="layui-nav layui-nav-tree">';
+    for (var i = 0; i < data.length; i++) {
+        if (data[i].spread) {
+            ulHtml += '<li class="layui-nav-item layui-nav-itemed">';
+        } else {
+            ulHtml += '<li class="layui-nav-item">';
+        }
+        if (data[i].subMenuList != undefined && data[i].subMenuList.length > 0) {
+            ulHtml += '<a href="javascript:;">';
+            if (data[i].ico != undefined && data[i].ico != '') {
+                if (data[i].ico - 0 == 0) {
+                    data[i].ico = "&nbsp;";
+                }
+                if (data[i].ico.indexOf("icon-") != -1) {
+                    ulHtml += '<i class="iconfont ' + data[i].ico + '" data-icon="' + data[i].ico + '"></i>';
+                } else {
+                    ulHtml += '<i class="layui-icon" data-icon="' + data[i].ico + '">' + data[i].ico + '</i>';
+                }
+            }
+            ulHtml += '<cite>' + data[i].funName + '</cite>';
+            ulHtml += '<span class="layui-nav-more"></span>';
+            ulHtml += '</a>'
+            ulHtml += '<dl class="layui-nav-child">';
+            for (var j = 0; j < data[i].subMenuList.length; j++) {
+                ulHtml += '<dd><a href="javascript:;" data-url="' + data[i].subMenuList[j].fileUrl + '?id=' + data[i].subMenuList[j].id + '&ver=' + SYS_VER + '">';
+                if (data[i].subMenuList[j].ico != undefined && data[i].subMenuList[j].ico != '') {
+                    if (data[i].subMenuList[j].ico - 0 == 0) {
+                        data[i].subMenuList[j].ico = "&nbsp;";
+                    }
+                    if (data[i].subMenuList[j].ico.indexOf("icon-") != -1) {
+                        ulHtml += '<i class="iconfont ' + data[i].subMenuList[j].ico + '" data-icon="' + data[i].subMenuList[j].ico + '"></i>';
+                    } else {
+                        ulHtml += '<i class="layui-icon" data-icon="' + data[i].subMenuList[j].ico + '">' + data[i].subMenuList[j].ico + '</i>';
+                    }
+                }
+                ulHtml += '<cite>' + data[i].subMenuList[j].funName + '</cite></a></dd>';
+            }
+            ulHtml += "</dl>"
+        } else {
+            ulHtml += '<a href="javascript:;" data-url="' + data[i].fileUrl + '?id=' + data[i].id + '&ver=' + SYS_VER + '">';
+            if (data[i].ico != undefined && data[i].ico != '') {
+                if (data[i].ico - 0 == 0) {
+                    data[i].ico = "&nbsp;";
+                }
+                if (data[i].ico.indexOf("icon-") != -1) {
+                    ulHtml += '<i class="iconfont ' + data[i].ico + '" data-icon="' + data[i].ico + '"></i>';
+                } else {
+                    ulHtml += '<i class="layui-icon" data-icon="' + data[i].ico + '">' + data[i].ico + '</i>';
+                }
+            }
+            ulHtml += '<cite>' + data[i].funName + '</cite></a>';
+        }
+        ulHtml += '</li>'
+    }
+    ulHtml += '</ul>';
+    return ulHtml;
+}

+ 98 - 0
js/main.js

@@ -0,0 +1,98 @@
+layui.config({
+	base: "js/"
+}).use(['form', 'element', 'layer', 'jquery'], function () {
+	var form = layui.form,
+		layer = layui.layer,
+		element = layui.element,
+		$ = layui.jquery;
+
+	$(".panel a").on("click", function () {
+		window.parent.addTab($(this));
+	})
+
+	//动态获取文章总数和待审核文章数量,最新文章
+	$.get("../json/newsList.json",
+		function (data) {
+			var waitNews = [];
+			$(".allNews span").text(data.length);  //文章总数
+			for (var i = 0; i < data.length; i++) {
+				var newsStr = data[i];
+				if (newsStr["newsStatus"] == "待审核") {
+					waitNews.push(newsStr);
+				}
+			}
+			$(".waitNews span").text(waitNews.length);  //待审核文章
+			//加载最新文章
+			var hotNewsHtml = '';
+			for (var i = 0; i < 5; i++) {
+				hotNewsHtml += '<tr>'
+					+ '<td align="left">' + data[i].newsName + '</td>'
+					+ '<td>' + data[i].newsTime + '</td>'
+					+ '</tr>';
+			}
+			$(".hot_news").html(hotNewsHtml);
+		}
+	)
+
+	//图片总数
+	$.get("../json/images.json",
+		function (data) {
+			$(".imgAll span").text(data.length);
+		}
+	)
+
+	//用户数
+	$.get("../json/usersList.json",
+		function (data) {
+			$(".userAll span").text(data.length);
+		}
+	)
+
+	//新消息
+	$.get("../json/message.json",
+		function (data) {
+			$(".newMessage span").text(data.length);
+		}
+	)
+
+
+	//数字格式化
+	$(".panel span").each(function () {
+		$(this).html($(this).text() > 9999 ? ($(this).text() / 10000).toFixed(2) + "<em>万</em>" : $(this).text());
+	})
+
+	//系统基本参数
+	if (window.sessionStorage.getItem("systemParameter")) {
+		var systemParameter = JSON.parse(window.sessionStorage.getItem("systemParameter"));
+		fillParameter(systemParameter);
+	} else {
+		$.ajax({
+			url: "../json/systemParameter.json",
+			type: "get",
+			dataType: "json",
+			success: function (data) {
+				fillParameter(data);
+			}
+		})
+	}
+
+	//填充数据方法
+	function fillParameter(data) {
+		//判断字段数据是否存在
+		function nullData(data) {
+			if (data == '' || data == "undefined") {
+				return "未定义";
+			} else {
+				return data;
+			}
+		}
+		$(".version").text(nullData(data.version));      //当前版本
+		$(".author").text(nullData(data.author));        //开发作者
+		$(".homePage").text(nullData(data.homePage));    //网站首页
+		$(".server").text(nullData(data.server));        //服务器环境
+		$(".dataBase").text(nullData(data.dataBase));    //数据库版本
+		$(".maxUpload").text(nullData(data.maxUpload));    //最大上传限制
+		$(".userRights").text(nullData(data.userRights));//当前用户权限
+	}
+
+})

+ 167 - 0
js/md5.js

@@ -0,0 +1,167 @@
+/**
+ * Des: MD5加密
+ * User: Yanbo
+ * Date: 2017-09-01
+ * Time: 10:50
+ * Mail: <a href="yanbo@hyphoneit.com">Yanbo</a>.
+ */
+;!function (win) {
+    'use strict';
+    layui.define(function (exports) {
+        var md5 = {
+            config: {
+                MOD_NAME: 'md5'
+            }
+            /**
+             * 对字符串进行MD5加密
+             * @param str 要加密的字符串
+             */
+            , calcMD5: function (str) {
+                var self = this
+                    , x = self.str2blksMD5(str)
+                    , a = 0x67452301
+                    , b = 0xEFCDAB89
+                    , c = 0x98BADCFE
+                    , d = 0x10325476;
+                for (var i = 0; i < x.length; i += 16) {
+                    var olda = a
+                        , oldb = b
+                        , oldd = d
+                        , oldc = c;
+                    a = self.ff(a, b, c, d, x[i + 0], 7, 0xD76AA478);
+                    d = self.ff(d, a, b, c, x[i + 1], 12, 0xE8C7B756);
+                    c = self.ff(c, d, a, b, x[i + 2], 17, 0x242070DB);
+                    b = self.ff(b, c, d, a, x[i + 3], 22, 0xC1BDCEEE);
+                    a = self.ff(a, b, c, d, x[i + 4], 7, 0xF57C0FAF);
+                    d = self.ff(d, a, b, c, x[i + 5], 12, 0x4787C62A);
+                    c = self.ff(c, d, a, b, x[i + 6], 17, 0xA8304613);
+                    b = self.ff(b, c, d, a, x[i + 7], 22, 0xFD469501);
+                    a = self.ff(a, b, c, d, x[i + 8], 7, 0x698098D8);
+                    d = self.ff(d, a, b, c, x[i + 9], 12, 0x8B44F7AF);
+                    c = self.ff(c, d, a, b, x[i + 10], 17, 0xFFFF5BB1);
+                    b = self.ff(b, c, d, a, x[i + 11], 22, 0x895CD7BE);
+                    a = self.ff(a, b, c, d, x[i + 12], 7, 0x6B901122);
+                    d = self.ff(d, a, b, c, x[i + 13], 12, 0xFD987193);
+                    c = self.ff(c, d, a, b, x[i + 14], 17, 0xA679438E);
+                    b = self.ff(b, c, d, a, x[i + 15], 22, 0x49B40821);
+
+                    a = self.gg(a, b, c, d, x[i + 1], 5, 0xF61E2562);
+                    d = self.gg(d, a, b, c, x[i + 6], 9, 0xC040B340);
+                    c = self.gg(c, d, a, b, x[i + 11], 14, 0x265E5A51);
+                    b = self.gg(b, c, d, a, x[i + 0], 20, 0xE9B6C7AA);
+                    a = self.gg(a, b, c, d, x[i + 5], 5, 0xD62F105D);
+                    d = self.gg(d, a, b, c, x[i + 10], 9, 0x02441453);
+                    c = self.gg(c, d, a, b, x[i + 15], 14, 0xD8A1E681);
+                    b = self.gg(b, c, d, a, x[i + 4], 20, 0xE7D3FBC8);
+                    a = self.gg(a, b, c, d, x[i + 9], 5, 0x21E1CDE6);
+                    d = self.gg(d, a, b, c, x[i + 14], 9, 0xC33707D6);
+                    c = self.gg(c, d, a, b, x[i + 3], 14, 0xF4D50D87);
+                    b = self.gg(b, c, d, a, x[i + 8], 20, 0x455A14ED);
+                    a = self.gg(a, b, c, d, x[i + 13], 5, 0xA9E3E905);
+                    d = self.gg(d, a, b, c, x[i + 2], 9, 0xFCEFA3F8);
+                    c = self.gg(c, d, a, b, x[i + 7], 14, 0x676F02D9);
+                    b = self.gg(b, c, d, a, x[i + 12], 20, 0x8D2A4C8A);
+
+                    a = self.hh(a, b, c, d, x[i + 5], 4, 0xFFFA3942);
+                    d = self.hh(d, a, b, c, x[i + 8], 11, 0x8771F681);
+                    c = self.hh(c, d, a, b, x[i + 11], 16, 0x6D9D6122);
+                    b = self.hh(b, c, d, a, x[i + 14], 23, 0xFDE5380C);
+                    a = self.hh(a, b, c, d, x[i + 1], 4, 0xA4BEEA44);
+                    d = self.hh(d, a, b, c, x[i + 4], 11, 0x4BDECFA9);
+                    c = self.hh(c, d, a, b, x[i + 7], 16, 0xF6BB4B60);
+                    b = self.hh(b, c, d, a, x[i + 10], 23, 0xBEBFBC70);
+                    a = self.hh(a, b, c, d, x[i + 13], 4, 0x289B7EC6);
+                    d = self.hh(d, a, b, c, x[i + 0], 11, 0xEAA127FA);
+                    c = self.hh(c, d, a, b, x[i + 3], 16, 0xD4EF3085);
+                    b = self.hh(b, c, d, a, x[i + 6], 23, 0x04881D05);
+                    a = self.hh(a, b, c, d, x[i + 9], 4, 0xD9D4D039);
+                    d = self.hh(d, a, b, c, x[i + 12], 11, 0xE6DB99E5);
+                    c = self.hh(c, d, a, b, x[i + 15], 16, 0x1FA27CF8);
+                    b = self.hh(b, c, d, a, x[i + 2], 23, 0xC4AC5665);
+
+                    a = self.ii(a, b, c, d, x[i + 0], 6, 0xF4292244);
+                    d = self.ii(d, a, b, c, x[i + 7], 10, 0x432AFF97);
+                    c = self.ii(c, d, a, b, x[i + 14], 15, 0xAB9423A7);
+                    b = self.ii(b, c, d, a, x[i + 5], 21, 0xFC93A039);
+                    a = self.ii(a, b, c, d, x[i + 12], 6, 0x655B59C3);
+                    d = self.ii(d, a, b, c, x[i + 3], 10, 0x8F0CCC92);
+                    c = self.ii(c, d, a, b, x[i + 10], 15, 0xFFEFF47D);
+                    b = self.ii(b, c, d, a, x[i + 1], 21, 0x85845DD1);
+                    a = self.ii(a, b, c, d, x[i + 8], 6, 0x6FA87E4F);
+                    d = self.ii(d, a, b, c, x[i + 15], 10, 0xFE2CE6E0);
+                    c = self.ii(c, d, a, b, x[i + 6], 15, 0xA3014314);
+                    b = self.ii(b, c, d, a, x[i + 13], 21, 0x4E0811A1);
+                    a = self.ii(a, b, c, d, x[i + 4], 6, 0xF7537E82);
+                    d = self.ii(d, a, b, c, x[i + 11], 10, 0xBD3AF235);
+                    c = self.ii(c, d, a, b, x[i + 2], 15, 0x2AD7D2BB);
+                    b = self.ii(b, c, d, a, x[i + 9], 21, 0xEB86D391);
+
+                    a = self.add(a, olda);
+                    b = self.add(b, oldb);
+                    c = self.add(c, oldc);
+                    d = self.add(d, oldd);
+                }
+                return self.rhex(a) + self.rhex(b) + self.rhex(c) + self.rhex(d);
+            }
+            /*
+             * Convert a string to a sequence of 16-word blocks, stored as an array.
+             * Append padding bits and the length, as described in the MD5 standard.
+             */
+            , str2blksMD5: function (str) {
+                var nblk = ((str.length + 8) >> 6) + 1
+                    , blks = new Array(nblk * 16);
+                for (var i = 0; i < nblk * 16; i++) blks[i] = 0;
+                for (var i = 0; i < str.length; i++)
+                    blks[i >> 2] |= str.charCodeAt(i) << ((i % 4) * 8);
+                blks[i >> 2] |= 0x80 << ((i % 4) * 8);
+                blks[nblk * 16 - 2] = str.length * 8;
+                return blks;
+            }
+            /*
+             * Add integers, wrapping at 2^32
+             */
+            , add: function (x, y) {
+                return ((x & 0x7FFFFFFF) + (y & 0x7FFFFFFF)) ^ (x & 0x80000000) ^ (y & 0x80000000);
+            }
+            /*
+             * Bitwise rotate a 32-bit number to the left
+             */
+            , rol: function (num, cnt) {
+                return (num << cnt) | (num >>> (32 - cnt));
+            }
+            /*
+             * These functions implement the basic operation for each round of the
+             * algorithm.
+             */
+            , cmn: function (q, a, b, x, s, t) {
+                var self = this;
+                return self.add(self.rol(self.add(self.add(a, q), self.add(x, t)), s), b);
+            }
+            , ff: function (a, b, c, d, x, s, t) {
+                var self = this;
+                return self.cmn((b & c) | ((~b) & d), a, b, x, s, t);
+            }
+            , gg: function (a, b, c, d, x, s, t) {
+                var self = this;
+                return self.cmn((b & d) | (c & (~d)), a, b, x, s, t);
+            }
+            , hh: function (a, b, c, d, x, s, t) {
+                var self = this;
+                return self.cmn(b ^ c ^ d, a, b, x, s, t);
+            }
+            , ii: function (a, b, c, d, x, s, t) {
+                var self = this;
+                return self.cmn(c ^ (b | (~d)), a, b, x, s, t);
+            }
+            , rhex: function (num) {
+                var hex_chr = '0123456789abcdef'
+                    , str = '';
+                for (var j = 0; j <= 3; j++)
+                    str += hex_chr.charAt((num >> (j * 8 + 4)) & 0x0F) + hex_chr.charAt((num >> (j * 8)) & 0x0F);
+                return str;
+            }
+        }
+            , _config = md5.config;
+        exports(_config.MOD_NAME, md5);
+    });
+}(window);

+ 160 - 0
layui/css/eleTree.css

@@ -0,0 +1,160 @@
+/* #region tree */
+.eleTree{
+    min-width: 200px;
+    position: relative;
+    overflow: hidden;
+}
+.eleTree-hide{
+    display: none;
+}
+.eleTree-node-content{
+    cursor: pointer;
+    height: 28px;
+    line-height: 1.5;
+}
+.eleTree-node-content.eleTree-node-content-active{
+    color: #1E9FFF;
+    background-color: #eee;
+}
+.eleTree-node-content:hover{
+    background-color: #eee;
+}
+/* #regionTree .eleTree-node-content-label{
+    font-size: 15px;
+} */
+.eleTree-node-content-icon .layui-icon{
+    padding: 6px 3px;
+    color: #c0c4cc;
+    font-size: 12px;
+    display: inline-block;
+    transform: rotate(0deg);
+    transition: transform .3s ease-in-out;
+}
+.eleTree-node-content-iconfont .iconfont{
+    padding: 0 0 0 5px;
+    color: #999;
+    font-size: 18px;
+    display: inline-block;
+    vertical-align: middle;
+}
+.eleTree-node-content-iconfont .icon-folder{
+    color: #ff9800;
+}
+.eleTree-node-content-iconfont .icon-file{
+    color: #457fd9;
+}
+.eleTree-node-content-btn{
+    float: right;
+    margin-top: 3px;
+}
+.eleTree-node-content-btn .layui-lock{
+    color: #f8bf00;
+    font-weight: bold;
+}
+.eleTree-node-content-btn .layui-forbid{
+    color: red;
+    font-weight: bold;
+}
+.eleTree-node-content-icon .layui-icon.icon-rotate{
+    transform: rotate(90deg);
+}
+.eleTree-node-content .layui-form-checkbox[lay-skin=primary] i{
+    width: 13px;
+    height: 14px;
+    line-height: 1.3;
+}
+.eleTree-node-content-label{
+    padding-left: 5px;
+}
+
+/* checkbox第三种状态 */
+input.eleTree-hideen[type=checkbox]{
+    display: none;
+}
+.eleTree-checkbox {
+    height: auto!important;
+    line-height: normal!important;
+    min-height: 12px;
+    border: none!important;
+    margin-right: 0;
+    padding-left: 18px;
+    position: relative;
+    display: inline-block;
+}
+.eleTree-checkbox i {
+    left: 0;
+    border: 1px solid #d2d2d2;
+    font-size: 12px;
+    border-radius: 2px;
+    background-color: #fff;
+    -webkit-transition: .1s linear;
+    transition: .1s linear;
+    position: absolute;
+    top: 0;
+    color: #fff;
+    cursor: pointer;
+    text-align: center;
+    width: 13px;
+    height: 14px;
+    line-height: 1.3;
+}
+.eleTree-checkbox i:hover {
+    border-color: #5FB878;
+}
+.eleTree-checkbox-checked i {
+    border-color: #5FB878;
+    background-color: #5FB878;
+    color: #fff;
+}
+.eleTree-checkbox-line:after{
+    content: "";
+    position: relative;
+    width: 8px;
+    height: 1px;
+    background-color: #fff;
+    display: inline-block;
+    top: -4px;
+}
+
+.eleTree-checkbox.eleTree-checkbox-disabled i{
+    cursor: not-allowed;
+    background-color: #f2f6fc;
+    border-color: #dcdfe6;
+    color: #c2c2c2;
+}
+.eleTree-checkbox.eleTree-checkbox-disabled i.eleTree-checkbox-line:after{
+    background-color: #c2c2c2;
+}
+.eleTree-checkbox.eleTree-checkbox-disabled i:hover{
+    border-color: #dcdfe6;
+}
+
+#tree-menu{
+    position: absolute;
+    z-index: 1001;
+    border: 1px solid #e4e7ed;
+    border-radius: 4px;
+    background-color: #fff;
+    box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
+    box-sizing: border-box;
+    margin: 0;
+}
+#tree-menu li>a{
+    display: block;
+    padding: 0 1.5em;
+    text-decoration: none;
+    width: auto;
+    color: #000;
+    white-space: nowrap;
+    line-height: 2.4em;
+    text-shadow: 1px 1px 0 #fff;
+    border-radius: 1px;
+    font-size: 13px;
+}
+#tree-menu li>a:hover{
+    background-color: #e8eff7;
+}
+.tree-menu-bg{
+    background-color: #ccc;
+}
+/* #endregion */

File diff suppressed because it is too large
+ 158 - 0
layui/css/formSelects-v4.css


File diff suppressed because it is too large
+ 1 - 0
layui/css/layui.css


File diff suppressed because it is too large
+ 1 - 0
layui/css/layui.mobile.css


+ 2 - 0
layui/css/modules/code.css

@@ -0,0 +1,2 @@
+/** layui-v2.4.3 MIT License By https://www.layui.com */
+ html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}

File diff suppressed because it is too large
+ 1 - 0
layui/css/modules/laydate/default/laydate.css


BIN
layui/css/modules/laydate/icon.png


File diff suppressed because it is too large
+ 1 - 0
layui/css/modules/laydate/laydate.css


BIN
layui/css/modules/layer/default/icon-ext.png


BIN
layui/css/modules/layer/default/icon.png


File diff suppressed because it is too large
+ 1 - 0
layui/css/modules/layer/default/layer.css


BIN
layui/css/modules/layer/default/loading-0.gif


BIN
layui/css/modules/layer/default/loading-1.gif


BIN
layui/css/modules/layer/default/loading-2.gif


+ 134 - 0
layui/css/step.css

@@ -0,0 +1,134 @@
+/* #region 步骤条面板 */
+html,body{
+    width: 100%;
+}
+.layui-step{
+    width: 100%;
+    height: 100%;
+    position: relative;
+    background-color: #fff;
+}
+
+.layui-step-title {
+    width: 100%;
+    padding-top: 10px;
+}
+.layui-step-title-item{
+    min-height: 60px;
+    float: left;
+    background-color: #fff;
+    text-align: center;
+    position: relative;
+}
+.layui-step-title-item::after{
+    content: "";
+    width: 100%;
+    display: inline-block;
+    height: 2px;
+    background-color: #ccc;
+    position: absolute;
+    top: 14px;
+    left: 0px;
+}
+.layui-step-title-item.step-finish::after{
+    background-color: #1E9FFF;
+}
+.layui-step-title-item.step-current::after{
+    background-color: #1E9FFF;
+}
+.layui-step-title-item.step-disabled::after{
+    background-color: #ccc;
+}
+.layui-step-title-item.step-first::after{
+    width: 50%;
+    left: 50%;
+}
+.layui-step-title-item.step-last::after{
+    width: 50%;
+    right: 50%;
+}
+.layui-step-title-item.step-finish .step-icon{
+    background-color: #1E9FFF;
+    color: #fff;
+    border: 1px solid #1E9FFF
+}
+.layui-step-title-item.step-current .step-icon{
+    background-color: #1E9FFF;
+    color: #fff;
+    border: 1px solid #1E9FFF;
+}
+.layui-step-title-item.step-disabled .step-icon{
+    background-color: #ccc;
+    color: #fff;
+    border: 1px solid #ccc;
+    cursor: not-allowed;
+}
+.layui-step-title-item.step-disabled .step-text{
+    color: #bbb;
+}
+.layui-step-title-item.step-disabled .step-description{
+    color: #ddd;
+}
+.step-icon{
+    height: 26px;
+    width: 26px;
+    z-index: 1;
+    color: #999;
+    cursor: pointer;
+    text-align: center;
+    position: relative;
+    border-radius: 50%;
+    display: inline-block;
+    background: #ffffff;
+    border: 1px solid #ccc;
+}
+.step-icon>i{
+    position: absolute;
+    top: 5px;
+    font-style: normal;
+    left: 9px;
+}
+.step-text{
+    font-weight: bolder;
+    color: #555555;
+    margin-bottom: 10px;
+    padding: 0px 15px;
+}
+.step-description{
+    color: #aaa;
+    font-weight: 300;
+    padding: 0px 15px;
+}
+
+.layui-step-content{
+    width: 100%;
+    min-height: calc(100% - 105px);
+    position: relative;
+    margin-top: 10px;
+    background-color: #f5f5f5;
+}
+.layui-step-content-item{
+    width: 100%;
+    position: relative;
+    padding: 15px 0px 0;
+    top: 0px;
+    left: 0px;
+    display: none;
+}
+.layui-step-content-item .content-item-before{
+    content: " ";
+    width: 20px;
+    height: 20px;
+    background-color: #f5f5f5;
+    position: absolute;
+    top: -10px;
+    transform: rotate(45deg);
+}
+
+.layui-step-btn{
+    position: fixed;
+    top: calc(100% - 48px);
+    right: 50%;
+    margin-right: -46px;
+}
+/* #endregion */

BIN
layui/font/iconfont.eot


File diff suppressed because it is too large
+ 25 - 0
layui/font/iconfont.svg


BIN
layui/font/iconfont.ttf


BIN
layui/font/iconfont.woff


BIN
layui/images/face/0.gif


BIN
layui/images/face/1.gif


BIN
layui/images/face/10.gif


BIN
layui/images/face/11.gif


BIN
layui/images/face/12.gif


BIN
layui/images/face/13.gif


BIN
layui/images/face/14.gif


BIN
layui/images/face/15.gif


BIN
layui/images/face/16.gif


BIN
layui/images/face/17.gif


BIN
layui/images/face/18.gif


BIN
layui/images/face/19.gif


BIN
layui/images/face/2.gif


BIN
layui/images/face/20.gif


BIN
layui/images/face/21.gif


BIN
layui/images/face/22.gif


BIN
layui/images/face/23.gif


BIN
layui/images/face/24.gif


BIN
layui/images/face/25.gif


BIN
layui/images/face/26.gif


BIN
layui/images/face/27.gif


BIN
layui/images/face/28.gif


BIN
layui/images/face/29.gif


BIN
layui/images/face/3.gif


BIN
layui/images/face/30.gif


BIN
layui/images/face/31.gif


BIN
layui/images/face/32.gif


BIN
layui/images/face/33.gif


BIN
layui/images/face/34.gif


BIN
layui/images/face/35.gif


BIN
layui/images/face/36.gif


BIN
layui/images/face/37.gif


BIN
layui/images/face/38.gif


BIN
layui/images/face/39.gif


Some files were not shown because too many files changed in this diff