From f1e4e5843ff9ae37ccecd0ea391911f67de0e50d Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Sat, 29 Mar 2025 16:02:53 +0800
Subject: [PATCH] feat: 机巢点击交互
---
src/views/Home/components/HomeLeft/HomeLeft.vue | 92 +++++++++++++++++++++++++++++++++------------
1 files changed, 67 insertions(+), 25 deletions(-)
diff --git a/src/views/Home/components/HomeLeft/HomeLeft.vue b/src/views/Home/components/HomeLeft/HomeLeft.vue
index b3e12bc..48d86b4 100644
--- a/src/views/Home/components/HomeLeft/HomeLeft.vue
+++ b/src/views/Home/components/HomeLeft/HomeLeft.vue
@@ -1,35 +1,77 @@
<template>
- <div class="home-left-index">
- <!--时间 天气-->
- <div class="time-watch">
- <div class="time">2025.03.04 15:30:00</div>
- <div>
- <img src="" alt="">
- <span>阴天</span>
- <span>适合飞行</span>
- </div>
- </div>
+ <div class="home-left">
+ <!--时间 天气-->
+ <div class="time-weather">
+ <div class="time">{{ time }}</div>
+ <div class="line"></div>
+ <div class="weather">
+ <img src="@/assets/images/home/homeLeft/tq.png" alt="" />
+ <span class="tq">阴天</span>
+ <span class="qk">适合飞行</span>
+ </div>
</div>
+ <!--机巢概况-->
+ <overview-next></overview-next>
+ <!--巡检任务情况-->
+ <inspection-rask-details></inspection-rask-details>
+ </div>
</template>
-<script></script>
+<script setup>
+import OverviewNext from './OverviewNext.vue';
+import InspectionRaskDetails from './InspectionRaskDetails.vue';
+import dayjs from 'dayjs';
+
+
+const time = ref('');
+const updateTime = () => {
+ time.value = dayjs().format('YYYY.MM.DD HH:mm:ss');
+};
+onMounted(() => {
+ updateTime(); // 立即执行一次
+ time.value = setInterval(updateTime, 1000);
+});
+onUnmounted(() => {
+ if (time.value) {
+ clearInterval(time.value);
+ time.value = null;
+ }
+});
+</script>
<style scoped lang="scss">
-.home-left-index {
- margin-top: 12px;
+.home-left {
+ position: absolute;
+ top: 88px;
+ color: #e7f5ff;
+ .time-weather {
margin-left: 45px;
- // border: 1px springgreen solid;
- width: 360px;
-
- .time-watch {
- font-size: 14px;
- height: hToV(36);
- display: flex;
- .time {
- font-weight: 400;
- font-size: 14px;
- line-height: hToV(16);
- }
+ width: 310px;
+ font-size: 14px;
+ height: 36px;
+ line-height: 36px;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ .line {
+ border: 1px solid #ffffff;
+ height: 10px;
+ opacity: 0.5;
}
+ .weather {
+ img {
+ width: 20px;
+ height: 20px;
+ }
+ .tq {
+ margin: 0 5px;
+ color: #e7f5ff;
+ }
+ .qk {
+ margin-left: 5px;
+ color: #04f043;
+ }
+ }
+ }
}
</style>
--
Gitblit v1.9.3