<div class="uk-layui-form">
	<form class="layui-form uk-form" method="post" action="/setting/tag/update.html">
		<input type="hidden" name="id" value="${tag.id!''}">
		<input type="hidden" name="tagtype" value="${tagtype!''}">
		<input type="hidden" id="initialColor" value="<#if tag??>${tag.color!''}</#if>">
	  <div class="layui-form-item">
	    <label class="layui-form-label">标签：</label>
	    <div class="layui-input-inline">
	      <input type="text" name="tag" required value="${tag.tag!''}" lay-verify="required" placeholder="请输入标签" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  <div class="layui-form-item" style="margin-top:20px;">
	    <label class="layui-form-label">背景颜色：</label>
	    <div class="layui-input-inline ukefu-im-theme" style="width: 350px;">
	      	<div class="item-cnt ukefu-im-ping-color" style="display: block;">
	      		<input type="hidden" name="color" id="color" value="<#if tag??>${tag.color!''}</#if>">
				<div class="ukefu-im-item theme1 <#if tag?? && tag.color?? && tag.color == '1'>ukefu-im-checked</#if>"
					data-class="theme1" data-value="1">
					<i
						class="layui-icon ukefu-im-check">&#xe618;</i>
				</div>
				<div class="ukefu-im-item theme2 <#if tag?? && tag.color?? && tag.color == '2'>ukefu-im-checked</#if>" data-class="theme2" data-value="2">
					<i
						class="layui-icon ukefu-im-check">&#xe618;</i>
				</div>
				<div class="ukefu-im-item theme3 <#if tag?? && tag.color?? && tag.color == '3'>ukefu-im-checked</#if>" data-class="theme3" data-value="3">
					<i
						class="layui-icon ukefu-im-check">&#xe618;</i>
				</div>
				<div class="ukefu-im-item theme4 <#if tag?? && tag.color?? && tag.color == '4'>ukefu-im-checked</#if>" data-class="theme4" data-value="4">
					<i
						class="layui-icon ukefu-im-check">&#xe618;</i>
				</div>
				<div class="ukefu-im-item theme5 <#if tag?? && tag.color?? && tag.color == '5'>ukefu-im-checked</#if>" data-class="theme5" data-value="5">
					<i
						class="layui-icon ukefu-im-check">&#xe618;</i>
				</div>
				<div class="ukefu-im-item theme6 <#if tag?? && tag.color?? && tag.color == '6'>ukefu-im-checked</#if>" data-class="theme6" data-value="6">
					<i
						class="layui-icon ukefu-im-check">&#xe618;</i>
				</div>
			</div>
	    </div>
	  </div>
	  <div class="layui-form-button">
	    <div class="layui-button-block">
	      <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
	      <button type="reset" class="layui-btn layui-btn-primary" id="reset">重置</button>
	    </div>
	  </div>
	</form>
</div>
 
<script>
//Demo
layui.use('form', function(){
  var form = layui.form();
  form.render(); //更新全部
  form.verify({
	  repass: function(value){
	    if(value != $('#password').val()){
	      return '两次输入的密码不一致，请确认';
	    }
	  }
	});      
});
$(document).ready(
		function() {
			$('.ukefu-im-ping-color .ukefu-im-item')
					.click(
							function() {
								var theme = $(this).attr(
										'data-class');
								$('.ukefu-im-ping-color .ukefu-im-item')
										.removeClass(
												'ukefu-im-checked');
								$(this).addClass('ukefu-im-checked');
								$('#color').val($(this).attr('data-value'));
							});
		});

	    $("#reset").click(function () {
	    	var num = $("#initialColor").val()
			$('.ukefu-im-ping-color .ukefu-im-item')
					.removeClass(
							'ukefu-im-checked');
			$(".theme" + num).addClass('ukefu-im-checked');
			$('#color').val(num)
		})

</script>