Browse Source

提交修改

夜仔 3 years ago
parent
commit
1a7cc99009

+ 9 - 9
package-lock.json

@@ -1342,9 +1342,9 @@
             "dev": true
         },
         "@types/lodash": {
-            "version": "4.14.170",
-            "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.170.tgz",
-            "integrity": "sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q=="
+            "version": "4.14.171",
+            "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.171.tgz",
+            "integrity": "sha512-7eQ2xYLLI/LsicL2nejW9Wyko3lcpN6O/z0ZLHrEQsg280zIdCv1t/0m6UtBjUHokCGBQ3gYTbHzDkZ1xOBwwg=="
         },
         "@types/mime": {
             "version": "1.3.2",
@@ -4324,9 +4324,9 @@
             }
         },
         "dayjs": {
-            "version": "1.10.5",
-            "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.5.tgz",
-            "integrity": "sha512-BUFis41ikLz+65iH6LHQCDm4YPMj5r1YFLdupPIyM4SGcXMmtiLQ7U37i+hGS8urIuqe7I/ou3IS1jVc4nbN4g=="
+            "version": "1.10.6",
+            "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.6.tgz",
+            "integrity": "sha512-AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw=="
         },
         "debug": {
             "version": "4.3.1",
@@ -4857,9 +4857,9 @@
             "dev": true
         },
         "element-plus": {
-            "version": "1.0.2-beta.48",
-            "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-1.0.2-beta.48.tgz",
-            "integrity": "sha512-BKLjkZqZCJIYxUgwEj4ojaU0iEXHf6LPma100rMQPXZ/AUEVx3yjuo3fmTV54CTsIG+V2W1VCEnD7jF2iw+qrQ==",
+            "version": "1.0.2-beta.54",
+            "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-1.0.2-beta.54.tgz",
+            "integrity": "sha512-XXgZMnVt2ECtLyxJLVMq+faTxcYKNy9ZTaQ4cgbITgR/iGF5iXPHHjn1J1DWNLIKJ0XQRo8atAM1fyOpJsyJzw==",
             "requires": {
                 "@popperjs/core": "^2.4.4",
                 "@types/lodash": "^4.14.161",

+ 1 - 1
package.json

@@ -17,7 +17,7 @@
         "echarts-gl": "^2.0.4",
         "echarts-liquidfill": "^3.0.0",
         "echarts-wordcloud": "^2.0.0",
-        "element-plus": "^1.0.2-beta.48",
+        "element-plus": "^1.0.2-beta.54",
         "vue": "^3.0.11",
         "vue-amap": "^0.5.10",
         "vue-router": "^4.0.0-0",

+ 1 - 1
public/index.html

@@ -9,7 +9,7 @@
     <title>
         <%= htmlWebpackPlugin.options.title %>
     </title>
-    <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=8e266e1ac2ad2383c7773ff504ac248f"></script>
+    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=8e266e1ac2ad2383c7773ff504ac248f"></script>
     <script type="text/javascript" src="//webapi.amap.com/ui/1.1/main.js"></script>
     <!-- <script src="@a/js/flexible.js"></script> -->
 </head>

+ 3 - 1
src/App.vue

@@ -4,7 +4,9 @@
       <heads class="headS" :style="{height: $route.fullPath === '/' ? '.625rem' : ''}"></heads>
     </header>
     <div class="viewContent">
-      <router-view></router-view>
+      <keep-alive>
+        <router-view></router-view>
+      </keep-alive>
     </div>
     <footer class="footS">
       <foot></foot>

BIN
src/assets/img/home/footer-bg.png


BIN
src/assets/img/home/footer-bg1.png


BIN
src/assets/img/home/title1.png


BIN
src/assets/img/home/title11.png


BIN
src/assets/img/home/title2.png


BIN
src/assets/img/home/title22.png


+ 203 - 0
src/assets/js/dataFormate.js

@@ -0,0 +1,203 @@
+/**
+ * 获取本周、本季度、本月、上月的开始日期、结束日期
+ */
+var now = new Date(); //当前日期
+var nowDayOfWeek = now.getDay(); //今天本周的第几天
+var nowDay = now.getDate(); //当前日
+var nowMonth = now.getMonth(); //当前月
+var nowYear = now.getYear(); //当前年
+nowYear += (nowYear < 2000) ? 1900 : 0; //
+var lastMonthDate = new Date(); //上月日期
+lastMonthDate.setDate(1);
+lastMonthDate.setMonth(lastMonthDate.getMonth() - 1);
+// var lastYear = lastMonthDate.getYear();
+var lastMonth = lastMonthDate.getMonth();
+//格式化日期:yyyy-MM-dd
+function formatDate(date) {
+    var myyear = date.getFullYear();
+    var mymonth = date.getMonth() + 1;
+    var myweekday = date.getDate();
+    if (mymonth < 10) {
+        mymonth = "0" + mymonth;
+    }
+    if (myweekday < 10) {
+        myweekday = "0" + myweekday;
+    }
+    return (myyear + "-" + mymonth + "-" + myweekday);
+}
+//获得某月的天数
+function getMonthDays(myMonth) {
+    var monthStartDate = new Date(nowYear, myMonth, 1);
+    var monthEndDate = new Date(nowYear, myMonth + 1, 1);
+    var days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24);
+    return days;
+}
+//获得本季度的开始月份
+function getQuarterStartMonth() {
+    var quarterStartMonth = 0;
+    if (nowMonth < 3) {
+        quarterStartMonth = 0;
+    }
+    if (2 < nowMonth && nowMonth < 6) {
+        quarterStartMonth = 3;
+    }
+    if (5 < nowMonth && nowMonth < 9) {
+        quarterStartMonth = 6;
+    }
+    if (nowMonth > 8) {
+        quarterStartMonth = 9;
+    }
+    return quarterStartMonth;
+}
+//获得本周的开始日期
+function getWeekStartDate() {
+    var weekStartDate = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek);
+    return formatDate(weekStartDate) + ' 00:00:00';
+}
+//获得本周的结束日期
+function getWeekEndDate() {
+    var weekEndDate = new Date(nowYear, nowMonth, nowDay + (6 - nowDayOfWeek));
+    return formatDate(weekEndDate) + ' 23:59:59';
+}
+//获得上周的开始日期
+function getLastWeekStartDate() {
+    var weekStartDate = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 7);
+    return formatDate(weekStartDate) + ' 00:00:00';
+}
+//获得上周的结束日期
+function getLastWeekEndDate() {
+    var weekEndDate = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 1);
+    return formatDate(weekEndDate) + ' 23:59:59';
+}
+//获得本月的开始日期
+function getMonthStartDate() {
+    var monthStartDate = new Date(nowYear, nowMonth, 1);
+    return formatDate(monthStartDate) + ' 00:00:00';
+}
+//获得本月的结束日期
+function getMonthEndDate() {
+    var monthEndDate = new Date(nowYear, nowMonth, getMonthDays(nowMonth));
+    return formatDate(monthEndDate) + ' 23:59:59';
+}
+//获得上月开始时间
+function getLastMonthStartDate() {
+    var lastMonthStartDate = new Date(nowYear, lastMonth, 1);
+    return formatDate(lastMonthStartDate) + ' 00:00:00';
+}
+//获得上月结束时间
+function getLastMonthEndDate() {
+    var lastMonthEndDate = new Date(nowYear, lastMonth, getMonthDays(lastMonth));
+    return formatDate(lastMonthEndDate) + ' 23:59:59';
+}
+//获得本季度的开始日期
+function getQuarterStartDate() {
+    var quarterStartDate = new Date(nowYear, getQuarterStartMonth(), 1);
+    return formatDate(quarterStartDate) + ' 00:00:00';
+}
+//或的本季度的结束日期
+function getQuarterEndDate() {
+    var quarterEndMonth = getQuarterStartMonth() + 2;
+    var quarterStartDate = new Date(nowYear, quarterEndMonth,
+        getMonthDays(quarterEndMonth));
+    return formatDate(quarterStartDate) + ' 23:59:59';
+}
+//获得前半年开始时间
+function getHalfYearStartDate() {
+    var firstHalfYearStartDate = new Date(nowYear, 1 - 1, 1);
+    return formatDate(firstHalfYearStartDate) + ' 00:00:00';
+}
+//获前半年结束时间
+function getHalfYearEndDate() {
+    var firstHalfYearEndDate = new Date(nowYear, 6 - 1, 30);
+    return formatDate(firstHalfYearEndDate) + ' 23:59:59';
+}
+//获得前今年开始时间
+function getThisYearStartDate() {
+    var firstThisYearStartDate = new Date(nowYear, 1 - 1, 1);
+    return formatDate(firstThisYearStartDate) + ' 00:00:00';
+}
+//获前今年结束时间
+function getThisYearEndDate() {
+    var firstThisYearEndDate = new Date(nowYear, 12 - 1, 31);
+    return formatDate(firstThisYearEndDate) + ' 23:59:59';
+}
+//获取当前日期yy-mm-dd
+//date 为时间对象
+function getDateStr3(date) {
+    var year = "";
+    var month = "";
+    var day = "";
+    var now = date;
+    year = "" + now.getFullYear();
+    if ((now.getMonth() + 1) < 10) {
+        month = "0" + (now.getMonth() + 1);
+    } else {
+        month = "" + (now.getMonth() + 1);
+    }
+    if ((now.getDate()) < 10) {
+        day = "0" + (now.getDate());
+    } else {
+        day = "" + (now.getDate());
+    }
+    return year + "-" + month + "-" + day;
+}
+/** 
+ * 获得相对当前周AddWeekCount个周的起止日期 
+ * AddWeekCount为0代表当前周  为-1代表上一个周  为1代表下一个周以此类推
+ * **/
+function getWeekStartAndEnd(AddWeekCount) {
+    //起止日期数组  
+    var startStop = new Array();
+    //一天的毫秒数  
+    var millisecond = 1000 * 60 * 60 * 24;
+    //获取当前时间  
+    var currentDate = new Date();
+    //相对于当前日期AddWeekCount个周的日期
+    currentDate = new Date(currentDate.getTime() + (millisecond * 7 * AddWeekCount));
+    //返回date是一周中的某一天
+    var week = currentDate.getDay();
+    //返回date是一个月中的某一天  
+    // var month = currentDate.getDate();
+    //减去的天数  
+    var minusDay = week != 0 ? week - 1 : 6;
+    //获得当前周的第一天  
+    var currentWeekFirstDay = new Date(currentDate.getTime() - (millisecond * minusDay));
+    //获得当前周的最后一天
+    var currentWeekLastDay = new Date(currentWeekFirstDay.getTime() + (millisecond * 6));
+    //添加至数组  
+    startStop.push(getDateStr3(currentWeekFirstDay));
+    startStop.push(getDateStr3(currentWeekLastDay));
+
+    return startStop;
+}
+/** 
+ * 获得相对当月AddMonthCount个月的起止日期 
+ * AddMonthCount为0 代表当月 为-1代表上一个月 为1代表下一个月 以此类推
+ * ***/
+function getMonthStartAndEnd(AddMonthCount) {
+    //起止日期数组  
+    var startStop = new Array();
+    //获取当前时间  
+    var currentDate = new Date();
+    var month = currentDate.getMonth() + AddMonthCount;
+    if (month < 0) {
+        var n = parseInt((-month) / 12);
+        month += n * 12;
+        currentDate.setFullYear(currentDate.getFullYear() - n);
+    }
+    currentDate = new Date(currentDate.setMonth(month));
+    //获得当前月份0-11  
+    var currentMonth = currentDate.getMonth();
+    //获得当前年份4位年  
+    var currentYear = currentDate.getFullYear();
+    //获得上一个月的第一天  
+    var currentMonthFirstDay = new Date(currentYear, currentMonth, 1);
+    //获得上一月的最后一天  
+    var currentMonthLastDay = new Date(currentYear, currentMonth + 1, 0);
+    //添加至数组  
+    startStop.push(getDateStr3(currentMonthFirstDay));
+    startStop.push(getDateStr3(currentMonthLastDay));
+    //返回  
+    return startStop;
+}
+export { getWeekStartAndEnd, getMonthStartAndEnd, getHalfYearStartDate, getHalfYearEndDate, getThisYearStartDate, getThisYearEndDate, getWeekStartDate, getWeekEndDate, getLastWeekStartDate, getLastWeekEndDate, getMonthStartDate, getMonthEndDate, getLastMonthStartDate, getLastMonthEndDate, getQuarterStartDate, getQuarterEndDate }

