nav_info_add.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. {extend name="common/base"/}
  2. <!-- 主体 -->
  3. {block name="body"}
  4. <form class="layui-form p-4">
  5. <h3 class="pb-3">导航内容</h3>
  6. <table class="layui-table layui-table-form">
  7. <tr>
  8. <td class="layui-td-gray">父级导航<font>*</font>
  9. </td>
  10. <td>
  11. <input type="hidden" name="id" value="{$id}" />
  12. <input type="hidden" name="nav_id" value="{$nav_id}" />
  13. <select name="pid" lay-verify="required" lay-reqText="请选择父级导航">
  14. <option value="0">作为顶级导航</option>
  15. {volist name=":set_recursion(get_nav($nav_id))" id="v"}
  16. <option value="{$v.id}" {eq name="pid" value="$v.id" }selected="" {/eq}>{$v.title} </option>
  17. {/volist}
  18. </select>
  19. </td>
  20. <td class="layui-td-gray">排序</td>
  21. <td>
  22. <input type="text" name="sort" autocomplete="off" class="layui-input" {notempty name="$nav.sort"
  23. }value="{$nav.sort}" {else/}value="0" {/notempty}>
  24. </td>
  25. <td class="layui-td-gray">参数</td>
  26. <td>
  27. <input type="text" name="param" placeholder="请输入导航参数,可空" autocomplete="off" class="layui-input"
  28. {notempty name="$nav.param" }value="{$nav.param}" {/notempty}>
  29. </td>
  30. </tr>
  31. <tr>
  32. <td class="layui-td-gray">导航名称<font>*</font>
  33. </td>
  34. <td colspan="3">
  35. <input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入名称"
  36. lay-reqText="请输入名称" class="layui-input" {notempty name="$nav.title" }value="{$nav.title}"
  37. {/notempty}>
  38. </td>
  39. <td class="layui-td-gray-2">新窗口打开</td>
  40. <td>
  41. {if condition="$id eq 0"}
  42. <input type="radio" name="target" value="0" title="否" checked>
  43. <input type="radio" name="target" value="1" title="是">
  44. {else/}
  45. <input type="radio" name="target" value="0" title="否" {eq name="$nav.target" value="0" }checked{/eq}>
  46. <input type="radio" name="target" value="1" title="是" {eq name="$nav.target" value="1" }checked{/eq}>
  47. {/if}
  48. </td>
  49. </tr>
  50. <tr>
  51. <td class="layui-td-gray">网址链接</td>
  52. <td colspan="3">
  53. <input type="text" name="src" placeholder="请输入导航网址链接,可空" autocomplete="off" class="layui-input"
  54. {notempty name="$nav.src" }value="{$nav.src}" {/notempty}>
  55. </td>
  56. <td class="layui-td-gray">状态<font>*</font>
  57. </td>
  58. <td>
  59. {if condition="$id eq 0"}
  60. <input type="radio" name="status" value="1" title="正常" checked>
  61. <input type="radio" name="status" value="-1" title="禁用">
  62. {else/}
  63. <input type="radio" name="status" value="1" title="正常" {eq name="$nav.status" value="1" }checked{/eq}>
  64. <input type="radio" name="status" value="-1" title="禁用" {eq name="$nav.status" value="-1" }checked{/eq}>
  65. {/if}
  66. </td>
  67. </tr>
  68. </table>
  69. <div class="py-3">
  70. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  71. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  72. </div>
  73. </form>
  74. {/block}
  75. <!-- /主体 -->
  76. <!-- 脚本 -->
  77. {block name="script"}
  78. <script>
  79. const moduleInit = ['tool'];
  80. function gouguInit() {
  81. var form = layui.form, tool = layui.tool;
  82. //监听提交
  83. form.on('submit(webform)', function (data) {
  84. let callback = function (e) {
  85. layer.msg(e.msg);
  86. if (e.code == 0) {
  87. setTimeout(function () {
  88. parent.location.reload();
  89. }, 1000);
  90. }
  91. }
  92. tool.post("/admin/nav/nav_info_add", data.field, callback);
  93. return false;
  94. });
  95. }
  96. </script>
  97. {/block}
  98. <!-- /脚本 -->