lukeyan #132

Merged
lukeyan merged 2 commits from lukeyan into master 1 year ago

@ -87,15 +87,40 @@ export default {
get_day(day) { get_day(day) {
let myDate = new Date(); // let myDate = new Date(); //
myDate.setDate(myDate.getDate() - (day - 1)); //setDate() myDate.setDate(myDate.getDate() - (day - 1)); //setDate()
let year = myDate.getFullYear(); //
let month = myDate.getMonth() + 1; //
if (month >= 1 && month <= 9) {
month = "0" + month;
}
let dateArray = []; let dateArray = [];
let dateTemp; let dateTemp;
let flag = 1; let flag = 1;
for (let i = 1; i < day; i++) { for (let i = 1; i < day; i++) {
dateTemp = myDate.getDate() + "日"; dateTemp = year + "-" + month + myDate.getDate();
dateArray.push(dateTemp); dateArray.push(dateTemp);
myDate.setDate(myDate.getDate() + flag); myDate.setDate(myDate.getDate() + flag);
} }
dateArray.push(myDate.getDate() + "日"); dateArray.push(year + "-" + month + myDate.getDate());
return dateArray;
},
// 7
get_old_day(day) {
let myDate = new Date(); //
myDate.setDate(myDate.getDate() - (day - 1)); //setDate()
let year = myDate.getFullYear(); //
let month = myDate.getMonth(); //
if (month >= 1 && month <= 9) {
month = "0" + month;
}
let dateArray = [];
let dateTemp;
let flag = 1;
for (let i = 1; i < day; i++) {
dateTemp = year + "-" + month + myDate.getDate();
dateArray.push(dateTemp);
myDate.setDate(myDate.getDate() + flag);
}
dateArray.push(year + "-" + month + myDate.getDate());
return dateArray; return dateArray;
}, },
init_chart() { init_chart() {
@ -200,7 +225,7 @@ export default {
}, },
}, },
// prettier-ignore // prettier-ignore
data: ['2015-1', '2015-2', '2015-3', '2015-4', '2015-5', '2015-6', '2015-7', '2015-8', '2015-9', '2015-10', '2015-11', '2015-12'], data: this.get_old_day(7),
}, },
], ],
yAxis: [ yAxis: [
@ -224,9 +249,7 @@ export default {
emphasis: { emphasis: {
focus: "series", focus: "series",
}, },
data: [ data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6],
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6,
],
}, },
{ {
name: "今日出园区", name: "今日出园区",
@ -236,7 +259,7 @@ export default {
emphasis: { emphasis: {
focus: "series", focus: "series",
}, },
data: [2.6, 5.9, 9.0, 26, 27, 70.7, 175.6, ], data: [2.6, 5.9, 9.0, 26, 27, 70.7, 175.6],
}, },
{ {
name: "上月进园区", name: "上月进园区",
@ -245,9 +268,7 @@ export default {
emphasis: { emphasis: {
focus: "series", focus: "series",
}, },
data: [ data: [3.9, 5.9, 11.1, 18.7, 48.3, 69.2, 231.6],
3.9, 5.9, 11.1, 18.7, 48.3, 69.2, 231.6,
],
}, },
{ {
name: "上月出园区", name: "上月出园区",
@ -256,7 +277,7 @@ export default {
emphasis: { emphasis: {
focus: "series", focus: "series",
}, },
data: [3.9, 5.9, 22, 34, 48.3, 69.2, 123, ], data: [3.9, 5.9, 22, 34, 48.3, 69.2, 123],
}, },
], ],
}; };

