修复新增config的sysFlag的状态问题

pull/65/head
fengshuonan 4 years ago
parent de6b6e472c
commit 584583fa58

@ -4,9 +4,14 @@ layui.use(['form', 'admin', 'HttpRequest'], function () {
var admin = layui.admin;
var HttpRequest = layui.HttpRequest;
$("#groupCode").val(Feng.getUrlParam("groupCode"));
// 修改系统配置状态
var checked = 'Y';
form.on('switch(sysFlag)', function (obj) {
checked = obj.elem.checked ? 'Y' : 'N';
});
//表单提交事件
form.on('submit(btnSubmit)', function (data) {
var httpRequest = new HttpRequest(Feng.ctxPath + "/sysConfig/add", 'post', function (data) {
@ -17,6 +22,7 @@ layui.use(['form', 'admin', 'HttpRequest'], function () {
admin.closeThisDialog();
Feng.error("添加失败!" + data.message)
});
data.field.sysFlag = checked;
httpRequest.set(data.field);
httpRequest.start(true);
});

@ -1,5 +1,5 @@
@layout("/layout/_form.html",{js:["/assets/modular/system/config/sysConfig_add.js"]}){
<form class="layui-form" id="sysConfigForm" lay-filter="sysConfigForm" >
<form class="layui-form" id="sysConfigForm" lay-filter="sysConfigForm">
<div class="layui-fluid " style="">
<div class="layui-card">
<div class="layui-card-body">
@ -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" name="sysFlag" lay-skin="switch" lay-text="是|否" value="Y" checked>
<input type="checkbox" lay-filter="sysFlag" name="sysFlag" lay-skin="switch" lay-text="是|否" value="Y" checked>
</div>
</div>
<!-- -->

Loading…
Cancel
Save