1
This commit is contained in:
parent
cb027611f6
commit
0221e7378d
128
index.html
128
index.html
@ -34,6 +34,16 @@
|
||||
.save-list:hover { background-color: #f1f8ff; }
|
||||
.save-list-but-box { width: 100%; display: flex; align-items: center; border-radius: 8px; }
|
||||
.save-list-but-box div{ cursor: pointer; background-color: #FF5722; color: #fff;width: 100%;height: 45px;line-height: 45px;text-align: center;margin: 0 8px;padding: 0 16px;font-weight: 400;font-size: 14px;text-shadow: none;border-radius: 2px; }
|
||||
.baseevent-box { width: 600px; height: 400px; background-color: #fff; position: fixed; top: 0; bottom: 0; left: 0; right: 0; margin: auto;}
|
||||
.baseevent-tit-box { padding: 16px; text-align: center; }
|
||||
.baseevent-checkbox-box { margin: 30px; }
|
||||
.baseevent-checkbox-box input { }
|
||||
.layui-form-checkbox[lay-skin=primary]{ margin-top: 10px; }
|
||||
.baseevent-but-box { display: flex; justify-content: end; align-items: center; margin: 0 30px; }
|
||||
.baseevent-but-box div { cursor: pointer;width: 40px;height: 30px;line-height: 30px;text-align: center;margin: 0 8px;padding: 0 16px;font-weight: 400;font-size: 14px;text-shadow: none;border-radius: 2px; }
|
||||
.baseevent-but-qb { border: 1px solid #d9d9d9; color: #42546d; }
|
||||
.baseevent-but-qx { background: #FF5722; color: #fff; }
|
||||
.baseevent-but-ok { background: #3d90ff; color: #fff; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@ -81,6 +91,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" class="layui-btn layui-btn-sm baseevent"><i class="layui-icon layui-icon-add-1"></i> 基础事件</button>
|
||||
|
||||
<button type="button" class="layui-btn layui-btn-sm layui-btn-normal eventattr-add" style="float: right;"><i class="layui-icon layui-icon-add-1"></i> 添加</button>
|
||||
|
||||
<div class="layui-form-item" style="padding-top: 15px">
|
||||
@ -144,6 +156,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="zhezhao baseevent-pop" style="display: none;">
|
||||
<div class="baseevent-box">
|
||||
<p class="baseevent-tit-box">基础事件</p>
|
||||
<form class="layui-form" action="" lay-filter="baseeventexample">
|
||||
<div class="baseevent-checkbox-box">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<div class="baseevent-but-box">
|
||||
<div class="baseevent-but-qb">全选</div>
|
||||
<div class="baseevent-but-qx">取消</div>
|
||||
<div class="baseevent-but-ok">确定</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -210,13 +237,19 @@
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
<script id="baseevent-checkbox-box-dot" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
{{# if(item.on == 1){ }}
|
||||
<input type="checkbox" name="{{item.title}}" lay-skin="primary" title="{{item.title}}" checked="">
|
||||
{{# } else { }}
|
||||
<input type="checkbox" name="{{item.title}}" lay-skin="primary" title="{{item.title}}">
|
||||
{{# } }}
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
var eventarr = [
|
||||
];
|
||||
|
||||
var eventarr = [];
|
||||
var conditionarr = [];
|
||||
|
||||
$(document).on('click','.eventattr-add',function(){
|
||||
var arr = {
|
||||
'attrname':'',
|
||||
@ -287,16 +320,90 @@
|
||||
$(".baocun-pup").show();
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click','.save-list-qx',function(){
|
||||
$('.save-pop').hide();
|
||||
});
|
||||
|
||||
$(document).on('click','.baseevent-but-qx',function(){
|
||||
baseeventdata = {};
|
||||
$('.baseevent-pop').hide();
|
||||
});
|
||||
|
||||
var baseeventdata={};
|
||||
$(document).on('click','.baseevent-but-ok',function(){
|
||||
var fromdata = layui.form.val('baseeventexample');
|
||||
var defaultfield = {};
|
||||
for(let i in fromdata){
|
||||
defaultfield[i] = default_field[i]
|
||||
}
|
||||
baseeventdata = defaultfield;
|
||||
$('.baseevent-pop').hide();
|
||||
})
|
||||
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
|
||||
}
|
||||
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('条件错误');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click','.baseevent-but-qb',function(){
|
||||
// console.log(default_field);
|
||||
var listarr = [];
|
||||
for(let i in default_field){
|
||||
var arr = {
|
||||
'title': i,
|
||||
'on':1
|
||||
}
|
||||
listarr.push(arr);
|
||||
}
|
||||
laytpldata("#baseevent-checkbox-box-dot",listarr,".baseevent-checkbox-box");
|
||||
layui.form.render();
|
||||
});
|
||||
|
||||
$(document).on("click",'.save-list',function(){
|
||||
var index = $(this).attr('data-index');
|
||||
var data = savelist[index];
|
||||
// eventarr
|
||||
// conditionarr
|
||||
var props = data.check.props;
|
||||
var where = data.check.where;
|
||||
var eventData=[];
|
||||
@ -424,7 +531,8 @@
|
||||
'event_name':fromdata.eventname,
|
||||
'is_unique':is_unique,
|
||||
'props':props,
|
||||
'where':where
|
||||
'where':where,
|
||||
'default_field':baseeventdata
|
||||
};
|
||||
$.ajax({
|
||||
url: 'http://10.0.0.77:7997/v1/check/check?game='+fromdata.game+'&db_name='+fromdata.db_name,
|
||||
@ -466,4 +574,6 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user