瀏覽代碼

同步更新pro交互优化和代码优化

zhouchenglin 6 年之前
父節點
當前提交
2507e7ea38
共有 26 個文件被更改,包括 993 次插入806 次删除
  1. 3 0
      src/main/java/net/chenlin/dp/modules/sys/mapper/QuartzJobLogMapper.xml
  2. 22 2
      src/main/resources/template/Entity.java.btl
  3. 1 2
      src/main/resources/template/list.html.btl
  4. 48 34
      src/main/resources/template/list.js.btl
  5. 1 3
      src/main/webapp/WEB-INF/view/base/area/list.html
  6. 1 1
      src/main/webapp/WEB-INF/view/base/generator/list.html
  7. 1 1
      src/main/webapp/WEB-INF/view/base/log/list.html
  8. 1 3
      src/main/webapp/WEB-INF/view/base/macro/list.html
  9. 1 4
      src/main/webapp/WEB-INF/view/base/menu/list.html
  10. 1 3
      src/main/webapp/WEB-INF/view/base/org/list.html
  11. 1 8
      src/main/webapp/WEB-INF/view/base/quartz/list.html
  12. 1 9
      src/main/webapp/WEB-INF/view/base/role/list.html
  13. 1 11
      src/main/webapp/WEB-INF/view/base/user/list.html
  14. 11 20
      src/main/webapp/static/css/common.min.css
  15. 67 34
      src/main/webapp/static/js/base/area/list.js
  16. 36 21
      src/main/webapp/static/js/base/generator/list.js
  17. 34 16
      src/main/webapp/static/js/base/log/list.js
  18. 66 34
      src/main/webapp/static/js/base/macro/list.js
  19. 69 35
      src/main/webapp/static/js/base/menu/list.js
  20. 67 34
      src/main/webapp/static/js/base/org/list.js
  21. 81 87
      src/main/webapp/static/js/base/quartz/list.js
  22. 1 0
      src/main/webapp/static/js/base/quartz/log.js
  23. 92 72
      src/main/webapp/static/js/base/role/list.js
  24. 81 87
      src/main/webapp/static/js/base/user/list.js
  25. 31 1
      src/main/webapp/static/js/common.js
  26. 274 284
      src/main/webapp/static/plugins/validator/validator.js

+ 3 - 0
src/main/java/net/chenlin/dp/modules/sys/mapper/QuartzJobLogMapper.xml

@@ -17,6 +17,9 @@
 		FROM
 			quartz_job_log
 		<where>
+			<if test="jobId != null and jobId.trim() != ''">
+				AND job_id = #{jobId}
+			</if>
 			<if test="name != null and name.trim() != ''">
 				AND bean_name LIKE concat('%',#{name},'%')
 			</if>

+ 22 - 2
src/main/resources/template/Entity.java.btl

@@ -23,7 +23,9 @@ public class ${className}Entity implements Serializable {
 	private ${column.fieldType} ${column.fieldName};
 	
 <% } %>
-
+    /**
+     * ${className}Entity constructor
+     */
 	public ${className}Entity() {
 		super();
 	}
@@ -43,6 +45,24 @@ public class ${className}Entity implements Serializable {
 	public ${column.fieldType} get${column.methodName}() {
 		return ${column.fieldName};
 	}
-	
+
 <% } %>
+    /**
+     * ${className}Entity.toString()
+     */
+    @Override
+    public String toString() {
+        return "${className}Entity{" +
+               <% for (column in columns) { %>
+               <% if (columnLP.first) { %>
+               "${column.fieldName}='" + ${column.fieldName} + '\'' +
+               <% } else { %>
+               ", ${column.fieldName}='" + ${column.fieldName} + '\'' +
+               <% } %>
+               <% if (columnLP.last) { %>
+               '}';
+               <% } %>
+               <% } %>
+    }
+
 }

+ 1 - 2
src/main/resources/template/list.html.btl

@@ -13,8 +13,7 @@
             <div class="btn-group">
                 <a v-if="hasPermission('${authKey}:list')" class="btn btn-default" onclick="reload();"><i class="fa fa-refresh"></i>&nbsp;刷新</a>
                 <a v-if="hasPermission('${authKey}:save')" class="btn btn-default" \@click="save"><i class="fa fa-plus"></i>&nbsp;新增</a>
-                <a v-if="hasPermission('${authKey}:edit')" class="btn btn-default" \@click="edit"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
-                <a v-if="hasPermission('${authKey}:remove')" class="btn btn-default" \@click="remove"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
+                <a v-if="hasPermission('${authKey}:remove')" class="btn btn-default" \@click="remove(true)"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
             </div>
         </div>
     </div>

+ 48 - 34
src/main/resources/template/list.js.btl

@@ -25,9 +25,20 @@ function getGrid() {
 			{checkbox: true},
 <% for(column in columns!) { %>
     <% if(column.columnName != pk.columnName || pk.extra != 'auto_increment') { %>
-            {field : "${column.fieldName}", title : "${column.columnComment}", width : "100px"}<% if(!columnLP.last) {%>,<%} %>
+            {field : "${column.fieldName}", title : "${column.columnComment}", width : "100px"},
     <% } %>
 <% } %>
+            {title : "操作", formatter : function(value, row, index) {
+                    var _html = '';
+                    if (hasPermission('${authKey}:edit')) {
+                        _html += '<a href="javascript:;" onclick="vm.edit(\''+row.${pk.fieldName}+'\')" title="编辑"><i class="fa fa-pencil"></i></a>';
+                    }
+                    if (hasPermission('${authKey}:remove')) {
+                        _html += '<a href="javascript:;" onclick="vm.remove(false,\''+row.${pk.fieldName}+'\')" title="删除"><i class="fa fa-trash-o"></i></a>';
+                    }
+                    return _html;
+                }
+            }
 		]
 	})
 }
@@ -52,38 +63,41 @@ var vm = new Vue({
 				},
 			});
 		},
-		edit: function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections');
-			if(checkedRow(ck)){
-				dialogOpen({
-					title: '编辑${comments}',
-					url: '${viewPath}/edit.html?_' + $.now(),
-					width: '420px',
-					height: '350px',
-					success: function(iframeId){
-						top.frames[iframeId].vm.${objName}.${pk.fieldName} = ck[0].${pk.fieldName};
-						top.frames[iframeId].vm.setForm();
-					},
-					yes: function(iframeId){
-						top.frames[iframeId].vm.acceptClick();
-					}
-				});
-			}
-		},
-		remove: function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];	
-			if(checkedArray(ck)){
-				$.each(ck, function(idx, item){
-					ids[idx] = item.${pk.fieldName};
-				});
-				$.RemoveForm({
-					url: '../../${requestMapping}/remove?_' + $.now(),
-			    	param: ids,
-			    	success: function(data) {
-			    		vm.load();
-			    	}
-				});
-			}
-		}
+		edit: function(${pk.fieldName}) {
+            dialogOpen({
+                title: '编辑${comments}',
+                url: '${viewPath}/edit.html?_' + $.now(),
+                width: '420px',
+                height: '350px',
+                success: function(iframeId){
+                    top.frames[iframeId].vm.${objName}.${pk.fieldName} = ${pk.fieldName};
+                    top.frames[iframeId].vm.setForm();
+                },
+                yes: function(iframeId){
+                    top.frames[iframeId].vm.acceptClick();
+                }
+            });
+        },
+        remove: function(batch, ${pk.fieldName}) {
+            var ids = [];
+            if (batch) {
+                var ck = $('#dataGrid').bootstrapTable('getSelections');
+                if (!checkedArray(ck)) {
+                    return false;
+                }
+                $.each(ck, function(idx, item){
+                    ids[idx] = item.${pk.fieldName};
+                });
+            } else {
+                ids.push(${pk.fieldName});
+            }
+            $.RemoveForm({
+                url: '../../${requestMapping}/remove?_' + $.now(),
+                param: ids,
+                success: function(data) {
+                    vm.load();
+                }
+            });
+        }
 	}
 })

+ 1 - 3
src/main/webapp/WEB-INF/view/base/area/list.html

@@ -29,9 +29,7 @@
                                         class="fa fa-refresh"></i>&nbsp;刷新</a>
                                 <a v-if="hasPermission('sys:area:save')" class="btn btn-default" \@click="save"><i
                                         class="fa fa-plus"></i>&nbsp;新增</a>
-                                <a v-if="hasPermission('sys:area:edit')" class="btn btn-default" \@click="edit"><i
-                                        class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
-                                <a v-if="hasPermission('sys:area:remove')" class="btn btn-default" \@click="remove"><i
+                                <a v-if="hasPermission('sys:area:remove')" class="btn btn-default" \@click="remove(true)"><i
                                         class="fa fa-trash-o"></i>&nbsp;删除</a>
                             </div>
                         </div>

