guonan
2025-06-01 d348c7bb5f1726af0974789e407039a044c7ec4e
修改
已修改2个文件
33 ■■■■ 文件已修改
src/components/monifangzhen/schemeCard.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Screen.vue 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/monifangzhen/schemeCard.vue
@@ -14,7 +14,7 @@
        <p>
          方案状态 :
          <span style="color: aquamarine">
            {{ item.result === -1 ? "出错" : item.result || "创建仿真" }}
            {{ item.result === "-1" ? "出错" : item.result || "创建仿真" }}
          </span>
          <!-- <span style="color: aquamarine">{{ item.result || "创建仿真" }}</span> -->
          <!-- <span style="color: aquamarine">{{
src/views/Screen.vue
@@ -18,11 +18,17 @@
        <div class="screen-widget-text">
          {{ weather.now.text }} {{ weather.now.temperature + "℃" }}
        </div>
        <div
        <!-- <div
          class="screen-widget-time screen-widget-text"
          style="margin-left: 20px"
        >
          {{ $dayjs().format("YYYY/MM/DD HH:mm") }}
        </div> -->
        <div
          class="screen-widget-time screen-widget-text"
          style="margin-left: 20px"
        >
          {{ currentTime }}
        </div>
      </div>
      <div class="screen-widget-home">
@@ -38,8 +44,26 @@
</template>
<script setup>
import { ref, onMounted, computed, defineEmits } from "vue";
import { ref, onMounted, computed, defineEmits,onBeforeUnmount } from "vue";
import { useRouter } from "vue-router";
import dayjs from 'dayjs'
const currentTime = ref(dayjs().format("YYYY/MM/DD HH:mm:ss"));
const updateTime = () => {
  currentTime.value = dayjs().format("YYYY/MM/DD HH:mm:ss");
};
let timer;
onMounted(() => {
  timer = setInterval(updateTime, 1000);
});
onBeforeUnmount(() => {
  clearInterval(timer); // 避免内存泄漏
});
const router = useRouter();
const bgVisible = ref(true);
const defaultCity = ref(cityData.name);
@@ -96,7 +120,6 @@
    .then((response) => response.json())
    .then((data) => {
      weather.value = data.results[0];
      // console.log(weather.value)
    });
};
function initScene() {
@@ -144,7 +167,7 @@
  viewer.scene.camera.flyTo(view);
}
onMounted(() => {
  // getWeatherData()
  getWeatherData()
});
</script>
<style lang="less" scoped>