diff --git a/src/utils/request.js b/src/utils/request.js index bbddc92..c84653e 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -8,7 +8,7 @@ const request = axios.create({ //baseURL: 'http://172.18.113.13:8080/zhapi', // 孙强 //baseURL: 'http://192.168.0.188:8888/zhapi', //baseURL: 'http://121.41.91.94:12002/zhapi', - baseURL: `http://${window.location.host}/zhapi`, + gitbaseURL: `http://${window.location.host}/zhapi`, timeout: 50000, headers: { 'content-type': 'application/json' }, }) diff --git a/src/views/compositeIndex/components/companyCar.vue b/src/views/compositeIndex/components/companyCar.vue index c3dceb3..4d505ee 100644 --- a/src/views/compositeIndex/components/companyCar.vue +++ b/src/views/compositeIndex/components/companyCar.vue @@ -83,19 +83,44 @@ export default { this.out_car_num = res.total; }); }, - // 获取当月前7天数组 + // 获取当月前7天数组 get_day(day) { let myDate = new Date(); //获取今天日期 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 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; + }, + // 获取上月前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 = myDate.getDate() + "日"; + dateTemp = year + "-" + month + myDate.getDate(); dateArray.push(dateTemp); myDate.setDate(myDate.getDate() + flag); } - dateArray.push(myDate.getDate() + "日"); + dateArray.push(year + "-" + month + myDate.getDate()); return dateArray; }, init_chart() { @@ -200,7 +225,7 @@ export default { }, }, // 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: [ @@ -224,9 +249,7 @@ export default { emphasis: { focus: "series", }, - data: [ - 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, - ], + data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6], }, { name: "今日出园区", @@ -236,7 +259,7 @@ export default { emphasis: { 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: "上月进园区", @@ -245,9 +268,7 @@ export default { emphasis: { focus: "series", }, - data: [ - 3.9, 5.9, 11.1, 18.7, 48.3, 69.2, 231.6, - ], + data: [3.9, 5.9, 11.1, 18.7, 48.3, 69.2, 231.6], }, { name: "上月出园区", @@ -256,7 +277,7 @@ export default { emphasis: { 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], }, ], }; diff --git a/src/views/compositeIndex/components/companyNum.vue b/src/views/compositeIndex/components/companyNum.vue index 36f645b..921550a 100644 --- a/src/views/compositeIndex/components/companyNum.vue +++ b/src/views/compositeIndex/components/companyNum.vue @@ -10,19 +10,19 @@
-
+
{{ statisticsAlarmData.safeSum }}
平安企业
-
+
{{ statisticsAlarmData.companySum }}
石化企业
-
+
{{ statisticsAlarmData.alarmSum }}
@@ -36,16 +36,16 @@
-
占比
-
占比
-
占比
-
占比
+
占比
+
占比
+
占比
+
占比
-
{{ this.proportion_list[0] }}
-
{{ this.proportion_list[1] }}
-
{{ this.proportion_list[2] }}
-
{{ this.proportion_list[3] }}
+
{{ this.proportion_list[0] }}
+
{{ this.proportion_list[1] }}
+
{{ this.proportion_list[2] }}
+
{{ this.proportion_list[3] }}
@@ -184,6 +184,12 @@ export default { option && myChart.setOption(option); }, + turn_item(val) { + this.$router.push({ + path: "/home/enterpriseRank", + query: { companyParamName: val }, + }); + } }, }; @@ -274,14 +280,17 @@ export default { } } .green { + cursor: pointer; background: url("~@/assets/safetyIndex/companyNum01.png") no-repeat; background-size: 100% 100%; } .orange { + cursor: pointer; background: url("~@/assets/safetyIndex/companyNum02.png") no-repeat; background-size: 100% 100%; } .red { + cursor: pointer; background: url("~@/assets/safetyIndex/companyNum03.png") no-repeat; background-size: 100% 100%; } @@ -305,6 +314,7 @@ export default { height: 10vh; // border: 0.1px solid #495e70; .proportion_text_item { + cursor: pointer; width: 2vw; height: 2.5vh; line-height: 2.5vh; @@ -318,6 +328,7 @@ export default { height: 10vh; // border: 0.1px solid #495e70; .proportion_value_item { + cursor: pointer; width: 4vw; height: 2.5vh; line-height: 2.5vh;