Kaynağa Gözat

12.25修改aid直接传

liuqiao 8 ay önce
ebeveyn
işleme
ee199c4de5

+ 13 - 0
src/components/header.vue

@@ -83,6 +83,19 @@ const timeFn=()=> {
     emit('handleSelect', key);
     headername.value="";
 };
+// const handleSelect4 = (key) => {
+//   //emitter.on('checkeclear');
+//   emitter.emit('handleSelect4',(key));
+//     headerid.value=key;
+//     headeractive.value= headerid.value;
+//     emit('handleSelect', key);
+//     headername.value="";
+// };
+  emitter.on('handleSelect4',(data)=>{
+      headerid.value=data;
+    headeractive.value= headerid.value;
+    headername.value="";
+});
 const hname=(val)=>{
   headername.value=val// 获取项目名称
 }

+ 73 - 6
src/view/InfoDialoges.vue

@@ -60,7 +60,7 @@
                     </el-table-column>
                     <el-table-column type="index" label="序号" width="70" />
                     <el-table-column prop="name" label="名称" />
-                    <el-table-column prop="name" label="来源" />
+                    <!-- <el-table-column prop="name" label="来源" /> -->
                     <el-table-column prop="time" label="时间" width="150" />
                 </el-table>
                 <div class="demo-pagination-block pagination">
@@ -451,6 +451,8 @@ import closeimg from "@/assets/img/colse.png";
 import { timestampToTime } from '@/js/lindex.js'
 import { vtkmodel } from "@/control/vtkModel.js";
 import emitter from "@/utils/emitter";