+ 0 - 1
src/components/fire-pie/index.vue

@@ -85,7 +85,6 @@ export default {
               width: 200,
               overflow: "truncate",
               formatter: (params) => {
-                console.log(params)
                 return `${ parseInt(params.value * 100) / 100 + "%" }`;
               },
             },

+ 0 - 1
src/components/gauge/index.vue

@@ -73,7 +73,6 @@ export default {
             },
             detail: {
               formatter:  (value) => {
-                console.log( `${value}%`)
                 return this.dataNumber ? this.dataNumber :`${(value * 100).toFixed(0)}%`;
               },
               offsetCenter: [0, "0%"],

+ 34 - 20
src/components/line-smooth/index.vue

@@ -41,12 +41,12 @@ export default {
       let echartsMap = echarts.init(this.$refs.echartD);
       echartsMap.setOption({
         color: [
-          "rgba(20, 225, 234,.8)",
-          "rgba(20, 225, 234,.8)",
-          "rgba(250, 223, 43,.8)",
-          "rgba(250, 223, 43,.8)",
-          "rgba(239,107,61,.8)",
+          "rgba(62,175,64,.8)",
+          "rgba(62, 175, 64,.8)",
           "rgba(239,107,61,.8)",
+          "rgba(250, 223, 43,.8)",
+          "rgba(20, 225, 234,.8)",
+          "rgba(55, 155, 249,.8)",
         ],
         title: {
           show: false,
@@ -65,7 +65,14 @@ export default {
         legend: {
           show: true,
           data: ["社会救助", "火灾", "抢险救援"],
-          selected: { 社会救助: true, 火灾: false, 抢险救援: false, 救助月平均值: true, 火灾月平均值: false, 救援月平均值: false },
+          selected: {
+            社会救助: true,
+            火灾: false,
+            抢险救援: false,
+            救助月平均值: true,
+            火灾月平均值: false,
+            救援月平均值: false,
+          },
           bottom: 10,
           itemGap: 20,
           textStyle: {
@@ -140,11 +147,11 @@ export default {
               color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                 {
                   offset: 0,
-                  color: "rgba(20, 225, 234)",
+                  color: "rgba(62,175,64)",
                 },
                 {
                   offset: 1,
-                  color: "rgba(20, 225, 234, .1)",
+                  color: "rgba(62,175,64,.1)",
                 },
               ]),
             },
@@ -161,15 +168,15 @@ export default {
               color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                 {
                   offset: 0,
-                  color: "rgba(20, 225, 234)",
+                  color: "rgba(62, 175, 64,1)",
                 },
                 {
                   offset: 1,
-                  color: "rgba(20, 225, 234, .1)",
+                  color: "rgba(62, 175, 64,.1)",
                 },
               ]),
             },
-            data: dataMap[0].map((val) => val + 40),
+            data: dataMap[0].map((val) => val - 40),
           },
           {
             name: "火灾",
@@ -182,11 +189,11 @@ export default {
               color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                 {
                   offset: 0,
-                  color: "rgba(250, 223, 43,.5)",
+                  color: "rgba(239,107,61,1)",
                 },
                 {
                   offset: 1,
-                  color: "rgba(250, 223, 43, .1)",
+                  color: "rgba(239,107,61,.1)",
                 },
               ]),
             },
@@ -211,7 +218,7 @@ export default {
                 },
               ]),
             },
