huangxingxing 1 éve
szülő
commit
8a36baa424

+ 4 - 0
src/main.ts

@@ -28,3 +28,7 @@ app.use(ElementPlus)
 //4、放入全局
 app.config.globalProperties.$echarts = echarts
 app.mount('#app')
+app.config.errorHandler = function (err, vm, info) {
+    // 处理错误,例如记录日志
+    console.error('Vue error:', err, info);
+};

+ 2 - 1
src/view/InfoDialoges.vue

@@ -529,10 +529,11 @@ const accident = () => {
         emit('moxingclick', true);
         pollute();
         emit('handleSelect', '1');
+          fetchFileContent();
     }
     dialog.value.dialogVisible_fire = false;
     }
-    fetchFileContent();
+  
 
 }
 const accident2 = (key) => {

+ 382 - 365
src/view/appmian.vue

@@ -1,436 +1,453 @@
 <template>
-    <div class="appmian">
-
-        <el-container>
-            <el-header>
-                <div class="ve_menu_logo">
-                    <div class="ve_title">
-                        <div class="ve_logo_img">
-                            <el-image style="height: 100%" :src="logo" fit="contain"></el-image>
-                        </div>
-                        <h3 class="ve_logo_title">
-                            {{ title }}
-                        </h3>
-                    </div>
-                    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" :popper-offset="2"
-                        style="width:780px" background-color="#0D1639 " active-background-color="#0E50C8"
-                        text-color="#68ADFF" active-text-color="#fff" @select="handleSelect">
-                        <el-menu-item index="1">灾害源设置</el-menu-item>
-                        <el-menu-item index="2">边界设置</el-menu-item>
-
-                        <el-menu-item index="3">灾害推演</el-menu-item>
-                        <el-menu-item index="4">推演结果</el-menu-item>
-                        <el-menu-item index="5">结果对比</el-menu-item>
-                    </el-menu>
-                    <div class="ve_right">
-                        <div class="ve_timeioc"  v-if=" aid==null"  @click="titleclick()">
-                            <span>请选择</span>
-                        </div>
-                        <div  v-else>
-                        <div class="ve_time" v-show="titlefalse" @click="titleclick()" >
-                            <span class="l_huoqing">{{ headerobj.name }}</span>
-                            <span class="l_time">{{ headerobj.time }}</span>
-                        </div>
-                    </div>
-                       <!-- <router-link to="/configurator"> -->
-                        <div class="ve_timeioc" @click="tiaozhuan()">
-                            <el-image :src="Vector" fit="contain"></el-image>
-                            <span>模型库</span>
-                        </div>
-                    <!-- </router-link> -->
-                    </div>
-                </div>
-            </el-header>
-
-            <el-main>
-                <Dialoges ref="lliudialog" :addselect="addselect" :valzaiqing="valzaiqing" :headerobj="headerobj" @leftsimulation="leftsimulation"  @headerclick="headerclick" @handleSelect="handleSelect"
-                    @childfun="childfun" @moxingclick="moxingclick"></Dialoges>
-                <source-disaster ref="sourcedis" :classradio="classradio" :aid="aid" />
-                <info-boundary ref="boundary" :classradio="classradio" />
-                <info-animation ref="tanimation" :classradio="classradio" :aid="aid" />
-                <InfoVtkmodel ref="vtkmodel" />
-                <result ref="resultbidui" @titleclick="titleclick"></result>
-            </el-main>
-        </el-container>
-    </div>
+  <div class="appmian">
+    <el-container>
+      <el-header>
+        <div class="ve_menu_logo">
+          <div class="ve_title">
+            <div class="ve_logo_img">
+              <el-image style="height: 100%" :src="logo" fit="contain"></el-image>
+            </div>
+            <h3 class="ve_logo_title">
+              {{ title }}
+            </h3>
+          </div>
+          <el-menu
+            :default-active="activeIndex"
+            class="el-menu-demo"
+            mode="horizontal"
+            :popper-offset="2"
+            style="width: 780px"
+            background-color="#0D1639 "
+            active-background-color="#0E50C8"
+            text-color="#68ADFF"
+            active-text-color="#fff"
+            @select="handleSelect"
+          >
+            <el-menu-item index="1">灾害源设置</el-menu-item>
+            <el-menu-item index="2">边界设置</el-menu-item>
+
+            <el-menu-item index="3">灾害推演</el-menu-item>
+            <el-menu-item index="4">推演结果</el-menu-item>
+            <el-menu-item index="5">结果对比</el-menu-item>
+          </el-menu>
+          <div class="ve_right">
+            <div class="ve_timeioc" v-if="aid == null" @click="titleclick()">
+              <span>请选择</span>
+            </div>
+            <div v-else>
+              <div class="ve_time" v-show="titlefalse" @click="titleclick()">
+                <span class="l_huoqing">{{ headerobj.name }}</span>
+                <span class="l_time">{{ headerobj.time }}</span>
+              </div>
+            </div>
+            <!-- <router-link to="/configurator"> -->
+            <div class="ve_timeioc" @click="tiaozhuan()">
+              <el-image :src="Vector" fit="contain"></el-image>
+              <span>模型库</span>
+            </div>
+            <!-- </router-link> -->
+          </div>
+        </div>
+      </el-header>
+
+      <el-main>
+        <Dialoges
+          ref="lliudialog"
+          :addselect="addselect"
+          :valzaiqing="valzaiqing"
+          :headerobj="headerobj"
+          @leftsimulation="leftsimulation"
+          @headerclick="headerclick"
+          @handleSelect="handleSelect"
+          @childfun="childfun"
+          @moxingclick="moxingclick"
+        ></Dialoges>
+        <source-disaster ref="sourcedis" :classradio="classradio" :aid="aid" />
+        <info-boundary ref="boundary" :classradio="classradio" />
+        <info-animation ref="tanimation" :classradio="classradio" :aid="aid" />
+        <InfoVtkmodel ref="vtkmodel" />
+        <result ref="resultbidui" @titleclick="titleclick"></result>
+      </el-main>
+    </el-container>
+  </div>
 </template>
 
 <script setup>
 import { ref, onMounted, reactive, nextTick } from "vue";
-import { RouterView, RouterLink, useRouter } from "vue-router"
+import { RouterView, RouterLink, useRouter } from "vue-router";
 // import NavigateBar from "@/components/layout/NavigateBar.vue";
-import Dialoges from "./InfoDialoges.vue"
+import Dialoges from "./InfoDialoges.vue";
 import logo from "@/assets/logo.png";
 // import myIndex  from "./index"
-import SourceDisaster from "./components/InfoDisaster.vue"
-import InfoBoundary from "./components/InfoBoundary.vue"
-import InfoAnimation from "./components/InfoAnimation.vue"
-import InfoVtkmodel from "./components/InfoVtkmodel.vue"
-import result from "./result.vue"
+import SourceDisaster from "./components/InfoDisaster.vue";
+import InfoBoundary from "./components/InfoBoundary.vue";
+import InfoAnimation from "./components/InfoAnimation.vue";
+import InfoVtkmodel from "./components/InfoVtkmodel.vue";
+import result from "./result.vue";
 import Vector from "@/assets/img/Vector.png";
-import { timestampToTime } from '@/js/lindex.js'
-import mitts from "@/utils/Bus"
+import { timestampToTime } from "@/js/lindex.js";
+import mitts from "@/utils/Bus";
 // import { vtkmodel } from "@/control/vtkModel.js";
 
 let lliudialog = ref();
 let sourcedis = ref();
-let classradio = ref()
+let classradio = ref();
 let boundary = ref();
 let tanimation = ref();
 const title = "灾情推演软件";
-const activeIndex = ref('1')
-const activeIndex2 = ref('1')
+const activeIndex = ref("1");
+const activeIndex2 = ref("1");
 let titlefalse = ref(false);
-let resultbidui=ref();
-let mnindex=ref("");
-let resultleft=ref({
-    totaltime:'',
-    reportstep:'',
-    pickertime:'',
-    coids:'',
-    aid:'7'
-});
-let resultright=ref({
-    totaltime:'',
-    reportstep:'',
-    pickertime:'',
-    cocodes:'' ,
-    aid:'7'
-});
+let resultbidui = ref();
+let mnindex = ref("");
+let resultleft = ref({});
+let resultright = ref({});
 let headerobj = ref({
-    time: '',
-    name: "",
-})
-let valzaiqing=ref("");
+  time: "",
+  name: "",
+});
+let valzaiqing = ref("");
 let router = useRouter();
 let sgdata = ref({});
 let aid = ref();