+ 1 - 1
src/main/webapp/WEB-INF/view/base/generator/list.html

@@ -13,7 +13,7 @@
         <div class="btn-toolbar pull-right">
             <div class="btn-group">
                 <a class="btn btn-default" onclick="reload();"><i class="fa fa-refresh"></i>&nbsp;刷新</a>
-                <a class="btn btn-default" \@click="generate"><i class="fa fa-plus"></i>&nbsp;生成代码</a>
+                <a class="btn btn-default" \@click="generate(true)"><i class="fa fa-plus"></i>&nbsp;生成代码</a>
             </div>
         </div>
     </div>

+ 1 - 1
src/main/webapp/WEB-INF/view/base/log/list.html

@@ -29,7 +29,7 @@
             <div class="btn-group">
                 <a v-if="hasPermission('sys:log:list')" class="btn btn-default" onclick="reload();"><i
                         class="fa fa-refresh"></i>&nbsp;刷新</a>
-                <a v-if="hasPermission('sys:log:remove')" class="btn btn-default" \@click="remove"><i
+                <a v-if="hasPermission('sys:log:remove')" class="btn btn-default" \@click="remove(true)"><i
                         class="fa fa-trash-o"></i>&nbsp;删除</a>
                 <a v-if="hasPermission('sys:log:clear')" class="btn btn-default" \@click="clear"><i
                         class="fa fa-eraser"></i>&nbsp;清空</a>

+ 1 - 3
src/main/webapp/WEB-INF/view/base/macro/list.html

@@ -7,9 +7,7 @@
                         class="fa fa-refresh"></i>&nbsp;刷新</a>
                 <a v-if="hasPermission('sys:macro:save')" class="btn btn-default" \@click="save"><i
                         class="fa fa-plus"></i>&nbsp;新增</a>
-                <a v-if="hasPermission('sys:macro:edit')" class="btn btn-default" \@click="edit"><i
-                        class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
-                <a v-if="hasPermission('sys:macro:remove')" class="btn btn-default" \@click="remove"><i
+                <a v-if="hasPermission('sys:macro:remove')" class="btn btn-default" \@click="remove(true)"><i
                         class="fa fa-trash-o"></i>&nbsp;删除</a>
             </div>
         </div>

+ 1 - 4
src/main/webapp/WEB-INF/view/base/menu/list.html

@@ -9,10 +9,7 @@
                 <a v-if="hasPermission('sys:menu:save')" class="btn btn-default" \@click="save"><i
                         class="fa fa-plus"></i>&nbsp;新增
                 </a>
-                <a v-if="hasPermission('sys:menu:edit')" class="btn btn-default" \@click="edit"><i
-                        class="fa fa-pencil-square-o"></i>&nbsp;编辑
-                </a>
-                <a v-if="hasPermission('sys:menu:remove')" class="btn btn-default" \@click="remove"><i
+                <a v-if="hasPermission('sys:menu:remove')" class="btn btn-default" \@click="remove(true)"><i
                         class="fa fa-trash-o"></i>&nbsp;删除
                 </a>
             </div>

+ 1 - 3
src/main/webapp/WEB-INF/view/base/org/list.html

@@ -7,9 +7,7 @@
                         class="fa fa-refresh"></i>&nbsp;刷新</a>
                 <a v-if="hasPermission('sys:org:save')" class="btn btn-default" \@click="save"><i
                         class="fa fa-plus"></i>&nbsp;新增</a>
-                <a v-if="hasPermission('sys:org:edit')" class="btn btn-default" \@click="edit"><i
-                        class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
-                <a v-if="hasPermission('sys:org:remove')" class="btn btn-default" \@click="remove"><i
+                <a v-if="hasPermission('sys:org:remove')" class="btn btn-default" \@click="remove(true)"><i
                         class="fa fa-trash-o"></i>&nbsp;删除</a>
             </div>
         </div>

+ 1 - 8
src/main/webapp/WEB-INF/view/base/quartz/list.html

@@ -13,14 +13,7 @@
 			<div class="btn-group">
 				<a v-if="hasPermission('quartz:job:list')" class="btn btn-default" onclick="reload();"><i class="fa fa-refresh"></i>&nbsp;刷新</a>
 				<a v-if="hasPermission('quartz:job:save')" class="btn btn-default" \@click="save"><i class="fa fa-plus"></i>&nbsp;新增</a>
-				<a v-if="hasPermission('quartz:job:edit')" class="btn btn-default" \@click="edit"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
-				<a v-if="hasPermission('quartz:job:remove')" class="btn btn-default" \@click="remove"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
-				<a v-if="hasPermission('quartz:job:more')" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">更多&nbsp;<span class="caret"></span></a>
-				<ul class="dropdown-menu pull-right">
-					<li><a v-if="hasPermission('quartz:job:enable')" \@click="enable">&nbsp;启用</a></li>
-					<li><a v-if="hasPermission('quartz:job:disable')" \@click="disable">&nbsp;禁用</a></li>
-					<li><a v-if="hasPermission('quartz:job:run')" \@click="run">&nbsp;立即执行</a></li>
-				</ul>
+				<a v-if="hasPermission('quartz:job:remove')" class="btn btn-default" \@click="remove(true)"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
 			</div>
 			<div class="btn-group">
 				<a v-if="hasPermission('quartz:log:list')" class="btn btn-default" href="log.html"><i class="fa fa-warning"></i>&nbsp;日志列表</a>

+ 1 - 9
src/main/webapp/WEB-INF/view/base/role/list.html

@@ -16,17 +16,9 @@
                         class="fa fa-refresh"></i>&nbsp;刷新</a>
                 <a v-if="hasPermission('sys:role:save')" class="btn btn-default" \@click="save"><i
                         class="fa fa-plus"></i>&nbsp;新增</a>
-                <a v-if="hasPermission('sys:role:edit')" class="btn btn-default" \@click="edit"><i
-                        class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
-                <a v-if="hasPermission('sys:role:remove')" class="btn btn-default" \@click="remove"><i
+                <a v-if="hasPermission('sys:role:remove')" class="btn btn-default" \@click="remove(true)"><i
                         class="fa fa-trash-o"></i>&nbsp;删除</a>
             </div>
-            <div class="btn-group">
-                <a v-if="hasPermission('sys:role:authorizeOpt')" class="btn btn-default" \@click="authorizeOpt"><i
-                        class="fa fa-gavel"></i>&nbsp;操作权限</a>
-                <a v-if="hasPermission('sys:role:authorizeData')" class="btn btn-default" \@click="authorizeData"><i
-                        class="fa fa-eye"></i>&nbsp;数据权限</a>
-            </div>
         </div>
     </div>
 </div>

+ 1 - 11
src/main/webapp/WEB-INF/view/base/user/list.html

@@ -16,19 +16,9 @@
                         class="fa fa-refresh"></i>&nbsp;刷新</a>
                 <a v-if="hasPermission('sys:user:save')" class="btn btn-default" \@click="save"><i
                         class="fa fa-plus"></i>&nbsp;新增</a>
-                <a v-if="hasPermission('sys:user:edit')" class="btn btn-default" \@click="edit"><i
-                        class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
-                <a v-if="hasPermission('sys:user:remove')" class="btn btn-default" \@click="remove"><i
+                <a v-if="hasPermission('sys:user:remove')" class="btn btn-default" \@click="remove(true)"><i
                         class="fa fa-trash-o"></i>&nbsp;删除</a>
             </div>
-            <div class="btn-group">
-                <a v-if="hasPermission('sys:user:disable')" class="btn btn-default" \@click="disable"><i
-                        class="fa fa-pause"></i>&nbsp;禁用</a>
-                <a v-if="hasPermission('sys:user:enable')" class="btn btn-default" \@click="enable"><i
-                        class="fa fa-play"></i>&nbsp;启用</a>
-                <a v-if="hasPermission('sys:user:resetPassword')" class="btn btn-default" \@click="reset"><i
-                        class="fa fa-key"></i>&nbsp;重置密码</a>
-            </div>
         </div>
     </div>
 </div>

+ 11 - 20
src/main/webapp/static/css/common.min.css

