Bladeren bron

initialization

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

+ 29 - 0
404.html

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

+ 42 - 2
README.md

@@ -1,3 +1,43 @@
-# forest-traced-UI
+## forest-traced-UI
 
-林产品溯源管理系统-UI
+```bash
+# 项目名称
+林产品溯源管理系统-UI
+
+# version
+1.0.0
+
+# 入口首页
+./index.html
+```
+
+## 开发
+
+```bash
+# 开发 company
+信通达智能科技有限公司 (http://www.gz-xtd.com)
+
+# 开发 author
+Rockery (1113269755@qq.com)
+```
+
+## Features
+
+```bash
+- 首页 / index.html
+
+- Error Page
+  - 404.html
+
+- css
+- iconfont
+- images
+- js
+- layui
+- login
+- main
+- pages
+- user
+```
+
+Copyright (c) 2020-present www.gz-xtd.com 信通达智能科技有限公司

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


+ 127 - 0
css/common.css

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

+ 127 - 0
css/font_eolqem241z66flxr.css

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

+ 21 - 0
css/images.css

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

+ 82 - 0
css/inputTags.css

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

File diff suppressed because it is too large
+ 142 - 0
css/main.css


+ 15 - 0
css/message.css

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

+ 8 - 0
css/news.css

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

+ 38 - 0
css/systemTree.css

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

+ 28 - 0
css/user.css

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

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


BIN
iconfont/iconfont.eot


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


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


BIN
iconfont/iconfont.ttf


BIN
iconfont/iconfont.woff


BIN
images/face.jpg


BIN
images/favicon.ico


BIN
images/favicon_ab.ico


+ 16 - 0
index.html

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

+ 153 - 0
js/LodopFuncs.js

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

+ 215 - 0
js/a.js

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

File diff suppressed because it is too large
+ 1 - 0
js/ajaxhook.min.js


+ 435 - 0
js/config.js

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

+ 411 - 0
js/layui-xtree.js

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

+ 170 - 0
js/layuiPlugins/cascade.js

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

+ 141 - 0
js/layuiPlugins/cascade_bak.js

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

File diff suppressed because it is too large
+ 2182 - 0
js/layuiPlugins/dltable.js


File diff suppressed because it is too large
+ 1216 - 0
js/layuiPlugins/eleTree.js


File diff suppressed because it is too large
+ 1733 - 0
js/layuiPlugins/formSelects-v4.js


+ 79 - 0
js/layuiPlugins/inputTags.css

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

+ 29 - 0
js/layuiPlugins/inputTags.html

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

+ 128 - 0
js/layuiPlugins/inputTags.js

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

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

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

+ 167 - 0
js/layuiPlugins/md5.js

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

+ 332 - 0
js/layuiPlugins/step.js

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

+ 3 - 0
js/layuiPlugins/treeGrid.css

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

+ 23 - 0
js/layuiPlugins/treeGrid.js

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

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


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

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

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

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

+ 18 - 0
js/layuiPlugins/treetable.css

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

+ 204 - 0
js/layuiPlugins/treetable.js

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

+ 58 - 0
js/leftNav.js

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

+ 98 - 0
js/main.js

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

+ 167 - 0
js/md5.js

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

+ 160 - 0
layui/css/eleTree.css

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

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


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


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


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


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


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


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


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


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


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


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


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


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


+ 134 - 0
layui/css/step.css

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

BIN
layui/font/iconfont.eot


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


BIN
layui/font/iconfont.ttf


BIN
layui/font/iconfont.woff


BIN
layui/images/face/0.gif


BIN
layui/images/face/1.gif


BIN
layui/images/face/10.gif


BIN
layui/images/face/11.gif


BIN
layui/images/face/12.gif


BIN
layui/images/face/13.gif


BIN
layui/images/face/14.gif


BIN
layui/images/face/15.gif


BIN
layui/images/face/16.gif


BIN
layui/images/face/17.gif


BIN
layui/images/face/18.gif


BIN
layui/images/face/19.gif


BIN
layui/images/face/2.gif


BIN
layui/images/face/20.gif


BIN
layui/images/face/21.gif


BIN
layui/images/face/22.gif


BIN
layui/images/face/23.gif


BIN
layui/images/face/24.gif


BIN
layui/images/face/25.gif


BIN
layui/images/face/26.gif


BIN
layui/images/face/27.gif


BIN
layui/images/face/28.gif


BIN
layui/images/face/29.gif


BIN
layui/images/face/3.gif


BIN
layui/images/face/30.gif


BIN
layui/images/face/31.gif


BIN
layui/images/face/32.gif


BIN
layui/images/face/33.gif


BIN
layui/images/face/34.gif


BIN
layui/images/face/35.gif


BIN
layui/images/face/36.gif


BIN
layui/images/face/37.gif


+ 0 - 0
layui/images/face/38.gif


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