-            data: dataMap[1].map((val) => val + 40),
+            data: dataMap[1].map((val) => val - 40),
           },
           {
             name: "抢险救援",
@@ -224,11 +231,11 @@ export default {
               color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                 {
                   offset: 0,
-                  color: "rgba(239,107,61)",
+                  color: "rgba(20, 225, 234)",
                 },
                 {
                   offset: 1,
-                  color: "rgba(239,107,61,.1)",
+                  color: "rgba(20, 225, 234, .1)",
                 },
               ]),
             },
@@ -245,15 +252,15 @@ export default {
               color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                 {
                   offset: 0,
-                  color: "rgba(239,107,61)",
+                  color: "rgba(55, 155, 249,1)",
                 },
                 {
                   offset: 1,
-                  color: "rgba(239,107,61,.1)",
+                  color: "rgba(55, 155, 249,.1)",
                 },
               ]),
             },
-            data: dataMap[2].map((val) => val + 40),
+            data: dataMap[2].map((val) => val - 40),
           },
         ],
       });
@@ -262,7 +269,14 @@ export default {
         var isSelected = params.selected[params.name];
         echartsMap.dispatchAction({
           type: isSelected ? "legendSelect" : "legendUnSelect",
-            name: params.name === '社会救助' ? '救助月平均值' : params.name === '火灾' ? '火灾月平均值' : params.name === '抢险救援' ? '救援月平均值' :  '',
+          name:
+            params.name === "社会救助"
+              ? "救助月平均值"
+              : params.name === "火灾"
+              ? "火灾月平均值"
+              : params.name === "抢险救援"
+              ? "救援月平均值"
+              : "",
         });
       });
     },

