Browse Source

标签管理

shuzheng 9 years ago
parent
commit
edc0534b5f

+ 0 - 63
zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/tag/_list.jsp

@@ -1,63 +0,0 @@
-<%@ page contentType="text/html; charset=utf-8"%>
-<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
-<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
-<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
-<c:set var="basePath" value="${pageContext.request.contextPath}"/>
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8"/>
-<title>列表</title>
-</head>
-<body>
-<div>
-	<a href="${basePath}/manage/index">首页</a> &gt; 标签列表
-</div>
-<div>
-	<table border="1">
-		<caption><a href="${basePath}/manage/tag/add">新增</a></caption>
-		<thead>
-			<tr>
-				<th>ID</th>
-				<th>名称</th>
-				<th>描述</th>
-				<th>图标</th>
-				<th>类型</th>
-				<th>别名</th>
-				<th>创建时间</th>
-				<th>操作</th>
-			</tr>
-		</thead>
-		<tbody>
-			<c:forEach var="tag" items="${tags}">
-			<tr>
-				<td>${tag.tagId}</td>
-				<td>${tag.name}</td>
-				<td>${tag.description}</td>
-				<td>${tag.icon}</td>
-				<td>
-					<c:if test="${tag.type==1}">普通</c:if>
-					<c:if test="${tag.type==2}">热门</c:if>
-				</td>
-				<td>${tag.alias}</td>
-				<td>
-					<jsp:useBean id="date" class="java.util.Date"/>
-					<jsp:setProperty name="date" property="time" value="${tag.ctime}"/>
-					<fmt:formatDate value="${date}" type="both" pattern="yyyy-MM-dd HH:mm:ss" timeZone="Asia/Shanghai"/>
-				</td>
-				<td>
-					<a href="${basePath}/manage/tag/update/${tag.tagId}">修改</a>
-					<a href="${basePath}/manage/tag/delete/${tag.tagId}" onclick="return confirm('确认删除吗?');">删除</a>
-					<a href="${basePath}/manage/tag/up/${article.articleId}">上移</a>
-					<a href="${basePath}/manage/tag/down/${article.articleId}">下移</a>
-				</td>
-			</tr>
-			</c:forEach>
-		</tbody>
-	</table>
-	<div>${paginator.html}</div>
-</div>
-</body>
-</html>

+ 0 - 39
zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/tag/add.jsp

@@ -1,39 +0,0 @@
-<%@ page contentType="text/html; charset=utf-8"%>
-<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
-<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
-<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
-<c:set var="basePath" value="${pageContext.request.contextPath}"/>
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8"/>
-<title>新增</title>
-</head>
-<body>
-<div>
-	<a href="${basePath}/manage/index">首页</a> &gt; <a href="${basePath}/manage/tag/list">标签列表</a> &gt; 新增
-</div>
-<div>
-	<form method="post">
-	<table border="1">
-		<tr><td>名称:</td><td><input type="text" name="name" autofocus/></td></tr>
-		<tr><td>描述:</td><td><input type="text" name="description"/></td></tr>
-		<tr><td>图标:</td><td><input type="text" name="icon"/></td></tr>
-		<tr>
-			<td>类型:</td>
-			<td>
-				<select name="type">
-					<option value="1">普通</option>
-					<option value="2">热门</option>
-				</select>
-			</td>
-		</tr>
-		<tr><td>别名:</td><td><input type="text" name="alias"/></td></tr>
-		<tr><td></td><td><a href="${basePath}/manage/tag/list">取消</a> <input type="submit" value="保存"/></td></tr>
-	</table>
-	</form>
-</div>
-</body>
-</html>

+ 126 - 0
zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/tag/create.jsp

