Ver Fonte

联调底板、添加太师桥标签。调整路由

linqilong há 6 meses atrás
pai
commit
8cf4dd526e

Diff do ficheiro suprimidas por serem muito extensas
+ 292 - 831
src/api/gx.ts


+ 21 - 17
src/api/weather.ts

@@ -1,24 +1,28 @@
-import request from "@/utils/request";
-
 /**
  * 水质自动站多站最新数据
  */
 export async function getWeather() {
-  const jiaxinWeather = await request({
-    url: '/nmc_api/rest/weather?stationid=pxfeS',
-    method: 'get'
-  }).then(res => res.data.real.weather)
-  const huangshanWeather = await request({
-    url: '/nmc_api/rest/weather?stationid=dFIpc',
-    method: 'get'
-  }).then(res => res.data.real.weather)
-  const ningdeWeather = await request({
-    url: '/nmc_api/rest/weather?stationid=uKfig',
-    method: 'get'
-  }).then(res => res.data.real.weather)
+  // const jiaxinWeather = await request({
+  //   url: '/nmc_api/rest/weather?stationid=pxfeS',
+  //   method: 'get'
+  // }).then(res => res.data.real.weather)
+  // const huangshanWeather = await request({
+  //   url: '/nmc_api/rest/weather?stationid=dFIpc',
+  //   method: 'get'
+  // }).then(res => res.data.real.weather)
+  // const ningdeWeather = await request({
+  //   url: '/nmc_api/rest/weather?stationid=uKfig',
+  //   method: 'get'
+  // }).then(res => res.data.real.weather)
+  // return Promise.resolve([
+  //   {city: '嘉兴市', weather: `${jiaxinWeather.info} ${jiaxinWeather.temperature}℃`},
+  //   {city: '黄山市', weather: `${huangshanWeather.info} ${huangshanWeather.temperature}℃`},
+  //   {city: '宁德市', weather: `${ningdeWeather.info} ${ningdeWeather.temperature}℃`},
+  // ])
+
   return Promise.resolve([
-    {city: '嘉兴市', weather: `${jiaxinWeather.info} ${jiaxinWeather.temperature}℃`},
-    {city: '黄山市', weather: `${huangshanWeather.info} ${huangshanWeather.temperature}℃`},
-    {city: '宁德市', weather: `${ningdeWeather.info} ${ningdeWeather.temperature}℃`},
+    {city: '嘉兴市', weather: `晴 23℃`},
+    {city: '黄山市', weather: `多云 21℃`},
+    {city: '宁德市', weather: `晴 18℃`},
   ])
 }

+ 5 - 1
src/components/UePlayer.vue

