123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- {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="hidden" name="nav_id" value="{$nav_id}" />
- <select name="pid" lay-verify="required" lay-reqText="请选择父级导航">
- <option value="0">作为顶级导航</option>
- {volist name=":set_recursion(get_nav($nav_id))" id="v"}
- <option value="{$v.id}" {eq name="pid" value="$v.id" }selected="" {/eq}>{$v.title} </option>
- {/volist}
- </select>
- </td>
- <td class="layui-td-gray">排序</td>
- <td>
- <input type="text" name="sort" autocomplete="off" class="layui-input" {notempty name="$nav.sort"
- }value="{$nav.sort}" {else/}value="0" {/notempty}>
- </td>
- <td class="layui-td-gray">参数</td>
- <td>
- <input type="text" name="param" placeholder="请输入导航参数,可空" autocomplete="off" class="layui-input"
- {notempty name="$nav.param" }value="{$nav.param}" {/notempty}>
- </td>
- </tr>
- <tr>
- <td class="layui-td-gray">导航名称<font>*</font>
- </td>
- <td colspan="3">
- <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-2">新窗口打开</td>
- <td>
- {if condition="$id eq 0"}
- <input type="radio" name="target" value="0" title="否" checked>
- <input type="radio" name="target" value="1" title="是">
- {else/}
- <input type="radio" name="target" value="0" title="否" {eq name="$nav.target" value="0" }checked{/eq}>
- <input type="radio" name="target" value="1" title="是" {eq name="$nav.target" value="1" }checked{/eq}>
- {/if}
- </td>
- </tr>
- <tr>
- <td class="layui-td-gray">网址链接</td>
- <td colspan="3">
- <input type="text" name="src" placeholder="请输入导航网址链接,可空" autocomplete="off" class="layui-input"
- {notempty name="$nav.src" }value="{$nav.src}" {/notempty}>
- </td>
- <td class="layui-td-gray">状态<font>*</font>
- </td>
- <td>
- {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>
- </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) {
- setTimeout(function () {
- parent.location.reload();
- }, 1000);
- }
- }
- tool.post("/admin/nav/nav_info_add", data.field, callback);
- return false;
- });
- }
- </script>
- {/block}
- <!-- /脚本 -->
|