@@ -0,0 +1,126 @@
+<%@ page contentType="text/html; charset=utf-8"%>
+<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
+<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
+<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
+<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
+<c:set var="basePath" value="${pageContext.request.contextPath}"/>
+<div id="createDialog" class="crudDialog">
+	<form id="createForm" method="post">
+		<div class="form-group">
+			<label for="icon">图标</label>
+			<input id="icon" type="text" class="form-control" name="icon" maxlength="20">
+		</div>
+		<div class="form-group">
+			<label for="title">标题</label>
+			<input id="title" type="text" class="form-control" name="title" maxlength="20">
+		</div>
+		<div class="form-group">
+			<label for="name">名称</label>
+			<input id="name" type="text" class="form-control" name="name" maxlength="20">
+		</div>
+		<div class="form-group">
+			<label for="theme">主题</label>
+			<input id="theme" type="text" class="form-control" name="theme" maxlength="50">
+		</div>
+		<div class="form-group">
+			<label for="banner">背景图</label>
+			<input id="banner" type="text" class="form-control" name="banner" maxlength="50">
+		</div>
+		<div class="form-group">
+			<label for="description">描述</label>
+			<input id="description" type="text" class="form-control" name="description" maxlength="300">
+		</div>
+		<div class="form-group">
+			<label for="basepath">根目录</label>
+			<input id="basepath" type="text" class="form-control" name="basepath" maxlength="100">
+		</div>
+		<div class="radio">
+			<div class="radio radio-inline radio-success">
+				<input id="status_1" type="radio" name="status" value="1" checked>
+				<label for="status_1">正常 </label>
+			</div>
+			<div class="radio radio-inline">
+				<input id="status_0" type="radio" name="status" value="-1">
+				<label for="status_0">锁定 </label>
+			</div>
+		</div>
+		<div class="form-group text-right dialog-buttons">
+			<a class="waves-effect waves-button" href="javascript:;" onclick="createSubmit();">保存</a>
+			<a class="waves-effect waves-button" href="javascript:;" onclick="createDialog.close();">取消</a>
+		</div>
+	</form>
+</div>
+<script>
+function createSubmit() {
+    $.ajax({
+        type: 'post',
+        url: '${basePath}/manage/system/create',
+        data: $('#createForm').serialize(),
+        beforeSend: function() {
+            if ($('#title').val() == '') {
+                $('#title').focus();
+                return false;
+            }
+            if ($('#name').val() == '') {
+                $('#name').focus();
+                return false;
+            }
+        },
+        success: function(result) {
+			if (result.code != 1) {
+				if (result.data instanceof Array) {
+					$.each(result.data, function(index, value) {
+						$.confirm({
+							theme: 'dark',
+							animation: 'rotateX',
+							closeAnimation: 'rotateX',
+							title: false,
+							content: value.errorMsg,
+							buttons: {
+								confirm: {
+									text: '确认',
+									btnClass: 'waves-effect waves-button waves-light'
+								}
+							}
+						});
+					});
+				} else {
+						$.confirm({
+							theme: 'dark',
+							animation: 'rotateX',
+							closeAnimation: 'rotateX',
+							title: false,
+							content: result.data.errorMsg,
+							buttons: {
+								confirm: {
+									text: '确认',
+									btnClass: 'waves-effect waves-button waves-light'
+								}
+							}
+						});
+				}
+			} else {
+				createDialog.close();
+				$table.bootstrapTable('refresh');
+			}
+        },
+        error: function(XMLHttpRequest, textStatus, errorThrown) {
+			$.confirm({
+				theme: 'dark',
+				animation: 'rotateX',
+				closeAnimation: 'rotateX',
+				title: false,
+				content: textStatus,
+				buttons: {
+					confirm: {
+						text: '确认',
+						btnClass: 'waves-effect waves-button waves-light'
+					}
+				}
+			});
+        }
+    });
+}
+</script>

+ 197 - 90
zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/tag/index.jsp

@@ -1,9 +1,10 @@
-<%@ page contentType="text/html; charset=utf-8"%>
+<%@ page contentType="text/html; charset=utf-8"%>
 <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
 <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
 <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
+<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
 <c:set var="basePath" value="${pageContext.request.contextPath}"/>
 <!DOCTYPE HTML>
 <html lang="zh-cn">
@@ -11,109 +12,215 @@
 	<meta charset="utf-8">
 	<meta http-equiv="X-UA-Compatible" content="IE=edge">
 	<meta name="viewport" content="width=device-width, initial-scale=1">
