liuqiao 10 tháng trước cách đây
mục cha
commit
0c68ea51dd

+ 2 - 0
src/components/header.vue

@@ -33,7 +33,9 @@ import { request, uploadFile } from "@/utils/request";
 import logo from "@/assets/logo.png";
 import { ElMessage, ElButton, ElDialog, ElSelect } from 'element-plus'
 import { timestampToTime,formatTime } from "@/js/lindex.js";
+import emitter from "@/utils/emitter";
 let emit = defineEmits(['handleSelect'])
+
 let headername=ref();
 const props = defineProps({
     name:{

+ 2 - 5
src/style/style.css

@@ -657,7 +657,7 @@ border-image: linear-gradient(90deg, rgba(91, 175, 222, 0), rgba(91, 175, 222, 1
 }
 
 .he_pading {
-    padding: 19px 14px 0 31px;
+  padding: 0px 14px 0 13px;
 }
 
 .asideg1 .el-form-item__label {
@@ -1707,10 +1707,7 @@ font-size: .0677rem;
   height: calc(100vh - 64px);
   border-radius: 0px 0px 0px 0px; */
 }
-.woter {
-  margin-top: -15px;
-  margin-left: -15px;
-}
+
 .is-vertical{
   height: 100vh;
   overflow: hidden;

+ 7 - 0
src/utils/emitter.ts

@@ -0,0 +1,7 @@
+import mitt from 'mitt'
+// 调用 emitter,绑定事件
+const emitter = mitt()
+emitter
+
+export  default emitter
+

+ 2 - 4
src/view/components/InfoAnimation.vue

@@ -1314,7 +1314,7 @@ defineExpose({ monitor, accident5 });
 }
 
 .he_pading {
-  padding: 20px 0 0 21px;
+  padding: 0px 14px 0 13px;
 }
 
 .asideg1 .el-form-item__label {
@@ -1615,9 +1615,7 @@ defineExpose({ monitor, accident5 });
   font-weight: bold !important;
   font-size: 20px !important;
 }
-.woter {
-  margin-top: -15px;
-}
+
 .result1 .el-collapse-item__content {
   padding: 0 !important;
 }

+ 48 - 2
src/view/index/first-left.vue

@@ -12,9 +12,23 @@
             </template>
             <div class="rg_content">
               <div class="rg-padding">
+                <div style="display: flex;" >
+                  <span class="gaojing">告警:</span>
+                <el-switch 
+                v-model="valueswitch"
+                inline-prompt
+                @change="swutchfun($event)"
+                style="--el-switch-on-color:#ff4949; --el-switch-off-color: #525050"
+                active-text="是"
+                inactive-text="否"
+              />
+            </div>
+          
                 <div class="he_pading color1  wusele">
               <el-form-item label="物理量:" v-if="props.classradio == 'Fire'||props.classradio == 'Gass'">
-                <el-select
+                <el-select 
+                
+                 :disabled="disabledshow"
                   v-model="formInline.region"
                   @change="regionchange($event)"
                   placeholder="请选择"
@@ -201,8 +215,11 @@ import t2 from "@/assets/img/t2.png";
 import t3 from "@/assets/img/t3.png";
 import t4 from "@/assets/img/t4.png";
 import htmldialog from "./htmldialog.vue"
+import emitter from "@/utils/emitter";
 let firstshow = ref(false);
 let timeshow=ref(true);
+let valueswitch=ref(false);
+let disabledshow=ref(false);
 let timeline = ref("2024-03-2");
 let activeNames = ref(["1"]);
 let activeNames1=ref(["2"])
@@ -304,6 +321,7 @@ const tableData =ref( [
 ])
 let myChart;
 onMounted(() => {
+ // valueswitch.value=false;
   lineChart();
 //   window.onresize = function() {
 //     // 让图表自适应大小
@@ -921,19 +939,37 @@ function vtkGridRead() {
     })
     .catch((err) => {});
 }
+// 告警按钮
+function swutchfun(val){
+
+  vtkScalarRead()
+
+}
 function vtkScalarRead() {
   fcon
     .getScalrsByStep(fcon.step)
     .then((result) => {
       // velocityRead() ;
+      if(valueswitch.value==false){
+        disabledshow.value=false;
+        vtkShow();
+      }else{
+        disabledshow.value=true;
+        gjVtkShow();
+      }
       // vtkShow();
-      gjVtkShow();
+     
     })
     .catch((err) => {
      // console.log(err);
     });
 }
 watch(
+  //  props.classradio,
+  // (newVal, oldVal) => {
+  //   console.log("我的值变了"+newVal);
+  
+  // },
   newcount,
   (newVal, oldVal) => {
     console.log("值改变了", newVal, oldVal);
@@ -948,8 +984,10 @@ if( newVal>=endtime.value){
    isstop.value = false;
 }
   },
+ 
   { deep: true }
 ); //深度监视
+
 defineExpose({firstshow,isshow,indexinit});
 </script>
 <style lang="scss" scoped>
@@ -1018,4 +1056,12 @@ align-items: center;
     border-radius: 10px;
     padding: 15px;
 }
+.gaojing{
+  color: #fff;
+    font-size: 12px;
+    display: inline-block;
+    /* height: 30px; */
+    line-height: 35px;
+    padding-left: 11px
+}
 </style>