Rockery hace 3 años
commit
c7c0e95c63
Se han modificado 100 ficheros con 5568 adiciones y 0 borrados
  1. 4 0
      .project
  2. 10 0
      README.md
  3. 11 0
      admin/css/animate.min.css
  4. 182 0
      admin/css/common.css
  5. 21 0
      admin/css/images.css
  6. 143 0
      admin/css/main.css
  7. 15 0
      admin/css/message.css
  8. 8 0
      admin/css/news.css
  9. 38 0
      admin/css/systemTree.css
  10. 28 0
      admin/css/user.css
  11. 4 0
      admin/iconfont/iconfont.css
  12. BIN
      admin/iconfont/iconfont.eot
  13. 0 0
      admin/iconfont/iconfont.js
  14. 31 0
      admin/iconfont/iconfont.svg
  15. BIN
      admin/iconfont/iconfont.ttf
  16. BIN
      admin/iconfont/iconfont.woff
  17. 82 0
      admin/index.js
  18. 1 0
      admin/js/ajaxhook.min.js
  19. 29 0
      admin/js/common.js
  20. 338 0
      admin/js/config.js
  21. 21 0
      admin/js/echarts.min.js
  22. 169 0
      admin/js/layuiPlugins/cascade.js
  23. 760 0
      admin/js/layuiPlugins/eleTree.js
  24. 1733 0
      admin/js/layuiPlugins/formSelects-v4.js
  25. 411 0
      admin/js/layuiPlugins/layui-xtree.js
  26. 332 0
      admin/js/layuiPlugins/step.js
  27. 3 0
      admin/js/layuiPlugins/treeGrid.css
  28. 23 0
      admin/js/layuiPlugins/treeGrid.js
  29. 18 0
      admin/js/layuiPlugins/treetable-lay/treetable.css
  30. 206 0
      admin/js/layuiPlugins/treetable-lay/treetable.js
  31. 58 0
      admin/js/leftNav.js
  32. 98 0
      admin/js/main.js
  33. 167 0
      admin/js/md5.js
  34. 140 0
      admin/js/nav.js
  35. 160 0
      admin/layui/css/eleTree.css
  36. 158 0
      admin/layui/css/formSelects-v4.css
  37. 1 0
      admin/layui/css/layui.css
  38. 1 0
      admin/layui/css/layui.mobile.css
  39. 2 0
      admin/layui/css/modules/code.css
  40. 1 0
      admin/layui/css/modules/laydate/default/laydate.css
  41. BIN
      admin/layui/css/modules/laydate/icon.png
  42. 1 0
      admin/layui/css/modules/laydate/laydate.css
  43. BIN
      admin/layui/css/modules/layer/default/icon-ext.png
  44. BIN
      admin/layui/css/modules/layer/default/icon.png
  45. 1 0
      admin/layui/css/modules/layer/default/layer.css
  46. BIN
      admin/layui/css/modules/layer/default/loading-0.gif
  47. BIN
      admin/layui/css/modules/layer/default/loading-1.gif
  48. BIN
      admin/layui/css/modules/layer/default/loading-2.gif
  49. 134 0
      admin/layui/css/step.css
  50. BIN
      admin/layui/font/iconfont.eot
  51. 25 0
      admin/layui/font/iconfont.svg
  52. BIN
      admin/layui/font/iconfont.ttf
  53. BIN
      admin/layui/font/iconfont.woff
  54. BIN
      admin/layui/images/face/0.gif
  55. BIN
      admin/layui/images/face/1.gif
  56. BIN
      admin/layui/images/face/10.gif
  57. BIN
      admin/layui/images/face/11.gif
  58. BIN
      admin/layui/images/face/12.gif
  59. BIN
      admin/layui/images/face/13.gif
  60. BIN
      admin/layui/images/face/14.gif
  61. BIN
      admin/layui/images/face/15.gif
  62. BIN
      admin/layui/images/face/16.gif
  63. BIN
      admin/layui/images/face/17.gif
  64. BIN
      admin/layui/images/face/18.gif
  65. BIN
      admin/layui/images/face/19.gif
  66. BIN
      admin/layui/images/face/2.gif
  67. BIN
      admin/layui/images/face/20.gif
  68. BIN
      admin/layui/images/face/21.gif
  69. BIN
      admin/layui/images/face/22.gif
  70. BIN
      admin/layui/images/face/23.gif
  71. BIN
      admin/layui/images/face/24.gif
  72. BIN
      admin/layui/images/face/25.gif
  73. BIN
      admin/layui/images/face/26.gif
  74. BIN
      admin/layui/images/face/27.gif
  75. BIN
      admin/layui/images/face/28.gif
  76. BIN
      admin/layui/images/face/29.gif
  77. BIN
      admin/layui/images/face/3.gif
  78. BIN
      admin/layui/images/face/30.gif
  79. BIN
      admin/layui/images/face/31.gif
  80. BIN
      admin/layui/images/face/32.gif
  81. BIN
      admin/layui/images/face/33.gif
  82. BIN
      admin/layui/images/face/34.gif
  83. BIN
      admin/layui/images/face/35.gif
  84. BIN
      admin/layui/images/face/36.gif
  85. BIN
      admin/layui/images/face/37.gif
  86. BIN
      admin/layui/images/face/38.gif
  87. BIN
      admin/layui/images/face/39.gif
  88. BIN
      admin/layui/images/face/4.gif
  89. BIN
      admin/layui/images/face/40.gif
  90. BIN
      admin/layui/images/face/41.gif
  91. BIN
      admin/layui/images/face/42.gif
  92. BIN
      admin/layui/images/face/43.gif
  93. BIN
      admin/layui/images/face/44.gif
  94. BIN
      admin/layui/images/face/45.gif
  95. BIN
      admin/layui/images/face/46.gif
  96. BIN
      admin/layui/images/face/47.gif
  97. BIN
      admin/layui/images/face/48.gif
  98. BIN
      admin/layui/images/face/49.gif
  99. BIN
      admin/layui/images/face/5.gif
  100. BIN
      admin/layui/images/face/50.gif

+ 4 - 0
.project

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>生鲜供应链B2B系统</name>
+</projectDescription>

+ 10 - 0
README.md

@@ -0,0 +1,10 @@
+# 供应链-商城-web端
+
+```bash
+# 项目名称
+$ supply-chain-web
+
+# 请求url配置
+$ ./admin/js/config.js => window.hywa.config.href = '/buyer-side-web'
+
+```

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 11 - 0
admin/css/animate.min.css


+ 182 - 0
admin/css/common.css