-onMounted(() => {
-});
+onMounted(() => {});
 // 跳转页面,{ aid:aid.value}
 const tiaozhuan = () => {
-   activeIndex.value="1";
-   const key =activeIndex.value;
-    sourcedis.value.changeModel();
-            sourcedis.value.accident3(key);
-            boundary.value.accident4(key);
-            lliudialog.value.accident2(key);
-            tanimation.value.monitor = false;
-router.push({ path:"/configurator"})
-     
-    // console.log(router.push("/configurator"))
- 
-    // console.log(router.push("/configurator"))
-}
+  activeIndex.value = "1";
+  const key = activeIndex.value;
+  sourcedis.value.changeModel();
+  sourcedis.value.accident3(key);
+  boundary.value.accident4(key);
+  lliudialog.value.accident2(key);
+  tanimation.value.monitor = false;
+  router.push({ path: "/configurator" });
 
-const addselect = () => {
-    classradio.value = lliudialog.value.classradio;
+  // console.log(router.push("/configurator"))
 
-}
-// 获取模拟数据对比
-const leftsimulation=(res)=>{
-    if( mnindex.value=='1'){
-    resultleft.value.coids=res.coids;
-    resultleft.value.totaltime=res.totaltime;
-    resultleft.value.reportstep=res.reportstep;
-    resultleft.value.pickertime=res.acctime;
-
-    }else{
-    resultright.value.coids=res.coids;
-   resultrightresultleft.value.totaltime=res.totaltime;
-   resultright.value.reportstep=res.reportstep;
-    resultright.value.pickertime=res.acctime;
-    }
+  // console.log(router.push("/configurator"))
+};
 
