1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- {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="$config.title" } value="{$config.title}"
- {/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="0" title="禁用">
- {else/}
- <input type="radio" name="status" value="1" title="正常" {eq name="$config.status" value="1"
- }checked{/eq}>
- <input type="radio" name="status" value="0" title="禁用" {eq name="$config.status" value="0"
- }checked{/eq}>
- {/if}
- </td>
- </tr>
- <tr>
- <td class="layui-td-gray">
- 配置标识<font>*</font>
- </td>
- <td colspan="3">
- <input type="text" name="name" lay-verify="required" placeholder="请输入配置标识" lay-reqText="请输入配置标识"
- autocomplete="off" class="layui-input" {notempty name="$config.name" } value="{$config.name}"
- {/notempty}>
- </td>
- </tr>
- <tr>
- <td colspan="4">
- <span
- style="color: red; font-size: 12px;">注意:新增配置项以后,需要对应新增模板文件,模板文件名称需与标识名称一致,建议复制现有的配置模板文件,然后根据需求修改对应的表单即可。</span>
- </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.tool.close(1000);
- }
- }
- tool.post("/admin/conf/add", data.field, callback);
- return false;
- });
- }
- </script>
- {/block}
- <!-- /脚本 -->
|