@@ -29,23 +29,14 @@ tbody > tr > th {font-weight: normal; }
 .no-padding{padding:0px}
 table .fa-toggle-on{color: #449d44;font-size: 14pt;vertical-align: middle;margin-top: -1px;}
 table .fa-toggle-off{color: #aaa;font-size: 14pt;vertical-align: middle;margin-top: -1px;}
-/* * css: 表单校验提示 * ----------*/
-.poptip{z-index:1000;position: absolute;top: 20px;left:20px;padding: 6px 10px 6px;*padding: 7px 10px 5px;line-height: 16px;color: #fff;font-size: 12px;background-color: #B94A48;border: solid 1px #B94A48;border-radius: 2px;box-shadow: 0 0 3px #ddd;}
-.poptip-arrow{position: absolute;overflow: hidden;font-style: normal;font-family: simsun;text-shadow:0 0 2px #ccc;}
-.poptip-arrow em,.poptip-arrow i{position: absolute;left:0;top:0;font-style: normal;}
-.poptip-arrow em{color: #B94A48;}
-.poptip-arrow i{color: #B94A48;text-shadow:none;}
-.poptip-arrow-top,.poptip-arrow-bottom{height: 6px;width: 12px;left:12px;margin-left:-6px;}
-.poptip-arrow-left,.poptip-arrow-right{height: 12px;width: 6px;top: 12px;margin-top:-6px;}
-.poptip-arrow-top{top: -6px;}
-.poptip-arrow-top em{top: -1px;}
-.poptip-arrow-top i{top: 0px;}
-.poptip-arrow-bottom{bottom: -6px;}
-.poptip-arrow-bottom em{top: -8px;}
-.poptip-arrow-bottom i{top: -9px;}
-.poptip-arrow-left{left:-6px;}
-.poptip-arrow-left em{left:1px;}
-.poptip-arrow-left i{left:2px;}
-.poptip-arrow-right{right:-6px;}
-.poptip-arrow-right em{left:-6px;}
-.poptip-arrow-right i{left:-7px;}
+/* * css: 表格操作列 * ----------*/
+.bootstrap-table a i{color: #3c8dbc;display: inline-block;width: 15px;float: none;position: static;text-align: center;opacity: .85;-webkit-transition: all .12s;-o-transition: all .12s;transition: all .12s;margin: 0 0 2px 3px;vertical-align: middle;cursor: pointer;font-size: 14px;}
+.bootstrap-table a i:hover{transform: scale(1.2);opacity: 1;position: static;margin: 0 0 2px 3px}
+.bootstrap-table a i.fa-pencil{color: #69aa46;}/**编辑**/
+.bootstrap-table a i.fa-check-circle{color: #69aa46;}/**启用**/
+.bootstrap-table a i.fa-ban{color: #dd5a43;}/**禁用**/
+.bootstrap-table a i.fa-trash-o{color: #dd5a43;}/**删除**/
+.bootstrap-table a i.fa-stop{color: #efac56;}/**停止**/
+.bootstrap-table td .btn-group{vertical-align: top}
+.bootstrap-table .more-opt{top:-10px;padding: 5px 0 0 5px;background: #fff;border: 1px solid #ddd;border-radius: 4px;box-shadow: 2px 2px 15px #ccc;position: absolute;z-index: 1;animation-duration: .05s;animation-name: fadeInLeft;}
+.bootstrap-table .more-opt button{margin: 0 4px 4px 0;font-size: 13px;}

+ 67 - 34
src/main/webapp/static/js/base/area/list.js

@@ -77,7 +77,22 @@ function getGrid() {
 		}, {
 			field : "remark",
 			title : "备注"
-		} ]
+		}, {
+            title : "操作",
+            formatter : function (value, row, index) {
+                var _html = '';
+                if (hasPermission('sys:area:edit')) {
+                    _html += '<a href="javascript:;" onclick="vm.edit(\''+row.areaId+'\')" title="编辑"><i class="fa fa-pencil"></i></a>';
+                }
+                if (hasPermission('sys:area:remove')) {
+                    _html += '<a href="javascript:;" onclick="vm.remove(false,\''+row.areaId+'\')" title="删除"><i class="fa fa-trash-o"></i></a>';
+                }
+                if (hasPermission('sys:area:save')) {
+                    _html += '<a href="javascript:;" onclick="vm.saveChild(\''+row.areaCode+'\',\''+row.name+'\')" title="新增下级区域"><i class="fa fa-plus-square"></i></a>';
+                }
+                return _html;
+            }
+        }  ]
 	})
 }
 
@@ -140,39 +155,57 @@ var vm = new Vue({
 				},
 			});
 		},
-		edit : function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections');
-			if (checkedRow(ck)) {
-				dialogOpen({
-					title : '编辑区域',
-					url : 'base/area/edit.html?_' + $.now(),
-					width : '500px',
-					height : '456px',
-					success : function(iframeId) {
-						top.frames[iframeId].vm.area.areaId = ck[0].areaId;
-						top.frames[iframeId].vm.setForm();
-					},
-					yes : function(iframeId) {
-						top.frames[iframeId].vm.acceptClick();
-					}
-				});
-			}
-		},
-		remove : function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];
-			if (checkedArray(ck)) {
-				$.each(ck, function(idx, item) {
-					ids[idx] = item.areaId;
-				});
-				$.RemoveForm({
-					url : '../../sys/area/remove?_' + $.now(),
-					param : ids,
-					success : function(data) {
-						vm.load();
-					}
-				});
-			}
-		}
+        saveChild : function(areaCode, name) {
+            dialogOpen({
+                title : '新增区域',
+                url : 'base/area/add.html?_' + $.now(),
+                width : '500px',
+                height : '456px',
+                success : function(iframeId) {
+                    top.frames[iframeId].vm.area.parentCode = areaCode;
+                    top.frames[iframeId].vm.area.parentName = name;
+                },
+                yes : function(iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                }
+            });
+        },
+        edit : function(areaId) {
+            dialogOpen({
+                title : '编辑区域',
+                url : 'base/area/edit.html?_' + $.now(),
+                width : '500px',
+                height : '456px',
+                success : function(iframeId) {
+                    top.frames[iframeId].vm.area.areaId = areaId;
+                    top.frames[iframeId].vm.setForm();
+                },
+                yes : function(iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                }
+            });
+        },
+        remove : function(batch, areaId) {
+            var ids = [];
+            if (batch) {
+                var ck = $('#dataGrid').bootstrapTable('getSelections');
+                if (!checkedArray(ck)) {
+                    return false;
+                }
+                $.each(ck, function(idx, item) {
+                    ids[idx] = item.areaId;
+                });
+            } else {
+                ids.push(areaId);
+            }
+            $.RemoveForm({
+                url: '../../sys/area/remove?_' + $.now(),
+                param: ids,
+                success: function(data) {
+                    vm.load();
+                }
+            });
+        }
 	},
 	created : function() {
 		this.getArea(this.parentCode);

+ 36 - 21
src/main/webapp/static/js/base/generator/list.js

@@ -37,7 +37,16 @@ function getGrid() {
 		}, {
 			field : "createTime",
 			title : "创建时间"
-		}]
+		}, {
+            title : "操作",
+            formatter : function(value, row, index) {
+                var _html = '';
+                if (hasPermission('sys:gen:code')) {
+                    _html += '<a href="javascript:;" onclick="vm.generate(false,\''+row.tableName+'\')" title="生成代码"><i class="fa fa-file-archive-o"></i></a>';
+                }
+                return _html;
+            }
+        }]
 	})
 }
 
@@ -50,25 +59,31 @@ var vm = new Vue({
 		load : function() {
 			$('#dataGrid').bootstrapTable('refresh');
 		},
-		generate : function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), names = [];
-			if (checkedRow(ck)) {
-				$.each(ck, function(idx, item) {
-					names[idx] = item.tableName;
-				});
-				dialogOpen({
-					title : '生成代码',
-					url : 'base/generator/code.html?_' + $.now(),
-					width : '530px',
-					height : '500px',
-					success : function(iframeId) {
-						top.frames[iframeId].vm.generator.tables = names;
-					},
-					yes : function(iframeId) {
-						top.frames[iframeId].vm.acceptClick();
-					},
-				});
-			}
-		}
+        generate : function(batch, tableName) {
+            var names = [];
+            if (batch) {
+                var ck = $('#dataGrid').bootstrapTable('getSelections');
+                if (!checkedRow(ck)) {
+                    return false;
+                }
+                $.each(ck, function(idx, item) {
+                    names[idx] = item.tableName;
+                });
+            } else {
+                names.push(tableName);
+            }
+            dialogOpen({
+                title : '生成代码',
+                url : 'base/generator/code.html?_' + $.now(),
+                width : '530px',
+                height : '504px',
+                success : function(iframeId) {
+                    top.frames[iframeId].vm.generator.tables = names;
+                },
+                yes : function(iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                },
+            });
+        }
 	}
 })

+ 34 - 16
src/main/webapp/static/js/base/log/list.js