@@ -0,0 +1,182 @@
+/* 公用的 */
+html {
+	color: #333;
+}
+
+.layui-fluid {
+	padding: 15px;
+}
+
+.layui-layer-btn a {
+	margin: 0 5px 0 !important;
+}
+
+.ui-required:before {
+	content: "*";
+	color: red;
+	vertical-align: middle;
+}
+
+/* 滚动条 */
+/* ::-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, .3);
+	box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
+	background-color: #f5f5f5;
+}
+
+::-webkit-scrollbar {
+	width: 6px;
+	height: 6px;
+	background-color: #f5f5f5;
+} */
+
+/* 表格 */
+.layui-table,
+.layui-table-view {
+	margin-top: 0;
+}
+
+.layout-header .layui-form-item {
+	margin-bottom: 0;
+}
+
+.layout-header .layui-form-item .layui-inline:first-child {
+	width: 40%;
+}
+
+.layout-header.layui-card-header {
+	padding: 0 0 5px;
+	height: auto;
+}
+
+.layout-body.layui-card-body {
+	padding: 0 0;
+}
+
+.search-icon {
+	position: absolute;
+	left: 10px;
+	top: 50%;
+	transform: translate(0, -50%);
+}
+
+.search-icon+input {
+	padding-left: 35px;
+}
+
+.imgBox {
+	height: 190px;
+	overflow: hidden;
+	border: 1px solid #ddd;
+}
+
+.imgBox img {
+	max-width: 100%;
+}
+
+#detailBox {
+	padding: 20px;
+	background-color: #f2f2f2;
+}
+
+#detailBox .layui-card-header {
+	border-left: 4px solid #009688;
+	font-weight: bold;
+}
+
+#detailBox .layui-card-body ul li {
+	padding: 5px;
+	display: flex;
+	align-items: center;
+}
+
+#detailBox .layui-card-body ul li span {
+	flex: 1;
+}
+#detailBox .layui-card-body ul li img{
+	width: auto;
+	max-height: 250px;
+	vertical-align: text-top;
+}
+#detailBox .layui-card-body ul li span img {
+	width: auto;
+	max-width: 400px;
+	max-height: 300px;
+	vertical-align: text-top;
+}
+
+#detailBox .layui-card-body ul li span:first-child {
+	flex: 1.5;
+}
+
+.layui-btn-container .counter {
+	font-size: 14px;
+	line-height: 38px;
+	float: right;
+	color: #FF5722
+}
+
+.date-btn {
+	position: relative;
+	padding: 0 15px;
+}
+
+.date-btn .layui-icon {
+	font-size: 26px;
+	margin-right: 0;
+}
+
+.date-btn .dateClass {
+	position: absolute;
+	left: 0;
+	right: 0;
+	width: 100%;
+	height: 100%;
+	opacity: 0;
+}
+
+.chart-box {
+	margin-top: 30px;
+}
+
+.goodsTotal {
+	text-align: center;
+	padding: 15px;
+	border: 1px solid #ECECEC;
+	margin: 15px 0 0;
+}
+
+.goodsTotal>div {
+	border-right: 1px solid #ECECEC;
+}
+
+.goodsTotal>div:last-child {
+	border: none;
+}
+
+.goodsTotal span {
+	font-size: 28px;
+}
+
+.goodsTotal p {
+	font-size: :16px;
+	margin-top: 5px;
+}
+
+
+
+
+
+
+
+
+
+@media screen and (max-width: 450px) {
+	.layout-header .layui-form-item .layui-inline {
+		width: auto !important;
+	}
+}

+ 21 - 0
admin/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%;}
+}

+ 143 - 0
admin/css/main.css

@@ -0,0 +1,143 @@
+/*公共样式*/
+.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 .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; font-size:20px; padding:0 10px; text-align: center; margin-right: 15px; line-height: 60px}
+.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; padding: 0 }
+.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-header {position: fixed;top: 0;left: 0;width: 100%;}
+.layui-layout-admin .layui-side-menu{background-color: #393D49;}
+
+/*左侧用户头像*/
+.layui-layout-admin .layui-side{ left:0;}
+.layui-side-menu .layui-nav { background: 0 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;}
+.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;}
+.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: 40px; 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
admin/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
admin/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
admin/css/systemTree.css

@@ -0,0 +1,38 @@
+.region, .role, .system{
+    height: calc(100vh - 30px);
+    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}

+ 28 - 0
admin/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; }
+}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 4 - 0
admin/iconfont/iconfont.css


BIN
admin/iconfont/iconfont.eot


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
admin/iconfont/iconfont.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 31 - 0
admin/iconfont/iconfont.svg


BIN
admin/iconfont/iconfont.ttf


BIN
admin/iconfont/iconfont.woff


+ 82 - 0
admin/index.js

@@ -0,0 +1,82 @@
+//入口js
+'use strict';
+//版本控制
+var versions = 'v_1.0';
+//不缓存
+versions = 'v_' + new Date().getTime();
+//加载完成全局数组
+var LOAD = [];
+//获取当前目录级别
+var script = document.querySelector('script[door]');
+var dire = ''; //目录
+var _dire = ''; //相对目录
+
+if (script) {
+	var jHtml = script.outerHTML,
+		srcS = 'src="',
+		strE = '"';
+	srcS = jHtml.indexOf(srcS) + srcS.length; //路径开始位置
+	strE = jHtml.indexOf(strE, srcS); //路径结束位置
+	jHtml = jHtml.substring(srcS, strE); //完整路径带文件名
+	strE = jHtml.lastIndexOf('/'); //查找倒数第一斜杠位置
+	dire = jHtml.substring(0, strE + 1); //完整相对路径
+	/**
+	 * (项目跟目录) 预留本地加载文件名,实现预先本地配置 貌似无法完成
+	 * 通过配置项目名(项目目录)来获取项目路劲进行全项目页面相对路径配置
+	 * 完成通过全域名引用admin框架
+	 * 目前未实现
+	 */
+	if (dire.lastIndexOf("../") > -1) {
+		_dire = dire.substr(0, dire.lastIndexOf("../") + 3);
+	}
+	//载入ajax拦截器,引入layui,载入配置文件
+	require(['js/ajaxhook.min.js', "layui/layui.js", 'js/config.js']);
+} else {
+	console.error("入口js标签没有关键属性 door");
+}
+
+//动态加载js函数 连接,成功或失败回调
+function require(url, type) {
+	if (!Array.isArray(url)) {
+		url = [url];
+	}
+	for (var i = 0; i < url.length; i++) {
+		___load('script', url[i], type);
+	}
+}
+//动态载入CSS
+function link(url, type) {
+	if (!Array.isArray(url)) {
+		url = [url];
+	}
+	for (var i = 0; i < url.length; i++) {
+		___load('link', url[i], type);
+	}
+}
+//加载公共函数
+function ___load(type, url, _type) {
+	//拼接地址
+	var href = dire + url;
+	//_type为true 不进行url转换
+	_type && (href = url);
+	//全路劲直接访问
+	(url.substr(0, 2) == '//' || /^http(s*):\/\//.test(url)) && (href = url);
+	//添加版本号
+	href = href + '?v=' + versions;
+	//js类型
+	if (type == 'script') {
+		document.write("<script type='text/javascript' src='" + href + "'></script>");
+	} else { //样式类型
+		document.write("<link rel='stylesheet' type='text/css' media='all' href='" + href + "'>");
+	}
+}
+
+//加载完毕执行
+function ready(callback) {
+	LOAD.push(callback);
+	window.onload = function() {
+		for (var i = 0; i < LOAD.length; i++) {
+			LOAD[i] && (typeof LOAD[i] == 'function') && LOAD[i]();
+		}
+	}
+}

+ 1 - 0
admin/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}}]);

+ 29 - 0
admin/js/common.js