-  
-}
+const addselect = () => {
+  classradio.value = lliudialog.value.classradio;
+};
+// 获取模拟数据对比
+const leftsimulation = (res) => {
+  if (mnindex.value == "1") {
+    resultleft.value.coids = res.coids;
+    resultleft.value.totaltime = res.totaltime;
+    resultleft.value.reportstep = res.reportstep;
+    resultleft.value.pickertime = res.acctime;
+    resultleft.value.aid = res.aid;
+  } else {
+    resultright.value.coids = res.coids;
+    resultright.value.totaltime = res.totaltime;
+    resultright.value.reportstep = res.reportstep;
+    resultright.value.pickertime = res.acctime;
+    resultright.value.aid = res.aid;
+  }
+
+    //TODO 
+  if (resultleft.value.coids != resultright.value.coids) {
+    return;
+  }
+
+  if (resultleft.value.totaltime != resultright.value.totaltime) {
+    return;
+  }
+
+  if (resultleft.value.reportstep != resultright.value.reportstep) {
+    return;
+  }
+
+  if (resultleft.value.pickertime != resultright.value.pickertime) {
+    return;
+  }
+    
+//TODO 获取物理量
+resultbidui.value.initAid(resultleft.value.aid,resultright.value.aid);
+};
 //判断两个对象是否相等
-const objequality= ()=>{
-   
-
-}
+const objequality = () => {};
 const moxingclick = (val) => {
-    titlefalse.value = val;
-}
+  titlefalse.value = val;
+};
 // const qingsel=()=>{
 //     lliudialog.value.dialogVisible = true;
 // }
 //点击头部弹出弹框
 
