appmian.vue 16 KB

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