@@ -0,0 +1,29 @@
+;
+layui.use('jquery', function() {
+	$ = layui.jquery;
+	$(function() {
+		layui.data('auth', null);
+		console.log('wo',location.searchObj().menuId)
+		if(location.searchObj().menuId){
+			console.log(2)
+			$.ajax({
+				url: 'getMenuBtn',
+				type: 'get',
+				data: {
+					menuId: location.searchObj().menuId || '0'
+				},
+				success: function(res) {
+					
+					if (res.code == 0) {
+						let auth = res.data[0];
+						layui.data('auth', {
+							key: 'data',
+							value: auth
+						})
+						console.log('ee', layui.data('auth').data);
+					}
+				}
+			});
+		}
+	});
+});

+ 338 - 0
admin/js/config.js

@@ -0,0 +1,338 @@
+;
+!(function(win) {
+	"use strict";
+	var pcLogin = function(){
+		let path = top.location.pathname.split('/');
+		path.splice(-1,1,'');
+		path = path.join('/');
+		console.log(path + 'login/');
+		top.location.href = path + 'login/';
+		return true;
+	};
+	window.hywa = {
+		config: {
+			href: '/buyer-side-web',
+			// href: 'http://172.16.90.125:8765',
+			port: {
+				login: '/user/pcLogin', //登录
+				loginOut: "/user/pcLogout", //退出
+				mainMenu: '/menu/sysMenuTree', //获取左侧菜单
+				changePassword: "/user/changePwd", //修改密码
+				check_userPhone: "/login/userCheck", //检验手机号
+				mainInfo: '/user/findSysInfoByUserId', //主页信息
+				uploadFileUrl: '/file/upload', //上传图片
+				getMenuBtn: '/menu/getButton', //获取菜单按钮
+
+				// 农产品
+				productTableUrl: '/product/findProductByWebFrom',
+				productBigTypeUrl: '/dict',
+				productSmallTypeUrl: '/dict/productSmallType',
+				productAddFormUrl: '/product',
+				productUpdateFormUrl: '/product/update',
+				productStatusUrl: '/product/onOff',
+				productByIdUrl: '/product',
+				del_productTableData: '/product',
+
+				// 店铺
+				shopTableUrl: '/sellerInfo',
+				shopStatusUrl: '/sellerInfo/isAvailable',
+				shopByIdUrl: '/sellerInfo',
+
+				// 用户-买家
+				userTableUrl: '/buyer/buyerList',
+				userByIdUrl: '/buyer/examine',
+				userStatusUrl: '/buyer/onOff',
+
+				// 骑手
+				riderTableUrl: '/rider',
+				riderAddFormUrl: '/rider',
+				riderUpdateFormUrl: '/rider',
+				riderByIdUrl: '/product',
+				riderDelUrl: '/rider',
+				riderStatusUrl: '/rider/available',
+
+				// 消息发布
+				mesTableUrl: '/announcement/findAnnouncementInfoAll',
+				mesStatusUrl: '/announcement/available',
+				mesFormUrl: '/announcement/saveOrUpdate',
+				mesByIdUrl: '/announcement/findAnnouncementById',
+				imgContentUpload: '/file/uploadImage',
+				show_img: '/file/showImage?filePath=',
+
+				// 交易统计
+				tradeTableUrl: '/analysis/transaction/list',
+				shopsTableUrl: '/analysis/seller/list',
+				tradeTotalUrl: '/analysis/transaction',
+				shopsTotalUrl: '/analysis/seller',
+				tradeExportUrl: '/analysis/transaction/excel',
+				shopExportUrl: '/analysis/seller/excel',
+
+				// 访客分析
+				visitorTableUrl: '/analysis/customer',
+				viewsVolumeUrl: '/analysis/views',
+
+				// 排行榜
+				goodsTableUrl: '/analysis/product/leaderboard',
+				sellerTableUrl: '/analysis/seller/leaderboard',
+
+				// 单品分析
+				singleGoodsTotalUrl: '/analysis/product',
+				singleGoodsTableUrl: '/analysis/product/details',
+				singleOrderVolumeUrl: '/analysis/orders',
+
+				multiTypeSelect: "/dict", //参数多条件查询
+				getProvince: "/region/province/index", //获取省
+				getCity: "/region/city/index", //获取市
+				getCounty: "/region/county/index", //获取县
+
+				// 订单
+				purchaseOrderTableUrl: "/orderInfo/list",
+				flowOrderTableUrl: "/transferOrder/findByOrderId",
+				orderByIdUrl: '/orderInfo/orderDetails',
+
+				// 骑手取货
+				riderPickTableUrl: '/transferOrder/list',
+				
+				//费用设置
+				costsSetUrl:'/costsSet',
+
+				// 权限
+				userList: "/user/findAll", //用户列表
+				userAddNew: "/user", //添加用户
+				delete_newAddUser: "/user", //删除用户
+				select_user: "/user/findById", //查询用户
+				forbidUser: '/user/disableUser', //禁止用户
+				purchaseUserList: '/user/findSpotName', //获取用户收购点信息
+
+				regionListUrl: '/area/search',
+				regionFormUrl: '/area',
+				roleDataList: "/role/getAll", //获取角色列表
+
+				roleListUrl: '/role/getAll',
+				roleFormUrl: '/role',
+				roleByid: '/role/findById',
+
+				menuListUrl: '/menu/getMenuByRole',
+				menuFormUrl: '/menu/saveRoleMenu',
+			}
+		},
+		sessionTable: {
+			tableName: 'system',
+			userData: 'userData',
+		},
+		jumpPage: {
+			home: "../index.html",
+			login: 'login/'
+		},
+		codeVerify: {
+			401: pcLogin,
+			402: pcLogin,
+			403: pcLogin,
+			404: pcLogin,
+			405: pcLogin,
+			1004: function() {
+				return true;
+			},
+			2006: function() {
+				return false;
+			},
+			default: function() {
+				return true;
+			}
+		},
+		//字体库,layui样式,自己的公共样式,所有页面样式
+		css: ['iconfont/iconfont.css', 'layui/css/layui.css', 'css/common.css'],
+		//需要加载的js
+		js: []
+	};
+	//加载样式
+	link(window.hywa.css);
+	//加载JS
+	require(window.hywa.js);
+
+	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]);
+		//xhr.lay_loading =  layer.load(0, {shade: false});
+		try {
+			if (!_this.url.userId) {
+				var token = layui.sessionData(window.hywa.sessionTable.tableName);
+				_this.url.userId = (JSON.stringify(token) != '{}' ? token.userData.userId : false);
+			}
+		} catch (e) {
+
+		}
+		// debugger
+		_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);
+		console.log("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 || "不知道怎么了!!!";
+			}
+			if (json.retBody && !!json.retBody.list && !!json.retBody.list.length) {
+				_this.json.count = json.retBody.total || 0;
+				_this.json.data = json.retBody.list || [];
+			} else if (json.retBody != "null" && !!json.retBody && Array.isArray(json.retBody.list) && !json.retBody.total) {
+				_this.json.data = [];
+			} else {
+				_this.json.data = Array.isArray(json.retBody) ? (function() {
+					_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);
+			xhr.setRequestHeader('accessToken', (JSON.stringify(token) != '{}' ? token.token : false));
+		}
+	};
+	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;
+}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 21 - 0
admin/js/echarts.min.js


+ 169 - 0
admin/js/layuiPlugins/cascade.js

@@ -0,0 +1,169 @@
+/**
+ * 请求接口格式
+ * {
+ }
+ */
+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);
+			_this.click(obj);
+			if(!obj.value){
+				return false;
+			};
+			_this.element(_this.formParm[x - 0 + 1], obj.value);
+			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);
+});