@ -10,19 +10,19 @@
</div> </div>
<!-- 企业数量 --> <!-- 企业数量 -->
<div class="company_num_box_body"> <div class="company_num_box_body">
<div class="company_num_box_body_item green"> <div class="company_num_box_body_item green" @click="turn_item('平安')">
<div class="num_green"> <div class="num_green">
{{ statisticsAlarmData.safeSum }} {{ statisticsAlarmData.safeSum }}
</div> </div>
<div class="type">平安企业</div> <div class="type">平安企业</div>
</div> </div>
<div class="company_num_box_body_item orange"> <div class="company_num_box_body_item orange" @click="turn_item('石化总数')">
<div class="num_orange"> <div class="num_orange">
{{ statisticsAlarmData.companySum }} {{ statisticsAlarmData.companySum }}
</div> </div>
<div class="type">石化企业</div> <div class="type">石化企业</div>
</div> </div>
<div class="company_num_box_body_item red"> <div class="company_num_box_body_item red" @click="turn_item('预警')">
<div class="num_red"> <div class="num_red">
{{ statisticsAlarmData.alarmSum }} {{ statisticsAlarmData.alarmSum }}
</div> </div>
@ -36,16 +36,16 @@
<!-- 占比 --> <!-- 占比 -->
<div class="company_proportion"> <div class="company_proportion">
<div class="proportion_text"> <div class="proportion_text">
<div class="proportion_text_item"></div> <div class="proportion_text_item" @click="turn_item('剧毒')"></div>
<div class="proportion_text_item"></div> <div class="proportion_text_item" @click="turn_item('易制爆')"></div>
<div class="proportion_text_item"></div> <div class="proportion_text_item" @click="turn_item('易制毒')"></div>
<div class="proportion_text_item"></div> <div class="proportion_text_item" @click="turn_item('放射源')"></div>
</div> </div>
<div class="proportion_value"> <div class="proportion_value">
<div class="proportion_value_item">{{ this.proportion_list[0] }}</div> <div class="proportion_value_item" @click="turn_item('剧毒')">{{ this.proportion_list[0] }}</div>
<div class="proportion_value_item">{{ this.proportion_list[1] }}</div> <div class="proportion_value_item" @click="turn_item('易制爆')">{{ this.proportion_list[1] }}</div>
<div class="proportion_value_item">{{ this.proportion_list[2] }}</div> <div class="proportion_value_item" @click="turn_item('易制毒')">{{ this.proportion_list[2] }}</div>
<div class="proportion_value_item">{{ this.proportion_list[3] }}</div> <div class="proportion_value_item" @click="turn_item('放射源')">{{ this.proportion_list[3] }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -184,6 +184,12 @@ export default {
option && myChart.setOption(option); option && myChart.setOption(option);
}, },
turn_item(val) {
this.$router.push({
path: "/home/enterpriseRank",
query: { companyParamName: val },
});
}
}, },
}; };
</script> </script>
@ -274,14 +280,17 @@ export default {
} }
} }
.green { .green {
cursor: pointer;
background: url("~@/assets/safetyIndex/companyNum01.png") no-repeat; background: url("~@/assets/safetyIndex/companyNum01.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.orange { .orange {
cursor: pointer;
background: url("~@/assets/safetyIndex/companyNum02.png") no-repeat; background: url("~@/assets/safetyIndex/companyNum02.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.red { .red {
cursor: pointer;
background: url("~@/assets/safetyIndex/companyNum03.png") no-repeat; background: url("~@/assets/safetyIndex/companyNum03.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
@ -305,6 +314,7 @@ export default {
height: 10vh; height: 10vh;
// border: 0.1px solid #495e70; // border: 0.1px solid #495e70;
.proportion_text_item { .proportion_text_item {
cursor: pointer;
width: 2vw; width: 2vw;
height: 2.5vh; height: 2.5vh;
line-height: 2.5vh; line-height: 2.5vh;
@ -318,6 +328,7 @@ export default {
height: 10vh; height: 10vh;
// border: 0.1px solid #495e70; // border: 0.1px solid #495e70;
.proportion_value_item { .proportion_value_item {
cursor: pointer;
width: 4vw; width: 4vw;
height: 2.5vh; height: 2.5vh;
line-height: 2.5vh; line-height: 2.5vh;

Loading…
Cancel
Save