+ 1 - 1
src/components/mixins/map.js

@@ -31,7 +31,7 @@ export default {
     methods: {
         async initMap() {
             this.map = await new AMap.Map('mapF', {
-                mapStyle: 'amap://styles/darkblue', //设置地图的显示样式
+                mapStyle: 'amap://styles/706effbde9cf9c72e136dfad8b9f6891', //设置地图的显示样式
                 resizeEnable: true,
                 zoom: 13,
                 zooms: [3, 16],

+ 0 - 1
src/components/pie-3D/echarts.js

@@ -184,7 +184,6 @@ export default function getPie3D(pieData, internalDiameterRatio = 2, ) {
     // 向每个 series-surface 传入不同的参数方程 series-surface.parametricEquation,也就是实现每一个扇形。
     for (let i = 0; i < series.length; i++) {
         endValue = startValue + series[i].pieData.value;
-        // console.log(series[i]);
         series[i].pieData.startRatio = startValue / sumValue;
         series[i].pieData.endRatio = endValue / sumValue;
         series[i].parametricEquation = getParametricEquation(series[i].pieData.startRatio, series[i].pieData.endRatio, false, false, k, series[i].pieData.value);

+ 0 - 1
src/components/pie-3D/index.vue

@@ -25,7 +25,6 @@ export default {
   },
   mounted() {
     this.getData();
-    // console.log(echartJ);
   },
   methods: {
     getData() {

+ 0 - 1
src/components/scatter/index.vue

@@ -122,7 +122,6 @@ export default {
       });
     },
     resize() {
-      // console.log(2)
       echarts.init(this.$refs.echartD).resize();
     },
   },

+ 0 - 2
src/components/treemap/index.vue

@@ -21,7 +21,6 @@ export default {
   },
   methods: {
     getData() {
-      console.log(this.dataMap);
       let dataMap = []
       if (this.dataMap.length > 0) {
         let levels = [1, 2, 6, 4, 5, 3].sort();
@@ -64,7 +63,6 @@ export default {
             align: "center",
             lineHeight: 17,
             formatter: (param) => {
-              console.log(param);
               return param.name + "\n" + param.data.values;
             },
           },

+ 1 - 1
src/router/index.js

@@ -14,7 +14,7 @@ const routes = [
 console.log(process.env.NODE_ENV)
 const router = createRouter({
     history: process.env.NODE_ENV === 'production' ? createWebHistory(process.env.BASE_URL) : createWebHashHistory(process.env.BASE_URL),
-    // history: createWebHashHistory(process.env.BASE_URL),
+    // history: createWebHistory(process.env.BASE_URL),
     base: '/',
     routes
 })

+ 1 - 0
src/store/index.js

@@ -451,6 +451,7 @@ export default createStore({
         },
         changTimeList(state, time) {
             state.timeList = time
+            console.log(state.timeList)
         },
         changTypeTime(state, type) {
             if (state.typeTime !== type) {

+ 3 - 4
src/views/Home.vue

@@ -27,11 +27,11 @@
         </el-row>
       </el-col>
       <el-col class="flexJ echartsPad">
-        <h4>闵行区消防情况</h4>
+        <h4>城市体征指数</h4>
         <radar-chart
           v-if="complaintList.length > 0"
           :dataMap="complaintList"
-          name="闵行区消防情况"
+          name="城市体征指数"
           ref="radarChart"
         ></radar-chart>
       </el-col>
@@ -301,8 +301,7 @@ export default {
       this.getTrend();
     },
     imgClick(val) {
-      console.log(val);
-      if(val === 2) window.open('https://iot.usky.cn/YtIoT/mhxf_index.jsp')
+      if(val === 2) window.open('http://120.55.70.156:8080/YtIoT/mhxf_index.jsp')
     },
   },
 };

+ 1 - 1
src/views/fire-data-analysis.vue

@@ -78,7 +78,7 @@
       </el-col>
     </transition>
     <transition name="el-fade-in-linear">
-      <el-col class="rightBox" v-show="rightBtn">
+      <el-col class="rightBox" v-show="rightBtn" >
         <div class="rightContent">
           <el-col class="rightTop">
             <h4>详细火灾情况</h4>

+ 1 - 0
src/views/foot.vue

@@ -27,6 +27,7 @@
         placement="top"
         trigger="click"
         class="bluePopover"
+        :offset="30"
       >
         <template #reference>
           <el-row class="blueHelp"></el-row>

+ 71 - 25
src/views/head.vue

@@ -4,7 +4,7 @@
     <div class="day">{{ dateDay }}</div>
     <div class="time">{{ dataTime }}</div>
     <div class="homeIcon" v-if="$route.fullPath !== '/'">
-      <i class="el-icon-s-home" @click="$router.push({path: '/',})"></i>
+      <i class="el-icon-s-home" @click="$router.push({ path: '/' })"></i>
     </div>
     <div class="weather">
       <img
@@ -12,24 +12,26 @@
         :src="weatherObj.weather_pic || ''"
         alt=""
       />
-      <span v-if="weatherObj.weather" >{{ weatherObj.weather }} {{ weatherObj.temperature }}℃</span>
+      <span v-if="weatherObj.weather"
+        >{{ weatherObj.weather }} {{ weatherObj.temperature }}℃</span
+      >
     </div>
     <el-row class="timeSelect" v-if="$route.fullPath !== '/'">
       <img src="~@a/img/home/circle_box.png" alt="" class="timeImage" />
-      <el-button size="mini" @click="timeTypeClick('day')">今日</el-button>
-      <el-button size="mini" @click="timeTypeClick('m')">当月</el-button>
-      <el-button size="mini" @click="timeTypeClick('s')">季度</el-button>
-      <el-button size="mini" @click="timeTypeClick('by')">半年</el-button>
-      <el-button size="mini" @click="timeTypeClick('y')">年</el-button>
+      <el-button size="mini" @click="timeTypeClick('day')" :class="{ btnClick: timeArea === 'day' }">今日</el-button>
+      <el-button size="mini" @click="timeTypeClick('m')" :class="{ btnClick: timeArea === 'm' }">当月</el-button>
+      <el-button size="mini" @click="timeTypeClick('s')" :class="{ btnClick: timeArea === 's' }">季度</el-button>
+      <el-button size="mini" @click="timeTypeClick('by')" style="width:.5rem;" :class="{ btnClick: timeArea === 'by' }">半年</el-button>
+      <el-button size="mini" @click="timeTypeClick('y')" :class="{ btnClick: timeArea === 'y' }">年</el-button>
       <el-date-picker
-        v-model="value1"
+        v-model="valueTime"
         class="dataComponent"
         type="daterange"
         align="right"
         range-separator="~"
         size="small"
         prefix-icon
-        :default-time="defaultTime"
+        :default-time="$store.state.timeList"
         format="YYYY-MM-DD"
         start-placeholder="开始日期"
         end-placeholder="结束日期"
@@ -41,14 +43,25 @@
 </template>
 
 <script>
+import {
+  getMonthStartDate,
+  getMonthEndDate,
+  getQuarterStartDate,
+  getQuarterEndDate,
+  getHalfYearStartDate,
+  getHalfYearEndDate,
+  getThisYearStartDate,
+  getThisYearEndDate,
+} from "../assets/js/dataFormate";
 export default {
   data() {
     return {
       dateDay: "",
       dataTime: "",
+      timeArea: "",
       weatherObj: {},
       dataWeekList: ["一", "二", "三", "四", "五", "六", "七"],
-      value1: [],
+      valueTime: [],
       defaultTime: [
         new Date(2000, 1, 1, 0, 0, 0),
         new Date(2000, 2, 1, 23, 59, 59),
@@ -56,8 +69,7 @@ export default {
     };
   },
   created() {
-    console.log(this.$route)
-    this.value1 = this.$store.state.timeList.map((val) => {
+    this.valueTime = this.$store.state.timeList.map((val) => {
       return val;
     });
     this.getWeather();
@@ -65,6 +77,13 @@ export default {
       this.getWeather();
     }, 1000 * 60 * 30);
   },
+  watch: {
+    "$store.state.timeList"(val) {
+      this.valueTime = val.map((value) => {
+        return value;
+      });
+    },
+  },
   mounted() {
     setInterval(() => {
       let day = new Date();
@@ -89,17 +108,40 @@ export default {
   },
   methods: {
     async getWeather() {
-      let res = await this.$axios.get(
-        '/aliWeather'
-      );
-      console.log(res)
+      let res = await this.$axios.get("/aliWeather");
       if (res.showapi_res_code === 0) {
         this.weatherObj = res.showapi_res_body.now;
-        console.log(this.weatherObj);
       }
     },
     timeTypeClick(val) {
-      this.$store.commit("changTypeTime", val);
+      if (val === "day") {
+        this.$store.commit("changTimeList", [
+          new Date().Format("yyyy-MM-dd") + " 00:00:00",
+          new Date().Format("yyyy-MM-dd") + " 23:59:59",
+        ]);
+      } else if (val === "m") {
+        this.$store.commit("changTimeList", [
+          getMonthStartDate(),
+          getMonthEndDate(),
+        ]);
+      } else if (val === "s") {
+        this.$store.commit("changTimeList", [
+          getQuarterStartDate(),
+          getQuarterEndDate(),
+        ]);
+      } else if (val === "by") {
+        this.$store.commit("changTimeList", [
+          getHalfYearStartDate(),
+          getHalfYearEndDate(),
+        ]);
+      } else if (val === "y") {
+        this.$store.commit("changTimeList", [
+          getThisYearStartDate(),
+          getThisYearEndDate(),
+        ]);
+      }
+      this.timeArea = val
+      // this.$store.commit("changTypeTime", val);
     },
     dateTimeChange(val) {
       this.$store.commit(
@@ -122,7 +164,7 @@ export default {
     left: 0;
     right: 0;
     margin: auto;
-    top: .25rem;
+    top: 0.25rem;
     font-size: 0.425rem;
     font-weight: 800;
     width: fit-content;
@@ -131,11 +173,11 @@ export default {
   }
   .homeIcon {
     position: absolute;
-    right: .6875rem;
-    top: .0625rem;
-    font-size: .625rem;
+    right: 0.6875rem;
+    top: 0.0625rem;
+    font-size: 0.625rem;
     color: #28bcfa;
-    i{
+    i {
       cursor: pointer;
     }
   }
@@ -161,7 +203,7 @@ export default {
   .weather {
     position: absolute;
     left: 5.375rem;
-    top: .0625rem;
+    top: 0.0625rem;
     display: flex;
     justify-content: center;
     align-items: center;
@@ -205,7 +247,11 @@ export default {
       box-sizing: border-box;
       font-size: 0.15rem;
       border-image: linear-gradient(0deg, #0461c2 0%, #0ecdf1 100%) 1 1;
-      border-radius: 0.125rem;
+      // border-radius: 0.125rem;
+    }
+    .btnClick {
+      color: #fccf2a;
+      border-image: linear-gradient(0deg, #ff6800 0%, #fccf2a 100%) 1 1;
     }
     /deep/.dataComponent {
       height: 0.325rem;

+ 0 - 2
src/views/rescue-station.vue

@@ -450,7 +450,6 @@ export default {
           })
           return a
         })
-        console.log(this.unitBeOnDutyListData)
       }else{
          this.unitBeOnDutyListData = []
       }
@@ -482,7 +481,6 @@ export default {
     // 各站点执勤实力
     async getFireSiteDuty(row, expandedRows) {
       if(!expandedRows || expandedRows.length<1) return
-      console.log(row, expandedRows)
       // let res = await this.$axios.get(this.$api.fireSite.fireSiteDuty +
       //     "?" +
       //     this.$qs.stringify({

+ 0 - 3
src/views/water-sources.vue

@@ -257,7 +257,6 @@ export default {
           })
           return a
         })
-        console.log(this.unitBeOnDutyListData)
       }else{
          this.unitBeOnDutyListData = []
       }
@@ -334,8 +333,6 @@ export default {
         })
         funnelList.map((val,ind)=> val.value = ind * 20 + 20)
         this.fireWaterStatisticsObj.funnelList = funnelList
-        console.log(total)
-        console.log(this.fireWaterStatisticsObj)
       }
     },
     searchTime(val){