+ 760 - 0
admin/js/layuiPlugins/eleTree.js

@@ -0,0 +1,760 @@
+/**
+ * 基于layui的tree重写
+ * author: hsianglee
+ * 最近修改时间: 2018/09/26
+ */
+
+layui.define(["jquery", "laytpl", "layer", "form"], function (exports) {
+    var $ = layui.jquery;
+    var laytpl = layui.laytpl;
+    var layer = layui.layer;
+    var form = layui.form;
+
+    function Class(option) {
+        this.option = option;     // 获取传入的数据
+        this.elem = "";
+        this.data = [];
+        this.showCheckbox = this.option.showCheckbox;
+        this.showIcon = this.option.showIcon;
+        this.drag = this.option.drag;
+        this.accordion = this.option.accordion;
+        this.contextmenuList = [];
+        this.node = "";               // 生成树的dom字符串
+        this.checkedData = [];        // 被选中的数据
+        this.prevClickEle;          // 记录上次点击的dom
+        this.treeMenu = "";           // 右键菜单字符串
+        this.filter = "";
+        this.menuShow = this.option.menuShow;
+        this.open = this.option.open;
+
+        this.render();
+    }
+
+    Class.prototype = {
+        constructor: Class,
+        // 初始化参数数据
+        render: function () {
+            var self = this;
+            self.option.elem ? (function () {
+                self.elem = self.option.elem;
+            })() : (function () {
+                throw "缺少elem节点选择器";
+            })();
+            self.contextmenuList = self.option.contextmenuList ? self.option.contextmenuList : [];
+            self.filter = $(self.elem).attr("lay-filter");
+            // 判断data参数
+            if (self.option.data) {
+                self.data = self.option.data;
+                self.init();
+                return;
+            }
+            // 判断url参数
+            if (self.option.url) {
+                $.ajax({
+                    url: self.option.url,
+                    type: self.option.type ? self.option.type : "get",
+                    data: self.option.where ? self.option.where : {},
+                    success: function (data) {
+                        if (data.code === 0) {
+                            self.data = data.data;
+                            self.init();
+                            return;
+                        }
+                        layer.alert(data.Msg, { title: "选择器" + self.elem + "获取数据失败", icon: 2 });
+                    }
+                });
+                return;
+            }
+            throw "选择器" + self.elem + "缺少data或url参数";
+        },
+        // 初始化容器和标签
+        init: function () {
+            var self = this;
+            this.node = "";
+            $(this.elem).empty();
+            $(this.elem).off();
+            this.nodeInit(this.data, 0, false);
+
+            $(this.elem).html(this.node);
+            this.checkboxEvent();
+            // 更新选中的数据
+            this.getCheckedData();
+
+            this.drag && this.nodeDrag();
+
+            this.eleTreeEvent();
+            this.eleTreeClick();
+
+            this.contextmenuList.length && this.contextmenuList.length > 0 && this.rightClickMenu();
+            this.checkInit();
+
+        },
+        // dom生成
+        nodeInit: function (arr, count, spread) {
+            // count: 第几层
+            // spread: 是否不展开
+            var self = this;
+            var a = [];
+            arr.forEach(function (val, index) {
+                var b = ['<div class="eleTree-node ', spread ? 'eleTree-hide' : "", '" eleTree-floor="' + count + '">'
+                    , '<div class="eleTree-node-content" style="padding-left: ' + 18 * count + 'px;">'
+                    , '<span class="eleTree-node-content-icon">'
+                    // 判断叶子节点
+                    , (function () {
+                        if (val.children && val.children.length > 0) {
+                            var s = '<i class="layui-icon layui-icon-triangle-r ';
+                            if (val.spread) {
+                                s += 'icon-rotate';
+                            }
+                            s += ' "></i>'
+                            return s;
+                        } else {
+                            return '<i class="layui-icon layui-icon-triangle-r" style="color: transparent;"></i>'
+                        }
+                    })()
+                    , '</span>'
+                    // 判断是否启用checkbox
+                    , (function () {
+                        var s = '';
+                        if (self.showCheckbox) {
+                            s += '<input type="checkbox" value="' + val.id + '" name="eleTree-node"';
+                            if (val.checked == 1) {
+                                s += ' eleTree-status="1" checked '
+                            } else {
+                                s += ' eleTree-status="0"'
+                            }
+                            s += 'class="eleTree-hideen '
+                            if (self.open == 0) {
+                                val.disabled = true;
+                                if (val.disabled) {
+                                    s += 'eleTree-disabled'
+                                }
+                            }
+                            s += '" >';
+                        }
+
+                        return s;
+                    })()
+                    , (function () {
+                        if (self.showIcon) {
+                            return '<span class="eleTree-node-content-iconfont"><i class="layui-icon iconfont">' + val.icon + '</i></span>'
+                        }
+                    })()
+                    , (function () {
+                        if (self.menuShow) {
+                            return '<span class="eleTree-node-content-label">' + val.name + '</span>'
+                        } else {
+                            return '<span class="eleTree-node-content-label">' + val.areaName + '</span>'
+                        }
+                    })()
+                    , (function () {
+                        if (val.status == 2) {
+                            return '<span class="eleTree-node-content-btn"><i class="layui-icon layui-forbid iconfont icon-forbid"></i></span>'
+                        }
+                    })()
+                    , (function () {
+                        if (val.status == 1) {
+                            return '<span class="eleTree-node-content-btn"><i class="layui-icon layui-lock iconfont icon-lock"></i></span>'
+                        }
+                    })()
+                    , '</div>'
+                    , '<div class="eleTree-node-group">'
+                    , (function () {
+                        if (val.children && val.children.length > 0) {
+                            return self.nodeInit(val.children, count + 1, !val.spread);  // 获取已经遍历完的子节点
+                        }
+                    })()
+                    , '</div>'
+                    , '</div>'];
+                a = a.concat(b);
+            }, this);
+            this.node = a.join("");
+            return this.node;   // 返回已经遍历完的子节点
+        },
+        // 手风琴效果
+        accordionFn: function (ele, d) {
+            if (!this.accordion) return;
+            // 手风琴
+            var parentSibling = ele.parent(".eleTree-node").siblings(".eleTree-node");
+            parentSibling.children(".eleTree-node-group").children().slideUp("fast");
+            parentSibling.children(".eleTree-node-content").find(".layui-icon-triangle-r").removeClass("icon-rotate");
+            var parentData = d.parentData;
+            // 最外层判断
+            if (d.index.length === 1) {
+                this.data.forEach(function (val, index) {
+                    if (index !== parentData.childIndex) {
+                        delete val.spread;
+                    }
+                })
+            } else {
+                parentData.data.children.forEach(function (val, index) {
+                    if (index !== parentData.childIndex) {
+                        delete val.spread;
+                    }
+                })
+            }
+        },
+        // 展开合并动画
+        eleTreeEvent: function () {
+            var self = this;
+            $(this.elem).on("click", ".eleTree-node-content-icon", function (e) {
+                e.stopPropagation();
+                // 获取点击所在数据
+                var node = $(this).parents(".eleTree-node ");
+                var data = self.reInitData(node);
+                var d = data.currentData;
+                // 切换下拉
+                var el = $(this).find(".layui-icon-triangle-r");
+                if (el.hasClass("icon-rotate")) {
+                    $(this).parent(".eleTree-node-content").siblings(".eleTree-node-group").children().slideUp("fast");
+                    el.removeClass("icon-rotate");
+                    // 数据修改
+                    delete d.spread;
+                } else {
+                    $(this).parent(".eleTree-node-content").siblings(".eleTree-node-group").children().slideDown("fast");
+                    el.addClass("icon-rotate");
+                    // 数据修改
+                    d.spread = true;
+
+                    self.accordionFn($(this), data);
+
+                }
+                self.prevClickEle = $(this);
+
+                // 数据返回
+                layui.event.call(this, "eleTree", 'toggleSlide(' + self.filter + ')', {
+                    data: self.data
+                    , currentData: d
+                });
+
+                $("#tree-menu").hide().remove();
+            });
+            $(document).on("click", function () {
+                $("#tree-menu").hide().remove();
+            });
+        },
+        // 单击动画
+        eleTreeClick: function () {
+            var self = this;
+            $(this.elem).on("click", ".eleTree-node-content", function (e) {
+                if ($(this).find(".layui-lock").length > 0) {
+                    ;
+                    return true
+                }
+                e.stopPropagation();
+                // 添加active背景
+                $(".eleTree-node-content").removeClass("eleTree-node-content-active");
+                $(this).addClass("eleTree-node-content-active");
+                // 获取点击所在数据
+                var node = $(this).parent(".eleTree-node ");
+                var data = self.reInitData(node);
+                var d = data.currentData;
+                // 数据返回
+                layui.event.call(this, "eleTree", 'click(' + self.filter + ')', {
+                    currentData: d
+                });
+                $("#tree-menu").hide().remove();
+            });
+            $(document).on("click", function () {
+                $("#tree-menu").hide().remove();
+            });
+        },
+        // 右键菜单
+        rightClickMenu: function () {
+            var self = this;
+            var menuStr = ['<ul id="tree-menu" lay-filter="treeMenu">'
+                , $.inArray("copy", this.contextmenuList) !== -1 ? '<li class="copy"><a href="javascript:;">复制</a></li>' : ''
+                , $.inArray("add", this.contextmenuList) !== -1 ? '<li class="add"><a href="javascript:;">新增子区域</a></li>' : ''
+                , $.inArray("edit", this.contextmenuList) !== -1 ? '<li class="edit"><a href="javascript:;">修改</a></li>' : ''
+                , $.inArray("forbid", this.contextmenuList) !== -1 ? '<li class="forbid"><a href="javascript:;">禁用</a></li>' : ''
+                , $.inArray("remove", this.contextmenuList) !== -1 ? '<li class="remove"><a href="javascript:;">删除</a></li>' : ''
+                , '</ul>'].join("");
+            this.treeMenu = $(menuStr);
+            $(this.elem).on("contextmenu", ".eleTree-node-content", function (e) {
+                if ($(this).find(".eleTree-node-content-btn").length > 0) {
+                    ;
+                    return true
+                }
+                var _self = this;
+                e.stopPropagation();
+                e.preventDefault();
+                // 添加active背景
+                $(".eleTree-node-content").removeClass("eleTree-node-content-active");
+                if (self.prevClickEle) self.prevClickEle.removeClass("eleTree-node-content-active");
+                $(this).addClass("eleTree-node-content-active");
+
+                // 菜单位置
+                $(self.elem).after(self.treeMenu);
+                $("#tree-menu").css({
+                    left: e.pageX + 10,
+                    top: e.pageY - 30,
+                }).show();
+                // 复制
+                $("#tree-menu li.copy").off().on("click", function () {
+                    var el = $(_self).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 () {
+                    var node = $(_self).parent(".eleTree-node ");
+                    var data = self.reInitData(node);
+                    var d = data.parentData.data;
+                    // 数据返回
+                    layui.event.call(_self, "eleTree", 'add(' + self.filter + ')', {
+                        data: data.currentData,
+                        parentData: d
+                    });
+                });
+                // 删除
+                $("#tree-menu li.remove").off().on("click", function () {
+                    // 数据删除
+                    var node = $(_self).parent(".eleTree-node ");
+
+                    var data = self.reInitData(node);
+                    var d = data.parentData.data;
+                    var arr = data.index;
+                    console.log(data)
+                    // 最外层判断
+                    if (arr.length === 1) {
+                        self.data.splice(arr[arr.length - 1], 1);
+                    } else {
+                        if (d["children"]) {
+                            d["children"].splice(arr[arr.length - 1], 1);
+                            d["children"].length === 0 && delete d["children"];
+                        }
+                    }
+
+                    // 数据返回
+                    layui.event.call(_self, "eleTree", 'remove(' + self.filter + ')', {
+                        data: data.currentData
+                        , parentData: d
+                    });
+                    // dom删除
+                    var tem = $(_self).parent(".eleTree-node").parent(".eleTree-node-group");
+                    //$(_self).parent(".eleTree-node").remove();
+                    var isLeaf = tem.children(".eleTree-node").length === 0;
+                    isLeaf && tem.siblings(".eleTree-node-content").children(".eleTree-node-content-icon").children("i").css("color", "transparent").removeClass("icon-rotate");
+                });
+
+                // 禁用
+                $("#tree-menu li.forbid").off().on("click", function () {
+                    // 数据删除
+                    var node = $(_self).parent(".eleTree-node ");
+                    var data = self.reInitData(node);
+                    var d = data.parentData.data;
+                    var arr = data.index;
+                    // 最外层判断
+                    if (arr.length === 1) {
+                        self.data.splice(arr[arr.length - 1], 1);
+                    } else {
+                        if (d["children"]) {
+                            d["children"].splice(arr[arr.length - 1], 1);
+                            d["children"].length === 0 && delete d["children"];
+                        }
+                    }
+
+                    // 数据返回
+                    layui.event.call(_self, "eleTree", 'forbid(' + self.filter + ')', {
+                        data: data.currentData,
+                        parentData: d
+                    });
+                    // dom禁止
+                    var tem = $(_self).parent(".eleTree-node").parent(".eleTree-node-group");
+                    var isLeaf = tem.children(".eleTree-node").length === 0;
+                    isLeaf && tem.siblings(".eleTree-node-content").children(".eleTree-node-content-icon").children("i").css("color", "transparent").removeClass("icon-rotate");
+                });
+
+                self.prevClickEle = $(this);
+            })
+        },
+        // 自定义checkbox解析
+        checkboxRender: function () {
+            $(this.elem).find(this.elem + " .eleTree-checkbox").remove();
+            $(this.elem + " 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>');
+                }
+
+            })
+        },
+        // 通过子孙选中祖父(递归)
+        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");
+                // 父元素的icon
+                var parentIcon = parentCheckbox.children("i");
+                if (arr.every(function (val) {
+                    return val === "1";
+                })) {
+                    // 子都选中则选中父
+                    parentInput.prop("checked", "checked").attr("eleTree-status", "1");
+                    parentCheckbox.addClass("eleTree-checkbox-checked");
+                    parentIcon.addClass("layui-icon-ok").removeClass("eleTree-checkbox-line");
+                }
+                if (arr.some(function (val) {
+                    return val === "0" || val === "2";
+                })) {
+                    // 子有一个未选中则checkbox第三种状态
+                    // parentInput.prop("checked","checked");
+                    parentInput.attr("eleTree-status", "2");
+                    parentCheckbox.addClass("eleTree-checkbox-checked");
+                    parentIcon.removeClass("layui-icon-ok").addClass("eleTree-checkbox-line");
+                }
+                if (arr.every(function (val) {
+                    return val === "0";
+                })) {
+                    // 子全部未选中则取消父选中(并且取消第三种状态)
+                    parentInput.removeAttr("checked");
+                    parentInput.attr("eleTree-status", "0");
+                    parentCheckbox.removeClass("eleTree-checkbox-checked");
+                    parentIcon.removeClass("layui-icon-ok eleTree-checkbox-line");
+                }
+
+                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;
+            }
+        },
+        // checkbox添加选中事件
+        checkboxEvent: function () {
+            var self = this;
+            this.checkboxRender();
+            // input添加属性eleTree-status:即input的三种状态,"0":未选中,"1":选中,"2":子孙部分选中
+            $(this.elem).on("click", ".eleTree-checkbox", function (e) {
+                e.stopPropagation();
+                if ($(this).hasClass("eleTree-checkbox-disabled")) return;
+                // 获取点击所在数据
+                var node = $(this).parent(".eleTree-node-content").parent(".eleTree-node ");
+                var d = self.reInitData(node).currentData;
+                // 实际的input
+                var inp = $(this).siblings(".eleTree-hideen").get(0);
+                if (inp.checked) {
+                    $(inp).removeAttr("checked").attr("eleTree-status", "0");
+                    $(this).removeClass("eleTree-checkbox-checked");
+                    $(this).children("i").removeClass("layui-icon-ok eleTree-checkbox-line");
+                    // 数据更新
+                    delete d.checked;
+                } else {
+                    $(inp).prop("checked", "checked").attr("eleTree-status", "1");
+                    $(this).addClass("eleTree-checkbox-checked");
+                    $(this).children("i").addClass("layui-icon-ok").removeClass("eleTree-checkbox-line");
+                    d.checked = true;
+                }
+
+                var childNode = $(inp).parent(".eleTree-node-content").siblings(".eleTree-node-group").find("input[name='eleTree-node']");
+                // 点击祖父层选中子孙层
+                inp.checked ? (function () {
+                    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");
+                })() : (function () {
+                    childNode.removeAttr("checked");
+                    childNode.attr("eleTree-status", "0");
+                    childNode.siblings(".eleTree-checkbox").removeClass("eleTree-checkbox-checked");
+                    childNode.siblings(".eleTree-checkbox").children("i").removeClass("layui-icon-ok eleTree-checkbox-line");
+                })();
+
+
+                var eleNode = $(inp).parent(".eleTree-node-content").parent(".eleTree-node");
+                var siblingNode = eleNode.siblings(".eleTree-node");
+                // 点击子孙层选中祖父层(递归)
+                self.selectParents(inp, eleNode, siblingNode);
+                // 更新选中的数据
+                self.getCheckedData();
+
+                // 数据返回
+                layui.event.call(inp, "eleTree", 'checkbox(' + self.filter + ')', {
+                    data: self.data
+                    , checkedData: self.checkedData
+                    , currentData: d
+                });
+            })
+        },
+        // 拖拽
+        nodeDrag: function () {
+            var self = this;
+            $(this.elem).on("mousedown", ".eleTree-node-content", function (e) {
+                var _self = this;
+                var time = 0;
+                e.stopPropagation();
+                $(self.elem).css("user-select", "none");
+                var node = $(this).parent(".eleTree-node ");
+                var cloneNode = node.clone(true);
+                var temNode = node.clone(true);
+
+                var x = e.clientX - $(self.elem).offset().left;
+                var y = e.clientY - $(self.elem).offset().top;
+                $(self.elem).append(cloneNode);
+                cloneNode.css({
+                    display: "none",
+                    position: "absolute",
+                    "background-color": "#f5f5f5",
+                    width: "100%"
+                })
+                $("#tree-menu").hide().remove();
+
+                $(document.body).on("mousemove", function (e) {
+                    // t为了区别click事件
+                    time++;
+                    if (time > 2) {
+                        var xx = e.clientX - $(self.elem).offset().left + 10;
+                        var yy = e.clientY - $(self.elem).offset().top - 5;
+
+                        cloneNode.css({
+                            display: "block",
+                            left: xx + "px",
+                            top: yy + "px"
+                        })
+                    }
+                }).on("mouseup", function (e) {
+                    // dom更改
+                    var groupNode = node.parent(".eleTree-node-group");
+                    cloneNode.remove();
+                    $(self.elem).css("user-select", "auto");
+                    $(document.body).off("mousemove").off("mouseup");
+                    var target = $(e.target);
+                    // 数据更改
+                    var dataReset = function (len, childIndex, t) {
+                        // 删除数据
+                        var d = self.reInitData(node);
+                        var parentData = d.parentData.data;
+                        var temData = d.currentData;
+                        var i = d.parentData.childIndex;
+
+                        if (len === 0) {
+                            // 判断目标是否超出范围
+                            return false;
+                        }
+                        // 判断当前是否是最外层
+                        if (d.index.length === 1) {
+                            self.data.splice(d.index[0], 1);
+                        } else {
+                            parentData.children.splice(i, 1);
+                            parentData.children.length === 0 && delete parentData.children;
+                        }
+                        // 如果是同级的,并且从上面的移动到下面,则index减一
+                        var f1 = Number(node.attr("eletree-floor")) - 1;
+                        var f2 = Number(node.attr("eletree-floor")) - 1;
+                        if (i < childIndex && node.parents(".eleTree-node[eletree-floor='" + f1 + "']").get(0).isEqualNode(t.parents(".eleTree-node[eletree-floor='" + f2 + "']").get(0))) {
+                            childIndex = childIndex - 1;
+                        }
+
+                        return {
+                            temData: temData,
+                            childIndex: childIndex
+                        };
+                    }
+
+                    // 判断是否是同一个dom树
+                    var isOwnTarget = target.parents(".eleTree").length === 0 ? target.get(0) : target.parents(".eleTree").get(0);
+                    if (!(isOwnTarget.isEqualNode($(self.elem + ".eleTree").get(0)))) {
+                        return;
+                    }
+
+                    // 判断目标是否是最外层
+                    if (target.get(0).isEqualNode($(self.elem + ".eleTree").get(0))) {
+                        var dataRe = dataReset();
+                        var d = dataRe.temData;
+                        self.data.push(d);
+                        node.remove();
+                        // 添加节点
+                        $(self.elem + ".eleTree").append(temNode);
+                        // 改floor
+                        temNode.attr("eletree-floor", "0");
+                        // 加padding
+                        temNode.children(".eleTree-node-content").css("padding-left", "0px");
+                        // 原dom去三角
+                        var leaf = groupNode.children(".eleTree-node").length === 0;
+                        leaf && groupNode.siblings(".eleTree-node-content")
+                            .children(".eleTree-node-content-icon").children(".layui-icon-triangle-r")
+                            .removeClass("icon-rotate").css("color", "transparent");
+
+                        // 数据返回
+                        if (time > 2) {
+                            layui.event.call(_self, "eleTree", 'drag(' + self.filter + ')', {
+                                data: self.data
+                                , currentData: d
+                            });
+                            eleTree.reload(self.elem, { data: self.data });
+                        }
+                        return;
+                    }
+                    // 判断是否不是同一个dom节点或者是其子节点(父节点不能放到子节点)
+                    var t = target;
+                    if (!target.hasClass("eleTree-node-content")) {
+                        t = target.parents(".eleTree-node-content");
+                    }
+                    var f = Number(node.attr("eletree-floor"));
+                    var isNotParentsNode = node.get(0).isEqualNode(t.parents("[eletree-floor='" + f + "']").get(0));
+
+                    if (!isNotParentsNode) {
+                        var d = self.reInitData(t.parent(".eleTree-node"));
+                        var i = d.parentData.childIndex;
+                        var dataRe = dataReset(d.index.length, i, t);
+                        var temData = dataRe.temData;
+                        i = dataRe.childIndex;
+
+                        // 判断目标是否超出范围
+                        if (temData) {
+                            node.remove();
+                            // 添加之前先删dom
+                            var parentData = d.parentData.data;
+                            if (d.index.length === 1) {
+                                parentData.children ? parentData.children.push(temData) : parentData.children = [temData];
+                            } else {
+                                parentData.children[i].children ? parentData.children[i].children.push(temData) : parentData.children[i].children = [temData];
+                            }
+
+                            // 添加节点
+                            target.siblings(".eleTree-node-group").append(temNode);
+                            // 改floor
+                            var floor = Number(target.parent(".eleTree-node").attr("eletree-floor")) + 1;
+                            temNode.attr("eletree-floor", String(floor));
+                            // 加padding
+                            temNode.children(".eleTree-node-content").css("padding-left", floor * 18 + "px");
+                            // 加三角
+                            target.children(".eleTree-node-content-icon").children(".layui-icon-triangle-r")
+                                .addClass("icon-rotate").css("color", "#c0c4cc");
+                            // 原dom去三角
+                            var leaf = groupNode.children(".eleTree-node").length === 0;
+                            leaf && groupNode.siblings(".eleTree-node-content")
+                                .children(".eleTree-node-content-icon").children(".layui-icon-triangle-r")
+                                .removeClass("icon-rotate").css("color", "transparent");
+
+                            // 数据返回
+                            if (time > 2) {
+                                layui.event.call(_self, "eleTree", 'drag(' + self.filter + ')', {
+                                    data: self.data
+                                    , currentData: temData
+                                    , targetData: d.currentData
+                                });
+                                eleTree.reload(self.elem, { data: self.data });
+                            }
+                        }
+                    }
+
+                })
+
+
+            })
+        },
+        // 初始化checkbox选中状态
+        checkInit: function (arr, floor) {
+            var self = this;
+            $(self.elem + " 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);
+            })
+        },
+        // 获取选中的数据
+        getCheckedData: function () {
+            this.checkedData = [];
+            var self = this;
+            $(this.elem + " input[eletree-status='1']").each(function (index, item) {
+                var node = $(item).parent(".eleTree-node-content").parent(".eleTree-node ");
+                var d = self.reInitData(node).currentData;
+                self.checkedData.push(d);
+            });
+            return this.checkedData
+        },
+        // 通过dom节点找对应数据
+        reInitData: function (node) {
+            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.data;
+            // 当前节点的父节点数据
+            var parentData = oData[arr[0]];
+            // 当前节点的data数据
+            var d = oData[arr[0]];
+            for (var i = 1; i < arr.length; i++) {
+                d = d["children"] ? d["children"][arr[i]] : d;
+            }
+            for (var i = 1; i < arr.length - 1; i++) {
+                parentData = parentData["children"] ? parentData["children"][arr[i]] : parentData;
+            }
+            return {
+                currentData: d,
+                parentData: {
+                    data: parentData,
+                    childIndex: arr[arr.length - 1]
+                },
+                index: arr
+            }
+        },
+    }
+
+    var thisEleTree = function () {
+        thisEleTree.o[this.elem] = this;
+        thisEleTree.config[this.elem] = this.option;
+        thisEleTree.getCheckedData[this.elem] = this.getCheckedData;
+    }
+    // 保存当前对象(为了获取选中元素时改变this指向)
+    thisEleTree.o = {};
+    // 保存对象的option
+    thisEleTree.config = {};
+    // 获取选中的元素
+    thisEleTree.getCheckedData = {};
+
+    var eleTree = {
+        checkedData: function (elem) {
+            return thisEleTree.getCheckedData[elem].call(thisEleTree.o[elem]);
+        },
+        render: function (option) {
+            var inst = new Class(option);
+            thisEleTree.call(inst);
+        },
+        on: function (events, callback) {
+            return layui.onevent.call(this, "eleTree", events, callback);
+        },
+        reload: function (elem, option) {
+            var config = thisEleTree.config[elem];
+            this.render($.extend({}, config, option));
+        }
+    }
+
+    exports('eleTree', eleTree);
+})