-const titleclick = (val,index) => {
-    mnindex.value=index;
-    valzaiqing.value=val;
-    if(val=='模拟数据'){
-        lliudialog.value.dialogVisible = true;
-    }else{
+const titleclick = (val, index) => {
+  mnindex.value = index;
+  valzaiqing.value = val;
+  if (val == "模拟数据") {
+    lliudialog.value.dialogVisible = true;
+  } else {
     lliudialog.value.dialogVisible = true;
     clearInterval();
-}
-}
+  }
+};
 //获取aid
 const aidlist = () => {
-    sgdata.value = lliudialog.value.sgdata;
-    aid.value = sgdata.value.aid
-}
+  sgdata.value = lliudialog.value.sgdata;
+  aid.value = sgdata.value.aid;
+};
 // 获取子组件的方法
 const childfun = () => {
-    sourcedis.value.handledisaster(aid.value);
-    boundary.value.addboundary(aid.value);
-    sourcedis.value.accident3();
-}
+  sourcedis.value.handledisaster(aid.value);
+  boundary.value.addboundary(aid.value);
+  sourcedis.value.accident3();
+};
 const headerclick = (data) => {
-    console.log(data);
-    headerobj.value.name = data.name;
-    headerobj.value.time = data.time;
-    aid.value = data.aid
-}
+  console.log(data);
+  headerobj.value.name = data.name;
+  headerobj.value.time = data.time;
+  aid.value = data.aid;
+};
 const handleSelect = (key) => {
-    activeIndex.value='';
-    switch (key) {
-        case '1':
-            sourcedis.value.changeModel();
-            sourcedis.value.accident3(key);
-            boundary.value.accident4(key);
-            lliudialog.value.accident2(key);
-            tanimation.value.monitor = false;
-            resultbidui.value.accident6(key,aid.value)
-            tanimation.value.accident5(aid.value,key);
-            activeIndex.value='1';
-            break;
-        case '2':
-             boundary.value.changeModel();
-            boundary.value.accident4(key);
-            sourcedis.value.accident3(key);
-            lliudialog.value.accident2(key);
-            tanimation.value.monitor = false;
-            resultbidui.value.accident6(key,aid.value)
-            tanimation.value.accident5(aid.value,key);
-            activeIndex.value='2'
-            break;
-        case '3':
-            lliudialog.value.changeModel();
-            boundary.value.accident4(key);
-            sourcedis.value.accident3(key);
-            lliudialog.value.accident2(key);
-            tanimation.value.monitor = false;
-            activeIndex.value='3';
-            tanimation.value.accident5(aid.value,key);
-            resultbidui.value.accident6(key,aid.value)
-       
-            break;
-        case '4':
-            boundary.value.accident4(key);
-            tanimation.value.accident5(aid.value,key);
-             sourcedis.value.accident3(key);
-            lliudialog.value.accident2(key);
-            resultbidui.value.accident6(key,aid.value)
-            activeIndex.value='4'
-            break;
-            case '5':
-            sourcedis.value.changeModel();
-            sourcedis.value.accident3(key);
-            boundary.value.accident4(key);
-            lliudialog.value.accident2(key);
-            resultbidui.value.accident6(key,aid.value)
-            tanimation.value.accident5(aid.value,key);
-            tanimation.value.monitor = false;
-            activeIndex.value='5';
-        default:
-            break;  
-    }
-}
-
+  activeIndex.value = "";
+  switch (key) {
+    case "1":
+      sourcedis.value.changeModel();
+      sourcedis.value.accident3(key);
+      boundary.value.accident4(key);
+      lliudialog.value.accident2(key);
+      tanimation.value.monitor = false;
+      resultbidui.value.accident6(key, aid.value);
+      tanimation.value.accident5(aid.value, key);
+      activeIndex.value = "1";
+      break;
+    case "2":
+      boundary.value.changeModel();
+      boundary.value.accident4(key);
+      sourcedis.value.accident3(key);
+      lliudialog.value.accident2(key);
+      tanimation.value.monitor = false;
+      resultbidui.value.accident6(key, aid.value);
+      tanimation.value.accident5(aid.value, key);
+      activeIndex.value = "2";
+      break;
+    case "3":
+      lliudialog.value.changeModel();
+      boundary.value.accident4(key);
+      sourcedis.value.accident3(key);
+      lliudialog.value.accident2(key);
+      tanimation.value.monitor = false;
+      activeIndex.value = "3";
+      tanimation.value.accident5(aid.value, key);
+      resultbidui.value.accident6(key, aid.value);
+
+      break;
+    case "4":
+      boundary.value.accident4(key);
+      tanimation.value.accident5(aid.value, key);
+      sourcedis.value.accident3(key);
+      lliudialog.value.accident2(key);
+      resultbidui.value.accident6(key, aid.value);
+      activeIndex.value = "4";
+      break;
+    case "5":
+      sourcedis.value.changeModel();
+      sourcedis.value.accident3(key);
+      boundary.value.accident4(key);
+      lliudialog.value.accident2(key);
+      resultbidui.value.accident6(key, aid.value);
+      tanimation.value.accident5(aid.value, key);
+      tanimation.value.monitor = false;
+      activeIndex.value = "5";
+    default:
+      break;
+  }
+};
 </script>
 
 <style lang="scss" scoped>
 .appmian {
+  .el-main {
+    --el-main-padding: 0 !important;
+  }
 
-    .el-main {
-        --el-main-padding: 0 !important;
-    }
-
-    .el-header {
-        padding: 0;
-        margin: 0;
-        width: 100%;
-        position: absolute;
-        z-index: 206;
-        top: 0;
-    }
+  .el-header {
+    padding: 0;
+    margin: 0;
+    width: 100%;
+    position: absolute;
+    z-index: 206;
+    top: 0;
+  }
 }
 
 .ve_menu_logo {
-    width: 100%;
-    height: 70px;
-    background: #0D1639;
-    white-space: nowrap;
-    text-align: left;
-    overflow: hidden;
-    display: flex;
-    background: #0D1639;
-    box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
-    border-radius: 0px 0px 0px 0px;
-    border-bottom: 1px solid;
+  width: 100%;
+  height: 70px;
+  background: #0d1639;
+  white-space: nowrap;
+  text-align: left;
+  overflow: hidden;
+  display: flex;
+  background: #0d1639;
+  box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
+  border-radius: 0px 0px 0px 0px;
+  border-bottom: 1px solid;
+  box-sizing: border-box;
+  border-image: linear-gradient(28deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0)) 1 1;
+
+  .ve_title {
+  }
+
+  .ve_logo_img {
+    padding-left: 30px;
+    height: 100%;
+    display: inline-block;
     box-sizing: border-box;
-    border-image: linear-gradient(28deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0)) 1 1;
-
-    .ve_title {}
+    vertical-align: middle;
+    padding: 15px;
+  }
 
