<%@ page language="java" contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fastboot" prefix="fb"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<fb:ui src="base/main">

	<fb:property name="title">系统配置</fb:property>

	<fb:script type="text/javascript">
		<script>
			layui.use(['tool', 'form'],
					function() {
				  		// 操作对象
					    var $ = layui.$,tool = layui.tool,form = layui.form;
						// 初始赋值
					    form.val('inputForm', ${json});
					    // 监听提交
					    form.on('submit(go)',function(data) {
					        console.log($("#inputForm").serializeArray());
					        tool.submit('${base}/config/submit', $("#inputForm").serializeArray());
					        return false;
					    });
					});
	</script>

	</fb:script>

	<fb:layout>
		<form id="inputForm" class="layui-form layui-form-pane" action="" lay-filter="inputForm">

			<input type="hidden" name="id" />

			<div class="layui-form-item">
				<label class="layui-form-label">标题 </label>
				<div class="layui-input-block">
					<input type="text" name="title" lay-verify="required" lay-verType="tips" autocomplete="off" placeholder="请输入标题" class="layui-input">
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">键 </label>
				<div class="layui-input-block">
					<input type="text" name="k" lay-verify="required" lay-verType="tips" autocomplete="off" placeholder="请输入键" class="layui-input">
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label">值 </label>
				<div class="layui-input-block">
					<textarea placeholder="请输入值" class="layui-textarea" name="v" style="height: 200px"></textarea>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">备注 </label>
				<div class="layui-input-block">
					<input type="text" name="remark" autocomplete="off" placeholder="请输入备注" class="layui-input">
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">排序 </label>
				<div class="layui-input-block">
					<input type="text" name="sort" lay-verify="number" lay-verType="tips" autocomplete="off" placeholder="请输入排序" class="layui-input">
				</div>
			</div>
			<button id="submit" lay-submit lay-filter="go" hidden="true" />
			<button id="reset" type="reset" hidden="true" />
		</form>

	</fb:layout>
</fb:ui>