@@ -70,7 +70,19 @@ function getGrid() {
 		},  {
 			field : "gmtCreate",
 			title : "创建时间"
-		}]
+		}, {
+            title : "操作",
+            formatter : function (value, row, index) {
+                var _html = '';
+                if (hasPermission('sys:log:remove')) {
+                    _html += '<a href="javascript:;" onclick="vm.remove(false,\''+row.id+'\')" title="删除"><i class="fa fa-trash-o"></i></a>';
+                }
+                return _html;
+            }
+        }],
+        onPostBody: function() {
+            $('#dataGrid').bootstrapTable('expandAllRows');
+        }
 	})
 }
 
@@ -110,21 +122,27 @@ var vm = new Vue({
                 vm.dateRange = '';
             }
         },
-		remove: function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];	
-			if(checkedArray(ck)){
-				$.each(ck, function(idx, item){
-					ids[idx] = item.id;
-				});
-				$.RemoveForm({
-					url: '../../sys/log/remove?_' + $.now(),
-			    	param: ids,
-			    	success: function(data) {
-			    		vm.load();
-			    	}
-				});
-			}
-		},
+        remove: function(batch, id) {
+            var ids = [];
+            if (batch) {
+                var ck = $('#dataGrid').bootstrapTable('getSelections');
+                if(!checkedArray(ck)){
+                    return false;
+                }
+                $.each(ck, function(idx, item){
+                    ids[idx] = item.id;
+                });
+            } else {
+                ids.push(id);
+            }
+            $.RemoveForm({
+                url: '../../sys/log/remove?_' + $.now(),
+                param: ids,
+                success: function(data) {
+                    vm.load();
+                }
+            });
+        },
 		clear: function() {
 			$.ConfirmAjax({
 				msg : "您确定要清空日志吗?",

+ 66 - 34
src/main/webapp/static/js/base/macro/list.js

@@ -54,7 +54,21 @@ function getGrid() {
                     }
                 }
             },
-            {title: '备注', field: 'remark'}
+            {title: '备注', field: 'remark'},
+            {title: '操作', formatter: function(value, row, index) {
+                    var _html = '';
+                    if (hasPermission('sys:macro:edit')) {
+                        _html += '<a href="javascript:;" onclick="vm.edit(\''+row.macroId+'\')" title="编辑"><i class="fa fa-pencil"></i></a>';
+                    }
+                    if (hasPermission('sys:macro:remove')) {
+                        _html += '<a href="javascript:;" onclick="vm.remove(false,\''+row.macroId+'\')" title="删除"><i class="fa fa-trash-o"></i></a>';
+                    }
+                    if (hasPermission('sys:macro:save') && row.type === 0) {
+                        _html += '<a href="javascript:;" onclick="vm.saveChild(\''+row.macroId+'\',\''+row.name+'\')" title="新增字典数据"><i class="fa fa-navicon"></i></a>';
+                    }
+                    return _html;
+                }
+            }
         ],
         onPostBody: function() {
             switchUtils.init({
@@ -96,39 +110,57 @@ var vm = new Vue({
 				},
 			});
 		},
-		edit: function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections');
-			if(checkedRow(ck)){
-				dialogOpen({
-					title: '编辑字典',
-					url: 'base/macro/edit.html?_' + $.now(),
-					width: '600px',
-					height: '420px',
-					scroll : true,
-					success: function(iframeId){
-						top.frames[iframeId].vm.macro.macroId = ck[0].macroId;
-						top.frames[iframeId].vm.setForm();
-					},
-					yes : function(iframeId) {
-						top.frames[iframeId].vm.acceptClick();
-					},
-				});
-			}
+        saveChild: function(macroId, name) {
+            dialogOpen({
+                title: '新增字典',
+                url: 'base/macro/add.html?_' + $.now(),
+                width: '600px',
+                height: '420px',
+                scroll : true,success: function(iframeId){
+                    top.frames[iframeId].vm.macro.typeId = macroId;
+                    top.frames[iframeId].vm.macro.typeName = name;
+                },
+                yes : function(iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                },
+            });
+        },
+		edit: function(macroId) {
+            dialogOpen({
+                title: '编辑字典',
+                url: 'base/macro/edit.html?_' + $.now(),
+                width: '600px',
+                height: '420px',
+                scroll : true,
+                success: function(iframeId){
+                    top.frames[iframeId].vm.macro.macroId = macroId;
+                    top.frames[iframeId].vm.setForm();
+                },
+                yes : function(iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                },
+            });
 		},
-		remove: function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];
-			if(checkedArray(ck)){
-				$.each(ck, function(idx, item){
-					ids[idx] = item.macroId;
-				});
-				$.RemoveForm({
-					url: '../../sys/macro/remove?_' + $.now(),
-			    	param: ids,
-			    	success: function(data) {
-			    		vm.load();
-			    	}
-				});
-			}
-		}
+        remove: function(batch, macroId) {
+            var ids = [];
+            if (batch) {
+                var ck = $('#dataGrid').bootstrapTable('getSelections');
+                if(!checkedArray(ck)){
+                    return false;
+                }
+                $.each(ck, function(idx, item){
+                    ids[idx] = item.macroId;
+                });
+            } else {
+                ids.push(macroId);
+            }
+            $.RemoveForm({
+                url: '../../sys/macro/remove?_' + $.now(),
+                param: ids,
+                success: function(data) {
+                    vm.load();
+                }
+            });
+        }
 	}
 })

+ 69 - 35
src/main/webapp/static/js/base/menu/list.js

@@ -53,7 +53,21 @@ function getGrid() {
             },
             {title: '排序', field: 'orderNum', width: '50px'},
             {title: '菜单URL', field: 'url', width: '200px'},
-            {title: '授权标识', field: 'perms'}
+            {title: '授权标识', field: 'perms'},
+            {title: '操作', formatter: function(value, row, index) {
+                    var _html = '';
+                    if (hasPermission('sys:menu:edit')) {
+                        _html += '<a href="javascript:;" onclick="vm.edit(\''+row.menuId+'\')" title="编辑"><i class="fa fa-pencil"></i></a>';
+                    }
+                    if (hasPermission('sys:area:remove')) {
+                        _html += '<a href="javascript:;" onclick="vm.remove(false,\''+row.menuId+'\')" title="删除"><i class="fa fa-trash-o"></i></a>';
+                    }
+                    if (hasPermission('sys:menu:save') && row.type !== 2) {
+                        _html += '<a href="javascript:;" onclick="vm.saveChild(\''+row.menuId+'\',\''+row.name+'\')" title="新增下级菜单"><i class="fa fa-plus-square"></i></a>';
+                    }
+                    return _html;
+                }
+            }
         ]
     });
 }
@@ -76,39 +90,59 @@ var vm = new Vue({
 				},
 			});
 		},
-		edit: function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections');
-			if(checkedRow(ck)){
-				dialogOpen({
-					title: '编辑菜单',
-					url: 'base/menu/edit.html?_' + $.now(),
-					width: '600px',
-					height: '420px',
-					scroll : true,
-					success: function(iframeId){
-						top.frames[iframeId].vm.menu.menuId = ck[0].menuId;
-						top.frames[iframeId].vm.setForm();
-					},
-					yes : function(iframeId) {
-						top.frames[iframeId].vm.acceptClick();
-					},
-				});
-			}
-		},
-		remove: function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];
-			if(checkedArray(ck)){
-				$.each(ck, function(idx, item){
-					ids[idx] = item.menuId;
-				});
-				$.RemoveForm({
-					url: '../../sys/menu/remove?_' + $.now(),
-			    	param: ids,
-			    	success: function(data) {
-			    		vm.load();
-			    	}
-				});
-			}
-		}
+        saveChild: function(menuId, name) {
+            dialogOpen({
+                title: '新增菜单',
+                url: 'base/menu/add.html?_' + $.now(),
+                width: '600px',
+                height: '420px',
+                scroll : true,
+                success: function(iframeId){
+                    top.frames[iframeId].vm.menu.parentId = menuId;
+                    top.frames[iframeId].vm.menu.parentName = name;
+                },
+                yes : function(iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                },
+            });
+        },
+        edit: function(menuId) {
+            dialogOpen({
+                title: '编辑菜单',
+                url: 'base/menu/edit.html?_' + $.now(),
+                width: '600px',
+                height: '420px',
+                scroll : true,
+                success: function(iframeId){
+                    top.frames[iframeId].vm.menu.menuId = menuId;
+                    top.frames[iframeId].vm.setForm();
+                },
+                yes : function(iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                },
+            });
+        },
+        remove: function(batch, menuId) {
+            var ids = [];
+            if (batch) {
+                var ck = $('#dataGrid').bootstrapTable('getSelections');
+                if(!checkedArray(ck)){
+                    return false;
+                }
+                $.each(ck, function(idx, item){
+                    ids[idx] = item.menuId;
+                });
+            } else {
+                ids.push(menuId);
+            }
+            $.RemoveForm({
+                url: '../../sys/menu/remove?_' + $.now(),
+                param: ids,
+                success: function(data) {
+                    vm.load();
+                }
+            });
+
+        }
 	}
 })