-    .ve_logo_img {
-        padding-left: 30px;
-        height: 100%;
-        display: inline-block;
-        box-sizing: border-box;
-        vertical-align: middle;
-        padding: 15px;
+  .ve_logo_title {
+    width: 160px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    display: inline-block;
+    margin: 0;
+    vertical-align: middle;
+    color: #68adff;
+    font-size: 20px;
+  }
+
+  .el-menu-demo {
+    width: 60% !important;
+    height: 70px;
+    border: none !important;
+    background: rgba(12, 97, 197, 0);
+
+    .el-menu-item {
+      position: relative;
+      width: 97px;
+      font-family: Microsoft YaHei UI, Microsoft YaHei UI;
+      font-weight: bold;
+      font-size: 13px;
+      color: #68adff;
+      line-height: 15px;
+      text-align: center;
+      font-style: normal;
+      text-transform: none;
+      width: 110px;
+      height: 70px;
+      border-radius: 0px 0px 0px 0px;
+      border: none;
     }
 
-    .ve_logo_title {
-        width: 160px;
-        white-space: nowrap;
-        overflow: hidden;
-        text-overflow: ellipsis;
-        display: inline-block;
-        margin: 0;
-        vertical-align: middle;
-        color: #68ADFF;
-        font-size: 20px;
+    .is-active {
+      width: 110px;
+      height: 70px;
+      background: radial-gradient(ellipse at 54px 0px, #3aa0ff -37%, #123066 53%);
+      border-radius: 0px 0px 0px 0px;
+      border: 1px solid;
+      border-left: 1px solid rgba(16, 92, 240, 1);
+      border-right: 1px solid rgba(18, 48, 102, 1);
+      border-image: linear-gradient(347deg, rgba(16, 92, 240, 1), rgba(18, 48, 102, 1)) 1
+        1;
+
+      &:after {
+        width: 24px;
+        height: 1px;
+        background-color: #fff;
+        -webkit-transition: all ease-out 0.2s;
+        transition: all ease-out 0.2s;
+        content: "";
+        position: absolute;
+        left: 50%;
+        bottom: 15px;
+        webkit-transform: translate(-50%, 0%);
+        -moz-transform: translate(-50%, 0%);
+        transform: translate(-50%, 0%);
+      }
     }
+  }
 
-    .el-menu-demo {
-        width: 60% !important;
-        height: 70px;
-        border: none !important;
-        background: rgba(12, 97, 197, 0);
-
-        .el-menu-item {
-            position: relative;
-            width: 97px;
-            font-family: Microsoft YaHei UI, Microsoft YaHei UI;
-            font-weight: bold;
-            font-size: 13px;
-            color: #68ADFF;
-            line-height: 15px;
-            text-align: center;
-            font-style: normal;
-            text-transform: none;
-            width: 110px;
-            height: 70px;
-            border-radius: 0px 0px 0px 0px;
-            border: none;
-        }
-
-        .is-active {
-            width: 110px;
-            height: 70px;
-            background: radial-gradient(ellipse at 54px 0px, #3AA0FF -37%, #123066 53%);
-            border-radius: 0px 0px 0px 0px;
-            border: 1px solid;
-            border-left: 1px solid rgba(16, 92, 240, 1);
-            border-right: 1px solid rgba(18, 48, 102, 1);
-            border-image: linear-gradient(347deg, rgba(16, 92, 240, 1), rgba(18, 48, 102, 1)) 1 1;
-
-            &:after {
-                width: 24px;
-                height: 1px;
-                background-color: #fff;
-                -webkit-transition: all ease-out 0.2s;
-                transition: all ease-out 0.2s;
-                content: "";
-                position: absolute;
-                left: 50%;
-                bottom: 15px;
-                webkit-transform: translate(-50%, 0%);
-                -moz-transform: translate(-50%, 0%);
-                transform: translate(-50%, 0%);
-            }
-        }
+  .ve_right {
+    // width: 350px;
+    height: 70px;
+    overflow: hidden;
+    position: absolute;
+    right: 0;
+    display: flex;
+
+    .ve_time {
+      height: 55px;
+      padding-top: 15px;
+      height: 70px;
+      border-radius: 0px 0px 0px 0px;
+      border-left: 2px solid rgba(12, 97, 197, 0.2);
+      border-right: 2px solid rgba(12, 97, 197, 0.2);
+      box-sizing: border-box;
+      padding: 15px 22px;
+      // border-image: linear-gradient(347deg, rgba(31, 107, 255, 1), rgba(164, 195, 255, 1)) 1 1;
+      span {
+        display: block;
+        font-family: Microsoft YaHei UI, Microsoft YaHei UI;
+        color: #ffffff;
+        text-align: center;
+        font-style: normal;
+        text-transform: none;
+      }
+
+      .l_huoqing {
+        font-size: 13px;
+        line-height: 15px;
+        font-weight: bold;
+        line-height: 2;
+      }
+
+      .l_time {
+        font-size: 12px;
+        line-height: 14px;
+        font-weight: 400;
+      }
     }
 
-    .ve_right {
-        // width: 350px;
-        height: 70px;
-        overflow: hidden;
-        position: absolute;
-        right: 0;
-        display: flex;
-
-        .ve_time {
-            height: 55px;
-            padding-top: 15px;
-            height: 70px;
-            border-radius: 0px 0px 0px 0px;
-            border-left: 2px solid rgba(12, 97, 197, 0.20);
-            border-right: 2px solid rgba(12, 97, 197, 0.20);
-            ;
-            box-sizing: border-box;
-            padding: 15px 22px;   
-            // border-image: linear-gradient(347deg, rgba(31, 107, 255, 1), rgba(164, 195, 255, 1)) 1 1;
-            span {
-                display: block;
-                font-family: Microsoft YaHei UI, Microsoft YaHei UI;
-                color: #FFFFFF;
-                text-align: center;
-                font-style: normal;
-                text-transform: none;
-            }
-
-            .l_huoqing {
-                font-size: 13px;
-                line-height: 15px;
-                font-weight: bold;
-                line-height: 2;
-            }
-
-            .l_time {
-                font-size: 12px;
-                line-height: 14px;
-                font-weight: 400;
-            }
-        }
-
-        .ve_timeioc {
-            width: 150px;
-            height: 70px;
-            // border-radius: 0px 0px 0px 0px;
-            // border: 1px solid;
-            // border-image: linear-gradient(347deg, rgba(16, 92, 240, 1), rgba(164, 195, 255, 1)) 1 1;
-            font-family: Microsoft YaHei UI, Microsoft YaHei UI;
-            font-weight: bold;
-            font-size: 13px;
-            color: #68ADFF;
-            line-height: 15px;
-            text-align: center;
-            font-style: normal;
-            text-transform: none;
-            display: flex;
-            justify-content: center;
-            align-items: center;
-
-            span {
-                padding-left: 15px;
-            }
-        }
+    .ve_timeioc {
+      width: 150px;
+      height: 70px;
+      // border-radius: 0px 0px 0px 0px;
+      // border: 1px solid;
+      // border-image: linear-gradient(347deg, rgba(16, 92, 240, 1), rgba(164, 195, 255, 1)) 1 1;
+      font-family: Microsoft YaHei UI, Microsoft YaHei UI;
+      font-weight: bold;
+      font-size: 13px;
+      color: #68adff;
+      line-height: 15px;
+      text-align: center;
+      font-style: normal;
+      text-transform: none;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+
+      span {
+        padding-left: 15px;
+      }
     }
+  }
 }
 </style>
 
 <style>
 body {
-    width: 100%;
-    height: 100vh;
-    background: #161A2A;
+  width: 100%;
+  height: 100vh;
+  background: #161a2a;
 }
 
 button:focus,
 button:focus-visible {
-    outline: none;
+  outline: none;
 }
 
 .l_Dialog {
-    position: absolute;
-    z-index: 206;
-    top: 0;
-
+  position: absolute;
+  z-index: 206;
+  top: 0;
 }
-</style>
+</style>

+ 67 - 12
src/view/result.vue

@@ -62,13 +62,19 @@
     </div>
     <div class="result_left results">
       <div class="elimgmn" @click="hazardtype('1')">
-      <el-image :src="mn" fit="contain"></el-image></div>
-      <resultLeft :region="formInline.region" :count="formInline.count"/>
+        <el-image :src="mn" fit="contain"></el-image>
+      </div>
+      <resultLeft
+        ref="setleftAid"
+        :region="formInline.region"
+        :count="formInline.count"
+      />
     </div>
     <div class="result_right results">
       <div class="elimgmn" @click="hazardtype('2')">
-      <el-image :src="mn" fit="contain"></el-image></div>
-      <resultRight :region="formInline.region" :count="formInline.count"/>
+        <el-image :src="mn" fit="contain"></el-image>
+      </div>
+      <resultRight  ref="setrightAid" :region="formInline.region" :count="formInline.count" />
     </div>
   </div>
 </template>
@@ -85,7 +91,7 @@ import t2 from "@/assets/img/t2.png";
 import t3 from "@/assets/img/t3.png";
 import t4 from "@/assets/img/t4.png";
 import mn from "@/assets/img/Group204.png";
-let emit = defineEmits(['titleclick'])
+let emit = defineEmits(["titleclick"]);
 let resultyem = ref(false);
 let timing = ref(null);
 let starttime = ref(1);
@@ -93,6 +99,8 @@ let endtime = ref(60);
 let timenum = ref(2);
 let aid = ref(Number);
 let timeline = ref("2024-03-03 14:00");
+let setleftAid = ref();
+let setrightAid = ref();
 const formInline = ref({
   region: "shanghai",
   count: 0,
@@ -138,8 +146,55 @@ function regionchange(val) {
     }
   });
 }
-const hazardtype=(val)=>{
-  emit("titleclick","模拟数据",val);
+const hazardtype = (val) => {
+  emit("titleclick", "模拟数据", val);
+};
+
+const initAid = (leftAid, rightAid) => {
+  console.log("result.vue", leftAid, rightAid);
+  getMonitor(leftAid,rightAid);
+};
+
+//监测点数据获取
+async function getMonitor(leftAid,rightAid) {
+  const params = {
+    transCode: "D10016",
+    aid: leftAid,
+    step: 1,
+  };
+  await request(params)
+    .then((res) => {
+      if (res.returnCode == "000000000") {
+        strResultFormatlist.value = [];
+        for (let i = 0; i < res.cocodes.length; i++) {
+          let cocode = res.cocodes[i];
+          strResultFormatlist.value.push({
+            id: i,
+            name: cocode.cocode,
+            value: cocode.cocode,
+          });
+        }
+        formInline.value.region = strResultFormatlist.value[0].value;
+        console.log(strResultFormatlist.value);
+        setleftAid.value.leftChangAid(
+          leftAid,
+          formInline.value.count.value + 1,
+          formInline.value.region
+        );
+        setrightAid.value.rightChangAid(
+          rightAid,
+          formInline.value.count.value + 1,
+          formInline.value.region
+        );
+        //TODO right AID 没加
+      } else {
+        ElMessage({
+          message: res.returnMsg,
+          type: "error",
+        });
+      }
+    })
+    .catch((err) => {});
 }
 onMounted(() => {
   newtime();
@@ -151,7 +206,7 @@ onUnmounted(() => {
     clearInterval(timing.value);
   }
 });
-defineExpose({ accident6 });
+defineExpose({ accident6, initAid });
 </script>
 <style scoped lang="scss">
 .heigjie {
@@ -261,10 +316,10 @@ defineExpose({ accident6 });
 .heigjie .el-select .el-input__inner {
   color: #fff;
 }
-.results .elimgmn{
+.results .elimgmn {
   position: absolute;
-    top: 0;
-    left: 0;
-    z-index: 111;
+  top: 0;
+  left: 0;
+  z-index: 111;
 }
 </style>

+ 24 - 7
src/view/result/resultLeft.vue

@@ -22,6 +22,7 @@ import vtkDataArray from "@kitware/vtk.js/Common/Core/DataArray.js";
 let vtkObj = {};
 let resetCameraFlag = false;
 let max, min;
+let initFlag=false;
 const props = defineProps({
   region: "Temperature",
   count: 50,
@@ -30,7 +31,8 @@ const props = defineProps({
 watch(
   () => [props.region, props.count, props.aid],
   (newVal, oldVal) => {
-    if (newVal[1] != oldVal[1]) {
+    if(initFlag){
+       if (newVal[1] != oldVal[1]) {
       console.log("步数改变", newVal[1], oldVal[1]);
       if (vtkObj.fcon) {
         vtkScalarRead(props.count); //步数
@@ -42,12 +44,14 @@ watch(
         vtkShow();
       }
     }
-    if (newVal[2] != oldVal[2]) {
-      console.log("aid改变", newVal[0], oldVal[0]);
-      if (vtkObj.fcon) {
-        vtkGridRead(props.aid);
-      }
+
     }
+    // if (newVal[2] != oldVal[2]) {
+    //   console.log("aid改变", newVal[0], oldVal[0]);
+    //   if (vtkObj.fcon) {
+    //     vtkGridRead(props.aid);
+    //   }
+    // }
   },
   { deep: true }
 ); //深度监视
@@ -85,7 +89,7 @@ onMounted(() => {
   const lut = vtkObj.jgMapper.getLookupTable();
   vtkObj.scalarBarActor.setScalarsToColors(lut);
   vtkObj.renderWindow.getRenderer().addActor(vtkObj.scalarBarActor);
-  vtkGridRead(props.aid);
+  // vtkGridRead(props.aid);
   // vtkObj.renderWindow.getRenderer().resetCamera();
   // vtkObj.renderWindow.getRenderWindow().render();
 });
@@ -166,6 +170,8 @@ function vtkShow() {
     resetCameraFlag = true;
   }
   vtkObj.renderWindow.getRenderWindow().render();
+
+  initFlag=true;
 }
 function getMinMax(scalars) {
   // console.log("getMinMax:",scalars);
@@ -189,5 +195,16 @@ onBeforeUnmount(() => {
   vtkObj.renderWindow.delete();
   vtkObj = null;
 });
+const leftChangAid = (leftAid,step,region) => {
+   console.log(leftAid,step,region);
+  if (vtkObj.fcon) {
+    props.aid=leftAid;
+    props.region =region;
+    props.step=step;
+    console.log(props);
+    vtkGridRead(leftAid);
+  }
+};
+defineExpose({ leftChangAid });
 </script>
 <style scoped></style>

+ 32 - 16
src/view/result/resultRight.vue

@@ -20,6 +20,7 @@ import vtkDataArray from "@kitware/vtk.js/Common/Core/DataArray.js";
 let vtkObj = {};
 let resetCameraFlag = false;
 let max, min;
+let initFlag = false;
 const props = defineProps({
   region: "Temperature",
   count: 50,
@@ -28,24 +29,26 @@ const props = defineProps({
 watch(
   () => [props.region, props.count, props.aid],
   (newVal, oldVal) => {
-    if (newVal[1] != oldVal[1]) {
-      console.log("步数改变", newVal[1], oldVal[1]);
-      if (vtkObj.fcon) {
-        vtkScalarRead(props.count); //步数
+    if (initFlag) {
+      if (newVal[1] != oldVal[1]) {
+        console.log("步数改变", newVal[1], oldVal[1]);
+        if (vtkObj.fcon) {
+          vtkScalarRead(props.count); //步数
+        }
       }
-    }
-    if (newVal[0] != oldVal[0]) {
-      console.log("标量改变", newVal[0], oldVal[0]);
-      if (vtkObj.fcon) {
-        vtkShow();
-      }
-    }
-    if (newVal[2] != oldVal[2]) {
-      console.log("aid改变", newVal[0], oldVal[0]);
-      if (vtkObj.fcon) {
-        vtkGridRead(props.aid);
+      if (newVal[0] != oldVal[0]) {
+        console.log("标量改变", newVal[0], oldVal[0]);
+        if (vtkObj.fcon) {
+          vtkShow();
+        }
       }
     }
+    // if (newVal[2] != oldVal[2]) {
+    //   console.log("aid改变", newVal[0], oldVal[0]);
+    //   if (vtkObj.fcon) {
+    //     vtkGridRead(props.aid);
+    //   }
+    // }
   },
   { deep: true }
 ); //深度监视
@@ -83,7 +86,7 @@ onMounted(() => {
   const lut = vtkObj.jgMapper.getLookupTable();
   vtkObj.scalarBarActor.setScalarsToColors(lut);
   vtkObj.renderWindow.getRenderer().addActor(vtkObj.scalarBarActor);
-  vtkGridRead(props.aid);
+  // vtkGridRead(props.aid);
   // vtkObj.renderWindow.getRenderer().resetCamera();
   // vtkObj.renderWindow.getRenderWindow().render();
 });
@@ -164,6 +167,8 @@ function vtkShow() {
     resetCameraFlag = true;
   }
   vtkObj.renderWindow.getRenderWindow().render();
+
+  initFlag = true;
 }
 function getMinMax(scalars) {
   // console.log("getMinMax:",scalars);
@@ -187,5 +192,16 @@ onBeforeUnmount(() => {
   vtkObj.renderWindow.delete();
   vtkObj = null;
 });
+const rightChangAid = (rightAid, step, region) => {
+  console.log(rightAid, step, region);
+  if (vtkObj.fcon) {
+    props.aid = rightAid;
+    props.region = region;
+    props.step = step;
+    console.log(props);
+    vtkGridRead(rightAid);
+  }
+};
+defineExpose({ rightChangAid });
 </script>
 <style scoped></style>