分类计数

This commit is contained in:
wuhao 2020-12-04 13:49:30 +08:00
parent e6bcecd72b
commit 793e798701

View File

@ -103,6 +103,15 @@ if ($act == 'newevent') {
$sql = "select * from calendar where ((start>='{$startDate}' and start<='{$endDate}') or (end>='{$startDate}' and end<='{$endDate}')) {$where}";
$rss = DB::getArray($sql);
$eventTypeCnt = array(
'节点' => 0,
'打包' => 0,
'版本更新' => 0,
'上线' => 0,
'修复外网' => 0
);
$eventCount = array(
'总更新&总修复' => array(
'dangerCount' => 0,
@ -118,6 +127,9 @@ if ($act == 'newevent') {
'purpleCount' => 0
);
}
if (strstr($rs['end'], $month)) {
$eventTypeCnt[$rs['event']] += 1;
}
$class = "light";
if ($rs['event'] == '节点') {
$class = "success";
@ -191,6 +203,10 @@ if ($act == 'newevent') {
if ($type == 'charts')
// we(json_encode($eventCharts));
we(json_encode(array('charts' => $eventCharts, 'table' => $eventTable)));
elseif ($type == 'count')
{
we(json_encode($eventTypeCnt));
}
else
we(json_encode($json));
}
@ -382,6 +398,7 @@ if ($act == 'newevent') {
.data_box {
display: none;
}
.data_tab {
width: 240px;
display: flex;
@ -392,10 +409,29 @@ if ($act == 'newevent') {
z-index: 1000;
float: right;
}
.data-box { width: 50px; text-align:center; }
.data-box img { width:28px; height: 28px; margin: 0 auto; }
.data-box .data-name { font-size: 15px; color:#5fadff; text-align:center; }
.data-box .data-num { font-size: 14px; color:#a0a0a0; text-align:center; }
.data-box {
width: 50px;
text-align: center;
}
.data-box img {
width: 28px;
height: 28px;
margin: 0 auto;
}
.data-box .data-name {
font-size: 15px;
color: #5fadff;
text-align: center;
}
.data-box .data-num {
font-size: 14px;
color: #a0a0a0;
text-align: center;
}
</style>
<div class='datarepair' id="datarepair" onclick="datarepair()">
<img src='assets/images/xiazai.png'/> 修复数据
@ -590,14 +626,30 @@ if ($act == 'newevent') {
.fujian a {
color: #61adfe;
}
input[type="file"] { padding: 0 14px; }
input[type="file"] {
padding: 0 14px;
}
.tijaioanniu {
display: flex;
justify-content: space-between;
align-items: center;
/* padding: 10px 0; */
}
.tijiao { width: 60px; height: 25px; background-color:#5fadff; font-size: 14px; text-align: center; line-height: 25px; color:#fff; border-radius: 4px; float: right; cursor:pointer;}
.tijiao {
width: 60px;
height: 25px;
background-color: #5fadff;
font-size: 14px;
text-align: center;
line-height: 25px;
color: #fff;
border-radius: 4px;
float: right;
cursor: pointer;
}
</style>
<div class='popup-bg' id='popup-bg'>
<div class="yiny" id='yiny'></div>
@ -624,9 +676,11 @@ if ($act == 'newevent') {
<div class="tijaioanniu">
<div style=" position: relative; display: none" class="upfujian" id="upfujian_cp">
<iframe id="_hideiframe" name="_hideiframe" style="display: none;"></iframe>
<form method="post" id="uploader" style="display: block; clear: both; margin-top: 10px;;" target="_hideiframe" action="" enctype="multipart/form-data">
<form method="post" id="uploader" style="display: block; clear: both; margin-top: 10px;;"
target="_hideiframe" action="" enctype="multipart/form-data">
<input name="cid" type="hidden" value="<%=DATA.lastShowCardID%>"/>
<input type="file" id="fujian" name="fujian[]" multiple onchange="document.getElementById('uploader').submit()">
<input type="file" id="fujian" name="fujian[]" multiple
onchange="document.getElementById('uploader').submit()">
</form>
<div class='tijiao' id="cptijiao">提交</div>
@ -659,9 +713,11 @@ if ($act == 'newevent') {
<div class="tijaioanniu">
<div style=" position: relative;display: none;" class="upfujian" id="upfujian_yy">
<iframe id="_hideiframe2" name="_hideiframe" style="display: none;"></iframe>
<form method="post" id="uploader_yy" style="display: block; clear: both; margin-top: 10px;;" target="_hideiframe" action="" enctype="multipart/form-data">
<form method="post" id="uploader_yy" style="display: block; clear: both; margin-top: 10px;;"
target="_hideiframe" action="" enctype="multipart/form-data">
<input name="cid" type="hidden" value="<%=DATA.lastShowCardID%>"/>
<input type="file" id="fujian_yy" name="fujian[]" multiple onchange="document.getElementById('uploader_yy').submit()">
<input type="file" id="fujian_yy" name="fujian[]" multiple
onchange="document.getElementById('uploader_yy').submit()">
</form>
<div class='tijiao' id="yytijiao">提交</div>
</div>
@ -689,9 +745,11 @@ if ($act == 'newevent') {
<div class="tijaioanniu">
<div style=" position: relative;display: none;" class="upfujian" id="upfujian_yf">
<iframe id="_hideiframe3" name="_hideiframe" style="display: none;"></iframe>
<form method="post" id="uploader_yf" style="display: block; clear: both; margin-top: 10px;;" target="_hideiframe" action="" enctype="multipart/form-data">
<form method="post" id="uploader_yf" style="display: block; clear: both; margin-top: 10px;;"
target="_hideiframe" action="" enctype="multipart/form-data">
<input name="cid" type="hidden" value="<%=DATA.lastShowCardID%>"/>
<input type="file" id="fujian_yf" name="fujian[]" multiple onchange="document.getElementById('uploader_yf').submit()">
<input type="file" id="fujian_yf" name="fujian[]" multiple
onchange="document.getElementById('uploader_yf').submit()">
</form>
<div class='tijiao' id="yftijiao">提交</div>
</div>
@ -902,6 +960,7 @@ if ($act == 'newevent') {
})
var i = 0;
function bianji() {
if ("<?=$isgxyyerole?>" == "1") {
@ -914,7 +973,8 @@ if ($act == 'newevent') {
$("#upfujian_yy").hide();
i = 0;
}
};
}
;
if ("<?=$isgxcperole?>" == "1") {
if (i == 0) {
$('#cptext').attr('disabled', false)
@ -925,7 +985,8 @@ if ($act == 'newevent') {
$("#upfujian_cp").hide();
i = 0;
}
};
}
;
console.log("<?=$isgxyferole?>")
if ("<?=$isgxyferole?>" == "1") {
if (i == 0) {
@ -938,7 +999,8 @@ if ($act == 'newevent') {
$("#upfujian_yf").hide();
i = 0;
}
};
}
;
if ("<?=$isxfyyerole?>" == "1") {
if (i == 0) {
@ -950,7 +1012,8 @@ if ($act == 'newevent') {
$("#upfujian_yy").hide();
i = 0;
}
};
}
;
if ("<?=$canEdit?>" == "1") {
if (i == 0) {
@ -966,7 +1029,8 @@ if ($act == 'newevent') {
$(".upfujian").hide();
i = 0;
}
};
}
;
// $canEdit = in_array($user['name'], $ROLES);
// $isgxvrole = in_array($user['name'], $GXVROLES); //更新信息查看区浏览权限
@ -1162,7 +1226,8 @@ if ($act == 'newevent') {
});
dstr = $.fullCalendar.formatDate(calEvent.start, 'yyyy-MM-dd');
showEventData(calEvent.id);
};
}
;
} else if (calEvent.className[0] == 'label-purple') {
if ("<?=$isxfvrole?>" != "1" && "<?=$isxfyyerole?>" != "1") {
return
@ -1188,14 +1253,14 @@ if ($act == 'newevent') {
});
dstr = $.fullCalendar.formatDate(calEvent.start, 'yyyy-MM-dd');
showEventData(calEvent.id);
};
}
;
} else {
return
}
}
$('#uploader').attr('action', './?app=uploader&id=' + calEvent.id + '&bumen=chanpin&act=add');
$('#uploader_yy').attr('action', './?app=uploader&id=' + calEvent.id + '&bumen=yunyig&act=add')
$("#uploader_yf").attr('action', './?app=uploader&id=' + calEvent.id + '&bumen=yanfa&act=add')