2022-05-31 22:01:51 +08:00

66 lines
2.3 KiB
HTML

{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">导航组</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">标题<font>*</font></td>
<td>
<input type="hidden" name="id" value="{$id}" />
<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入标题" lay-reqText="请输入标题" class="layui-input" {notempty name="$nav.title" }value="{$nav.title}" {/notempty}>
</td>
<td class="layui-td-gray">标识<font>*</font></td>
<td>
<input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="请输入标识" lay-reqText="请输入标识" class="layui-input" {notempty name="$nav.name" }value="{$nav.name}" {/notempty}>
</td>
</tr>
<tr>
<td class="layui-td-gray">状态<font>*</font></td>
<td colspan="3">
{if condition="$id eq 0"}
<input type="radio" name="status" value="1" title="正常" checked>
<input type="radio" name="status" value="-1" title="禁用">
{else/}
<input type="radio" name="status" value="1" title="正常" {eq name="$nav.status" value="1" }checked{/eq}>
<input type="radio" name="status" value="-1" title="禁用" {eq name="$nav.status" value="-1" }checked{/eq}>
{/if}
</td>
</tr>
<tr>
<td class="layui-td-gray">备注</td>
<td colspan="3"><textarea name="desc" placeholder="请输入备注" class="layui-textarea">{notempty name="$nav.desc" }{$nav.desc}{/notempty}</textarea></td>
</tr>
</table>
<div class="py-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var form = layui.form,tool=layui.tool;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
parent.layui.pageTable.reload();
setTimeout(function(){
parent.layui.tool.close();
},1000);
}
}
tool.post("/admin/nav/add", data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->