liuqiao 1 tahun lalu
induk
melakukan
1d28a31dcf

+ 2 - 0
src/main.js

@@ -11,6 +11,7 @@ import './style/index.css' // 引入整个Element样式
 import "normalize.css/normalize.css";//重置样式
 import '@/js/lindex.js'
 import '@/utils/flexible'
+import directive from '@/utils/directive'
 
 // import mitt from 'mitt'
 
@@ -21,6 +22,7 @@ createApp(App)
     .use(ElementUI)
     .use(createPinia)
     .use(VScaleScreen)
+    .use(directive)
     // .use(mitt)
     //.use(Vuex)
     .mount('#app')

+ 12 - 6
src/style/style.css

@@ -301,7 +301,7 @@ body,html{
   }
   
   .logs_pading {
-    padding: 13px 20px 23px 24px;
+    padding: 0.0672rem 0.1420rem .1198rem .125rem;
   }
   
   .newtime {
@@ -535,6 +535,7 @@ border-image: linear-gradient(90deg, rgba(91, 175, 222, 0), rgba(91, 175, 222, 1
 		} */
 .flex1 {
     flex: 1;
+    text-align: center;
 }
 
 .el-radio__input.is-checked .el-radio__inner {
@@ -899,8 +900,11 @@ ol {
 .spantext{
     cursor: pointer;
 }
+.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{
+  background-color: #F9A466  !important;
+}
 .tablebk .el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell {
-    background-color: #F9A466  !important;
+  background-color: #F9A466  !important;
 }
 .shigutable  .el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{
     background-color: rgba(255, 255, 25, 0) !important;
@@ -1456,7 +1460,7 @@ font-size: .0833rem;
 }
 .modle{
   width: 100%;
-  height: 299px;
+  height: 1.5365rem;
   padding: .0365rem;
  
 }
@@ -1465,9 +1469,8 @@ font-size: .0833rem;
 }
 .waterdisaster{
   padding: .0729rem;
-  /* background: radial-gradient( #0B338B 0%, #1C253D 100%);
-border-radius: 0px 0px 0px 0px; */
 background: rgba(26, 38, 69, 0.4);
+
 }
 .re_tele{
   font-family: Microsoft YaHei, Microsoft YaHei;
@@ -1574,7 +1577,7 @@ font-size: .0677rem;
 
 }
 .bgk3{
-  height: calc(100vh - 58px);
+  height: calc(100vh);
   background: radial-gradient(closest-side, #0B338B , #1C253D);
   z-index: 330;
 }
@@ -1625,4 +1628,7 @@ background-color: #F9A466  !important;
   position: fixed;
   width: 100%;
   z-index: 10000;
+}
+.has-time .el-button>span{
+color: #666;
 }

+ 44 - 0
src/utils/directive.js

@@ -0,0 +1,44 @@
+// 引入拖拽js
+import { startDrag } from './drag' 
+/**
+ * 为el-dialog弹框增加拖拽功能
+ * @param {*} el 指定dom
+ * @param {*} binding 绑定对象
+ * desc   只要用到了el-dialog的组件,都可以通过增加v-draggable属性变为可拖拽的弹框
+ */
+const draggable = (el, binding) => {
+    // 绑定拖拽事件 [绑定拖拽触发元素为弹框头部、拖拽移动元素为整个弹框]
+    startDrag(el.querySelector('.el-dialog__header'), el.querySelector('.el-dialog'), binding.value);
+};
+// const draggleft = {
+//   bind(el, binding){
+//    el.querySelector('.el-dialog').style.left =binding.value;
+//    console.log(binding.value);
+//    console.log(1111111);
+//    console.log(el);
+//   },
+//   inserted(el, binding){
+// console.log(binding)
+//   },
+//   update(el, binding){
+
+//   },
+ 
+// }
+const draggleft = (el, binding) => {
+  // 绑定拖拽事件 [绑定拖拽触发元素为弹框头部、拖拽移动元素为整个弹框]
+  el.querySelector('.el-dialog').style.left =binding.value;
+  // startDrag(el.querySelector('.el-dialog__header'), el.querySelector('.el-dialog'), binding.value);
+};
+const directives = {
+    draggable,draggleft,
+ 
+};
+// 这种写法可以批量注册指令
+export default {
+  install(Vue) {
+      Object.keys(directives).forEach((key) => {
+      Vue.directive(key, directives[key]);
+    });
+  },
+};

+ 105 - 0
src/utils/drag.js

@@ -0,0 +1,105 @@
+/**
+ * 拖拽移动
+ * @param  {elementObjct} bar 鼠标点击控制拖拽的元素
+ * @param {elementObjct}  target 移动的元素
+ * @param {function}  callback 移动后的回调
+ */
+ export function startDrag(bar, target, callback) {
+    var params = {
+      top: 0,
+      left: 0,
+      currentX: 0,
+      currentY: 0,
+      flag: false,
+      cWidth: 0,
+      cHeight: 0,
+      tWidth: 0,
+      tHeight: 0
+    };
+    
+    // 给拖动块添加样式
+    bar.style.cursor = 'move';
+    
+    // 获取相关CSS属性
+    // o是移动对象
+    // var getCss = function (o, key) {
+    //   return o.currentStyle ? o.currentStyle[key] :             document.defaultView.getComputedStyle(o, false)[key];
+    // };
+    
+    bar.onmousedown = function (event) {
+      // 按下时初始化params
+      var e = event ? event : window.event;
+      params = {
+        top: target.offsetTop,
+        left: target.offsetLeft,
+        currentX: e.clientX,
+        currentY: e.clientY,
+        flag: true,
+        cWidth: document.body.clientWidth,
+        cHeight: document.body.clientHeight,
+        tWidth: target.offsetWidth,
+        tHeight: target.offsetHeight
+      };
+    
+      // 给被拖动块初始化样式
+      target.style.margin = 0;
+      target.style.top = params.top + 'px';
+      target.style.left = params.left + 'px';
+   
+      if (!event) {
+        // 防止IE文字选中
+        bar.onselectstart = function () {
+          return false;
+        }
+      }
+    
+      document.onmousemove = function (event) {
+        // 防止文字选中
+        window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
+    
+        var e = event ? event : window.event;
+        if (params.flag) {
+          var nowX = e.clientX;
+          var nowY = e.clientY;
+          // 差异距离
+          var disX = nowX - params.currentX;
+          var disY = nowY - params.currentY;
+          // 最终移动位置
+          var zLeft = 0;
+          var zTop = 0;
+    
+          zLeft = parseInt(params.left) + disX;
+          // 限制X轴范围
+          if (zLeft <= -parseInt(params.tWidth / 2)) {
+            zLeft = -parseInt(params.tWidth / 2);
+          }
+          if (zLeft >= params.cWidth - parseInt(params.tWidth * 0.5)) {
+            zLeft = params.cWidth - parseInt(params.tWidth * 0.5);
+          }
+    
+          zTop = parseInt(params.top) + disY;
+          // 限制Y轴范围
+          if (zTop <= 0) {
+            zTop = 0;
+          }
+          if (zTop >= params.cHeight - parseInt(params.tHeight * 0.5)) {
+            zTop = params.cHeight - parseInt(params.tHeight * 0.5);
+          }
+    
+          // 执行移动
+          target.style.left = zLeft + 'px';
+          target.style.top = zTop + 'px';
+        }
+    
+        if (typeof callback == "function") {
+          callback(zLeft, zTop);
+        }
+      }
+    
+      document.onmouseup = function () {
+        params.flag = false;
+        document.onmousemove = null;
+        document.onmouseup = null;
+      };
+    };
+  }

+ 23 - 14
src/view/InfoDialoges.vue

@@ -400,7 +400,7 @@ const changeModel= ()=>  {
 }
 let currentrow=ref(false);
 let placeholder=ref('某次某事件火灾事故');
-let emit = defineEmits(['headerclick', 'childfun', 'imgonclock','moxingclick','handleSelect','leftsimulation'])
+let emit = defineEmits(['headerclick', 'childfun', 'imgonclock','moxingclick','handleSelect','leftsimulation','resulysucss','websockfrist'])
 const props = defineProps({
     addselect: {
         type: Function,
@@ -452,6 +452,7 @@ let idobj = ref({
     name: "",
     time: ""
 })
+let state=ref();
 let router = useRouter();
 const value1 = ref('')
 let loading = ref(true)
@@ -586,7 +587,6 @@ const classclick = (val) => {
 const handleClose = () => {
     emit('imgonclock');
 }
-
 // 事故确定列表
 const accident = () => {
     if (idobj.value.name == '') {
@@ -602,6 +602,7 @@ const accident = () => {
             .then((res) => {
                 if(res.state=='1'){
                     emit("leftsimulation",res,sgdata.value);
+                  
                 }
                 else if(res.state=='-1'){
                     ElMessage({
@@ -630,7 +631,7 @@ const accident = () => {
         // setTimeout(function(){
          initWebSocket();
          rizhi.value.logs='';
-         newlog.value ='';  
+         newlog.value =''; 
         emit('headerclick', sgdata.value);
         emit('childfun');
         emit('moxingclick', true);
@@ -638,6 +639,7 @@ const accident = () => {
         //  emit('handleSelect', '1');
         fetchFileContent();
         accident2(props.activeIndex)
+        rewu();
     // },100)
     }
     dialog.value.dialogVisible_fire = false;
@@ -648,16 +650,12 @@ const accident = () => {
 
 }
 const accident2 = (key) => {
-    console.log(key);
+   
     if (key == '1'||key == '2'||key == '3') {
-        console.log(classradio.value);
         if (classradio.value== "Fire") {
- 
             leftcoll.value.collfire = true;
             leftcoll.value.collwater = false;
             leftcoll.value.Gass = false;
-            console.log(leftcoll.value.collfire)
-            console.log(1112333)
         } else if (classradio.value== "Water") {
             leftcoll.value.collwater = true;
             leftcoll.value.collfire = false;
@@ -667,7 +665,6 @@ const accident2 = (key) => {
             leftcoll.value.collfire = false;
             leftcoll.value.collwater = false;
         }
-        rewu();
     } else {
           leftcoll.value.collfire = false;
           leftcoll.value.collwater = false;
@@ -795,17 +792,21 @@ const pollute = () => {
 //任务求解任务信息
 //state 完成1  失败是-1
 const rewu=()=>{
-  
      arrvalue.value=[];
-
     const params = {
         transCode: 'D10017',
         aid:aid.value,
     }
     request(params)
         .then((res) => {
+         
+            emit('resulysucss',res.state);
+        
             arrvalue.value=res.cocodes.split(',');
             tuiyanobj.value=res;
+            state.value=res.state;
+           // console.log("状态"+state.value);
+           // emit('resulysucss'); 
             tuiyanobj.value.pickertime=res.acctime;
             console.log(tuiyanobj.value.acctime)
             console.log(options.value.length);
@@ -818,14 +819,18 @@ const rewu=()=>{
             }
               }
            }
-      
+         //  state.value=ref(null)
+          //
         })
         .catch((err) => {
            // ElMessage.error(err.returnMsg)
+           //state.value='0';
+           emit('resulysucss');
            addinitial();
         })
       
 }
+
 //默认时间
 const inititimeDefaultal = () => {
     var date = new Date();
@@ -961,7 +966,10 @@ const websocketonmessage = (res) => {
  //   console.log("数据", res);
     //  console.log(res.data);
     getthislog(res.data);
-
+    // console.log(res.data);
+    if(res.data=="求解——————————————————成功"){
+        emit('websockfrist');
+    }
     reset();
 };
 // Websoket连接错误事件
@@ -973,6 +981,7 @@ const websocketonerror = (res) => {
 // Websoket断开事件
 const websocketclose = (res) => {
     console.log("断开连接", res);
+    reconnect();
 };
 // 创建 websocket 的实例
 
@@ -1029,7 +1038,7 @@ onMounted(() => {
    // dialogVisible.value=true;
 });
 
-defineExpose({ monitor, accident2, leftcoll, classradio, aid, dialogVisible ,changeModel,classclick});
+defineExpose({ monitor, accident2, leftcoll, classradio, aid, dialogVisible ,changeModel,classclick,state});
 </script>
 <style scoped>
 

+ 23 - 8
src/view/appmian.vue

@@ -26,6 +26,8 @@
           @handleSelect="handleSelect"
           @childfun="childfun"
           @moxingclick="moxingclick"
+          @resulysucss="resulysucss"
+          @websockfrist="websockfrist"
           :classradio="classradio" 
         ></Dialoges>
         <!-- 模型库 -->
@@ -71,7 +73,7 @@
       <result ref="resultbidui" @titleclick="titleclick"  :classradio="classradio" ></result></div>
        <!-- 底部按钮三个页面 -->
   <div class="footer">
-    <Index ref="indexref" @indexchange="indexchange" @vtkshowfuc="vtkshowfuc" @hiadden="hiadden" :classradio="classradio" :aid="aid"/>
+    <Index ref="indexref" @indexchange="indexchange" @vtkshowfuc="vtkshowfuc" @hiadden="hiadden" :state='state' :classradio="classradio" :aid="aid"/>
   </div>
     </el-container>
   <!-- </v-scale-screen> -->
@@ -114,6 +116,7 @@ let sourcedis = ref();
 let classradio = ref();
 let boundary = ref();
 let tanimation = ref();
+let state=ref();
 let menumine=ref();
 let menusen=ref();
 let indexref=ref();
@@ -159,7 +162,18 @@ const  handleSelectzt=(val)=>{
   router.push({ path: "/" ,query:{classradio:val}});
 
 }
-
+//求解成功后的调用
+const resulysucss=(val)=>{
+  state.value=val;
+  // 求解成功
+  setTimeout(function(){
+  indexref.value.changeColor(0);},300)
+}
+//求解成功
+// const indexinit=()=>{
+// console.log(234789)
+//   indexref.value.changeColor(0)
+// }
 // 当前时间
 const timeFn=()=> {
   headertime.value.timing = setInterval(() => {
@@ -224,8 +238,6 @@ resultbidui.value.timeline=res.acctime;
 resultbidui.value.oldtime=res.acctime;
 // resultbidui.value.zdtime=res.acctime;
 resultbidui.value.endtime= Number(res.totaltime)/Number(res.reportstep);
-console.log("我是第一个",resultleft.value.aid)
-console.log("我是第二个",resultright.value.aid)
 resultbidui.value.initAid(resultleft.value.aid,resultright.value.aid);
 resultbidui.value.clickflat=true;
     }
@@ -285,10 +297,14 @@ const headerclick = (data) => {
   headerobj.value.name = data.name;
   headerobj.value.time = data.time;
   aid.value = data.aid;
+ // state.value=lliudialog.value.state;
 };
 //首页组件调用的方法
 const handindodialoges=()=>{
 
+}
+const websockfrist=()=>{
+  indexref.value.firsrdata();
 }
 // 隐藏图形
 const vtkshowfuc= (key)=>{
@@ -302,14 +318,14 @@ const vtkshowfuc= (key)=>{
  const hiadden= (key)=>{
     boundary.value.accident4(key);
       sourcedis.value.accident3(key);
-      lliudialog.value.accident2(key);
+    lliudialog.value.accident2(key);
  }
 const imgonclock=()=>{
 
   activeIndeximg.value=null;
 }
 const handleSelect = (key) => {
-  // router.push({ path: "/" ,query:{classradio:key}});
+  // window.location.reload();
  titleclick();
 
   activeIndeximg.value=key;
@@ -324,10 +340,9 @@ const handleSelect = (key) => {
   indexref.value.hiddfalse();
   configuratorref.value.menumfalse();
   }
-  indexref.value.btnlistshow=false;
  resultbidui.value.accident6('5');
   activeIndex.value =key;
-  indexref.value.changeColor(null)
+  //indexref.value.changeColor(null)
   switch (key) {
     case "1":
     classradio.value="Water";

+ 1 - 1
src/view/components/InfoAnimation.vue

@@ -194,7 +194,7 @@ const tableRowClassName = ({ row, rowIndex }) => {
   return "oddRow";
 };
 const formInline = ref({
-  region: "shanghai",
+  region: "Height",
 });
 
 const tableData = ref([]);

+ 1 - 0
src/view/components/InfoBoundary.vue

@@ -156,6 +156,7 @@
       width="482"
       :modal="false"
       :close-on-click-modal="false"
+      :append-to-body="true"
       draggable
       :fullscreen="false"
       :modal-append-to-body="false"

+ 13 - 5
src/view/components/InfoDisaster.vue

@@ -41,7 +41,7 @@
                         <div
                           class="flex_a"
                           @click="
-                            newtable();
+                            newtable($event);
                             sdialog.dianadddialog = true;
                           "
                         >
@@ -166,7 +166,7 @@
                         <div
                           class="flex_a"
                           @click="
-                            newtable();
+                            newtable($event);
                             sdialog.dianadddialog = true;
                           "
                         >
@@ -665,19 +665,22 @@
         </div>
       </div>
     </el-dialog>
-    <!-- 灾害点源数据的添加-->
+    <!-- 突水灾害点源数据的添加      draggable-->
     <el-dialog
       v-model="sdialog.dianadddialog"
       width="400"
       align-center
       :modal="false"
+      :append-to-body="true"
       :z-index='1000'
       :close-on-click-modal="false"
-      draggable
+
       :fullscreen="false"
       :modal-append-to-body="false"
       modal-class="summary-dlg"
       class="dialog_class bgcolor tianjia"
+      draggable
+ 
     >
       <template #header="{ titleId, titleClass }">
         <div class="my-header">
@@ -746,6 +749,7 @@
     <el-dialog
       v-model="sdialog.dialogVisiblenode"
       width="50%"
+      :append-to-body="true"
       class="dialog_class bgcolor tianjia asideg asidegbg leftbgimg"
     >
       <template #header="{ titleId, titleClass }">
@@ -1069,6 +1073,7 @@ const changeModel= ()=>  {
   vtkmodel.clearJgAddMode();
   vtkmodel.renderWindow.render();
 }
+let styX=ref({left: ""})
 const gfx=ref();
 const inp=ref();
 let gid=ref("");
@@ -1353,7 +1358,10 @@ const handleCurrentChange = (val) => {
   pipelinedata(searchtaggd.value);
 };
 //新建fire
-const newtable = () => {
+const newtable = (e) => {
+  var e = e || window.Event;
+  styX.value.left = e.clientX + "px";
+  console.log(styX.value.left);
   currentrow.value=false;
   selectstr.value = "";
   firepid.value = "";

+ 3 - 2
src/view/components/Menudisaster.vue

@@ -21,7 +21,7 @@
                       <div class="xian btncolor tablefocus bmar">
                        <!--内容 -->
             <div class="classtab">
-                <el-tabs v-model="resultactiveName" type="card" class="demo-tabs" @tab-click="handleClick"
+                <el-tabs v-model="resultactiveName" type="card" class="demo-tabs" 
                     :stretch="true">
                     <el-tab-pane label="突水" name="first">
                         <div class="asides_content">
@@ -31,7 +31,7 @@
                                     <div class=" btncolor tablefocus bmar">
 
                                         <el-table :data="tableData" style="width:480px" :max-height="tableHeight"
-                                            :highlight-current-row="currentrow" :row-class-name="tableRowClassName"
+                                            :highlight-current-row="currentrow"
                                             @row-click="handleDelete($event)"
                                             :header-cell-style="{ 'background': 'rgba(13, 22, 57,0) ' }">
                                             <el-table-column   prop="state"  label="预警" >
@@ -109,6 +109,7 @@ import bt4 from "@/assets/img/Group1396.png"
   const resultactiveName = ref("first");
   let coolactiveName1 = ref(["1",'2']);
   let tableHeight = ref(280);
+  let currentrow=ref(false)
   const tableData = [
   {
     date: '检测点',

+ 3 - 2
src/view/components/PipeIine.vue

@@ -316,17 +316,18 @@ const projectsSelectionSelect=(selection, row)=>{
         border-radius: 0px 0px 0px 0px;
 
         .el-image {
-            padding: 10px 10px 0 0;
+            padding: 0px 10px 0 0;
         }
 
         h4 {
             font-weight: bold;
             font-size: 12px;
-            color: #68ADFF;
+            color: #fff;
             line-height: 14px;
             text-align: left;
             font-style: normal;
             text-transform: none;
+            margin-top: 8px;
         }
     }
 

+ 3 - 1
src/view/components/SetNode.vue

@@ -5,6 +5,7 @@
       v-model="dialoglog"
       :modal="false"
       :close-on-click-modal="false"
+      :append-to-body="true"
       draggable
       :fullscreen="false"
       :modal-append-to-body="false"
@@ -244,7 +245,7 @@ function jgSelect(){
     border-radius: 0px 0px 0px 0px;
 
     .el-image {
-      padding: 10px 10px 0 0;
+      padding: 0px 10px 0 0;
     }
 
     h4 {
@@ -255,6 +256,7 @@ function jgSelect(){
       text-align: left;
       font-style: normal;
       text-transform: none;
+      margin-top: 8px;
     }
   }
 

+ 3 - 1
src/view/components/SetPipe.vue

@@ -4,6 +4,7 @@
       width="300px"
       v-model="dialoglog"
       :modal="false"
+      :append-to-body="true"
       :close-on-click-modal="false"
       draggable
       :fullscreen="false"
@@ -254,7 +255,7 @@ function jgSelect(){
     border-radius: 0px 0px 0px 0px;
 
     .el-image {
-      padding: 10px 10px 0 0;
+      padding: 0px 10px 0 0;
     }
 
     h4 {
@@ -265,6 +266,7 @@ function jgSelect(){
       text-align: left;
       font-style: normal;
       text-transform: none;
+      margin-top: 8px;
     }
   }
 

+ 0 - 4
src/view/configurator.vue

@@ -93,10 +93,6 @@ const menumfalse=()=>{
 // }
 // }
 defineExpose({showmenum,menumfalse});
-watch(router, (to, from) => {
-  router.go(0)
-})
-
   </script>
   
   <style lang="scss" scoped>

+ 181 - 22
src/view/index/first-left.vue

@@ -120,6 +120,8 @@ import { request, uploadFile } from "@/utils/request";
 import { ElMessage, ElButton, ElDialog, ElSelect } from 'element-plus'
 import * as echarts from 'echarts'
 import { createFireControl } from "@/control/fireControl.js";
+import { vtkmodel } from "@/control/vtkModel.js";
+import vtkDataArray from "@kitware/vtk.js/Common/Core/DataArray.js";
 import bt4 from "@/assets/img/Group1376.png"
 import bt1 from "@/assets/img/Group1377.png"
 import bt3 from "@/assets/img/Group1395.png"
@@ -132,8 +134,9 @@ let firstshow = ref(false);
 let activeNames = ref(["1"]);
 let tableHeight = ref(130);
 let playshow=ref(true);
-let showfalse=ref(false);
 let suspendshow=ref(false);
+let showfalse=ref(false);
+
 const isstop = ref(false);
 let count=ref(1);
 let starttime = ref(1);
@@ -155,6 +158,26 @@ let warnin2=ref(0);
 const dynamicHeaders = ref([
 
 ]);
+const job = ref({
+  jid: 0, //	任务ID
+  aid: 0, //	事故ID
+  starttime: "", //	结束时间
+  endtime: "", //	开始时间
+  state: "", //	状态
+  faildes: "", //	失败原因
+  dt: "", //	时间步长
+  dx: "", //	空间步长
+  reportstep: "", //	输出步长
+  interactionstep: "", //	交互步长
+  acctime: "", //	事故开始时间
+  totaltime: "", //	模拟时长
+  coids: "", //	物理属性ID逗号分隔
+  cocodes: "", //物理属性code逗号分隔
+});
+const formInline = ref({
+  region: "shanghai",
+});
+
 const tableData =ref( [
   // {
   //   date: '检测点',
@@ -193,7 +216,57 @@ const indexinit= (id)=>{
   aid.value=id;
   fcon.step=count.value;
   getMonitor();
-  lineChart();
+  vtkmodel.clearModeAddJg();
+  vtkGridRead()
+ // readJob()
+
+}
+//获取任务信息
+async function readJob() {
+
+
+const params = {
+  transCode: "D10017",
+  aid: aid.value,
+};
+await request(params)
+  .then((res) => {
+    if (res.returnCode == "000000000") {
+      //成功
+      if(res.state=='1'){
+      //  vtkmodel.clearModeAddJg(); //隐藏模版显示结果
+      monitor.value = true;
+      job.value = res;
+      reddate(new Date());
+      vtkGridRead();
+      endtime.value= Number(res.totaltime)/Number(res.reportstep);
+      console.log( endtime.value);
+    }else if(res.state=='-1'){
+      ElMessage({
+        message: " 求解失败",
+        type: 'error',
+      });
+    }else if(res.state=='0'){
+      ElMessage({ message: "求解未完成",  type: 'error',
+      });
+    }
+    } else {
+      ElMessage({
+        message: res.returnMsg,
+        type: "error",
+      });
+    }
+  })
+  .catch((err) => {
+    if(err.returnMsg=="任务不存在!"){
+      monitor.value=false;
+      console.log(1111)
+      ElMessage({
+        message: "未求解",
+        type: 'error',
+      });
+         }
+  });
 }
 //监测点数据获取
 async  function getMonitor() {
@@ -277,8 +350,7 @@ function Prev() {
   count.value--;
   fcon.step = count.value;
   newcount.value = count.value;
-  // vtkScalarRead();
- // getMonitor();
+
 }
 //  下一页
 function increment() {
@@ -291,8 +363,7 @@ function increment() {
   newcount.value = count.value;
   fcon.step = count.value;
   console.log( newcount.value );
-  // vtkScalarRead();
-   //getMonitor();
+
 }
 // 播放暂停
 const play =(time)=>{
@@ -313,9 +384,7 @@ const play =(time)=>{
         count.value++;
         fcon.step = count.value;
         newcount.value = count.value;
-        // vtkScalarRead();
-        // getMonitor();
-       // getMonitor();
+  
       }
     }
   };
@@ -334,9 +403,7 @@ function sliderchange(val) {
   newcount.value = count.value;
   fcon.step = count.value;
   console.log(count.value);
-  // console.log(count.value);
-  // vtkScalarRead();
-  // getMonitor();
+
 }
 const tableRowClassName=()=>{
 
@@ -501,25 +568,117 @@ const lineChart=()=>{
     // 让图表自适应大小
     myChart.resize();
 };
+}
+function reddate(date) {
+  //当前时间
+  const timestamp = date.getTime();
+  // newtime.value = timestampToTime(timestamp);
+  const accstamp = Date.parse(job.value.acctime);
+  var timeDifference = parseInt((timestamp - accstamp) / 1000);
+  fcon.stepsum = parseInt(job.value.totaltime) / parseInt(job.value.reportstep);
+  max.value = fcon.stepsum;
+  if (timeDifference < parseInt(job.value.totaltime)) {
+    //最长时间范围
+    fcon.step = parseInt(timeDifference / parseInt(job.value.reportstep));
+  } else {
+    fcon.step = fcon.stepsum;
+  }
+  count.value = fcon.step;
+  newcount.value = count.value;
+}
+function velocityRead() {
+  return;
+  // clearInterval(arrowtime.value);
+   fcon
+    .getVelocityByStep(fcon.step)
+    .then((result) => {
+        vtkmodel.addArrow(fcon.velocitys);
+        // arrowtimeStart();
+    })
+    .catch((err) => {
+      console.log(err);
+    });
+}
+function getMinMax(scalars) {
+  // console.log("getMinMax:",scalars);
+  min.value = scalars[0];
+  max.value = scalars[0];
+  for (let index = 0; index <= scalars.length; index++) {
+    let scalar = scalars[index];
+    if (min.value > scalar) {
+      min.value = scalar;
+    }
+    if (max.value < scalar) {
+      max.value = scalar;
+    }
+  }
+  // console.log("max,min:", max.value, min.value);
+}
+function vtkShow() {
+
+  const scalarBarActor = vtkmodel.scalarBarActor;
+  const mapper = vtkmodel.jgMapper;
+  const actor = vtkmodel.jgActor;
+
+  // console.log(formInline.value.region);
+
+  if (!fcon.scalar) {
+    return;
+  }
+
+  const scalarArray = fcon.scalar.get(formInline.value.region);
+  console.log("执行了");
+  if (!scalarArray || !fcon.polydata) {
+    return;
+  }
+
+  // console.log("scalarArray:", scalarArray);
+  const dataArray = vtkDataArray.newInstance({
+    name: formInline.value.region,
+    size: fcon.polydata.getNumberOfPoints(),
+  });
+  // console.log(dataArray);
+  dataArray.setData(scalarArray);
+  fcon.polydata.getPointData().setScalars(dataArray);
+  // fcon.polydata.getPointData().setOpacity(dataArray);
+  mapper.setInputData(fcon.polydata);
+  getMinMax(scalarArray);
+  mapper.setScalarRange(
+    parseFloat(min.value.toFixed(3)),
+    parseFloat(max.value.toFixed(3))
+  ); //设置范围
+  // actor.setMapper(mapper);
+  scalarBarActor.setAxisLabel(formInline.value.region);
+  mapper.clearColorArrays(); //强制重建颜色
+  actor.getProperty().setOpacity(count.value); //设置错误的透明度使得页面重新加载  不设置不刷新页面
+  actor.getProperty().setOpacity(0.5);
+  // vtkmodel.renderer.resetCamera();
+  vtkmodel.renderWindow.render();
  
- 
-// // 监听窗口大小变化
-// myChart.dispatchAction({ //设置激活第一个选项
-//      type: 'showTip',
-//      seriesIndex: 0,
-//      dataIndex: 0
-//    });
+}
+
+function vtkGridRead() {
+  fcon.aid = aid.value;
+  fcon
+    .initGemetry()
+    .then((result) => {
+      console.log(result);
+      vtkScalarRead();
+   
+    })
+    .catch((err) => {});
 }
 function vtkScalarRead() {
   fcon
     .getScalrsByStep(fcon.step)
     .then((result) => {
-      // console.log(fcon.scalar);
+     console.log(fcon.scalar);
+     console.log(123444);
       velocityRead() ;
       vtkShow();
     })
     .catch((err) => {
-      console.log(err);
+     // console.log(err);
     });
 }
 watch(
@@ -528,7 +687,7 @@ watch(
 console.log("值改变了", newVal, oldVal);
     fcon.step = newVal;
     getMonitor();
-     vtkScalarRead();
+    vtkScalarRead();
 
   },
   { deep: true }

+ 20 - 7
src/view/index/index.vue

@@ -33,7 +33,10 @@ const props = defineProps({
     type: String,
     // default: '',activeIndex
   },
-
+  state: {
+    type: String,
+    // default: '',activeIndex
+  },
 
 });
 let firstleftref=ref();
@@ -45,11 +48,11 @@ let listArray = ref([
      { id: 1, name: "路径判断" ,img:bt2},
      { id: 2, name: "灾害对比" ,img:bt2},
    ]);
-let currentIndex=ref(null);
+let currentIndex=ref(0);
 let btnlistshow=ref(false);
 const changeColor=(index)=>{
     btnindex.value=index;
-    console.log(index);
+    //btnlistshow.value=false;
     emit("vtkshowfuc", index);
     currentIndex.value = btnindex.value;
     indexchange(btnindex.value);
@@ -59,32 +62,42 @@ const changeColor=(index)=>{
     }else{
         emit("hiadden", 5);
     }
+   
+}
+// 求解成功后调用右边
+const firsrdata= ()=>{
+    firstleftref.value.firstshow=true;
+    firstleftref.value.indexinit(props.aid);
 }
+
 const indexchange=(key)=>{
   if(key==0){
-    firstleftref.value.firstshow=true;
+    
     towrightref.value.towshow=false;
+    if(props.state=='1'){
+      firstleftref.value.firstshow=true;
     firstleftref.value.indexinit(props.aid);
-
+    }
   }else if(key==1){
     firstleftref.value.firstshow=false;
     towrightref.value.towshow=true;
   }
   else{
-
     firstleftref.value.firstshow=false;
     towrightref.value.towshow=false;
+    
     // threerightref.value.threeshow=false;
   }
 }
 const hiddfalse=()=>{
     firstleftref.value.firstshow=false;
     towrightref.value.towshow=false;
+    btnlistshow.value=false;s
 }
 const showhadend=()=>{
     btnlistshow.value=true;
 }
-     defineExpose({showhadend,changeColor,btnindex,btnlistshow,hiddfalse,currentIndex});
+     defineExpose({showhadend,changeColor,btnindex,btnlistshow,hiddfalse,currentIndex,firsrdata});
    </script>
    <style  lang="scss" scoped>
 

+ 3 - 2
src/view/result.vue

@@ -366,7 +366,7 @@ defineExpose({ accident6, initAid, mntext1, mntext2, clickflat, endtime, zdtime,
 }
 
 .animation_s .el-slider {
-  padding: 43px 10px;
+  padding: 0px 10px;
 }
 
 .tanniu {
@@ -376,6 +376,7 @@ defineExpose({ accident6, initAid, mntext1, mntext2, clickflat, endtime, zdtime,
   align-items: center;
 }
 .tanniu ul{
+  margin-top: 24px;
   width: 100%;
 }
 .resultyem {
@@ -392,7 +393,7 @@ defineExpose({ accident6, initAid, mntext1, mntext2, clickflat, endtime, zdtime,
 .results {
   flex: 1;
   position: relative;
-  overflow: auto;
+  overflow:hidden;
 
 }
 

+ 1 - 1
src/view/result/Wdisaster.vue

@@ -50,7 +50,7 @@
                       <el-icon class="iconimg1 Frame3" fit="contain"></el-icon>{{ jcname }}
                 </div>
                 <div class="echart echartxian">
-                <div id="line2" style="width: 100%; height: 1.25rem;"></div></div>
+                <div id="line2" style="width: 100%; height: 178px;"></div></div>
                 </div>
                 </div>
               </div>

+ 1 - 1
src/view/result/Wdisaster2.vue

@@ -50,7 +50,7 @@
                       <el-icon class="iconimg1 Frame3" fit="contain"></el-icon>{{ jcname }}
                 </div>
                 <div class="echart echartxian">
-                <div id="line3" style="width: 100%; height: 1.25rem;"></div></div>
+                <div id="line3" style="width: 100%; height: 178px;"></div></div>
                 </div>
                 </div>
               </div>