+ 1733 - 0
admin/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();
+});

+ 411 - 0
admin/js/layuiPlugins/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;
+}

+ 332 - 0
admin/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
admin/js/layuiPlugins/treeGrid.css

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

+ 23 - 0
admin/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);
+});

+ 18 - 0
admin/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
admin/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);
+});

+ 58 - 0
admin/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].childMenus != undefined && data[i].childMenus.length > 0){
+			ulHtml += '<a href="javascript:;">';
+			if(data[i].icon != undefined && data[i].icon != ''){
+				if(data[i].icon - 0 == 0){
+					data[i].icon = "&nbsp;";
+				}
+				if(data[i].icon.indexOf("icon-") != -1){
+					ulHtml += '<i class="iconfont '+data[i].icon+'" data-icon="'+data[i].icon+'"></i>';
+				}else{
+					ulHtml += '<i class="layui-icon" data-icon="'+data[i].icon+'">'+data[i].icon+'</i>';
+				}
+			}
+			ulHtml += '<cite>'+data[i].name+'</cite>';
+			ulHtml += '<span class="layui-nav-more"></span>';
+			ulHtml += '</a>'
+			ulHtml += '<dl class="layui-nav-child">';
+			for(var j=0;j<data[i].childMenus.length;j++){
+				ulHtml += '<dd><a href="javascript:;" data-url="'+data[i].childMenus[j].description+'?menuId='+data[i].childMenus[j].id+'">';
+				if(data[i].childMenus[j].icon != undefined && data[i].childMenus[j].icon != ''){
+					if(data[i].childMenus[j].icon - 0 == 0){
+						data[i].childMenus[j].icon = "&nbsp;";
+					}
+					if(data[i].childMenus[j].icon.indexOf("icon-") != -1){
+						ulHtml += '<i class="iconfont '+data[i].childMenus[j].icon+'" data-icon="'+data[i].childMenus[j].icon+'"></i>';
+					}else{
+						ulHtml += '<i class="layui-icon" data-icon="'+data[i].childMenus[j].icon+'">'+data[i].childMenus[j].icon+'</i>';
+					}
+				}
+				ulHtml += '<cite>'+data[i].childMenus[j].name+'</cite></a></dd>';
+			}
+			ulHtml += "</dl>"
+		}else{
+			ulHtml += '<a href="javascript:;" data-url="'+data[i].description+'?menuId='+data[i].id+'">';
+			if(data[i].icon != undefined && data[i].icon != ''){
+				if(data[i].icon - 0 == 0){
+					data[i].icon = "&nbsp;";
+				}
+				if(data[i].icon.indexOf("icon-") != -1){
+					ulHtml += '<i class="iconfont '+data[i].icon+'" data-icon="'+data[i].icon+'"></i>';
+				}else{
+					ulHtml += '<i class="layui-icon" data-icon="'+data[i].icon+'">'+data[i].icon+'</i>';
+				}
+			}
+			ulHtml += '<cite>'+data[i].name+'</cite></a>';
+		}
+		ulHtml += '</li>'
+	}
+	ulHtml += '</ul>';
+	return ulHtml;
+}