@@ -15,7 +15,7 @@ onMounted(() => {
   const config = new Config({
     useUrlParams: true,
     initialSettings: {
-      ss: "ws://192.168.0.120:85",
+      ss: "ws://192.168.0.136:85",
       AutoConnect: true,
       AutoPlayVideo: true,
       StartVideoMuted: false,
@@ -66,4 +66,8 @@ bus.on('emitUIInteraction', (data) => emitUIInteraction(data))
 #playerUI #uiFeatures #controls {
   display: none;
 }
+
+#playerUI #uiFeatures #connection {
+  display: none;
+}
 </style>

+ 9 - 4
src/layout/components/AppMain.vue

@@ -1,11 +1,16 @@
 <script lang="ts" setup>
-import {RouterView, useRoute} from 'vue-router'
+import {useRoute} from "vue-router";
+import {computed} from "vue";
 
-let route = useRoute()
+const route = useRoute();
+const key = computed(() => {
+  return route.path + Math.random();
+});
 </script>
 <template>
   <section ref="appMain" class="app-main">
-    <router-view :key="route.path"/>
+    <router-view :key="key" v-slot="{ Component, route }">
+      <component :is="Component" :key="route.fullPath"/>
+    </router-view>
   </section>
 </template>
-

+ 7 - 4
src/layout/components/Navbar.vue

@@ -36,6 +36,8 @@ let weatherInterval = null
 function titleChange(path) {
   switch (path) {
     case '/station/63304700':
+    case '/situational/63304700':
+    case '/intelloper/63304700':
       navbarTitleImage.value = new URL('@/assets/images/layout/header-title-tsq.png', import.meta.url).href
       break
     default:
@@ -60,7 +62,7 @@ function getWeathers() {
     weatherInterval = setInterval(() => {
       location.value = res[weatherIndex].city
       weather.value = res[weatherIndex].weather
-      Setting.setWeather(res[weatherIndex].weather.split(' ')[0])
+      // Setting.setWeather(res[weatherIndex].weather.split(' ')[0])
 
       if (res.length - 1 === weatherIndex) {
         weatherIndex = 0
@@ -122,10 +124,11 @@ onUnmounted(() => {
   color: #fff;
 
   img {
-    //width: 18%;
-    height: 40px;
+    object-fit: contain; /* 保持图片的宽高比,同时完整显示图片 */
+    max-width: 18%;
+    max-height: 40px;
     position: absolute;
-    top: 1.5vh;
+    top: 2vh;
     left: 50%;
     transform: translateX(-50%);
   }

+ 1 - 1
src/layout/index.vue

@@ -34,7 +34,7 @@ onMounted(() => {
 <template>
   <div :style="{ '--current-color': theme }" class="app-wrapper">
 
-    <antv-map v-if="appStore.floorType === 'map'" class="floor-container"></antv-map>
+    <antv-map v-show="appStore.floorType === 'map'" class="floor-container"></antv-map>
     <ue-player v-show="appStore.floorType === 'ue'" class="floor-container"></ue-player>
 
     <!-- 顶部阴影 -->

+ 2 - 1
src/utils/tdInstruction/index.ts

@@ -1,5 +1,6 @@
 import * as Setting from "./setting";
 import * as View from "./view";
 import * as Layer from "./layer";
+import * as Label from "./label";
 
-export {Setting, Layer, View};
+export {Setting, Layer, View, Label};

+ 19 - 0
src/utils/tdInstruction/label.ts

@@ -0,0 +1,19 @@
+import Bus from "@/utils/bus";
+
+
+/**
+ * 测站标签展示
+ * 测站主页:显示站房雨量场等图标;仪器运维:显示仪器图标
+ * @param type 展示标签类型(测站主页:显示站房雨量场等图标;仪器运维:显示仪器图标)
+ */
+export function setStationLabel(type = "测站主页", show = true) {
+  let descriptor = {
+    "command": "SetPOI",
+    "data": {
+      "type": type,
+      "display": show ? "True" : "False"
+    }
+  }
+  Bus.emit('emitUIInteraction', descriptor)
+  console.log("-- 测站标签展示", JSON.stringify(descriptor));
+}

+ 36 - 3
src/views/Situational.vue

@@ -16,8 +16,9 @@ import {
 } from "@/api/gx";
 import {formatd} from "@/utils/ruoyi";
 import {filterWaterQualitys} from "@/utils/unit";
-import {Setting, View} from "@/utils/tdInstruction";
+import {Label, Setting, View} from "@/utils/tdInstruction";
 import {getLatestTimeWithMinuteMultipleOfFive} from "@/utils/date";
+import {Hide, View as Elview} from '@element-plus/icons-vue'
 
 const route = useRoute()
 const dibaImage = (new URL('@/assets/images/dike.png', import.meta.url).href)
@@ -374,6 +375,13 @@ function getLatestWaterQuality() {
   })
 }
 
+const labelState = reactive({'测站主页': false, '仪器运维': false})
+
+function setStationLabel(type = "测站主页") {
+  labelState[type] = !labelState[type]
+  Label.setStationLabel(type, labelState[type])
+}
+
 onMounted(() => {
   reloadRight1()
   reloadRight3()
@@ -451,7 +459,21 @@ onMounted(() => {
             <div class="right-btn-option" @click="Setting.setWeather('大雨')">大雨</div>
           </div>
         </div>
-        <div class="right-btn-item"><img :src="flagSrc"></div>
+        <div class="right-btn-item">
+          <img :src="flagSrc">
+          <div class="right-btn-option-list">
+            <div class="right-btn-option" @click="setStationLabel('测站主页')">
+              测站标签
+              <Elview v-show="labelState['测站主页']"></Elview>
+              <Hide v-show="!labelState['测站主页']"></Hide>
+            </div>
+            <div class="right-btn-option" @click="setStationLabel('仪器运维')">
+              仪器运维
+              <Elview v-show="labelState['仪器运维']"></Elview>
+              <Hide v-show="!labelState['仪器运维']"></Hide>
+            </div>
+          </div>
+        </div>
         <div class="right-btn-item">
           <img :src="walkSrc">
           <div class="right-btn-option-list">
@@ -516,7 +538,7 @@ onMounted(() => {
       position: absolute;
       top: 0;
       right: 1.8rem;
-      width: 140px;
+      width: 160px;
       padding: 0 20px;
     }
 
@@ -528,6 +550,17 @@ onMounted(() => {
       text-align: center;
       color: #fff;
       box-sizing: border-box;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      font-size: 1rem;
+
+      svg {
+        width: 1rem;
+        height: 1rem;
+        margin-left: .5rem;
+      }
+
     }
 
   }

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff