bihuisong před 1 rokem
rodič
revize
16a224971c

+ 33 - 4
zhsq_qk-ui/src/views/fusion/index.vue

@@ -69,9 +69,9 @@
     <!--右侧开始-->
     <div class="right_con">
       <div class="top_txt">
-        <span>2024.04.20</span>
-        <span>星期六</span>
-        <b>11:16:58</b>
+        <span>{{ currentTime }}</span>
+<!--        <span>星期六</span>-->
+<!--        <b>11:16:58</b>-->
       </div>
       <!--党建引领-->
       <div class="qkq_djyl">
@@ -192,12 +192,21 @@ import "@/assets/images/qkq_index.css";
 
 export default {
   name: 'weather',
+  data() {
+    return {
+      currentTime: '',
+    }
+  },
   created() {
   },
   mounted() {
     this.doingBusiness();
     this.grid();
     this.economic();
+    // 每秒刷新时间
+    setInterval(() => {
+      this.getCurrentTime();
+    }, 1000);
   },
   methods: {
     handleNavigation(page) {
@@ -927,7 +936,7 @@ export default {
             "第二季度",
             "第三季度",
             "第四季度",
-                ],
+          ],
           axisLabel: {
             textStyle: {
               color: "#ffffff",
@@ -1053,6 +1062,26 @@ export default {
 
       // })
     },
+
+    getCurrentTime() {
+      const now = new Date();
+      const year = now.getFullYear();
+      const month = now.getMonth() + 1;
+      const date = now.getDate();
+      const day = now.getDay();
+      const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
+      const hour = now.getHours();
+      const minute = now.getMinutes();
+      const second = now.getSeconds();
+
+      const formattedMonth = month < 10 ? `0${month}` : month;
+      const formattedDate = date < 10 ? `0${date}` : date;
+      const formattedHour = hour < 10 ? `0${hour}` : hour;
+      const formattedMinute = minute < 10 ? `0${minute}` : minute;
+      const formattedSecond = second < 10 ? `0${second}` : second;
+
+      this.currentTime = `${year}年${formattedMonth}月${formattedDate}日 ${weekDays[day]} ${formattedHour}:${formattedMinute}:${formattedSecond}`;
+    },
   }
 }
 </script>

+ 1 - 1
zhsq_qk-ui/src/views/fusion/jczl.vue

@@ -266,7 +266,7 @@ export default {
     return {
       currentTime: '',
       sltProps: null,
-      btnOne: false,
+      btnOne: true,
       btnTwo: false
     }
   },

+ 1 - 1
zhsq_qk-ui/src/views/fusion/jtzl.vue

@@ -177,7 +177,7 @@ export default {
       cameras: [],
       sltProps: null,
       currentTime: '',
-      btnOne: false,
+      btnOne: true,
       btnTwo: false
     };
     // 可根据实际情况添加更多设备列表

+ 1 - 1
zhsq_qk-ui/src/views/fusion/sprh.vue

@@ -177,7 +177,7 @@ export default {
       cameras: [],
       sltProps: null,
       currentTime: '',
-      btnOne: false,
+      btnOne: true,
       btnTwo: false
     };
     // 可根据实际情况添加更多设备列表

+ 36 - 11
zhsq_qk-ui/src/views/fusion/yshj.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="map">
-<!--            <img src="@/assets/images/qkq_mapbg.png"/>-->
+      <!--            <img src="@/assets/images/qkq_mapbg.png"/>-->
       <supermap ref="supermap" style="height: 100%;width: 100%;position: absolute;z-index: 0;"
                 :yxtSltProps="sltProps"></supermap>
     </div>
@@ -111,9 +111,9 @@
     <!--右侧开始-->
     <div class="right_con">
       <div class="top_txt">
-        <span>2024.04.20</span>
-        <span>星期六</span>
-        <b>11:16:58</b>
+        <span>{{ currentTime }}</span>
+<!--        <span>星期六</span>-->
+<!--        <b>11:16:58</b>-->
       </div>
       <!-- 事项办件量Top10 -->
       <div class="qkq_tdzy">
@@ -192,8 +192,9 @@ export default {
   data() {
     return {
       sltProps: null,
-      btnOne: false,
-      btnTwo: false
+      btnOne: true,
+      btnTwo: false,
+      currentTime: '',
     }
   },
 
@@ -208,6 +209,10 @@ export default {
     this.bmbjs();
     this.bmbjl();
     this.bmyql();
+    // 每秒刷新时间
+    setInterval(() => {
+      this.getCurrentTime();
+    }, 1000);
   },
   methods: {
     sltHandle() {
@@ -949,8 +954,8 @@ export default {
         let object = {}
         labelData.push(data[i]);
         var lineNumber = Math.floor(Math.random() * 900);
-        this.$set(object,"name",data[i]);
-        this.$set(object,"value",lineNumber);
+        this.$set(object, "name", data[i]);
+        this.$set(object, "value", lineNumber);
         valueData.push(object);
       }
       var getArrByKey = (data, k) => {
@@ -1074,7 +1079,7 @@ export default {
             barWidth: 10,
             barGap: '-100%',
             z: 1,
-            data:getSymbolData(data),
+            data: getSymbolData(data),
             itemStyle: {
               normal: {
                 color: '#0b2645',
@@ -1155,7 +1160,7 @@ export default {
       }
 
 // 每隔一段时间更新数据
-      setInterval(function() {
+      setInterval(function () {
         updateData();
       }, 1000);
 
@@ -1440,6 +1445,7 @@ export default {
           },
         ],
       };
+
       function updateData() {
         let newData = [];
         for (var i = 0; i < typeList.length; i++) {
@@ -1449,6 +1455,7 @@ export default {
         option.series[0].data[0].value = newData;
         myChart.setOption(option);
       }
+
       setInterval(function () {
         updateData();
       }, 1000); // 每秒更新一次数据
@@ -1656,9 +1663,27 @@ export default {
       if (option) {
         myChart.setOption(option);
       }
-    }
+    },
+
+    getCurrentTime() {
+      const now = new Date();
+      const year = now.getFullYear();
+      const month = now.getMonth() + 1;
+      const date = now.getDate();
+      const day = now.getDay();
+      const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
+      const hour = now.getHours();
+      const minute = now.getMinutes();
+      const second = now.getSeconds();
 
+      const formattedMonth = month < 10 ? `0${month}` : month;
+      const formattedDate = date < 10 ? `0${date}` : date;
+      const formattedHour = hour < 10 ? `0${hour}` : hour;
+      const formattedMinute = minute < 10 ? `0${minute}` : minute;
+      const formattedSecond = second < 10 ? `0${second}` : second;
 
+      this.currentTime = `${year}年${formattedMonth}月${formattedDate}日 ${weekDays[day]} ${formattedHour}:${formattedMinute}:${formattedSecond}`;
+    },
   },
 };
 </script>