|
@@ -25,10 +25,10 @@
|
|
|
</div>
|
|
|
<!--星期-->
|
|
|
<!--<div class="date-max-box">-->
|
|
|
- <!--<div :class="dayIndex==index?'checkColor':''" v-for="(item,index) in timeList" :key="index" @click="dayButton(index)">-->
|
|
|
- <!--<p>{{item.label}}</p>-->
|
|
|
- <!--<p>{{item.name}}</p>-->
|
|
|
- <!--</div>-->
|
|
|
+ <!--<div :class="dayIndex==index?'checkColor':''" v-for="(item,index) in timeList" :key="index" @click="dayButton(index)">-->
|
|
|
+ <!--<p>{{item.label}}</p>-->
|
|
|
+ <!--<p>{{item.name}}</p>-->
|
|
|
+ <!--</div>-->
|
|
|
<!--</div>-->
|
|
|
<div class="for-position-dept-max-box">
|
|
|
<div class="for-position-dept-box"
|
|
@@ -52,9 +52,9 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import {
|
|
|
- reportReportBigDataWarningHandle,
|
|
|
-} from "@/api/index";
|
|
|
+ import {
|
|
|
+ reportReportBigDataWarningHandle
|
|
|
+ } from '@/api/index'
|
|
|
import titlePageImgComponents from '@/components/titlePageImgComponents.vue'
|
|
|
|
|
|
export default {
|
|
@@ -68,14 +68,14 @@ import {
|
|
|
title: '安全风险预警处置'
|
|
|
},
|
|
|
dateData: new Date().getDay(),
|
|
|
- dayIndex:null,
|
|
|
- timeList:[],
|
|
|
+ dayIndex: null,
|
|
|
+ timeList: [],
|
|
|
//获取数据
|
|
|
deptList: [],
|
|
|
//展示数据
|
|
|
- deptData:{},
|
|
|
- deptListIndex:0,
|
|
|
- eChartsTimer:null,
|
|
|
+ deptData: {},
|
|
|
+ deptListIndex: 0,
|
|
|
+ eChartsTimer: null
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -85,74 +85,82 @@ import {
|
|
|
this.initialize()
|
|
|
},
|
|
|
methods: {
|
|
|
- timedRefresh(){
|
|
|
- let self = this;
|
|
|
- self.getData();
|
|
|
+ timedRefresh() {
|
|
|
+ let self = this
|
|
|
+ self.getData()
|
|
|
//定时动画
|
|
|
- window.clearInterval(self.eChartsTimer);
|
|
|
- self.eChartsTimer = setInterval(function(){
|
|
|
+ window.clearInterval(self.eChartsTimer)
|
|
|
+ self.eChartsTimer = setInterval(function() {
|
|
|
self.deptListIndex++
|
|
|
- if(self.deptList[self.deptListIndex]){
|
|
|
- self.$set(self,'deptData',self.deptList[self.deptListIndex]);
|
|
|
- }else{
|
|
|
- self.getData();
|
|
|
+ if (self.deptList[self.deptListIndex]) {
|
|
|
+ self.$set(self, 'deptData', self.deptList[self.deptListIndex])
|
|
|
+ } else {
|
|
|
+ self.getData()
|
|
|
}
|
|
|
- },1000*30);
|
|
|
+ }, 1000 * 30)
|
|
|
},
|
|
|
//日期初始化
|
|
|
initialize() {
|
|
|
- let thisWeekDates = this.getThisWeekDates();
|
|
|
- let timeList = [];
|
|
|
- let day = new Date().getDay();
|
|
|
- day = day==0 ? 7 : day;
|
|
|
- this.$set(this,'dayIndex',day-1);
|
|
|
- for(let i=0;i<thisWeekDates.length;i++){
|
|
|
+ let thisWeekDates = this.getThisWeekDates()
|
|
|
+ let timeList = []
|
|
|
+ let day = new Date().getDay()
|
|
|
+ day = day == 0 ? 7 : day
|
|
|
+ this.$set(this, 'dayIndex', day - 1)
|
|
|
+ for (let i = 0; i < thisWeekDates.length; i++) {
|
|
|
timeList.push({
|
|
|
- label:i+1,
|
|
|
- name:i==0?'Mon':(i==1?'Tue':(i==2?'Wed':(i==3?'Thur':(i==4?'Fri':(i==5?'Sat':(i==6?'Sun':'')))))),
|
|
|
- value:thisWeekDates[i],
|
|
|
+ label: i + 1,
|
|
|
+ name: i == 0 ? 'Mon' : (i == 1 ? 'Tue' : (i == 2 ? 'Wed' : (i == 3 ? 'Thur' : (i == 4 ? 'Fri' : (i == 5 ? 'Sat' : (i == 6 ? 'Sun' : '')))))),
|
|
|
+ value: thisWeekDates[i]
|
|
|
})
|
|
|
}
|
|
|
- this.$set(this,'timeList',timeList);
|
|
|
- this.timedRefresh();
|
|
|
+ this.$set(this, 'timeList', timeList)
|
|
|
+ this.timedRefresh()
|
|
|
},
|
|
|
getThisWeekDates() {
|
|
|
- const today = new Date();
|
|
|
- const dayOfWeek = today.getDay();
|
|
|
- const firstDayOfWeek = new Date(today);
|
|
|
+ const today = new Date()
|
|
|
+ const dayOfWeek = today.getDay()
|
|
|
+ const firstDayOfWeek = new Date(today)
|
|
|
if (dayOfWeek === 0) {
|
|
|
- firstDayOfWeek.setDate(firstDayOfWeek.getDate() - 6);
|
|
|
+ firstDayOfWeek.setDate(firstDayOfWeek.getDate() - 6)
|
|
|
} else {
|
|
|
- firstDayOfWeek.setDate(firstDayOfWeek.getDate() - dayOfWeek + 1);
|
|
|
+ firstDayOfWeek.setDate(firstDayOfWeek.getDate() - dayOfWeek + 1)
|
|
|
}
|
|
|
- const dates = [];
|
|
|
+ const dates = []
|
|
|
for (let i = 0; i < 7; i++) {
|
|
|
- dates.push(new Date(firstDayOfWeek.getTime() + i * 24 * 60 * 60 * 1000).toLocaleDateString().split("/") .join("-") );
|
|
|
+ let time = new Date(firstDayOfWeek.getTime() + i * 24 * 60 * 60 * 1000).toLocaleDateString().split('/')
|
|
|
+ if (time[1] < 10) {
|
|
|
+ time[1] = '0' + time[1]
|
|
|
+ }
|
|
|
+ if (time[2] < 10) {
|
|
|
+ time[2] = '0' + time[2]
|
|
|
+ }
|
|
|
+ dates.push(time.join('-'))
|
|
|
+ // dates.push(new Date(firstDayOfWeek.getTime() + i * 24 * 60 * 60 * 1000).toLocaleDateString().split("/") .join("-") );
|
|
|
}
|
|
|
- return dates;
|
|
|
+ return dates
|
|
|
},
|
|
|
//日期点击
|
|
|
- dayButton(index){
|
|
|
- if(index != this.dayIndex){
|
|
|
- this.$set(this,'dayIndex',index);
|
|
|
+ dayButton(index) {
|
|
|
+ if (index != this.dayIndex) {
|
|
|
+ this.$set(this, 'dayIndex', index)
|
|
|
}
|
|
|
},
|
|
|
//获取数据
|
|
|
- getData(){
|
|
|
- reportReportBigDataWarningHandle({date:this.timeList[this.dayIndex].value}).then( response => {
|
|
|
- this.$set(this,'deptList',response.data);
|
|
|
- this.$set(this,'deptListIndex',0);
|
|
|
- this.$set(this,'deptData',this.deptList[this.deptListIndex]);
|
|
|
- });
|
|
|
- },
|
|
|
+ getData() {
|
|
|
+ reportReportBigDataWarningHandle({ date: this.timeList[this.dayIndex].value }).then(response => {
|
|
|
+ this.$set(this, 'deptList', response.data)
|
|
|
+ this.$set(this, 'deptListIndex', 0)
|
|
|
+ this.$set(this, 'deptData', this.deptList[this.deptListIndex])
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
//清除定时器
|
|
|
- window.clearInterval(this.eChartsTimer);
|
|
|
+ window.clearInterval(this.eChartsTimer)
|
|
|
},
|
|
|
destroyed() {
|
|
|
//清除定时器
|
|
|
- window.clearInterval(this.eChartsTimer);
|
|
|
+ window.clearInterval(this.eChartsTimer)
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -185,7 +193,7 @@ import {
|
|
|
background-image: url("../../../assets/ZDimages/img_yjczbg@1x.png");
|
|
|
background-size: 100%;
|
|
|
display: flex;
|
|
|
- margin-left:25px;
|
|
|
+ margin-left: 25px;
|
|
|
p:nth-child(1) {
|
|
|
color: #fff;
|
|
|
line-height: 52px;
|
|
@@ -228,7 +236,7 @@ import {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .for-position-dept-max-box{
|
|
|
+ .for-position-dept-max-box {
|
|
|
position: relative;
|
|
|
.for-position-dept-box {
|
|
|
display: inline-block;
|
|
@@ -303,75 +311,75 @@ import {
|
|
|
text-align: center;
|
|
|
}
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(1){
|
|
|
+ .for-position-dept-box:nth-child(1) {
|
|
|
top: 100px;
|
|
|
left: 30px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(2){
|
|
|
+ .for-position-dept-box:nth-child(2) {
|
|
|
top: 100px;
|
|
|
left: 280px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(3){
|
|
|
+ .for-position-dept-box:nth-child(3) {
|
|
|
top: 100px;
|
|
|
left: 530px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(4){
|
|
|
+ .for-position-dept-box:nth-child(4) {
|
|
|
top: 100px;
|
|
|
left: 780px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(5){
|
|
|
+ .for-position-dept-box:nth-child(5) {
|
|
|
top: 165px;
|
|
|
left: 153px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(6){
|
|
|
+ .for-position-dept-box:nth-child(6) {
|
|
|
top: 165px;
|
|
|
left: 403px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(7){
|
|
|
+ .for-position-dept-box:nth-child(7) {
|
|
|
top: 165px;
|
|
|
left: 653px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(8){
|
|
|
+ .for-position-dept-box:nth-child(8) {
|
|
|
top: 230px;
|
|
|
left: 30px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(9){
|
|
|
+ .for-position-dept-box:nth-child(9) {
|
|
|
top: 230px;
|
|
|
left: 280px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(10){
|
|
|
+ .for-position-dept-box:nth-child(10) {
|
|
|
top: 230px;
|
|
|
left: 530px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(11){
|
|
|
+ .for-position-dept-box:nth-child(11) {
|
|
|
top: 230px;
|
|
|
left: 780px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(12){
|
|
|
+ .for-position-dept-box:nth-child(12) {
|
|
|
top: 295px;
|
|
|
left: 153px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(13){
|
|
|
+ .for-position-dept-box:nth-child(13) {
|
|
|
top: 295px;
|
|
|
left: 403px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(14){
|
|
|
+ .for-position-dept-box:nth-child(14) {
|
|
|
top: 295px;
|
|
|
left: 653px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(15){
|
|
|
+ .for-position-dept-box:nth-child(15) {
|
|
|
top: 360px;
|
|
|
left: 30px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(16){
|
|
|
+ .for-position-dept-box:nth-child(16) {
|
|
|
top: 360px;
|
|
|
left: 280px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(17){
|
|
|
+ .for-position-dept-box:nth-child(17) {
|
|
|
top: 360px;
|
|
|
left: 530px;
|
|
|
}
|
|
|
- .for-position-dept-box:nth-child(18){
|
|
|
+ .for-position-dept-box:nth-child(18) {
|
|
|
top: 360px;
|
|
|
left: 780px;
|
|
|
}
|