-	<title>标签列表</title>
-
-	<link href="${basePath}/resources/zheng-ui/plugins/bootstrap-3.3.0/css/bootstrap.min.css" rel="stylesheet"/>
-	<link href="${basePath}/resources/zheng-ui/plugins/material-design-iconic-font-2.2.0/css/material-design-iconic-font.min.css" rel="stylesheet"/>
-	<link href="${basePath}/resources/zheng-ui/plugins/bootstrap-table-1.11.0/bootstrap-table.min.css" rel="stylesheet"/>
-	<link href="${basePath}/resources/zheng-ui/plugins/waves-0.7.5/waves.min.css" rel="stylesheet"/>
-
-	<link href="${basePath}/resources/zheng-ui/css/common.css" rel="stylesheet"/>
+	<title>标签管理</title>
+	<jsp:include page="/resources/inc/head.jsp" flush="true"/>
 </head>
 <body>
 <div id="main">
 	<div id="toolbar">
-		<a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增标签</a>
-		<a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑标签</a>
-		<a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除标签</a>
+		<%--<shiro:hasPermission name="cms:tag:read"><a class="waves-effect waves-button" href="javascript:;" onclick="createAction()"><i class="zmdi zmdi-plus"></i> 新增标签</a></shiro:hasPermission>--%>
+		<%--<shiro:hasPermission name="cms:tag:update"><a class="waves-effect waves-button" href="javascript:;" onclick="updateAction()"><i class="zmdi zmdi-edit"></i> 编辑标签</a></shiro:hasPermission>--%>
+		<%--<shiro:hasPermission name="cms:tag:delete"><a class="waves-effect waves-button" href="javascript:;" onclick="deleteAction()"><i class="zmdi zmdi-close"></i> 删除标签</a></shiro:hasPermission>--%>
 	</div>
 	<table id="table"></table>
 </div>
-<script src="${basePath}/resources/zheng-ui/plugins/jquery.1.12.4.min.js"></script>
-<script src="${basePath}/resources/zheng-ui/plugins/bootstrap-3.3.0/js/bootstrap.min.js"></script>
-<script src="${basePath}/resources/zheng-ui/plugins/bootstrap-table-1.11.0/bootstrap-table.min.js"></script>
-<script src="${basePath}/resources/zheng-ui/plugins/bootstrap-table-1.11.0/locale/bootstrap-table-zh-CN.min.js"></script>
-<script src="${basePath}/resources/zheng-ui/plugins/waves-0.7.5/waves.min.js"></script>
-
-<script src="${basePath}/resources/zheng-ui/js/common.js"></script>
+<jsp:include page="/resources/inc/footer.jsp" flush="true"/>
 <script>
