Browse Source

增加功能

sunzehao 3 months ago
parent
commit
0da39813a5

+ 1 - 1
index.html

@@ -3,7 +3,7 @@
   <head>
     <meta charset="UTF-8">
     <!-- <link rel="icon" href="/favicon.ico"> -->
-    <link rel="icon" href="cesiumIcon.png">
+    <link rel="icon" href="cesiumIco.png">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>“天镜” 数字孪生可视化引擎</title>
 

BIN
public/cesiumIco.png


+ 31 - 1
src/App.vue

@@ -1,18 +1,48 @@
 <template>
     <!-- <menuCom /> -->
+    <div class="header">
+        <img :src="cesiumImg" alt="">
+        <p>“天镜” 数字孪生可视化引擎</p>
+    </div>
 
     <RouterView />
 </template>
 
 <script>
 // import menuCom from "@/views/menuCom.vue"
+import cesiumImg from "/cesiumIco.png"
 export default {
     components: {
         // menuCom
     },
+    data() {
+        return {
+            cesiumImg
+        }
+    },
 }
 </script>
 
 <style lang="less">
-
+.header{
+    display: flex;
+    position: fixed;
+    z-index: 11111;
+    padding: 15px 0 0 15px;
+    width: 100%;
+    height: 50px;
+    background: linear-gradient(to bottom, #000000, transparent);
+    img{
+        width: 35px;
+        height: 35px;
+    }
+    p{
+        color: #fff;
+        margin-left: 10px;
+        font-size: 18px;
+        position: relative;
+        top: 3px;
+        font-weight: bold;
+    }
+}
 </style>

+ 7 - 6
src/components/devInfoBox.vue

@@ -22,7 +22,9 @@
           placement="top-end"
           v-if="gRenderer"
         >
-          <div class="item">型号:&nbsp;{{ gRenderer }}</div>
+          <div class="item">型号:&nbsp;
+            <span style="display: inline-black;">{{ gRenderer }}</span>
+            </div>
         </el-tooltip>
       </template>
     </div>
@@ -118,14 +120,13 @@ export default {
 
 <style lang="less">
 .devInfoBoxCom {
-    width: 130px;
+    // width: 130px;
     position: absolute;
-    right: 0;
-    bottom: 0;
-    padding: 4px;
+    // right: 0;
+    // bottom: 0;
     font-size: 12px;
     color: #fff;
-    background: rgba(0, 0, 0, 0.25);
+    // background: rgba(0, 0, 0, 0.25);
     display: flex;
     flex-direction: column;
     justify-content: flex-start;

+ 5 - 2
src/views/cesium.vue

@@ -96,7 +96,7 @@
     <div id="loading" class="dataLoading">
         加载中...
     </div>
-    <div class="devInfoBox" v-if="showDevInfoBox">
+    <!-- <div class="devInfoBox" v-if="showDevInfoBox">
       <div class="item">===&nbsp;帧率与内存&nbsp;===</div>
       <div class="item">运行帧率:&nbsp;{{ fps }}</div>
       <div class="item">响应时长:&nbsp;{{ ms }}</div>
@@ -122,10 +122,11 @@
           <div class="item">型号:&nbsp;{{ gRenderer }}</div>
         </el-tooltip>
       </template>
-    </div>
+    </div> -->
     <div class="tempImg" v-if="showtempImg">
         <img src="../assets/cesiumImg/temp.png" >
     </div>
+    <weatherView :viewer="viewer" />
   </div>
     
   <el-dialog
@@ -169,6 +170,7 @@ import axios from "axios";
 import ModelUnpack from "@/components/modelUnpack.vue";
 import menuCom from "./menuCom.vue"
 import {getTempData} from "@/api/index.js"
+import weatherView from "./cesiumComponents/weatherView.vue"
 
 export default {
   name: "CesiumMap",
@@ -176,6 +178,7 @@ export default {
   components: {
     ModelUnpack,
     menuCom,
+    weatherView
   },
 
   data() {

+ 2 - 2
src/views/cesiumComponents/homeView.vue

@@ -47,8 +47,8 @@ export default {
 <style lang="less">
   .cardContainer {
     position: fixed;
-    bottom: 20px;
-    left: 100px;
+    top: 50px;
+    right: 20px;
     width: fit-content;
     display: flex;
     align-items: center;

+ 123 - 0
src/views/cesiumComponents/weatherView.vue

@@ -0,0 +1,123 @@
+<template>
+    <div class="weatherView">
+        <!-- Right Sidebar -->
+        <aside class="sidebar-right panel">
+            <div class="weather-summary">
+                <div class="weather-temp">
+                    <span class="icon">☀️</span>
+                    <div>
+                        <span class="value">20<small>°C</small></span>
+                        <div class="weather-info">
+                            <span class="condition">晴转多云, 空气质量极佳</span>
+                        </div>
+                    </div>
+                </div>
+                <span>☰</span>
+            </div>
+
+            <div class="market-demand">
+                <strong>生活气象指数</strong>
+                <div style="display: flex; flex-direction: column; gap: 10px; margin-top: 8px; font-size: 12px; opacity: 0.9;">
+                    <span>● 穿衣:大衣类(15°C ~ 20°C)</span>
+                    <span>● 感冒:易发(早晚温差大)</span>
+                </div>
+            </div>
+
+            <div class="info-section">
+                <h3>天气信息--宁夏</h3>
+                <div class="info-item">
+                    <span class="label">平均风向</span><span class="value">12.9°</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">风速</span><span class="value">3.6m/s</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">空气质量指数</span><span class="value">>200 <span class="tag blue">蓝色预警</span></span>
+                </div>
+                <div class="info-item">
+                    <span class="label">湿度</span><span class="value">64.0% <span class="tag green">✔</span></span>
+                </div>
+                <div class="info-item">
+                    <span class="label">降水</span><span class="value">20mm</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">大气压力</span><span class="value">997.5hPa</span>
+                </div>
+            </div>
+
+            <div class="info-section">
+                <h3>操作信息</h3>
+                <div class="info-item">
+                    <span class="label">可用性</span><span class="value">100%</span>
+                </div>
+                <div class="op-progress-bar"><div class="op-progress-bar-inner" style="width: 100%;"></div></div>
+                <div class="info-item" style="margin-top: 15px;">
+                    <span class="label">容量因子</span><span class="value">32.6%</span>
+                </div>
+                <div class="op-progress-bar"><div class="op-progress-bar-inner" style="width: 32.6%;"></div></div>
+            </div>
+            <div class="devBox market-demand">
+                <devBox :viewer="viewer" />
+            </div>
+        </aside>
+    </div>
+</template>
+
+<script>
+import devBox from "@/components/devInfoBox.vue"
+export default {
+    props: {
+        viewer: {
+            type: Object,
+            default: () => null
+        }
+    },
+    components: {
+        devBox
+    }
+}
+</script>
+
+<style lang="less">
+.panel {
+    background: rgba(248, 249, 252, 0.85);
+    backdrop-filter: blur(15px);
+    -webkit-backdrop-filter: blur(15px);
+    border: 1px solid rgba(255, 255, 255, 0.2);
+    border-radius: 12px;
+    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
+    padding: 20px;
+}
+/* --- Right Sidebar --- */
+.sidebar-right {
+    position: absolute;
+    top: 20px;
+    right: 20px;
+    width: 300px;
+    height: calc(100% - 40px);
+    display: flex;
+    flex-direction: column;
+    gap: 20px;
+}
+.weather-summary { display: flex; align-items: center; justify-content: space-between; }
+.weather-temp { display: flex; align-items: center; gap: 10px; }
+.weather-temp .value { font-size: 28px; font-weight: 500; }
+.weather-temp .icon { font-size: 24px; }
+.weather-info .condition { font-size: 12px; color: #6c757d; }
+.market-demand { background-color: #134ac0; color: white; padding: 15px 10px; border-radius: 8px; font-size: 14px; }
+.info-section { font-size: 13px; }
+.info-section h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; color: #6c757d; margin-bottom: 15px; }
+.info-item { display: flex; justify-content: space-between; margin-bottom: 12px; }
+.info-item .label { color: #212529; }
+.info-item .value { color: #6c757d; display: flex; align-items: center; gap: 5px; }
+.tag { font-size: 11px; padding: 2px 6px; border-radius: 4px; }
+.tag.blue { background-color: #e7f1ff; color: #134ac0; }
+.tag.green { background-color: #e6f7f0; color: #28a745; }
+.op-progress-bar { height: 6px; background: #e9ecef; border-radius: 3px; margin-top: 5px; }
+.op-progress-bar-inner { height: 100%; background: #134ac0; border-radius: 3px; }
+.devBox{
+    position: relative;
+    width: 100%;
+    height: 100%;
+}
+</style>

+ 5 - 3
src/views/menuCom.vue

@@ -189,10 +189,11 @@ export default {
     position: relative;
   }
   .basemap{
-    background: linear-gradient(45deg, #872419, #db4a39, #ff7061);
+    background: linear-gradient(45deg, #134ac0, #316ff6, #78a3ff);
+    
   }
   .init:hover {
-    background: linear-gradient(45deg, #66757f, #00acee, #36daff, #dbedff);
+    background: linear-gradient(45deg, #872419, #db4a39, #ff7061);
   }
   .windspeed{
     cursor: no-drop;
@@ -201,7 +202,8 @@ export default {
 //     background: linear-gradient(45deg, #66757f, #00acee, #36daff, #dbedff);
 //   }
   .cloud:hover, .cloundBack {
-    background: linear-gradient(45deg, #134ac0, #316ff6, #78a3ff);
+    background: linear-gradient(45deg, #66757f, #00acee, #36daff, #dbedff);
+    // background: linear-gradient(45deg, #134ac0, #316ff6, #78a3ff);
   }
   .rainfall:hover, .rainBack {
     background: linear-gradient(45deg, #872419, #db4a39, #ff7061);