+import { useRoute } from 'vue-router';
+const route = useRoute();
 const changeModel= ()=>  {
   vtkmodel.clearJgAddMode();
   vtkmodel.renderWindow.render();
@@ -459,7 +461,7 @@ let txt=ref('更多设置');
 let iskeynum=ref(false);
 let currentrow=ref(false);
 let placeholder=ref('某次某事件火灾事故');
-let emit = defineEmits(['headerclick', 'childfun', 'imgonclock','moxingclick','handleSelect','leftsimulation','resulysucss','websockfrist','funcfirst'])
+let emit = defineEmits(['headerclick', 'childfun', 'imgonclock','moxingclick','handleSelect','leftsimulation','resulysucss','websockfrist','funcfirst','showfun'])
 const props = defineProps({
     addselect: {
         type: Function,
@@ -737,20 +739,22 @@ const accident = () => {
 
         }else{
         // setTimeout(function(){
-        
+          
          initWebSocket();
         rizhi.value.logs='';
         rizhi.value.flogs= rizhi.value.logs;
         rizhi.value.wlogs= rizhi.value.logs;
         newlog.value =''; 
-      
+           // console.log(sgdata.value);
         emit('headerclick', sgdata.value);
         emit('childfun');
+       
         emit('moxingclick', true);
         pollute();
         //  emit('handleSelect', '1');
         fetchFileContent();
-        accident2(props.activeIndex)
+        console.log(props.activeIndex);
+       // accident2(props.activeIndex)
         rewu();
         // if(state.value=="1"){
         //      emit('websockfrist');
@@ -817,6 +821,7 @@ const sgadd = () => {
 // 事故列表的选择
 const getRadioRow = (val) => {
     // currentrow.value=true;
+    console.log(val);
     sgdata.value = (val);
     formull.value.name = val.name;
     aid.value = val.aid;
@@ -1218,14 +1223,76 @@ onBeforeUnmount(() => {
     rizhi.logs='';
 
 });
+//查询
+const getmoun=()=>{
+       emit('showfun');
+    const params = {
+        transCode: 'D00003',
+        count: pageSize4.value,
+        page: currentPage4.value,
+        aid: aid.value,
+        stype: '',
+    }
+    request(params)
+        .then((res) => {
+        
+            sgdata.value=res.rows[0];
+            console.log( sgdata.value);
+        aid.value=sgdata.value.aid;
+         classradio.value=sgdata.value.stype;
+        classclick(classradio.value);
+        idobj.value.name=sgdata.value.name;
+           console.log( idobj.value.name); 
+           accident();
+            if( sgdata.value.stype=="Water"){
+                emitter.emit('handleSelect4', '1');
+            }else if( sgdata.value.stype=="Fire"){
+                emitter.emit('handleSelect4', '2');
+            }else if( sgdata.value.stype=="Gass"){
+                emitter.emit('handleSelect4', '3');
+            }else if( sgdata.value.stype=="4"){
+                emitter.emit('handleSelect4', '4');
+            }else if( sgdata.value.stype=="Gass1"){
+                emitter.emit('handleSelect4', '5');
+            }else{
 
+            }
+            
+           
+        })
+}
 onMounted(() => {
+    //const paramValue =window.location.href;//.paramNamehttp://localhost:5173/#/
+    const paramValue ='http://localhost:5173/#/aid=7';
+    const parts = paramValue.split('=');
+    console.log(parts);
+    aid.value=parts[1];
+    if( aid.value==null||aid.value==''){
+        
+    }else{
+        getmoun();
+                  
+    // emitter.on('accident',(data)=>{
+    //     getmoun();
+   
+    // });
+    }
+  
+
+
+        
+
+
+
 
-   // dialogVisible.value=true;
 });
 const change2=(val)=>{
     formull.value.name.forceUpdate();
 }
+onUnmounted(() =>{
+
+emitter.off('accident')
+})
 defineExpose({ monitor, accident2, leftcoll, classradio, aid, dialogVisible ,changeModel,classclick,state,dialog});
 </script>
 <style scoped>

+ 20 - 5
src/view/appmian.vue

@@ -32,6 +32,7 @@
           @moxingclick="moxingclick"
           @resulysucss="resulysucss"
           @websockfrist="websockfrist"
+          @showfun="showfun"
           :classradio="classradio" 
         ></Dialoges>
         <!-- 模型库 -->
@@ -293,23 +294,33 @@ const aidlist = () => {
 };
 // index组件的方法
 const indexchange=(key)=>{
+  console.log(key)
+  console.log('看看'+aid.value)
   bkmodel.value=true;
 resultbidui.value.accident6(key,aid.value);
 }
-
+// 显示
+const showfun= ()=>{
+  bgk2false.value=false;
+}
 // 获取子组件的方法
 const childfun = () => {
+  
   bgk2false.value=false;
   indexref.value.showhadend();
   indexchange(indexref.value.btnindex);
   if(classradio.value=='Gass'){
     sourcedis.value.Gassgetdata(aid.value);
   }else{
+    sourcedis.value.getrequest(aid.value);
+   setTimeout(() => {
     sourcedis.value.handledisaster(aid.value);
-    sourcedis.value.getrequest();
+   }, 3000);
+
+
   }
-  boundary.value.addboundary(aid.value);
   sourcedis.value.accident3(activeIndex.value);
+  boundary.value.addboundary(aid.value);
   boundary.value.accident4(activeIndex.value);
   //indexref.value.changeColor(0);
 };
@@ -317,6 +328,7 @@ const headerclick = (data) => {
   headerobj.value.name = data.name;
   headerobj.value.time = data.time;
   aid.value = data.aid;
+  console.log('是我没错',aid.value)
   reheaderref.value.hname(data.name);
 
  // state.value=lliudialog.value.state;
@@ -346,9 +358,9 @@ const imgonclock=()=>{
 
   activeIndeximg.value=null;
 }
-
 const handleSelect = (key) => {
-  emitter.emit('handleSelect',(key));
+   console.log('执行吗')
+ emitter.emit('handleSelect',(key));
   // window.location.reload();
  //indexref.value.changeColor("0")
 //  indexref.value.changeColor(0);
@@ -408,6 +420,9 @@ const handleSelect = (key) => {
       break;
   }
 };
+onUnmounted(() =>{
+
+})
 </script>
 <style>
 @import '../../src/style/style.css';

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

@@ -419,7 +419,7 @@
         <div class="dialog-footer footer_div l_btn">
           <div class="footerbtn flex1">
             <div class="borderimg">
-              <el-button @click="sdialog.dialogVisiblenode = false">取消</el-button>
+              <el-button @click="sdialog.dialogVisiblenode = false;searchtaggd=''">取消</el-button>
             </div>
           </div>
           <div class="footerbtn flex1">
@@ -449,7 +449,7 @@
       <div class="dialog-footer footer_div l_btn">
         <div class="footerbtn flex1">
           <div class="borderimg">
-            <el-button @click="sdialog.dialogsgdelect = false">取消</el-button>
+            <el-button @click="sdialog.dialogsgdelect = false;">取消</el-button>
           </div>
         </div>
         <div class="footerbtn flex1">
@@ -619,6 +619,7 @@ const pipelinedata = (searchtag) => {
 const selectfun = () => {
   sdialog.value.dialogVisiblenode = false;
   bformInline.value.nname = "";
+  searchtaggd.value='';
   currentPage4.value = 1;
   console.log();
   if (multipleSelection.value.length != 0) {

+ 14 - 3
src/view/components/InfoDisaster.vue

@@ -1800,6 +1800,8 @@ const tableData4 = ref([]);
 
 const accident3 = (key) => {
   console.log(key);
+    //aid.value=id;
+ // console.log('我是aid', id);
   if (key == "1"||key == "2"||key == "3"||key=='5') {
     console.log(props.classradio )
     if (props.classradio == "Fire") {
@@ -1808,12 +1810,16 @@ const accident3 = (key) => {
       sour.value.Gass = false;
       sour.value.collGass1=false
       Fengmenref.value.getquery(aid.value);
+  
+     // handledisaster(aid.value);
     } else if (props.classradio == "Water") {
      
       sour.value.collwater = true;
       sour.value.collfire = false;
       sour.value.Gass = false;
       sour.value.collGass1=false
+     
+     // handledisaster(aid.value);
     }else if(props.classradio == "Gass"){
       sour.value.collwater = false;
       sour.value.collfire = false;
@@ -1850,6 +1856,7 @@ const Dclick = () => {
 //灾情源查询列表
 const handledisaster = (aidval) => {
   vtkmodel.delSoures();
+  console.log('执行aid',aidval);
   aid.value = aidval;
   const params = {
     transCode: "D00005",
@@ -1857,6 +1864,8 @@ const handledisaster = (aidval) => {
   };
   request(params)
     .then((res) => {
+      console.log(res);
+      //vtkmodel.delSoures();
       res.rows.forEach((item,index)=>{
         vtkmodel.addSoures(item.pid,item.site)
       })
@@ -1865,6 +1874,7 @@ const handledisaster = (aidval) => {
       } else {
         tableDatawat.value = res.rows;
       }
+     
        tableobj.value={};
     })
     .catch((err) => {
@@ -2709,7 +2719,7 @@ const addrequest=()=>{
         type: "success",
       });
       sdialog.value.addpump = false;
-      getrequest();
+      getrequest( aid.value);
       fun3D();
     })
     .catch((err) => {
@@ -2720,7 +2730,8 @@ const addrequest=()=>{
   }
 }
 //水泵查询
-const getrequest=()=>{
+const getrequest=(id)=>{
+  aid.value=id;
   const params = {
     transCode: "D20001",
     aid: aid.value,
@@ -2846,7 +2857,7 @@ const xiugailine=()=>{
       });
       sdialog.value.linetable=false;
       vtkmodel.delpump();
-      getrequest();
+      getrequest( aid.value);
     })
     .catch((err) => {
       ElMessage.error(err.returnMsg);

+ 6 - 3
src/view/components/InfoVtkmodel.vue

@@ -2,7 +2,7 @@
   <div class="vtkmodel1" id="infomodel"></div>
 </template>
 <script setup>
-import { ref, onMounted, reactive } from "vue";
+import { ref, onMounted, reactive} from "vue";
 import { RouterView, RouterLink } from "vue-router";
 import { request, uploadFile } from "@/utils/request";
 import { vtkmodel } from "@/control/vtkModel.js";
@@ -12,9 +12,11 @@ import vtkActor from "@kitware/vtk.js/Rendering/Core/Actor";
 import vtkMapper from "@kitware/vtk.js/Rendering/Core/Mapper";
 import vtkLineSource from "@kitware/vtk.js/Filters/Sources/LineSource";
 import vtkPointSource from "@kitware/vtk.js/Filters/Sources/PointSource";
-
+import emitter from "@/utils/emitter";
+onBeforeMount(()=>{
+ 
+})
 onMounted(() => {
-
   const rootContainer = document.getElementById("infomodel");
   // rootContainer.style.position = "relative";
   // rootContainer.style.width = "100%";
@@ -22,6 +24,7 @@ onMounted(() => {
   vtkmodel.initMode(rootContainer);
   readNodeAndPipe();
   vtkmodel.clearJgAddMode();
+  emitter.emit('accident');
 });
 const nodes = ref([]); //节点数据
 const pipes = ref([]); //管道数据

+ 2 - 2
src/view/result.vue

@@ -90,7 +90,7 @@
           <resultLeft ref="setleftAid" :region="formInline.region" :count="newcount" />
         </div>
         <!--检测点信息 -->
-        <wdisaster ref="wdisasterref"  :count="newcount"/>
+        <wdisaster ref="wdisasterref" :classradio="props.classradio"   :count="newcount"/>
       </div>
       <!-- 检测点 -->
     </div>
@@ -113,7 +113,7 @@
           <resultRight ref="setrightAid" :region="formInline.region" :count="newcount" />
         </div>
         <!--检测点信息 -->
-        <wdisaster2 ref="wdisasterref2" :count="newcount"/>
+        <wdisaster2 ref="wdisasterref2" :classradio="props.classradio"  :count="newcount"/>
       </div>
       <!-- 检测点 -->
     </div>

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

@@ -81,6 +81,9 @@ const props = defineProps({
   type: Number,
 
 },
+classradio:{
+  type: String,
+}
 });
 let tableHeight=ref(114)
 let aid=ref();
@@ -212,7 +215,6 @@ const params = {
   aid: aid.value,
   step:step,
 };
-console.log("我的aid还在吗"+aid.value)
 request(params)
   .then((res) => {
     console.log(res)
@@ -274,14 +276,18 @@ request(params)
       let warning2=[];//二级警告
       let warning3=[];//突水发生
       let warning4=[];//安全区域
+      console.log(props.classradio);
       if(props.classradio=='Water'){
+      
           for (let j = 0; j < res.vals.length; j++) {
             if(Math.abs(Number(res.vals[j].v1))>1.5){
               res.vals[j].state=3;
               warning.push(res.vals[j].v1)
+              console.log(warning);
             }else{
               res.vals[j].state=0;
               warning4.push(res.vals[j].v1);
+              console.log(warning4);
             }
           }
         }else{

+ 3 - 0
src/view/result/Wdisaster2.vue

@@ -81,6 +81,9 @@ const props = defineProps({
   type: Number,
 
 },
+classradio:{
+  type: String,
+}
 });
 let tableHeight=ref(114)
 let aid=ref();