<div class="uk-layui-form">
	<form class="layui-form uk-form" action="/admin/metadata/properties/update.html">
		<input type="hidden" name="id" value="${tp.id!''}">
		<div class="layui-form-item">
			<label class="layui-form-label">标题：</label>
			<div class="layui-input-inline">
				<input type="text" name="name" value="${tp.name!''}"
					required lay-verify="required" placeholder="标题"
					autocomplete="off" class="layui-input">
			</div>
		</div>
		
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">禁用导入导出：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="impfield" lay-skin="switch" value="1" <#if tp.impfield == true>checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label" style="width:100px;">生成ID：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="pk" lay-skin="switch" value="1" <#if tp.pk == true>checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">启用字典：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="seldata" lay-filter="dic" lay-skin="switch" value="1" <#if tp.seldata == true>checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>
			<div class="layui-inline"  id="sysdicsel" style="<#if tp.seldata == false>display:none;</#if>">
				<label class="layui-form-label" style="width:60px;">字典项：</label>
				<div class="layui-input-inline">
					<select name="seldatacode" lay-ignore style="width:220px;">
						<option value="">请选择字典项</option>
						<#if sysdicList??>
						<#list sysdicList as sysDic>
						<option value="${sysDic.code!''}" <#if tp.seldatacode?? && tp.seldatacode == sysDic.code>selected="selected"</#if>>${sysDic.name}</option>
						</#list>
						</#if>
					</select>
				</div>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">启用流程变量：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="systemfield" lay-skin="switch" value="1" <#if tp.systemfield == true>checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label" style="width:100px;">启用多值：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="modits" lay-skin="switch" value="1" <#if tp.modits == true>checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>
		</div>
		
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">启用关联：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="reffk" lay-skin="switch" lay-filter="fk" value="1" <#if tp.reffk == true>checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>
			<div class="layui-inline" id="fk" style="<#if tp.reffk?? && tp.reffk><#else>display:none;</#if>" lay-ignore>
				<label class="layui-form-label" style="width:60px;">关联表：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					  <select name="reftbid" lay-ignore style="width:220px;">
						<option value="">请选择数据接口</option>
						<#if dataImplList??>
						<#list dataImplList as datadic>
						<option value="${datadic.code!''}" <#if tp.reftbid?? && tp.reftbid == datadic.code>selected="selected"</#if>>${datadic.name}</option>
						</#list>
						</#if>
					</select>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">数据校验：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:380px;margin-top:0px;">
					<input type="checkbox" name="defaultvaluetitle" title="非空" value="required" <#if tp.defaultvaluetitle?? && tp.defaultvaluetitle?index_of("required") gte 0>checked</#if> lay-skin="primary">
					<input type="checkbox" name="defaultvaluetitle" title="数字" value="numstr" <#if tp.defaultvaluetitle?? && tp.defaultvaluetitle?index_of("numstr") gte 0>checked</#if> lay-skin="primary"> 
					<input type="checkbox" name="defaultvaluetitle" title="日期" value="datenum" <#if tp.defaultvaluetitle?? && tp.defaultvaluetitle?index_of("datenum") gte 0>checked</#if> lay-skin="primary">
					<input type="checkbox" name="defaultvaluetitle" title="日期时间" value="datetime" <#if tp.defaultvaluetitle?? && tp.defaultvaluetitle?index_of("datetime") gte 0>checked</#if> lay-skin="primary"> 
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">转日期：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:380px;margin-top:0px;">
					 <input type="checkbox" name=defaultfieldvalue lay-skin="switch" value="date" <#if tp.defaultfieldvalue?? && tp.defaultfieldvalue == "date">checked="checked"</#if> lay-text="开启|关闭">
				</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>
//Demo
layui.use('form', function(){
  var form = layui.form();
  form.render(); //更新全部
  form.on("switch(dic)" , function(data){
  	if(data.elem.checked){
	  	$("#sysdicsel").show();
  	}else{
  		$("#sysdicsel").hide();
  	}
  });
  form.on("switch(fk)" , function(data){
  	if(data.elem.checked){
	  	$("#fk").show();
  	}else{
  		$("#fk").hide();
  	}
  });
});
</script>