+ 67 - 34
src/main/webapp/static/js/base/org/list.js

@@ -36,7 +36,22 @@ function getGrid() {
                         return '<i class="fa fa-toggle-on"></i>';
                     }
                 }},
-            {title: '排序', field: 'orderNum', width: '80px'}
+            {title: '排序', field: 'orderNum', width: '80px'},
+            {
+                title: '操作', formatter: function (value, row, index) {
+                    var _html = '';
+                    if (hasPermission('sys:org:edit')) {
+                        _html += '<a href="javascript:;" onclick="vm.edit(\'' + row.orgId + '\')" title="编辑"><i class="fa fa-pencil"></i></a>';
+                    }
+                    if (hasPermission('sys:org:remove')) {
+                        _html += '<a href="javascript:;" onclick="vm.remove(false,\'' + row.orgId + '\')" title="删除"><i class="fa fa-trash-o"></i></a>';
+                    }
+                    if (hasPermission('sys:org:save')) {
+                        _html += '<a href="javascript:;" onclick="vm.saveChild(\'' + row.orgId + '\',\'' + row.name + '\')" title="新增下级机构"><i class="fa fa-plus-square"></i></a>';
+                    }
+                    return _html;
+                }
+            }
         ]
     });
 }
@@ -58,38 +73,56 @@ var vm = new Vue({
 				},
 			});
 		},
-		edit: function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections');
-			if(checkedRow(ck)){
-				dialogOpen({
-					title: '编辑机构',
-					url: 'base/org/edit.html?_' + $.now(),
-					width: '500px',
-					height: '320px',
-					success: function(iframeId){
-						top.frames[iframeId].vm.org.orgId = ck[0].orgId;
-						top.frames[iframeId].vm.setForm();
-					},
-					yes : function(iframeId) {
-						top.frames[iframeId].vm.acceptClick();
-					},
-				});
-			}
-		},
-		remove: function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];
-			if(checkedArray(ck)){
-				$.each(ck, function(idx, item){
-					ids[idx] = item.orgId;
-				});
-				$.RemoveForm({
-					url: '../../sys/org/remove?_' + $.now(),
-			    	param: ids,
-			    	success: function(data) {
-			    		vm.load();
-			    	}
-				});
-			}
-		}
+        saveChild: function (orgId, name) {
+            dialogOpen({
+                title: '新增机构',
+                url: 'base/org/add.html?_' + $.now(),
+                width: '500px',
+                height: '320px',
+                success: function (iframeId) {
+                    top.frames[iframeId].vm.org.parentId = orgId;
+                    top.frames[iframeId].vm.org.parentName = name;
+                },
+                yes: function (iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                },
+            });
+        },
+        edit: function (orgId) {
+            dialogOpen({
+                title: '编辑机构',
+                url: 'base/org/edit.html?_' + $.now(),
+                width: '500px',
+                height: '320px',
+                success: function (iframeId) {
+                    top.frames[iframeId].vm.org.orgId = orgId;
+                    top.frames[iframeId].vm.setForm();
+                },
+                yes: function (iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                },
+            });
+        },
+        remove: function (batch, orgId) {
+            var ids = [];
+            if (batch) {
+                var ck = $('#dataGrid').bootstrapTable('getSelections');
+                if (!checkedArray(ck)) {
+                    return false;
+                }
+                $.each(ck, function (idx, item) {
+                    ids[idx] = item.orgId;
+                });
+            } else {
+                ids.push(orgId);
+            }
+            $.RemoveForm({
+                url: '../../sys/org/remove?_' + $.now(),
+                param: ids,
+                success: function (data) {
+                    vm.load();
+                }
+            });
+        }
 	}
 })

+ 81 - 87
src/main/webapp/static/js/base/quartz/list.js

@@ -50,10 +50,19 @@ function getGrid() {
 			title : "状态",
 			width : "60px",
 			formatter : function(value, row, index) {
-                if(value === 0){
-                    return '<input type="checkbox" class="js-switch" data-id="'+row.jobId+'">';
-                }else if(value === 1){
-                    return '<input type="checkbox" class="js-switch" data-id="'+row.jobId+'" checked>';
+                if (row.status === 1) {
+                	if (hasPermission('quartz:job:disable')) {
+                        return '<input type="checkbox" class="js-switch" data-id="'+row.jobId+'" checked>';
+					} else {
+                        return '<i class="fa fa-toggle-on"></i>';
+                    }
+                }
+                if (row.status === 0) {
+                    if (hasPermission('quartz:job:enable')) {
+                        return '<input type="checkbox" class="js-switch" data-id="'+row.jobId+'">';
+                    } else {
+                        return '<i class="fa fa-toggle-off"></i>';
+                    }
                 }
 			}
 		}, {
@@ -63,7 +72,25 @@ function getGrid() {
 		}, {
 			field : "remark",
 			title : "备注"
-		} ],
+		}, {
+            title : "操作",
+            formatter : function(value, row, index) {
+                var _html = '';
+                if (hasPermission('quartz:job:edit')) {
+                    _html += '<a href="javascript:;" onclick="vm.edit(\''+row.jobId+'\')" title="编辑"><i class="fa fa-pencil"></i></a>';
+                }
+                if (hasPermission('quartz:job:run')) {
+                    _html += '<a href="javascript:;" onclick="vm.run(\''+row.jobId+'\')" title="立即运行一次"><i class="fa fa-forward"></i></a>';
+                }
+                if (hasPermission('quartz:job:remove')) {
+                    _html += '<a href="javascript:;" onclick="vm.remove(false,\''+row.jobId+'\')" title="删除"><i class="fa fa-trash-o"></i></a>';
+                }
+                if (hasPermission('quartz:log:list')) {
+                    _html += '<a href="log.html?jobId='+row.jobId+'" title="调度日志"><i class="fa fa-file-text-o"></i></a>';
+                }
+                return _html;
+            }
+        } ],
         onPostBody: function() {
             switchUtils.init({
                 selector: '.js-switch',
@@ -109,87 +136,54 @@ var vm = new Vue({
 				},
 			});
 		},
-		edit : function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections');
-			if (checkedRow(ck)) {
-				dialogOpen({
-					title : '编辑任务',
-					url : 'base/quartz/edit.html?_' + $.now(),
-					width : '450px',
-					height : '396px',
-					scroll : true,
-					success : function(iframeId) {
-						top.frames[iframeId].vm.job.jobId = ck[0].jobId;
-						top.frames[iframeId].vm.setForm();
-					},
-					yes : function(iframeId) {
-						top.frames[iframeId].vm.acceptClick();
-					},
-				});
-			}
-		},
-		remove : function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];
-			if (checkedArray(ck)) {
-				$.each(ck, function(idx, item) {
-					ids[idx] = item.jobId;
-				});
-				$.RemoveForm({
-					url : '../../quartz/job/remove?_' + $.now(),
-					param : ids,
-					success : function(data) {
-						vm.load();
-					}
-				});
-			}
-		},
-		enable : function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];
-			if (checkedArray(ck)) {
-				$.each(ck, function(idx, item) {
-					ids[idx] = item.jobId;
-				});
-				$.ConfirmForm({
-					msg : '您是否要启用所选任务吗?',
-					url : '../../quartz/job/enable?_' + $.now(),
-					param : ids,
-					success : function(data) {
-						vm.load();
-					}
-				});
-			}
-		},
-		disable : function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];
-			if (checkedArray(ck)) {
-				$.each(ck, function(idx, item) {
-					ids[idx] = item.jobId;
-				});
-				$.ConfirmForm({
-					msg : '您是否要暂停所选任务吗?',
-					url : '../../quartz/job/disable?_' + $.now(),
-					param : ids,
-					success : function(data) {
-						vm.load();
-					}
-				});
-			}
-		},
-		run : function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];
-			if (checkedArray(ck)) {
-				$.each(ck, function(idx, item) {
-					ids[idx] = item.jobId;
-				});
-				$.ConfirmForm({
-					msg : '您是否要立即运行所选任务吗?',
-					url : '../../quartz/job/run?_' + $.now(),
-					param : ids,
-					success : function(data) {
-						vm.load();
-					}
-				});
-			}
-		}
+        edit : function(jobId) {
+            dialogOpen({
+                title : '编辑任务',
+                url : 'base/quartz/edit.html?_' + $.now(),
+                width : '450px',
+                height : '396px',
+                scroll : true,
+                success : function(iframeId) {
+                    top.frames[iframeId].vm.job.jobId = jobId;
+                    top.frames[iframeId].vm.setForm();
+                },
+                yes : function(iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                },
+            });
+        },
+        remove : function(batch, jobId) {
+            var ids = [];
+            if (batch) {
+                var ck = $('#dataGrid').bootstrapTable('getSelections');
+                if (!checkedArray(ck)) {
+                    return false;
+                }
+                $.each(ck, function(idx, item) {
+                    ids[idx] = item.jobId;
+                });
+            } else {
+                ids.push(jobId);
+            }
+            $.RemoveForm({
+                url : '../../quartz/job/remove?_' + $.now(),
+                param : ids,
+                success : function(data) {
+                    vm.load();
+                }
+            });
+        },
+        run : function(jobId) {
+            var ids = [];
+            ids.push(jobId);
+            $.ConfirmForm({
+                msg : '您是否要立即运行所选任务吗?',
+                url : '../../quartz/job/run?_' + $.now(),
+                param : ids,
+                success : function(data) {
+                    vm.load();
+                }
+            });
+        }
 	}
 })

