Commit 7e95fab6 authored by 张牧越's avatar 张牧越

bugfix

parent 89d52fc2
...@@ -73,7 +73,11 @@ ...@@ -73,7 +73,11 @@
<div class="panel-title"> <div class="panel-title">
<p class="name">异常信息汇总</p> <p class="name">异常信息汇总</p>
<div class="value"> <div class="value">
<button class="switch prev-month layui-btn layui-btn-normal"
onclick="getBottomData.getPrevMonth()">上月</button>
<p class="date" id="bhg-date"><span class="begin">——</span><span class="end">——</span></p> <p class="date" id="bhg-date"><span class="begin">——</span><span class="end">——</span></p>
<button class="switch next-month layui-btn layui-btn-normal"
onclick="getBottomData.getNextMonth()">下月</button>
</div> </div>
</div> </div>
<div class="panel-info"> <div class="panel-info">
......
...@@ -651,9 +651,6 @@ ...@@ -651,9 +651,6 @@
color: #FFF; color: #FFF;
} }
.panel-item .panel-title .value p {
margin-left: .4rem;
}
.panel-item .panel-title .value .number { .panel-item .panel-title .value .number {
margin-left: .1rem; margin-left: .1rem;
...@@ -872,4 +869,10 @@ td { ...@@ -872,4 +869,10 @@ td {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
}
.switch {
height: inherit;
padding: 6px 12px;
line-height: inherit;
} }
\ No newline at end of file
...@@ -48,7 +48,7 @@ function getHeader() { ...@@ -48,7 +48,7 @@ function getHeader() {
<div class="name"> <div class="name">
<p class="icon_font icon-ilogo-2"></p> <p class="icon_font icon-ilogo-2"></p>
<p class="icon_font icon-vertical_line"></p> <p class="icon_font icon-vertical_line"></p>
<p><span id='area'></span>建设工程质量智慧监管云平台</p> <p><span id='area' style='display:none;'></span>检测监管云平台</p>
</div> </div>
<div class="right-item"> <div class="right-item">
<div class="tab" id="head-tab"> <div class="tab" id="head-tab">
...@@ -89,10 +89,15 @@ function getHeader() { ...@@ -89,10 +89,15 @@ function getHeader() {
function getHeaderInfo() { function getHeaderInfo() {
$.ajax({ $.ajax({
url: "http://detect.cnjsjd.net/Ajax/Screen/GetHeaderInfo.ashx", url: "/Ajax/Screen/GetHeaderInfo.ashx",
type: "get", type: "get",
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
if (data.status == 500) {
window.location = "/LoginDirect.aspx";
return
}
$("#op_name").html(data.data[0].op_name); $("#op_name").html(data.data[0].op_name);
$("#area").html(data.data[0].area); $("#area").html(data.data[0].area);
$("#op_avatar").attr('src', data.data[0].op_avatar); $("#op_avatar").attr('src', data.data[0].op_avatar);
...@@ -157,13 +162,13 @@ $(function () { ...@@ -157,13 +162,13 @@ $(function () {
}) })
}); });
const imgURL = 'http://detect.cnjsjd.net/'; const imgURL = '/';
const baseURL = 'http://detect.cnjsjd.net/Ajax/Screen/Pile/'; const baseURL = '/Ajax/Screen/Pile/';
const baseURL_xcjc = 'http://detect.cnjsjd.net/Ajax/Screen/XCJC/'; const baseURL_xcjc = '/Ajax/Screen/XCJC/';
const baseURL_jzjc = 'http://detect.cnjsjd.net/Ajax/Screen/JZJC/'; const baseURL_jzjc = '/Ajax/Screen/JZJC/';
const baseURL_htjc = 'http://detect.cnjsjd.net/Ajax/Screen/HTJC/'; const baseURL_htjc = '/Ajax/Screen/HTJC/';
const baseURL_Utility = 'http://detect.cnjsjd.net/Ajax/Screen/Utility/'; const baseURL_Utility = '/Ajax/Screen/Utility/';
window._AMapSecurityConfig = { window._AMapSecurityConfig = {
securityJsCode: '0711374220aba81dbf7515aaac08e50b', securityJsCode: '0711374220aba81dbf7515aaac08e50b',
......
...@@ -508,16 +508,57 @@ var getRightdata = { ...@@ -508,16 +508,57 @@ var getRightdata = {
showPopup('', '静载工程数据详情'); showPopup('', '静载工程数据详情');
} }
} }
function getMonthDay(year, month) {
let days = new Date(year, month + 1, 0).getDate()
return days
}
var getBottomData = { var getBottomData = {
init: function () { init: function () {
this.getUnusualDate(); this.getUnusualDate();
}, },
getUnusualDate: function () { getUnusualDate: function () {
$("#bhg-date .begin").html(getNextDate(dateFormat('YYYY-mm-dd', new Date()), -1)); $("#bhg-date .begin").html(getNextDate(dateFormat('YYYY-mm-dd', new Date()), Number('-' + new Date().getDate()) + 1));
$("#bhg-date .end").html(dateFormat('YYYY-mm-dd', new Date())); $("#bhg-date .end").html(dateFormat('YYYY-mm-dd', new Date()));
this.getUnusual(); this.getUnusual();
}, },
getPrevMonth: function () {
var date = new Date($("#bhg-date .begin")[0].innerHTML)
var year = date.getFullYear()
var month = date.getMonth() + 1
if (month == 1) {
month = 12
year = year - 1
} else {
month = month - 1
if (month < 10) {
month = '0' + month
}
}
var lastDay = getMonthDay(year, month)
console.log(year, month)
$("#bhg-date .begin").html(year + '-' + month + '-' + '01');
$("#bhg-date .end").html(year + '-' + month + '-' + lastDay);
this.getUnusual();
},
getNextMonth: function () {
var date = new Date($("#bhg-date .begin")[0].innerHTML)
var year = date.getFullYear()
var month = date.getMonth() + 1
if (month == 12) {
month = '01'
year = year + 1
} else {
month = month + 1
if (month < 10) {
month = '0' + month
}
}
var lastDay = getMonthDay(year, month)
console.log(year, month)
$("#bhg-date .begin").html(year + '-' + month + '-' + '01');
$("#bhg-date .end").html(year + '-' + month + '-' + lastDay);
this.getUnusual();
},
getUnusual: function () { getUnusual: function () {
$.ajax({ $.ajax({
url: baseURL_Utility + "UnusualList.ashx?begin_date=" + $("#bhg-date .begin").html() + "&end_date=" + $("#bhg-date .end").html() + "&screen_kind=3", url: baseURL_Utility + "UnusualList.ashx?begin_date=" + $("#bhg-date .begin").html() + "&end_date=" + $("#bhg-date .end").html() + "&screen_kind=3",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment