diff --git a/index.html b/index.html index 702d0b8..04ec20e 100644 --- a/index.html +++ b/index.html @@ -80,8 +80,8 @@
- - + +
@@ -92,7 +92,7 @@ - + @@ -344,49 +344,50 @@ var default_field; $(document).on('click','.baseevent',function(){ $(".baseevent-pop").show(); - $.ajax({ - url: 'http://10.0.0.77:7997/v1/check/default_field', - type:'get', - dataType: 'json', - async:true, - contentType:'application/json', - beforeSend: function () { - // loading 显示 - }, - success:function(d){ - default_field = d.data; - var listarr = []; - if(JSON.stringify(baseeventdata) != "{}"){ - for(let i in default_field){ - var arr= { - 'title': i, - 'on': 0 + }); + $.ajax({ + url: 'http://10.0.0.77:7997/v1/check/default_field', + type:'get', + dataType: 'json', + async:true, + contentType:'application/json', + beforeSend: function () { + // loading 显示 + }, + success:function(d){ + default_field = d.data; + var listarr = []; + if(JSON.stringify(baseeventdata) != "{}"){ + for(let i in default_field){ + var arr= { + 'title': i, + 'on': 0 + } + for(let j in baseeventdata){ + if(i == j){ + arr['on'] = 1; + break; } - for(let j in baseeventdata){ - if(i == j){ - arr['on'] = 1; - break; - } - } - listarr.push(arr); - } - }else { - for(let i in default_field){ - var arr = { - 'title': i, - 'on':1 - } - listarr.push(arr); - } - } - console.log(listarr); - laytpldata("#baseevent-checkbox-box-dot",listarr,".baseevent-checkbox-box"); - layui.form.render(); - }, - error:function(error){ - layer.msg('条件错误'); - } - }); + } + listarr.push(arr); + } + }else { + for(let i in default_field){ + var arr = { + 'title': i, + 'on':1 + } + listarr.push(arr); + } + } + console.log(listarr); + baseeventdata = default_field; + laytpldata("#baseevent-checkbox-box-dot",listarr,".baseevent-checkbox-box"); + layui.form.render(); + }, + error:function(error){ + layer.msg('条件错误'); + } }); $(document).on('click','.baseevent-but-qb',function(){ @@ -456,23 +457,26 @@ $(document).on('click','.save-list-but',function(){ $('.save-pop').show(); $.ajax({ - url: 'http://10.0.0.77:7997/v1/check/template', - type:'get', - dataType: 'json', - async:true, - contentType:'application/json', - beforeSend: function () { - // loading 显示 - }, - success:function(d){ - savelist = d.data; - laytpldata("#save-list-content-box-dot",d.data,".save-list-content-box"); - }, - error:function(error){ - layer.msg('条件错误'); - } - }); + url: 'http://10.0.0.77:7997/v1/check/template', + type:'get', + dataType: 'json', + async:true, + contentType:'application/json', + beforeSend: function () { + // loading 显示 + }, + success:function(d){ + savelist = d.data; + laytpldata("#save-list-content-box-dot",d.data,".save-list-content-box"); + + }, + error:function(error){ + layer.msg('条件错误'); + } }); + }); + + $(document).on('click','.but-qd',function(){