+ 1 - 0
src/main/webapp/static/js/base/quartz/log.js

@@ -13,6 +13,7 @@ function initialPage() {
 			height : $(window).height() - 56
 		});
 	});
+    vm.jobId = url("jobId");
 }
 
 function getGrid() {

+ 92 - 72
src/main/webapp/static/js/base/role/list.js

@@ -46,7 +46,30 @@ function getGrid() {
 		}, {
 			field : "gmtCreate",
 			title : "创建时间"
-		}]
+		}, {
+            title: "操作",
+            formatter: function (value, row, index) {
+                var _html = '';
+                if (hasPermission('sys:role:edit')) {
+                    _html += '<a href="javascript:;" onclick="vm.edit(\'' + row.roleId + '\')" title="编辑"><i class="fa fa-pencil"></i></a>';
+                }
+                if (hasPermission('sys:role:remove')) {
+                    _html += '<a href="javascript:;" onclick="vm.remove(false,\'' + row.roleId + '\')" title="删除"><i class="fa fa-trash-o"></i></a>';
+                }
+                var perms = cntPermission(['sys:role:authorizeOpt', 'sys:role:authorizeData']);
+                if (perms > 0) {
+                    var opts = [];
+                    if (hasPermission('sys:role:authorizeOpt')) {
+                        opts.push('<button class="btn btn-default btn-xs" onclick="vm.authorizeOpt(\'' + row.roleId + '\')"><i class="fa fa-gavel"></i>操作权限</button>');
+                    }
+                    if (hasPermission('sys:role:authorizeData')) {
+                        opts.push('<button class="btn btn-default btn-xs" onclick="vm.authorizeData(\'' + row.roleId + '\')"><i class="fa fa-eye"></i>数据权限</button>');
+                    }
+                    _html += morePermissionOpt(perms, opts);
+                }
+                return _html;
+            }
+        }]
 	})
 }
 
@@ -70,76 +93,73 @@ var vm = new Vue({
 				},
 			});
 		},
-		edit: function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections');
-			if(checkedRow(ck)){
-				dialogOpen({
-					title: '编辑角色',
-					url: 'base/role/edit.html?_' + $.now(),
-					width: '420px',
-					height: '350px',
-					success: function(iframeId){
-						top.frames[iframeId].vm.role.roleId = ck[0].roleId;
-						top.frames[iframeId].vm.setForm();
-					},
-					yes: function(iframeId){
-						top.frames[iframeId].vm.acceptClick();
-					}
-				});
-			}
-		},
-		remove: function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];	
-			if(checkedArray(ck)){
-				$.each(ck, function(idx, item){
-					ids[idx] = item.roleId;
-				});
-				$.RemoveForm({
-					url: '../../sys/role/remove?_' + $.now(),
-			    	param: ids,
-			    	success: function(data) {
-			    		vm.load();
-			    	}
-				});
-			}
-		},
-		authorizeOpt: function(){
-			var ck = $('#dataGrid').bootstrapTable('getSelections');
-			if(checkedRow(ck)){
-				dialogOpen({
-					title: '操作权限',
-					url: 'base/role/opt.html?_' + $.now(),
-					scroll : true,
-					width: "300px",
-					height: "450px",
-					success: function(iframeId){
-						top.frames[iframeId].vm.role.roleId = ck[0].roleId;
-						top.frames[iframeId].vm.setForm();
-					},
-					yes : function(iframeId) {
-						top.frames[iframeId].vm.acceptClick();
-					}
-				})
-			}
-		},
-		authorizeData: function(){
-			var ck = $('#dataGrid').bootstrapTable('getSelections');
-			if(checkedRow(ck)){
-				dialogOpen({
-					title: '数据权限',
-					url: 'base/role/data.html?_' + $.now(),
-					scroll : true,
-					width: "300px",
-					height: "450px",
-					success: function(iframeId){
-						top.frames[iframeId].vm.role.roleId = ck[0].roleId;
-						top.frames[iframeId].vm.setForm();
-					},
-					yes : function(iframeId) {
-						top.frames[iframeId].vm.acceptClick();
-					}
-				})
-			}
-		}
+        edit: function (roleId) {
+            dialogOpen({
+                title: '编辑角色',
+                url: 'base/role/edit.html?_' + $.now(),
+                width: '420px',
+                height: '350px',
+                success: function (iframeId) {
+                    top.frames[iframeId].vm.role.roleId = roleId;
+                    top.frames[iframeId].vm.setForm();
+                },
+                yes: function (iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                }
+            });
+        },
+        remove: function (batch, roleId) {
+            var ids = [];
+            if (batch) {
+                var ck = $('#dataGrid').bootstrapTable('getSelections');
+                if (!checkedArray(ck)) {
+                    return false;
+                }
+                $.each(ck, function (idx, item) {
+                    ids[idx] = item.roleId;
+                });
+            } else {
+                ids.push(roleId);
+            }
+            $.RemoveForm({
+                url: '../../sys/role/remove?_' + $.now(),
+                param: ids,
+                success: function (data) {
+                    vm.load();
+                }
+            });
+        },
+        authorizeOpt: function (roleId) {
+            dialogOpen({
+                title: '操作权限',
+                url: 'base/role/opt.html?_' + $.now(),
+                scroll: true,
+                width: "300px",
+                height: "450px",
+                success: function (iframeId) {
+                    top.frames[iframeId].vm.role.roleId = roleId;
+                    top.frames[iframeId].vm.setForm();
+                },
+                yes: function (iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                }
+            })
+        },
+        authorizeData: function (roleId) {
+            dialogOpen({
+                title: '数据权限',
+                url: 'base/role/data.html?_' + $.now(),
+                scroll: true,
+                width: "300px",
+                height: "450px",
+                success: function (iframeId) {
+                    top.frames[iframeId].vm.role.roleId = roleId;
+                    top.frames[iframeId].vm.setForm();
+                },
+                yes: function (iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                }
+            })
+        }
 	}
 })

+ 81 - 87
src/main/webapp/static/js/base/user/list.js