+ 98 - 0
admin/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
admin/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);

+ 140 - 0
admin/js/nav.js

@@ -0,0 +1,140 @@
+var navs = [{
+    "id": 1,
+    "name": "基础设置",
+    "icon": "",
+    "description": "",
+	url:'',
+    "childrenMenu": [{
+            "name": "农产品基础信息",
+            "icon": "&nbsp;",
+            "description": "page/basicsSet/productBasicsInfo.html",
+            "spread": true
+        },
+        {
+            "name": "市场基础信息",
+            "icon": "&nbsp;",
+            "description": "page/basicsSet/marketBasisInfo.html",
+            "spread": true
+        }
+    ]
+}, {
+    "id": 2,
+    "name": "价格数据",
+    "icon": "&#xe65e;",
+    "description": "",
+    "spread": true,
+    "childrenMenu": [{
+            "name": "导入数据",
+            "icon": "&nbsp;",
+            "description": "page/priceData/importData.html",
+            "spread": true
+        },
+        {
+            "name": "数据列表",
+            "icon": "&nbsp;",
+            "description": "page/priceData/priceDataList/",
+            "spread": true
+        },
+        {
+            "name": "价格设置",
+            "icon": "&nbsp;",
+            "description": "page/priceData/priceSet/",
+            "spread": true,
+			"childrenMenu": [{
+					"name": "导入数据",
+					"icon": "&nbsp;",
+					"description": "page/priceData/importData.html",
+					"spread": true
+				},
+				{
+					"name": "数据列表",
+					"icon": "&nbsp;",
+					"description": "page/priceData/priceDataList/",
+					"spread": true
+				},
+				{
+					"name": "价格设置",
+					"icon": "&nbsp;",
+					"description": "page/priceData/priceSet/",
+					"spread": true,
+					"childrenMenu": [{
+							"name": "导入数据",
+							"icon": "&nbsp;",
+							"description": "page/priceData/importData.html",
+							"spread": true
+						},
+						{
+							"name": "数据列表",
+							"icon": "&nbsp;",
+							"description": "page/priceData/priceDataList/",
+							"spread": true
+						},
+						{
+							"name": "价格设置",
+							"icon": "&nbsp;",
+							"description": "page/priceData/priceSet/",
+							"spread": true
+						}
+					]
+				}
+			]
+        }
+    ]
+}, {
+    "id": 4,
+    "name": "系统设置",
+    "icon": "&#xe631;",
+    "description": "page/systemParameter/systemParameter.html",
+    "spread": true,
+    "childrenMenu": [{
+            "name": "角色管理",
+            "icon": "&nbsp;",
+            "description": "/page/systemParameter/systemRole/",
+            "spread": true
+        },
+        {
+            "name": "用户管理",
+            "icon": "&nbsp;",
+            "description": "page/systemParameter/userManagement",
+            "spread": true
+        },
+        {
+            "name": "菜单管理",
+            "icon": "&nbsp;",
+            "description": "page/systemParameter/systemMenu",
+            "spread": true
+        }
+    ]
+}];
+// , {
+// 	"id":3,
+//     "name": "数据分析",
+//     "icon": "&#xe629;",
+//     "description": "",
+//     "spread": true,
+//     "childrenMenu": [{
+//             "name": "排行榜",
+//             "icon": "&nbsp;",
+//             "description": "page/basicsSet/productBasicsInfo.html",
+//             "spread": true
+//         },
+//         {
+//             "name": "增长率",
+//             "icon": "&nbsp;",
+//             "description": "page/main.html",
+//             "spread": true
+//         },
+//         {
+//             "name": "价格走势",
+//             "icon": "&nbsp;",
+//             "description": "page/main.html",
+//             "spread": true
+//         },
+//         {
+//             "name": "价格举报",
+//             "icon": "&nbsp;",
+//             "description": "page/main.html",
+//             "spread": true
+//         }
+//     ]
+// }

