appmian.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. <template>
  2. <div class="appmian" >
  3. <!-- <v-scale-screen width="1920" height="1080" style="margin: 0;"> -->
  4. <el-container>
  5. <el-header>
  6. <reheader ref="reheaderref" @handleSelect="handleSelect" :name="headerobj.name"/>
  7. </el-header>
  8. <el-main>
  9. <div class="reghtzs"> </div>
  10. <div class="leftzs"> </div>
  11. <div class="maincontent">
  12. <div class="mainpdding">
  13. <source-disaster ref="sourcedis" :classradio="classradio" />
  14. <info-boundary ref="boundary" :classradio="classradio" />
  15. <info-animation ref="tanimation" :classradio="classradio" :aid="aid" />
  16. <Dialoges
  17. ref="lliudialog"
  18. :addselect="addselect"
  19. :valzaiqing="valzaiqing"
  20. :headerobj="headerobj"
  21. :activeIndex="activeIndex"
  22. @funcfirst="funcfirst"
  23. @imgonclock="imgonclock"
  24. @leftsimulation="leftsimulation"
  25. @headerclick="headerclick"
  26. @handleSelect="handleSelect"
  27. @childfun="childfun"
  28. @moxingclick="moxingclick"
  29. @resulysucss="resulysucss"
  30. @websockfrist="websockfrist"
  31. :classradio="classradio"
  32. ></Dialoges>
  33. <!-- 模型库 -->
  34. <configurator ref="configuratorref"/>
  35. <!-- <MenuMine ref="menumine"/>
  36. <MenuSensor ref="menusen"/> -->
  37. <!-- right -->
  38. <!-- <firstLeft/> -->
  39. <!-- </div> -->
  40. </div>
  41. </div>
  42. <div class="vtkmodel1" id="infomodel" v-show="modelshow"><InfoVtkmodel ref="vtkmodel" /></div>
  43. </el-main>
  44. <div class=" bgk3" v-show="bgk2false">
  45. <div class="bgk4"></div>
  46. <div class="bgk2">
  47. <div class="bjgg">
  48. <el-image :src="dtu" fit="contain"></el-image>
  49. <ul>
  50. <li class="s1" :class="activeIndeximg=='2'?'activeimg':''" @click="handleSelect('2')" >
  51. <el-image :src="s1" fit="contain"></el-image>
  52. <span class="stext">火灾推演</span>
  53. </li>
  54. <li class="s2" :class="activeIndeximg=='1'?'activeimg':''" @click="handleSelect('1')">
  55. <el-image :src="s2" fit="contain"></el-image>
  56. <span class="stext">突水推演</span>
  57. </li>
  58. <li class="s3" :class="activeIndeximg=='3'?'activeimg':''" @click="handleSelect('3')">
  59. <el-image :src="s3" fit="contain"></el-image>
  60. <span class="stext">瓦斯爆炸推演</span>
  61. </li>
  62. <li class="s4" :class="activeIndeximg=='4'?'activeimg':''" @click="handleSelect('4')"> <el-image :src="s4" fit="contain"></el-image>
  63. <span class="stext">模型库</span>
  64. </li>
  65. </ul>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="bkxolo" v-show="bkmodel">
  70. <result ref="resultbidui" @titleclick="titleclick" :classradio="classradio" ></result></div>
  71. <!-- 底部按钮三个页面 -->
  72. <div class="leftline"></div>
  73. <div class="rightline"></div>
  74. <div class="footer" >
  75. <Index ref="indexref" @indexchange="indexchange" @vtkshowfuc="vtkshowfuc" @hiadden="hiadden" :state='state' :classradio="classradio" :aid="aid"/>
  76. </div>
  77. </el-container>
  78. <!-- </v-scale-screen> -->
  79. </div>
  80. </template>
  81. <script setup>
  82. import { ref, onMounted, reactive, nextTick } from "vue";
  83. import { RouterView, RouterLink, useRouter } from "vue-router";
  84. import VScaleScreen from 'v-scale-screen'
  85. import '@/utils/flexible'
  86. // import NavigateBar from "@/components/layout/NavigateBar.vue";
  87. import Dialoges from "./InfoDialoges.vue";
  88. import logo from "@/assets/logo.png";
  89. import { ElMessage, ElButton, ElDialog, ElSelect, formEmits } from 'element-plus'
  90. // import myIndex from "./index"
  91. import Index from "./index/index.vue"
  92. import configurator from "./configurator.vue";
  93. import SourceDisaster from "./components/InfoDisaster.vue";
  94. import InfoBoundary from "./components/InfoBoundary.vue";
  95. import InfoAnimation from "./components/InfoAnimation.vue";
  96. import InfoVtkmodel from "./components/InfoVtkmodel.vue";
  97. // import configurator from "./components/configurator.vue"
  98. import reheader from "@/components/header.vue"
  99. import result from "./result.vue";
  100. import Vector from "@/assets/img/Vector.png";
  101. import s1 from "@/assets/img/s1.png";
  102. import dtu from "@/assets/img/Group1317.png";
  103. import s2 from "@/assets/img/s2.png";
  104. import s3 from "@/assets/img/s3.png";
  105. import s4 from "@/assets/img/s4.png";
  106. import b from "@/assets/img/Group1317.png";
  107. import { timestampToTime,formatTime } from "@/js/lindex.js";
  108. import mitts from "@/utils/Bus";
  109. import { contains } from "@kitware/vtk.js/Common/DataModel/BoundingBox";
  110. // import { vtkmodel } from "@/control/vtkModel.js";
  111. let activeIndeximg=ref( null);
  112. let reheaderref=ref();
  113. let lliudialog = ref();
  114. let sourcedis = ref();
  115. let classradio = ref();
  116. let boundary = ref();
  117. let tanimation = ref();
  118. let state=ref();
  119. let menumine=ref();
  120. let menusen=ref();
  121. let indexref=ref();
  122. let configuratorref=ref();
  123. let bkmodel=ref(false);
  124. let modelshow=ref(true);
  125. const title = "灾情推演软件";
  126. const activeIndex = ref("1");
  127. const activeIndex2 = ref("1");
  128. let titlefalse = ref(false);
  129. let resultbidui = ref();
  130. let mnindex = ref("");
  131. let resultleft = ref({});
  132. let datares=ref({});
  133. let firstleftref=ref();
  134. let towrightref=ref();
  135. let threerightref=ref();
  136. let resultright = ref({});
  137. let headertime=ref({
  138. timing: null,
  139. loading: true,
  140. dateDay: null,
  141. dateYear: null,
  142. dateWeek: null,
  143. weekday: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  144. })
  145. let bgk2false=ref(true);
  146. let headerobj = ref({
  147. time: "",
  148. name: "",
  149. });
  150. let valzaiqing = ref("");
  151. let router = useRouter();
  152. let sgdata = ref({});
  153. let aid = ref();
  154. onMounted(() => {
  155. timeFn();
  156. // childfun();
  157. });
  158. // 跳转页面,{ aid:aid.value}
  159. const handleSelectzt=(val)=>{
  160. router.push({ path: "/" ,query:{classradio:val}});
  161. }
  162. //求解成功后的调用
  163. const resulysucss=(val)=>{
  164. state.value=val;
  165. // 求解成功
  166. if( state.value=='1'){
  167. indexref.value.changeColor(0);
  168. }
  169. }
  170. // 开始计算调用的func
  171. const funcfirst=()=>{
  172. indexref.value.firstshowfuc();
  173. }
  174. //求解成功
  175. // const indexinit=()=>{
  176. // console.log(234789)
  177. // indexref.value.changeColor(0)
  178. // }
  179. // 当前时间
  180. const timeFn=()=> {
  181. headertime.value.timing = setInterval(() => {
  182. headertime.value.dateDay = formatTime(new Date(), "HH: mm: ss");
  183. headertime.value.dateYear = formatTime(new Date(), "yyyy-MM-dd");
  184. headertime.value.dateWeek = headertime.value.weekday[new Date().getDay()];
  185. }, 1000);
  186. }
  187. const addselect = () => {
  188. classradio.value = lliudialog.value.classradio;
  189. };
  190. // 获取模拟数据对比
  191. const leftsimulation = (res,data) => {
  192. console.log(mnindex.value)
  193. if (mnindex.value == "1") {
  194. resultleft.value.coids = res.coids;
  195. resultleft.value.totaltime = res.totaltime;
  196. resultleft.value.reportstep = res.reportstep;
  197. resultleft.value.pickertime = res.acctime;
  198. resultleft.value.aid = res.aid;
  199. resultbidui.value.mntext1=data.name;
  200. resultbidui.value.wdiclick(resultleft.value.aid,'1');
  201. } else {
  202. resultright.value.coids = res.coids;
  203. resultright.value.totaltime = res.totaltime;
  204. resultright.value.reportstep = res.reportstep;
  205. resultright.value.pickertime = res.acctime;
  206. resultright.value.aid = res.aid;
  207. resultbidui.value.mntext2=data.name;
  208. resultbidui.value.wdiclick( resultright.value.aid,'2');
  209. }
  210. //TODO
  211. if(resultleft.value.aid==''||resultright.value.aid==''||resultleft.value.aid==undefined||resultright.value.aid==undefined){
  212. }else{
  213. if (resultleft.value.coids != resultright.value.coids) {
  214. ElMessage.error('污染物不一样,无法进行比较')
  215. return;
  216. }
  217. if (resultleft.value.totaltime != resultright.value.totaltime) {
  218. ElMessage.error('模拟时长不一样,无法进行比较')
  219. return;
  220. }
  221. if (resultleft.value.reportstep != resultright.value.reportstep) {
  222. ElMessage.error('输出步长不一样,无法进行比较')
  223. return;
  224. }
  225. if (resultleft.value.pickertime != resultright.value.pickertime ) {
  226. ElMessage.error('事故时间不一样,无法进行比较')
  227. return;
  228. }
  229. //TODO 获取物理量
  230. resultbidui.value.timeline=res.acctime;
  231. resultbidui.value.oldtime=res.acctime;
  232. // resultbidui.value.zdtime=res.acctime;
  233. resultbidui.value.endtime= Number(res.totaltime)/Number(res.reportstep);
  234. resultbidui.value.initAid(resultleft.value.aid,resultright.value.aid,res.codes);
  235. resultbidui.value.clickflat=true;
  236. }
  237. };
  238. //判断两个对象是否相等
  239. const objequality = () => {};
  240. const moxingclick = (val) => {
  241. titlefalse.value = val;
  242. };
  243. // const qingsel=()=>{
  244. // lliudialog.value.dialogVisible = true;
  245. // }
  246. //点击头部弹出弹框
  247. const bgkchange= ()=>{
  248. }
  249. const titleclick = (val, index) => {
  250. mnindex.value = index;
  251. valzaiqing.value = val;
  252. if (val == "模拟数据") {
  253. lliudialog.value.dialogVisible = true;
  254. } else {
  255. // lliudialog.value.dialogVisible = true;
  256. clearInterval();
  257. }
  258. };
  259. //获取aid
  260. const aidlist = () => {
  261. sgdata.value = lliudialog.value.sgdata;
  262. aid.value = sgdata.value.aid;
  263. };
  264. // index组件的方法
  265. const indexchange=(key)=>{
  266. bkmodel.value=true;
  267. resultbidui.value.accident6(key,aid.value);
  268. }
  269. // 获取子组件的方法
  270. const childfun = () => {
  271. bgk2false.value=false;
  272. indexref.value.showhadend();
  273. indexchange(indexref.value.btnindex);
  274. if(classradio.value=='Gass'){
  275. sourcedis.value.Gassgetdata(aid.value);
  276. }else{
  277. sourcedis.value.handledisaster(aid.value);
  278. sourcedis.value.getrequest();
  279. }
  280. boundary.value.addboundary(aid.value);
  281. sourcedis.value.accident3(activeIndex.value);
  282. boundary.value.accident4(activeIndex.value);
  283. //indexref.value.changeColor(0);
  284. };
  285. const headerclick = (data) => {
  286. headerobj.value.name = data.name;
  287. headerobj.value.time = data.time;
  288. aid.value = data.aid;
  289. reheaderref.value.hname(data.name);
  290. // state.value=lliudialog.value.state;
  291. };
  292. //首页组件调用的方法
  293. const handindodialoges=()=>{
  294. }
  295. const websockfrist=()=>{
  296. indexref.value.firsrdata();
  297. }
  298. // 隐藏图形
  299. const vtkshowfuc= (key)=>{
  300. if(key==2){
  301. modelshow.value=false;
  302. }else{
  303. modelshow.value=true;
  304. }
  305. }
  306. //清空灾情推演隐藏
  307. const hiadden= (key)=>{
  308. boundary.value.accident4(key);
  309. sourcedis.value.accident3(key);
  310. lliudialog.value.accident2(key);
  311. }
  312. const imgonclock=()=>{
  313. activeIndeximg.value=null;
  314. }
  315. const handleSelect = (key) => {
  316. // window.location.reload();
  317. //indexref.value.changeColor("0")
  318. // indexref.value.changeColor(0);
  319. // indexref.value.clearconst();
  320. titleclick();
  321. activeIndeximg.value=key;
  322. bgk2false.value=true;
  323. indexref.value.btnlistshow=false;
  324. if( bgk2false.value==true){
  325. activeIndex.value='11'
  326. bkmodel.value=false;
  327. sourcedis.value.accident3(activeIndex.value);
  328. boundary.value.accident4(activeIndex.value);
  329. lliudialog.value.accident2( activeIndex.value);
  330. indexref.value.hiddfalse();
  331. configuratorref.value.menumfalse();
  332. }
  333. resultbidui.value.accident6('5');
  334. activeIndex.value =key;
  335. //indexref.value.changeColor(null)
  336. reheaderref.value.headeractive=key;
  337. switch (key) {
  338. case "1":
  339. classradio.value="Water";
  340. lliudialog.value.classclick( classradio.value);
  341. break;
  342. case "2":
  343. classradio.value="Fire";
  344. lliudialog.value.classclick(classradio.value);
  345. break;
  346. case "3":
  347. classradio.value="Gass";
  348. console.log( classradio.value);
  349. lliudialog.value.classclick( classradio.value);
  350. break;
  351. case "4":
  352. classradio.value="Model";
  353. bgk2false.value=false;
  354. configuratorref.value.showmenum();
  355. boundary.value.accident4(key);
  356. sourcedis.value.accident3(key);
  357. lliudialog.value.accident2(key);
  358. lliudialog.value.dialog.dialogVisible_fire=false;
  359. break;
  360. case "5":
  361. classradio.value="Gass1";
  362. lliudialog.value.classclick( classradio.value);
  363. default:
  364. break;
  365. }
  366. };
  367. </script>
  368. <style>
  369. @import '../../src/style/style.css';
  370. </style>
  371. <style lang="scss" scoped>
  372. .appmian {
  373. .el-main {
  374. --el-main-padding: 0px !important;
  375. }
  376. .el-container {
  377. padding: 0;
  378. margin: 0;
  379. width: 100%;
  380. position: absolute;
  381. z-index: 206;
  382. top: 0;
  383. background-image: url(../../src/assets/img/BJ.png)!important;
  384. background-size: 100% 100%;
  385. background-repeat: no-repeat;
  386. }
  387. }
  388. .ve_menu_logo {
  389. width: 100%;
  390. height: 70px;
  391. background: #0d1639;
  392. white-space: nowrap;
  393. text-align: left;
  394. overflow: hidden;
  395. display: flex;
  396. background: #0d1639;
  397. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  398. border-radius: 0px 0px 0px 0px;
  399. border-bottom: 1px solid;
  400. box-sizing: border-box;
  401. border-image: linear-gradient(28deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0)) 1 1;
  402. .ve_title {
  403. }
  404. .ve_logo_img {
  405. padding-left: 30px;
  406. padding-right: 30px;
  407. display: inline-block;
  408. box-sizing: border-box;
  409. vertical-align: middle;
  410. padding: 15px;
  411. }
  412. .ve_logo_title {
  413. width: 160px;
  414. white-space: nowrap;
  415. overflow: hidden;
  416. text-overflow: ellipsis;
  417. display: inline-block;
  418. margin: 0;
  419. vertical-align: middle;
  420. color: #68adff;
  421. font-size: 20px;
  422. }
  423. .el-menu-demo {
  424. width: 60% !important;
  425. height: 70px;
  426. border: none !important;
  427. background: rgba(12, 97, 197, 0);
  428. .el-menu-item {
  429. position: relative;
  430. width: 97px;
  431. font-family: Microsoft YaHei UI, Microsoft YaHei UI;
  432. font-weight: bold;
  433. font-size: 13px;
  434. color: #68adff;
  435. line-height: 15px;
  436. text-align: center;
  437. font-style: normal;
  438. text-transform: none;
  439. width: 110px;
  440. height: 70px;
  441. border-radius: 0px 0px 0px 0px;
  442. border: none;
  443. }
  444. .is-active {
  445. width: 110px;
  446. height: 70px;
  447. background: radial-gradient(ellipse at 54px 0px, #3aa0ff -37%, #123066 53%);
  448. border-radius: 0px 0px 0px 0px;
  449. border: 1px solid;
  450. border-left: 1px solid rgba(16, 92, 240, 1);
  451. border-right: 1px solid rgba(18, 48, 102, 1);
  452. border-image: linear-gradient(347deg, rgba(16, 92, 240, 1), rgba(18, 48, 102, 1)) 1
  453. 1;
  454. &:after {
  455. width: 24px;
  456. height: 1px;
  457. background-color: #fff;
  458. -webkit-transition: all ease-out 0.2s;
  459. transition: all ease-out 0.2s;
  460. content: "";
  461. position: absolute;
  462. left: 50%;
  463. bottom: 15px;
  464. webkit-transform: translate(-50%, 0%);
  465. -moz-transform: translate(-50%, 0%);
  466. transform: translate(-50%, 0%);
  467. }
  468. }
  469. }
  470. .ve_right {
  471. // width: 350px;
  472. height: 70px;
  473. overflow: hidden;
  474. position: absolute;
  475. right: 0;
  476. display: flex;
  477. .ve_time {
  478. width: 190px;
  479. height: 55px;
  480. padding-top: 15px;
  481. height: 70px;
  482. overflow: hidden;
  483. border-radius: 0px 0px 0px 0px;
  484. border-left: 2px solid rgba(12, 97, 197, 0.2);
  485. border-right: 2px solid rgba(12, 97, 197, 0.2);
  486. box-sizing: border-box;
  487. padding: 15px 5px;
  488. // border-image: linear-gradient(347deg, rgba(31, 107, 255, 1), rgba(164, 195, 255, 1)) 1 1;
  489. span {
  490. display: block;
  491. font-family: Microsoft YaHei UI, Microsoft YaHei UI;
  492. color: #ffffff;
  493. text-align: center;
  494. font-style: normal;
  495. text-transform: none;
  496. }
  497. .l_huoqing {
  498. font-size: 13px;
  499. line-height: 15px;
  500. font-weight: bold;
  501. line-height: 2;
  502. white-space: nowrap;
  503. overflow: hidden;
  504. text-overflow: ellipsis;
  505. }
  506. .l_time {
  507. font-size: 12px;
  508. line-height: 14px;
  509. font-weight: 400;
  510. }
  511. }
  512. .ve_timeioc {
  513. width: 150px;
  514. height: 70px;
  515. // border-radius: 0px 0px 0px 0px;
  516. // border: 1px solid;
  517. // border-image: linear-gradient(347deg, rgba(16, 92, 240, 1), rgba(164, 195, 255, 1)) 1 1;
  518. font-family: Microsoft YaHei UI, Microsoft YaHei UI;
  519. font-weight: bold;
  520. font-size: 13px;
  521. color: #68adff;
  522. line-height: 15px;
  523. text-align: center;
  524. font-style: normal;
  525. text-transform: none;
  526. display: flex;
  527. justify-content: center;
  528. align-items: center;
  529. span {
  530. padding-left: 15px;
  531. }
  532. }
  533. }
  534. }
  535. </style>
  536. <style>
  537. .vtkmodel1{
  538. position: absolute;
  539. z-index: 100;
  540. width: 100%;
  541. height: 100vh;
  542. }
  543. body {
  544. width: 100%;
  545. height: 100vh;
  546. background: #161a2a;
  547. /* background:#b2bac7; */
  548. }
  549. button:focus,
  550. button:focus-visible {
  551. outline: none;
  552. }
  553. .l_Dialog {
  554. position: relative;
  555. }
  556. .main-conyeny{
  557. position: absolute;
  558. z-index: 206;
  559. top: 70px;
  560. }
  561. .L_aside {
  562. margin-top: 10px;
  563. overflow: hidden;
  564. }
  565. </style>