@@ -51,9 +51,20 @@ function getGrid() {
 			width : "60px",
             formatter : function(value , row, index) {
                 if(value === 0){
-                    return '<input type="checkbox" class="js-switch" data-id="'+row.userId+'">';
-                }else if(value === 1){
-                    return '<input type="checkbox" class="js-switch" data-id="'+row.userId+'" checked>';
+                	if (hasPermission('sys:user:disable')) {
+                        return '<input type="checkbox" class="js-switch" data-id="'+row.userId+'">';
+					} else {
+                        return '<i class="fa fa-toggle-off"></i>';
+					}
+
+                }
+                if(value === 1){
+                	if (hasPermission('sys:user:enable')) {
+                        return '<input type="checkbox" class="js-switch" data-id="'+row.userId+'" checked>';
+					} else {
+                        return '<i class="fa fa-toggle-on"></i>';
+					}
+
                 }
             }
 		}, {
@@ -63,7 +74,22 @@ function getGrid() {
 		}, {
 			field : "remark",
 			title : "备注"
-		} ],
+		}, {
+            title : "操作",
+            formatter : function(value, row, index) {
+                var _html = '';
+                if (hasPermission('sys:user:edit')) {
+                    _html += '<a href="javascript:;" onclick="vm.edit(\''+row.userId+'\')" title="编辑"><i class="fa fa-pencil"></i></a>';
+                }
+                if (hasPermission('sys:user:resetPassword')) {
+                    _html += '<a href="javascript:;" onclick="vm.reset(\''+row.userId+'\')" title="重置密码"><i class="fa fa-key"></i></a>';
+                }
+                if (hasPermission('sys:user:remove')) {
+                    _html += '<a href="javascript:;" onclick="vm.remove(false,\''+row.userId+'\')" title="删除"><i class="fa fa-trash-o"></i></a>';
+                }
+                return _html;
+            }
+        } ],
         onPostBody: function() {
             switchUtils.init({
                 selector: '.js-switch',
@@ -109,88 +135,56 @@ var vm = new Vue({
 				},
 			});
 		},
-		edit : function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections');
-			if (checkedRow(ck)) {
-				dialogOpen({
-					title : '编辑用户',
-					url : 'base/user/edit.html?_' + $.now(),
-                    width : '500px',
-                    height : '456px',
-					scroll : true,
-					success : function(iframeId) {
-						top.frames[iframeId].vm.user.userId = ck[0].userId;
-						top.frames[iframeId].vm.setForm();
-					},
-					yes : function(iframeId) {
-						top.frames[iframeId].vm.acceptClick();
-					},
-				});
-			}
-		},
-		remove : function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];
-			if (checkedArray(ck)) {
-				$.each(ck, function(idx, item) {
-					ids[idx] = item.userId;
-				});
-				$.RemoveForm({
-					url : '../../sys/user/remove?_' + $.now(),
-					param : ids,
-					success : function(data) {
-						vm.load();
-					}
-				});
-			}
-		},
-		disable : function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];
-			if (checkedArray(ck)) {
-				$.each(ck, function(idx, item) {
-					ids[idx] = item.userId;
-				});
-				$.ConfirmForm({
-					msg : '您是否要禁用所选账户吗?',
-					url : '../../sys/user/disable?_' + $.now(),
-					param : ids,
-					success : function(data) {
-						vm.load();
-					}
-				});
-			}
-		},
-		enable : function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections'), ids = [];
-			if (checkedArray(ck)) {
-				$.each(ck, function(idx, item) {
-					ids[idx] = item.userId;
-				});
-				$.ConfirmForm({
-					msg : '您是否要启用所选账户吗?',
-					url : '../../sys/user/enable?_' + $.now(),
-					param : ids,
-					success : function(data) {
-						vm.load();
-					}
-				});
-			}
-		},
-		reset : function() {
-			var ck = $('#dataGrid').bootstrapTable('getSelections');
-			if (checkedRow(ck)) {
-				dialogOpen({
-					title : '重置密码',
-					url : 'base/user/reset.html?_' + $.now(),
-					width : '400px',
-					height : '220px',
-					success : function(iframeId) {
-						top.frames[iframeId].vm.user.userId = ck[0].userId;
-					},
-					yes : function(iframeId) {
-						top.frames[iframeId].vm.acceptClick();
-					},
-				});
-			}
-		}
+        edit : function(userId) {
+            dialogOpen({
+                title : '编辑用户',
+                url : 'base/user/edit.html?_' + $.now(),
+                width : '500px',
+                height : '456px',
+                scroll : true,
+                success : function(iframeId) {
+                    top.frames[iframeId].vm.user.userId = userId;
+                    top.frames[iframeId].vm.setForm();
+                },
+                yes : function(iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                },
+            });
+        },
+        remove : function(batch, userId) {
+            var ids = [];
+            if (batch) {
+                var ck = $('#dataGrid').bootstrapTable('getSelections');
+                if (!checkedArray(ck)) {
+                    return false;
+                }
+                $.each(ck, function(idx, item) {
+                    ids[idx] = item.userId;
+                });
+            } else {
+                ids.push(userId);
+            }
+            $.RemoveForm({
+                url : '../../sys/user/remove?_' + $.now(),
+                param : ids,
+                success : function(data) {
+                    vm.load();
+                }
+            });
+        },
+        reset : function(userId) {
+            dialogOpen({
+                title : '重置密码',
+                url : 'base/user/reset.html?_' + $.now(),
+                width : '400px',
+                height : '220px',
+                success : function(iframeId) {
+                    top.frames[iframeId].vm.user.userId = userId;
+                },
+                yes : function(iframeId) {
+                    top.frames[iframeId].vm.acceptClick();
+                },
+            });
+        }
 	}
 })

+ 31 - 1
src/main/webapp/static/js/common.js

@@ -48,6 +48,36 @@ function hasPermission(permission) {
     }
 }
 
+//返回满足权限的个数
+function cntPermission(permission) {
+    var  count = 0;
+    if(isNullOrEmpty(window.parent.perms)) {
+        return count;
+    }
+    $.each(permission, function(idx, item){
+        if (window.parent.perms.indexOf(item) > -1) {
+            count++;
+        }
+    });
+    return count;
+}
+
+//构造更多操作按钮
+function morePermissionOpt(cnt, opts) {
+    var _html = '', width = (cnt*82);
+    _html += '<div class="btn-group">' +
+        '<a data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="更多">' +
+        '<i class="fa fa-chevron-circle-right"></i>' +
+        '</a>';
+    _html += 	'<ul class="more-opt dropdown-menu" style="min-width: '+width+'px;left: -'+width+'px;">';
+    $.each(opts, function(idx, item){
+        _html += item;
+    });
+    _html += 	'</ul>';
+    _html += '</div>'
+    return _html;
+}
+
 toUrl = function(href) {
 	window.location.href = href;
 }