-	$(function() {
-		// bootstrap table初始化
-		$('#table').bootstrapTable({
-			url: '${basePath}/manage/tag/list',
-			height: getHeight(),
-			striped: true,
-			search: true,
-			searchOnEnterKey: true,
-			showRefresh: true,
-			showToggle: true,
-			showColumns: true,
-			minimumCountColumns: 2,
-			showPaginationSwitch: true,
-			clickToSelect: true,
-			detailView: true,
-			detailFormatter: 'detailFormatter',
-			pagination: true,
-			paginationLoop: false,
-			classes: 'table table-hover table-no-bordered',
-			sidePagination: 'server',
-			idField: 'tag_id',
-			sortName: 'tag_id',
-			sortOrder: 'desc',
-			toolbar: '#toolbar',
-			columns: [
-				{field: 'state', checkbox: true},
-				{field: 'tagId', title: '编号', sortable: true, halign: 'center'},
-				{field: 'name', title: '标签名称', sortable: true, halign: 'center'},
-				{field: 'description', title: '标签描述', sortable: true, halign: 'center'},
-				{field: 'icon', title: '图标', sortable: true, halign: 'center'},
-				{field: 'type', title: '类型', sortable: true, halign: 'center'},
-				{field: 'alias', title: '别名', sortable: true, halign: 'center'},
-				{field: 'ctime', title: '创建时间', sortable: true, halign: 'center'},
-				{field: 'action', title: '操作', halign: 'center', align: 'center', formatter: 'actionFormatter', events: 'actionEvents'}
-			]
-		}).on('all.bs.table', function (e, name, args) {
-			$('[data-toggle="tooltip"]').tooltip();
-			$('[data-toggle="popover"]').popover();
-		});
-		$(window).resize(function () {
-			$('#table').bootstrapTable('resetView', {
-				height: getHeight()
-			});
-		});
+var $table = $('#table');
+$(function() {
+	// bootstrap table初始化
+	$table.bootstrapTable({
+		url: '${basePath}/manage/tag/list',
+		height: getHeight(),
+		striped: true,
+		search: true,
+		showRefresh: true,
+		showColumns: true,
+		minimumCountColumns: 2,
+		clickToSelect: true,
+		detailView: true,
+		detailFormatter: 'detailFormatter',
+		pagination: true,
+		paginationLoop: false,
+		sidePagination: 'server',
+		silentSort: false,
+		smartDisplay: false,
+		escape: true,
+		searchOnEnterKey: true,
+		idField: 'tagId',
+		maintainSelected: true,
+		toolbar: '#toolbar',
+		columns: [
+			{field: 'ck', checkbox: true},
+			{field: 'tagId', title: '编号', sortable: true, align: 'center'},
+			{field: 'name', title: '标签名称'},
+			{field: 'alias', title: '标签别名'},
+			{field: 'description', title: '描述'},
+			{field: 'icon', title: '图标', sortable: true, align: 'center', formatter: 'iconFormatter'},
+			{field: 'type', title: '类型', sortable: true, align: 'center', formatter: 'typeFormatter'},
+			{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false}
+		]
 	});
-	function actionFormatter(value, row, index) {
-		return [
-			'<a class="like" href="javascript:void(0)" data-toggle="tooltip" title="Like"><i class="glyphicon glyphicon-heart"></i></a> ',
-			'<a class="edit ml10" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
-			'<a class="remove ml10" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
-		].join('');
+});
+// 格式化操作按钮
+function actionFormatter(value, row, index) {
+    return [
+        '<a class="update" href="javascript:;" onclick="updateAction()" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
+        '<a class="delete" href="javascript:;" onclick="deleteAction()" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
+    ].join('');
+}
+// 格式化图标
+function iconFormatter(value, row, index) {
+    return '<i class="' + value + '"></i>';
+}
+// 格式化类型
+function typeFormatter(value, row, index) {
+	if (value == 1) {
+		return '<span class="label label-default">普通</span>';
 	}
-
-	window.actionEvents = {
-		'click .like': function (e, value, row, index) {
-			alert('You click like icon, row: ' + JSON.stringify(row));
-			console.log(value, row, index);
-		},
-		'click .edit': function (e, value, row, index) {
-			alert('You click edit icon, row: ' + JSON.stringify(row));
-			console.log(value, row, index);
-		},
-		'click .remove': function (e, value, row, index) {
-			alert('You click remove icon, row: ' + JSON.stringify(row));
-			console.log(value, row, index);
+	if (value == 2) {
+		return '<span class="label label-danger">热门</span>';
+	}
+}
+// 新增
+var createDialog;
+function createAction() {
+	createDialog = $.dialog({
+		animationSpeed: 300,
+		title: '新增标签',
+		content: 'url:${basePath}/manage/tag/create',
+		onContentReady: function () {
+			initMaterialInput();
 		}
-	};
-	function detailFormatter(index, row) {
-		var html = [];
-		$.each(row, function (key, value) {
-			html.push('<p><b>' + key + ':</b> ' + value + '</p>');
+	});
+}
+// 编辑
+var updateDialog;
+function updateAction() {
+	var rows = $table.bootstrapTable('getSelections');
+	if (rows.length != 1) {
+		$.confirm({
+			title: false,
+			content: '请选择一条记录!',
+			autoClose: 'cancel|3000',
+			backgroundDismiss: true,
+			buttons: {
+				cancel: {
+					text: '取消',
+					btnClass: 'waves-effect waves-button'
+				}
+			}
+		});
+	} else {
+		updateDialog = $.dialog({
+			animationSpeed: 300,
+			title: '编辑标签',
+			content: 'url:${basePath}/manage/tag/update/' + rows[0].tagId,
+			onContentReady: function () {
+				initMaterialInput();
+			}
 		});
-		return html.join('');
 	}
-	function getHeight() {
-		return $(window).height() - 20;
+}
+// 删除
+var deleteDialog;
+function deleteAction() {
+	var rows = $table.bootstrapTable('getSelections');
+	if (rows.length == 0) {
+		$.confirm({
+			title: false,
+			content: '请至少选择一条记录!',
+			autoClose: 'cancel|3000',
+			backgroundDismiss: true,
+			buttons: {
+				cancel: {
+					text: '取消',
+					btnClass: 'waves-effect waves-button'
+				}
+			}
+		});
+	} else {
+		deleteDialog = $.confirm({
+			type: 'red',
+			animationSpeed: 300,
+			title: false,
+			content: '确认删除该标签吗?',
+			buttons: {
+				confirm: {
+					text: '确认',
+					btnClass: 'waves-effect waves-button',
+					action: function () {
+						var ids = new Array();
+						for (var i in rows) {
+							ids.push(rows[i].tagId);
+						}
+						$.ajax({
+							type: 'get',
+							url: '${basePath}/manage/tag/delete/' + ids.join("-"),
+							success: function(result) {
+								if (result.code != 1) {
+									if (result.data instanceof Array) {
+										$.each(result.data, function(index, value) {
+											$.confirm({
+												theme: 'dark',
+												animation: 'rotateX',
+												closeAnimation: 'rotateX',
+												title: false,
+												content: value.errorMsg,
+												buttons: {
+													confirm: {
+														text: '确认',
+														btnClass: 'waves-effect waves-button waves-light'
+													}
+												}
+											});
+										});
+									} else {
+										$.confirm({
+											theme: 'dark',
+											animation: 'rotateX',
+											closeAnimation: 'rotateX',
+											title: false,
+											content: result.data.errorMsg,
+											buttons: {
+												confirm: {
+													text: '确认',
+													btnClass: 'waves-effect waves-button waves-light'
+												}
+											}
+										});
+									}
+								} else {
+									deleteDialog.close();
+									$table.bootstrapTable('refresh');
+								}
+							},
+							error: function(XMLHttpRequest, textStatus, errorThrown) {
+								$.confirm({
+									theme: 'dark',
+									animation: 'rotateX',
+									closeAnimation: 'rotateX',
+									title: false,
+									content: textStatus,
+									buttons: {
+										confirm: {
+											text: '确认',
+											btnClass: 'waves-effect waves-button waves-light'
+										}
+									}
+								});
+							}
+						});
+					}
+				},
+				cancel: {
+					text: '取消',
+					btnClass: 'waves-effect waves-button'
+				}
+			}
+		});
 	}
+}
 </script>
 </body>
 </html>

+ 118 - 32
zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/tag/update.jsp

@@ -1,40 +1,126 @@
-<%@ page contentType="text/html; charset=utf-8"%>
+<%@ page contentType="text/html; charset=utf-8"%>
 <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
 <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
 <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
+<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
 <c:set var="basePath" value="${pageContext.request.contextPath}"/>
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8"/>
-<title>编辑</title>
-</head>
-<body>
-<div>
-	<a href="${basePath}/manage/index">首页</a> &gt; <a href="${basePath}/manage/tag/list">标签列表</a> &gt; 编辑
-</div>
-<div>
-	<form method="post">
-	<table border="1">
-		<input type="hidden" name="tagId" value="${tag.tagId}"/>
-		<tr><td>名称:</td><td><input type="text" name="name" value="${tag.name}"/></td></tr>
-		<tr><td>描述:</td><td><input type="text" name="description" value="${tag.description}"/></td></tr>
-		<tr><td>图标:</td><td><input type="text" name="icon" value="${tag.icon}"/></td></tr>
-		<tr>
-			<td>类型:</td>
-			<td>
-				<select name="type">
-					<option value="1" <c:if test="${tag.type==1}">selected="selected"</c:if>>普通</option>
-					<option value="2" <c:if test="${tag.type==2}">selected="selected"</c:if>>热门</option>
-				</select>
-			</td>
-		</tr>
-		<tr><td>别名:</td><td><input type="text" name="alias" value="${tag.alias}"/></td></tr>
-		<tr><td></td><td><a href="${basePath}/manage/tag/list">取消</a> <input type="submit" value="保存"/></td></tr>
-	</table>
+<div id="updateDialog" class="crudDialog">
+	<form id="updateForm" method="post">
+		<div class="form-group">
+			<label for="icon">图标</label>
+			<input id="icon" type="text" class="form-control" name="icon" maxlength="20" value="${system.icon}">
+		</div>
+		<div class="form-group">
+			<label for="title">标题</label>
+			<input id="title" type="text" class="form-control" name="title" maxlength="20" value="${system.title}">
+		</div>
+		<div class="form-group">
+			<label for="name">名称</label>
+			<input id="name" type="text" class="form-control" name="name" maxlength="20" value="${system.name}">
+		</div>
+		<div class="form-group">
+			<label for="theme">主题</label>
+			<input id="theme" type="text" class="form-control" name="theme" maxlength="50" value="${system.theme}">
+		</div>
+		<div class="form-group">
+			<label for="banner">背景图</label>
+			<input id="banner" type="text" class="form-control" name="banner" maxlength="50" value="${system.banner}">
+		</div>
+		<div class="form-group">
+			<label for="description">描述</label>
+			<input id="description" type="text" class="form-control" name="description" maxlength="300" value="${system.description}">
+		</div>
+		<div class="form-group">
+			<label for="basepath">根目录</label>
+			<input id="basepath" type="text" class="form-control" name="basepath" maxlength="100" value="${system.basepath}">
+		</div>
+		<div class="radio">
+			<div class="radio radio-inline radio-success">
+				<input id="status_1" type="radio" name="status" value="1" <c:if test="${system.status==1}">checked</c:if>>
+				<label for="status_1">正常 </label>
+			</div>
+			<div class="radio radio-inline">
+				<input id="status_0" type="radio" name="status" value="-1" <c:if test="${system.status!=1}">checked</c:if>>
+				<label for="status_0">锁定 </label>
+			</div>
+		</div>
+		<div class="form-group text-right dialog-buttons">
+			<a class="waves-effect waves-button" href="javascript:;" onclick="createSubmit();">保存</a>
+			<a class="waves-effect waves-button" href="javascript:;" onclick="updateDialog.close();">取消</a>
+		</div>
 	</form>
 </div>
-</body>
-</html>
+<script>
+function createSubmit() {
+    $.ajax({
+        type: 'post',
+        url: '${basePath}/manage/system/update/${system.systemId}',
+        data: $('#updateForm').serialize(),
+        beforeSend: function() {
+            if ($('#title').val() == '') {
+                $('#title').focus();
+                return false;
+            }
+            if ($('#name').val() == '') {
+                $('#name').focus();
+                return false;
+            }
+        },
+        success: function(result) {
+			if (result.code != 1) {
+				if (result.data instanceof Array) {
+					$.each(result.data, function(index, value) {
+						$.confirm({
+							theme: 'dark',
+							animation: 'rotateX',
+							closeAnimation: 'rotateX',
+							title: false,
+							content: value.errorMsg,
+							buttons: {
+								confirm: {
+									text: '确认',
+									btnClass: 'waves-effect waves-button waves-light'
+								}
+							}
+						});
+					});
+				} else {
+						$.confirm({
+							theme: 'dark',
+							animation: 'rotateX',
+							closeAnimation: 'rotateX',
+							title: false,
+							content: result.data.errorMsg,
+							buttons: {
+								confirm: {
+									text: '确认',
+									btnClass: 'waves-effect waves-button waves-light'
+								}
+							}
+						});
+				}
+			} else {
+				updateDialog.close();
+				$table.bootstrapTable('refresh');
+			}
+        },
+        error: function(XMLHttpRequest, textStatus, errorThrown) {
+			$.confirm({
+				theme: 'dark',
+				animation: 'rotateX',
+				closeAnimation: 'rotateX',
+				title: false,
+				content: textStatus,
+				buttons: {
+					confirm: {
+						text: '确认',
+						btnClass: 'waves-effect waves-button waves-light'
+					}
+				}
+			});
+        }
+    });
+}
+</script>

+ 3 - 1
zheng-cms/zheng-cms-common/src/main/java/com/zheng/cms/common/constant/CmsResultConstant.java

@@ -8,7 +8,9 @@ public enum CmsResultConstant {
 
     SUCCESS(1, "success"),
 
-    FILE_TYPE_ERROR(20001, "File type not supported!");
+    FILE_TYPE_ERROR(20001, "File type not supported!"),
+
+    INVALID_LENGTH(20002, "Invalid length");
 
     public int code;