gbtomr 2 years ago
parent
commit
2d402440d5
3 changed files with 38 additions and 11 deletions
  1. 12 0
      src/utils/UIInteractions.js
  2. 24 10
      src/views/hdsj/Index.vue
  3. 2 1
      vue.config.js

+ 12 - 0
src/utils/UIInteractions.js

@@ -492,4 +492,16 @@ export function ueCallHistoryClear() {    // 清除模拟历史航班
   callUIInteractionFormat({
     "ActionName":"history_clear"
   })
+}
+
+export function ueCallStartYjyj() {    // 开启淤积预警
+  callUIInteractionFormat({
+    "ActionName":"start_yjyj"
+  })
+}
+
+export function ueCallCloseYjyj() {    // 关闭淤积预警
+  callUIInteractionFormat({
+    "ActionName":"close_yjyj"
+  })
 }

+ 24 - 10
src/views/hdsj/Index.vue

@@ -3,10 +3,10 @@
     <div class="panel-left">
       <div class="pl-b1">
         <span class="title1-left">水深管理</span>
-        <div v-for="item,index in data_ssgl.value" class="plb1-item" :class="{'highlight': index===1}">
+        <div v-for="item,index in data_ssgl.value" class="plb1-item">
           <img :src="item.iconUrl" alt="">
           <div>
-            <span>{{ item.title }}</span>
+            <span @click="handleToggleYuji(index)" :class="{'highlight': index===1&&isYujiOn}">{{ item.title }}</span>
             <div>
               <span>{{ item.value }}</span>
               <span>{{ item.unit }}</span>
@@ -136,7 +136,8 @@ export default {
   import { GetBoatNum, GetFstj, GetFstjByDay, GetYjWarning } from '@/apis/hdsj'
   import { useDateFormat } from '@vueuse/core';
   import {
-    ueCallInitShujun, ueCallClickShujun, ueCallRunShujun, ueCallBeforeShujun, ueCallClearShujun, ueCallAfterShujun, ueCallBackShujun, ueCallInitWaterShujun
+    ueCallInitShujun, ueCallClickShujun, ueCallRunShujun, ueCallBeforeShujun, ueCallClearShujun,
+    ueCallAfterShujun, ueCallBackShujun, ueCallInitWaterShujun, ueCallStartYjyj, ueCallCloseYjyj
   } from '@/utils/UIInteractions'
   import bus from '@/utils/bus';
 
@@ -157,6 +158,19 @@ export default {
     { title: '淤积预警', value:  1, unit: '处', iconUrl: require('@/assets/imgs/page_hdsj/logo-yjyj.png') },
   ]})
 
+  const isYujiOn = ref(false)
+
+  function handleToggleYuji(index) {
+    if(index===1) {
+      if(isYujiOn.value === false) {
+        ueCallStartYjyj()
+      } else {
+        ueCallCloseYjyj()
+      }
+      isYujiOn.value = !isYujiOn.value
+    }
+  }
+
   const listData_gcxx = reactive({value: [
     { name: '2022年董家渡弯道疏浚项目', date:'2022-11', status: '已完成' },
     { name: '2022年陆家嘴弯道疏浚项目', date:'2022-10', status: '已完成' },
@@ -185,7 +199,7 @@ export default {
 
   function getBoatNum() {
     GetBoatNum().then(res => {
-      data_gcgk.sta[0].value = 22.15
+      data_gcgk.sta[0].value = 1.469
       data_gcgk.sta[1].value = res.data || '-'
       data_gcgk.cata[0].value = 6
       data_gcgk.cata[1].value = 17
@@ -345,12 +359,7 @@ export default {
     .plb1-item {
       display: flex;
       align-items: center;
-      &.highlight {
-        &>div>span {
-          background: url('@/assets/imgs/page_hdsj/bg-ssgl-text2.png') no-repeat;
-          background-size: contain;
-        }
-      }
+      
       &>img {
         width: 105px;
         height: 95px;
@@ -372,6 +381,11 @@ export default {
           color: #FFFFFF;
           line-height: 25px;
           text-shadow: 1px 2px 0px rgba(17,20,22,0.22);
+          cursor: pointer;
+          &.highlight {
+            background: url('@/assets/imgs/page_hdsj/bg-ssgl-text2.png') no-repeat;
+            background-size: contain;
+          }
         }
         &>div {
           padding-left: 15px;

+ 2 - 1
vue.config.js

@@ -2,5 +2,6 @@ const { defineConfig } = require('@vue/cli-service')
 
 module.exports = defineConfig({
   transpileDependencies: true,
-  lintOnSave:false
+  lintOnSave:false,
+  publicPath: './'
 })