mirror of https://gitee.com/stylefeng/guns
更新sysConfig的新增和修改接口
parent
584583fa58
commit
55e8e47a0d
|
@ -7,8 +7,20 @@ layui.use(['form', 'admin', 'HttpRequest'], function () {
|
|||
// 获取详情信息,填充表单
|
||||
var httpRequest = new HttpRequest(Feng.ctxPath + "/sysConfig/detail?configId=" + Feng.getUrlParam("configId"), 'get');
|
||||
var result = httpRequest.start();
|
||||
|
||||
// 获取checkbox值
|
||||
var checkboxValue = result.data.sysFlag;
|
||||
|
||||
// checkbox特殊处理
|
||||
result.data.sysFlag = checkboxValue === 'Y';
|
||||
|
||||
// 表单赋值
|
||||
form.val('sysConfigForm', result.data);
|
||||
|
||||
// 修改系统配置状态
|
||||
form.on('switch(sysFlag)', function (obj) {
|
||||
checkboxValue = obj.elem.checked ? 'Y' : 'N';
|
||||
});
|
||||
|
||||
//表单提交事件
|
||||
form.on('submit(btnSubmit)', function (data) {
|
||||
|
@ -21,6 +33,7 @@ layui.use(['form', 'admin', 'HttpRequest'], function () {
|
|||
admin.closeThisDialog();
|
||||
Feng.error("修改失败!" + data.message)
|
||||
});
|
||||
data.field.sysFlag = checkboxValue;
|
||||
httpRequest.set(data.field);
|
||||
httpRequest.start(true);
|
||||
});
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label class="layui-form-label layui-form-required">系统参数</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" lay-filter="sysFlag" name="sysFlag" lay-skin="switch" lay-text="是|否" value="Y" checked>
|
||||
<input type="checkbox" name="sysFlag" lay-filter="sysFlag" lay-skin="switch" lay-text="是|否" value="Y" checked>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 手动输入 -->
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label class="layui-form-label layui-form-required">系统参数</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="sysFlag" lay-skin="switch" lay-text="是|否" value="Y" checked>
|
||||
<input type="checkbox" name="sysFlag" lay-filter="sysFlag" lay-skin="switch" lay-text="是|否">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 手动输入 -->
|
||||
|
|
Loading…
Reference in New Issue