+ 160 - 0
admin/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 */

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 158 - 0
admin/layui/css/formSelects-v4.css


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 0
admin/layui/css/layui.css


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 0
admin/layui/css/layui.mobile.css


+ 2 - 0
admin/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}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 0
admin/layui/css/modules/laydate/default/laydate.css


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


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 0
admin/layui/css/modules/laydate/laydate.css


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


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


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 0
admin/layui/css/modules/layer/default/layer.css


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


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


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


+ 134 - 0
admin/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
admin/layui/font/iconfont.eot


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 25 - 0
admin/layui/font/iconfont.svg


BIN
admin/layui/font/iconfont.ttf


BIN
admin/layui/font/iconfont.woff


BIN
admin/layui/images/face/0.gif


BIN
admin/layui/images/face/1.gif


BIN
admin/layui/images/face/10.gif


BIN
admin/layui/images/face/11.gif


BIN
admin/layui/images/face/12.gif


BIN
admin/layui/images/face/13.gif


BIN
admin/layui/images/face/14.gif


BIN
admin/layui/images/face/15.gif


BIN
admin/layui/images/face/16.gif


BIN
admin/layui/images/face/17.gif


BIN
admin/layui/images/face/18.gif


BIN
admin/layui/images/face/19.gif


BIN
admin/layui/images/face/2.gif


