<div class="uk-layui-form">
	<form class="layui-form" action="/admin/email/save.html" method="post">
		<div class="layui-form-item" style="margin-top:10px;">
			<div class="layui-inline">
				<label class="layui-form-label" style="width:150px;">技能组：</label>
				<div class="layui-input-inline">
					<select name="organ" required lay-verify="required">
						<#if organList?? && organList?size gt 0 >
							<#list organList as o>
								<option value="${o.id}">${o.name}</option>
							</#list>
						<#else>
							<option value="">请选择</option>
						</#if>
					</select>
				</div>
				<div class="layui-form-mid layui-word-aux">
					<font color="red">*</font>
				</div>
			</div>
		</div>
		<div class="layui-form-item" style="margin-top:10px;">
			<div class="layui-inline">
				<label class="layui-form-label" style="width:150px;">邮件服务器名称：</label>
				<div class="layui-input-inline">
					<input type="text" name="name" required lay-verify="required" autocomplete="off"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">
	            	<font color="red">*</font> 
	            </div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="width:150px;">邮件服务器地址：</label>
				<div class="layui-input-inline">
					<input type="text" name="smtpserver" required lay-verify="required" autocomplete="off"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">
	            	<font color="red">*</font> 
	            </div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="width:150px;">账号：</label>
				<div class="layui-input-inline">
					<input type="text" name="smtpuser" required lay-verify="required" autocomplete="off"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">
	            	<font color="red">*</font> 
	            </div>
			</div>
		</div>
		
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="width:150px;">密码：</label>
				<div class="layui-input-inline">
					<input type="password" name="smtppassword" required lay-verify="required" autocomplete="off"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">
	            	<font color="red">*</font> 
	            </div>
			</div>
		</div>
		
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="width:150px;">邮件发件人：</label>
				<div class="layui-input-inline">
					<input type="text" name="mailfrom" required autocomplete="off"
						class="layui-input">
				</div>
			</div>
		</div>
		
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="width:150px;">邮件服务器启用SSL：</label>
				<div class="layui-input-inline">
					<input type="checkbox" title="启用" name="seclev" value="true" lay-filter="ssl">
				</div>
			</div>
		</div>

		<div class="layui-form-item" id="sslport" style="display:none;">
			<div class="layui-inline">
				<label class="layui-form-label" style="width:150px;">SSL端口：</label>
				<div class="layui-input-inline">
					<input type="text" name="sslport"  autocomplete="off"
						class="layui-input">
				</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">重置</button>
			</div>
		</div>
	</form>
</div>
<script>
	layui.use('form', function() {
		var form = layui.form();
		form.render(); //更新全部
		form.on("checkbox(ssl)" , function(data){
			if(data.elem.checked == true){
				$('#sslport').show();		
			}else{
				$('#sslport').hide();
				$("input[name=sslport]").val("");
			}
		});
	});
	layui.use('element', function(){
		var element = layui.element();
	});
	
</script>