@@ -85,7 +115,7 @@ $.fn.bootstrapTreeTableEx = function(opt) {
         url: '',
         striped: true,
         sidePagination: 'server',
-        clickToSelect: true,
+        clickToSelect: false,
         idField: '',
         columns: [],
         treeShowField: '',

+ 274 - 284
src/main/webapp/static/plugins/validator/validator.js

@@ -1,15 +1,19 @@
 /**
-数据验证完整性
-**/
+ 数据验证完整性
+ **/
 $.fn.Validform = function () {
     var Validatemsg = "";
     var Validateflag = true;
     $(this).find("[isvalid=yes]").each(function () {
         var checkexpession = $(this).attr("checkexpession");
         var errormsg = $(this).attr("errormsg");
+        var placeholder = $(this).attr("placeholder");
         if (checkexpession != undefined) {
             if (errormsg == undefined) {
                 errormsg = "";
+                if (!(placeholder == undefined)) {
+                    errormsg = placeholder;
+                }
             }
             var value = $(this).val();
             if ($(this).hasClass('ui-select')) {
@@ -17,338 +21,338 @@ $.fn.Validform = function () {
             }
             switch (checkexpession) {
                 case "NotNull":
-                    {
-                        if (isNotNull(value)) {
-                            Validatemsg = errormsg + "不能为空!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (isNotNull(value)) {
+                        Validatemsg = errormsg + "不能为空!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "Num":
-                    {
-                        if (!isInteger(value)) {
-                            Validatemsg = errormsg + "必须为数字!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isInteger(value)) {
+                        Validatemsg = errormsg + "必须为数字!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "NumOrNull":
-                    {
-                        if (!isIntegerOrNull(value)) {
-                            Validatemsg = errormsg + "必须为数字!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isIntegerOrNull(value)) {
+                        Validatemsg = errormsg + "必须为数字!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "Email":
-                    {
-                        if (!isEmail(value)) {
-                            Validatemsg = errormsg + "必须为E-mail格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isEmail(value)) {
+                        Validatemsg = errormsg + "必须为E-mail格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "EmailOrNull":
-                    {
-                        if (!isEmailOrNull(value)) {
-                            Validatemsg = errormsg + "必须为E-mail格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isEmailOrNull(value)) {
+                        Validatemsg = errormsg + "必须为E-mail格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "EnglishStr":
-                    {
-                        if (!isEnglishStr(value)) {
-                            Validatemsg = errormsg + "必须为字符串!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isEnglishStr(value)) {
+                        Validatemsg = errormsg + "必须为字符串!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "EnglishStrOrNull":
-                    {
-                        if (!isEnglishStrOrNull(value)) {
-                            Validatemsg = errormsg + "必须为字符串!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isEnglishStrOrNull(value)) {
+                        Validatemsg = errormsg + "必须为字符串!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "LenNum":
-                    {
-                        if (!isLenNum(value, $(this).attr("length"))) {
-                            Validatemsg = errormsg + "必须为" + $(this).attr("length") + "位数字!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isLenNum(value, $(this).attr("length"))) {
+                        Validatemsg = errormsg + "必须为" + $(this).attr("length") + "位数字!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "LenNumOrNull":
-                    {
-                        if (!isLenNumOrNull(value, $(this).attr("length"))) {
-                            Validatemsg = errormsg + "必须为" + $(this).attr("length") + "位数字!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isLenNumOrNull(value, $(this).attr("length"))) {
+                        Validatemsg = errormsg + "必须为" + $(this).attr("length") + "位数字!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "LenStr":
-                    {
-                        if (!isLenStr(value, $(this).attr("length"))) {
-                            Validatemsg = errormsg + "必须小于" + $(this).attr("length") + "位字符!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isLenStr(value, $(this).attr("length"))) {
+                        Validatemsg = errormsg + "必须小于" + $(this).attr("length") + "位字符!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "LenStrOrNull":
-                    {
-                        if (!isLenStrOrNull(value, $(this).attr("length"))) {
-                            Validatemsg = errormsg + "必须小于" + $(this).attr("length") + "位字符!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isLenStrOrNull(value, $(this).attr("length"))) {
+                        Validatemsg = errormsg + "必须小于" + $(this).attr("length") + "位字符!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "Phone":
-                    {
-                        if (!isTelephone(value)) {
-                            Validatemsg = errormsg + "必须电话格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isTelephone(value)) {
+                        Validatemsg = errormsg + "必须电话格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "PhoneOrNull":
-                    {
-                        if (!isTelephoneOrNull(value)) {
-                            Validatemsg = errormsg + "必须电话格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isTelephoneOrNull(value)) {
+                        Validatemsg = errormsg + "必须电话格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "Fax":
-                    {
-                        if (!isTelephoneOrNull(value)) {
-                            Validatemsg = errormsg + "必须为传真格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isTelephoneOrNull(value)) {
+                        Validatemsg = errormsg + "必须为传真格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "Mobile":
-                    {
-                        if (!isMobile(value)) {
-                            Validatemsg = errormsg + "必须为手机格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isMobile(value)) {
+                        Validatemsg = errormsg + "必须为手机格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "MobileOrNull":
-                    {
-                        if (!isMobileOrnull(value)) {
-                            Validatemsg = errormsg + "必须为手机格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isMobileOrnull(value)) {
+                        Validatemsg = errormsg + "必须为手机格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "MobileOrPhone":
-                    {
-                        if (!isMobileOrPhone(value)) {
-                            Validatemsg = errormsg + "必须为电话格式或手机格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isMobileOrPhone(value)) {
+                        Validatemsg = errormsg + "必须为电话格式或手机格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "MobileOrPhoneOrNull":
-                    {
-                        if (!isMobileOrPhoneOrNull(value)) {
-                            Validatemsg = errormsg + "必须为电话格式或手机格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isMobileOrPhoneOrNull(value)) {
+                        Validatemsg = errormsg + "必须为电话格式或手机格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "Uri":
-                    {
-                        if (!isUri(value)) {
-                            Validatemsg = errormsg + "必须为网址格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isUri(value)) {
+                        Validatemsg = errormsg + "必须为网址格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "UriOrNull":
-                    {
-                        if (!isUriOrnull(value)) {
-                            Validatemsg = errormsg + "必须为网址格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isUriOrnull(value)) {
+                        Validatemsg = errormsg + "必须为网址格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "Equal":
-                    {
-                        if (!isEqual(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "不相等!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isEqual(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "不相等!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "Date":
-                    {
-                        if (!isDate(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为日期格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isDate(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为日期格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "DateOrNull":
-                    {
-                        if (!isDateOrNull(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为日期格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isDateOrNull(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为日期格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "DateTime":
-                    {
-                        if (!isDateTime(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为日期时间格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isDateTime(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为日期时间格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "DateTimeOrNull":
-                    {
-                        if (!isDateTimeOrNull(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为日期时间格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isDateTimeOrNull(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为日期时间格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "Time":
-                    {
-                        if (!isTime(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为时间格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isTime(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为时间格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "TimeOrNull":
-                    {
-                        if (!isTimeOrNull(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为时间格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isTimeOrNull(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为时间格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "ChineseStr":
-                    {
-                        if (!isChinese(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为中文!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isChinese(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为中文!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "ChineseStrOrNull":
-                    {
-                        if (!isChineseOrNull(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为中文!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isChineseOrNull(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为中文!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "Zip":
-                    {
-                        if (!isZip(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为邮编格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isZip(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为邮编格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "ZipOrNull":
-                    {
-                        if (!isZipOrNull(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为邮编格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isZipOrNull(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为邮编格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "Double":
-                    {
-                        if (!isDouble(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为小数!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isDouble(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为小数!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "DoubleOrNull":
-                    {
-                        if (!isDoubleOrNull(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为小数!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isDoubleOrNull(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为小数!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "IDCard":
-                    {
-                        if (!isIDCard(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为身份证格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isIDCard(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为身份证格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "IDCardOrNull":
-                    {
-                        if (!isIDCardOrNull(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为身份证格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isIDCardOrNull(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为身份证格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "IsIP":
-                    {
-                        if (!isIP(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为IP格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isIP(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为IP格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 case "IPOrNull":
-                    {
-                        if (!isIPOrNullOrNull(value, $(this).attr("eqvalue"))) {
-                            Validatemsg = errormsg + "必须为IP格式!\n";
-                            Validateflag = false;
-                            ValidationMessage($(this), Validatemsg); return false;
-                        }
-                        break;
+                {
+                    if (!isIPOrNullOrNull(value, $(this).attr("eqvalue"))) {
+                        Validatemsg = errormsg + "必须为IP格式!\n";
+                        Validateflag = false;
+                        ValidationMessage($(this), Validatemsg); return false;
                     }
+                    break;
+                }
                 default:
                     break;
             }
@@ -526,7 +530,7 @@ $.fn.Validform = function () {
             return true;
         }
     }
-    //验证是否手机号或电话号码 mobile phone 
+    //验证是否手机号或电话号码 mobile phone
     function isMobileOrPhone(obj) {
         reg_mobile = /^(\+\d{2,3}\-)?\d{11}$/;
         reg_phone = /^(\d{3,4}\-)?[1-9]\d{6,7}$/;
@@ -667,7 +671,7 @@ $.fn.Validform = function () {
             }
         }
     }
-    //判断输入的字符是否为中文 cchar 
+    //判断输入的字符是否为中文 cchar
     function isChinese(obj) {
         if (obj.length != 0) {
             reg = /^[\u0391-\uFFE5]+$/;
@@ -777,7 +781,7 @@ $.fn.Validform = function () {
     }
     //判断是否为IP地址格式
     function isIP(obj) {
-        var re = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g //匹配IP地址的正则表达式 
+        var re = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g //匹配IP地址的正则表达式
         if (re.test(obj)) {
             if (RegExp.$1 < 256 && RegExp.$2 < 256 && RegExp.$3 < 256 && RegExp.$4 < 256) return true;
         }
@@ -789,7 +793,7 @@ $.fn.Validform = function () {
         if (controlObj.length == 0 || controlObj == null || controlObj == undefined) {
             return true;
         }
-        var re = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g //匹配IP地址的正则表达式 
+        var re = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g //匹配IP地址的正则表达式
         if (re.test(obj)) {
             if (RegExp.$1 < 256 && RegExp.$2 < 256 && RegExp.$3 < 256 && RegExp.$4 < 256) return true;
         }
@@ -800,30 +804,17 @@ $.fn.Validform = function () {
 function ValidationMessage(obj, Validatemsg) {
     try {
         removeMessage(obj);
-//        dialogMsg(Validatemsg);
+        dialogToastr(Validatemsg);
         obj.focus();
-        var $poptip_error = $('<div class="poptip"><span class="poptip-arrow poptip-arrow-top"><em>◆</em></span>' + Validatemsg + '</div>').css("left", obj.offset().left + 'px').css("top", obj.offset().top + obj.parent().height() + 5 + 'px')
-        $('body').append($poptip_error);
-        if (obj.hasClass('form-control') || obj.hasClass('ui-select')) {
+        if (obj.hasClass('form-control')) {
             obj.parent().addClass('has-error');
         }
-        if (obj.hasClass('ui-select')) {
-            $('.input-error').remove();
-        }
         obj.change(function () {
             if (obj.val()) {
                 removeMessage(obj);
             }
-        }); 
-        if (obj.hasClass('ui-select')) {
-            $(document).click(function (e) {
-                if (obj.attr('data-value')) {
-                    removeMessage(obj);
-                }
-                e.stopPropagation();
-            });
-        }
-        return false;  
+        });
+        return false;
     } catch (e) {
         alert(e)
     }
@@ -831,6 +822,5 @@ function ValidationMessage(obj, Validatemsg) {
 //移除提示
 function removeMessage(obj) {
     obj.parent().removeClass('has-error');
-    $('.poptip').remove();
-    $('.input-error').remove();
+    top.layer.closeAll('dialog');
 }