BIN
admin/layui/images/face/20.gif


BIN
admin/layui/images/face/21.gif


BIN
admin/layui/images/face/22.gif


BIN
admin/layui/images/face/23.gif


BIN
admin/layui/images/face/24.gif


BIN
admin/layui/images/face/25.gif


BIN
admin/layui/images/face/26.gif


BIN
admin/layui/images/face/27.gif


BIN
admin/layui/images/face/28.gif


BIN
admin/layui/images/face/29.gif


BIN
admin/layui/images/face/3.gif


BIN
admin/layui/images/face/30.gif


BIN
admin/layui/images/face/31.gif


BIN
admin/layui/images/face/32.gif


BIN
admin/layui/images/face/33.gif


BIN
admin/layui/images/face/34.gif


BIN
admin/layui/images/face/35.gif


BIN
admin/layui/images/face/36.gif


BIN
admin/layui/images/face/37.gif


BIN
admin/layui/images/face/38.gif


BIN
admin/layui/images/face/39.gif


BIN
admin/layui/images/face/4.gif


BIN
admin/layui/images/face/40.gif


BIN
admin/layui/images/face/41.gif


BIN
admin/layui/images/face/42.gif


BIN
admin/layui/images/face/43.gif


BIN
admin/layui/images/face/44.gif


BIN
admin/layui/images/face/45.gif


BIN
admin/layui/images/face/46.gif


BIN
admin/layui/images/face/47.gif


BIN
admin/layui/images/face/48.gif


BIN
admin/layui/images/face/49.gif


BIN
admin/layui/images/face/5.gif


BIN
admin/layui/images/face/50.gif


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio