1
0

dialog-modal.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. <template>
  2. <div class="dialogModal" id="detailModal">
  3. <div class="modal-top">
  4. <span class="pointer-events-auto" @click="redictTo">
  5. <i>
  6. <SvgIcon class="icon" size="14" name="inner-kd" />
  7. </i>
  8. <span class="modal-title"> {{ title }}</span>
  9. </span>
  10. <span class="close" @click="getClose">✕</span>
  11. </div>
  12. <div class="modal-card">
  13. <div class="card-box" v-for="(item, index) in modalCard" :key="index">
  14. <div class="card-pic">
  15. <img :src="item.imgSrc" alt="" />
  16. </div>
  17. <div class="card-content">
  18. <div class="content-label">{{ item.label }}</div>
  19. <div class="content-value">{{ item.value }}</div>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="modal-card1">
  24. <div class="left-modal">
  25. <div class="value-m">{{ valueM }}</div>
  26. <div class="label-m">{{ labelM }}</div>
  27. </div>
  28. <div class="right-modal">
  29. <div class="modal-zl" v-for="(item, index) in zlList" :key="index">
  30. <div class="left-zl">
  31. <div class="label-left">
  32. <span class="pic"></span>
  33. <span>{{ item.label }}</span>
  34. </div>
  35. <div class="value-left">
  36. <span class="text">{{ item.value }}</span>
  37. <span>Pa</span>
  38. </div>
  39. </div>
  40. <div class="right-zl">
  41. <span class="text"> {{ item.percent }}</span>
  42. <span>%</span>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="modal-card2">
  48. <div class="modal-wind" v-for="(item, index) in windLfList" :key="index">
  49. <span class="text">{{ item.label }}</span>
  50. <span class="num">{{ item.value }}</span>
  51. <span class="dw">%</span>
  52. </div>
  53. </div>
  54. <!-- <div class="modal-card3">
  55. <div class="warn-left">
  56. <div class="vent-l">
  57. <span class="warn-label">{{ vent.value }}</span>
  58. <span class="warn-value">{{ vent.label }}</span>
  59. </div>
  60. <div class="gas-l">
  61. <span class="warn-label">{{ gas.value }}</span>
  62. <span class="warn-value">{{ gas.label }}</span>
  63. </div>
  64. </div>
  65. <div class="warn-c">
  66. <div class="warn-icon"></div>
  67. </div>
  68. <div class="warn-right">
  69. <div class="fire-r">
  70. <span class="warn-value">{{ fire.label }}</span>
  71. <span class="warn-label">{{ fire.value }}</span>
  72. </div>
  73. <div class="dust-r">
  74. <span class="warn-value">{{ dust.label }}</span>
  75. <span class="warn-label">{{ dust.value }}</span>
  76. </div>
  77. </div>
  78. </div> -->
  79. </div>
  80. </template>
  81. <script lang="ts" setup>
  82. import { ref, reactive, defineProps, watch } from 'vue';
  83. import { SvgIcon } from '/@/components/Icon';
  84. import { useAutoLogin } from '/@/hooks/vent/useAutoLogin';
  85. import { getAssetURL } from '/@/utils/ui';
  86. // const globalConfig = inject('globalConfig');
  87. let props = defineProps({
  88. centerDetail: {
  89. type: Object,
  90. default: () => {
  91. return {};
  92. },
  93. },
  94. title: {
  95. type: String,
  96. default: '布尔台矿',
  97. },
  98. });
  99. const { open } = useAutoLogin();
  100. // let modalTitle = ref('布尔台矿');
  101. // let modalTitle = ref('yjl');
  102. let modalCard = reactive([
  103. { imgSrc: getAssetURL('company/home/hang.png'), label: '巷道长度', value: 0 },
  104. { imgSrc: getAssetURL('company/home/people.png'), label: '人员总数', value: 0 },
  105. { imgSrc: getAssetURL('company/home/car.png'), label: '车辆总数', value: 0 },
  106. ]);
  107. let valueM = ref(0);
  108. let labelM = ref('');
  109. let zlList = reactive([
  110. { label: '关键阻力——进风', value: 0, percent: '0' },
  111. { label: '关键阻力——用风', value: 0, percent: '0' },
  112. { label: '关键阻力——回风', value: 0, percent: '0' },
  113. ]);
  114. let windLfList = reactive([
  115. { label: '有效风量率', value: '0' },
  116. { label: '矿井漏风率', value: '0' },
  117. ]);
  118. // let vent = reactive({
  119. // label: '通风风险性',
  120. // value: '低风险',
  121. // });
  122. // let gas = reactive({
  123. // label: '瓦斯风险性',
  124. // value: '低风险',
  125. // });
  126. // let fire = reactive({
  127. // label: '火灾风险性',
  128. // value: '低风险',
  129. // });
  130. // let dust = reactive({
  131. // label: '粉尘风险性',
  132. // value: '低风险',
  133. // });
  134. // let vent = reactive({
  135. // // label: '总进风',
  136. // label: '总阻力',
  137. // value: 0,
  138. // });
  139. // let gas = reactive({
  140. // label: '总风量',
  141. // value: 0,
  142. // });
  143. // let fire = reactive({
  144. // label: '等积孔',
  145. // value: 0,
  146. // });
  147. // let dust = reactive({
  148. // label: '粉尘风险性',
  149. // value: '低风险',
  150. // });
  151. // 选取各项数据是引用的索引,有些矿井存在多个关键阻力路线等,需要轮播
  152. const pickIndex = ref(0);
  153. const emit = defineEmits(['closeDialog']);
  154. function getClose() {
  155. emit('closeDialog', false);
  156. }
  157. // 根据新的数据更新依赖数据,核心方法
  158. function update(newC) {
  159. if (JSON.stringify(newC) != '{}') {
  160. modalCard[0]['value'] = newC.sys_data.totallength || 0;
  161. modalCard[1]['value'] = newC.sys_data.personCount || 0;
  162. modalCard[2]['value'] = newC.sys_data.vehicleCount || 0;
  163. // 根据目前轮播索引确定要展示的数据index
  164. const majorIndex = pickIndex.value % newC.majorpath_data.length;
  165. labelM.value = newC.majorpath_data[majorIndex].deviceName;
  166. valueM.value = newC.majorpath_data[majorIndex].majorpath.drag_total;
  167. zlList[0]['value'] = newC.majorpath_data[majorIndex].majorpath.drag_1;
  168. zlList[1]['value'] = newC.majorpath_data[majorIndex].majorpath.drag_2;
  169. zlList[2]['value'] = newC.majorpath_data[majorIndex].majorpath.drag_3;
  170. zlList[0]['percent'] = ((zlList[0]['value'] / valueM.value) * 100).toFixed(2);
  171. zlList[1]['percent'] = ((zlList[1]['value'] / valueM.value) * 100).toFixed(2);
  172. zlList[2]['percent'] = ((zlList[2]['value'] / valueM.value) * 100).toFixed(2);
  173. windLfList[0].value = newC.sys_data.useM3Perent || '0';
  174. const base = parseFloat(newC.sys_data.zongfengliang);
  175. windLfList[1].value = (((base - parseFloat(newC.sys_data.zongjinfeng)) / base) * 100).toFixed(2);
  176. // vent.value = newC.majorpath_data[majorIndex].majorpath.drag_total;
  177. // gas.value = newC.majorpath_data[majorIndex].majorpath.m3_total;
  178. // fire.value = Math.round(((1.19 * gas.value) / 60 / Math.sqrt(vent.value)) * 100) / 100;
  179. }
  180. }
  181. watch(
  182. () => props.centerDetail,
  183. (newC) => {
  184. // 轮播 index + 1,这样 update 取值是可以根据该 index 取值,对 1000 取余是为了处理 Infinity 后无法轮播的情况(虽然不可能出现)
  185. pickIndex.value = (pickIndex.value + 1) % 1000;
  186. update(newC);
  187. },
  188. {
  189. immediate: true,
  190. deep: true,
  191. }
  192. );
  193. // 重新向到新的页面,业务上讲是公司端跳转矿端
  194. function redictTo() {
  195. if (!props.centerDetail.ip) return;
  196. const url = `http://${props.centerDetail.ip}:8092/login`;
  197. open(url, '/micro-vent-3dModal/dashboard/analysis');
  198. }
  199. </script>
  200. <style lang="less" scoped>
  201. @font-face {
  202. font-family: 'douyuFont';
  203. src: url('/@/assets/font/douyuFont.otf');
  204. }
  205. .dialogModal {
  206. position: relative;
  207. width: 568px;
  208. height: 340px;
  209. background: url('/@/assets/images/company/area-card2.png') no-repeat;
  210. background-size: 100% 100%;
  211. pointer-events: none;
  212. z-index: 1000;
  213. .modal-top {
  214. position: absolute;
  215. left: 32px;
  216. top: 15px;
  217. height: 30px;
  218. line-height: 30px;
  219. width: 90%;
  220. .icon {
  221. cursor: pointer;
  222. }
  223. .modal-title {
  224. font-size: 14px;
  225. font-family: 'douyuFont';
  226. color: #fff;
  227. margin-left: 10px;
  228. }
  229. .close {
  230. position: absolute;
  231. right: 12px;
  232. color: #2cb6ff;
  233. cursor: pointer;
  234. pointer-events: auto;
  235. }
  236. }
  237. .modal-card {
  238. position: absolute;
  239. top: 45px;
  240. left: 50%;
  241. transform: translate(-50%, 0);
  242. height: 46px;
  243. width: 90%;
  244. margin-top: 15px;
  245. display: flex;
  246. justify-content: space-between;
  247. background: url('../../../../../assets/images/company/modal-card.png') no-repeat center;
  248. background-size: 100% 100%;
  249. .card-box {
  250. display: flex;
  251. flex: 1;
  252. height: 100%;
  253. justify-content: center;
  254. align-items: center;
  255. &:first-child {
  256. margin-left: 15px;
  257. }
  258. &:last-child {
  259. margin-right: 10px;
  260. }
  261. .card-pic {
  262. margin-right: 10px;
  263. }
  264. .card-content {
  265. display: flex;
  266. flex-direction: column;
  267. justify-content: space-between;
  268. .content-label {
  269. font-size: 14px;
  270. color: #ccd6df;
  271. }
  272. .content-value {
  273. font-family: 'douyuFont';
  274. font-size: 14px;
  275. color: #fff;
  276. text-align: center;
  277. }
  278. }
  279. }
  280. }
  281. .modal-card1 {
  282. position: absolute;
  283. top: 121px;
  284. left: 50%;
  285. transform: translate(-50%, 0);
  286. height: 116px;
  287. width: 90%;
  288. padding: 0px 10px;
  289. box-sizing: border-box;
  290. display: flex;
  291. justify-content: space-between;
  292. align-items: center;
  293. background: url('../../../../../assets/images/company/area3.png') no-repeat center;
  294. background-size: 100% 100%;
  295. .left-modal {
  296. position: relative;
  297. width: 95px;
  298. height: 95px;
  299. background: url('../../../../../assets/images/company/zfx.png') no-repeat center;
  300. background-size: 100% 100%;
  301. .value-m {
  302. position: absolute;
  303. top: 50%;
  304. left: 50%;
  305. transform: translate(-50%, -50%);
  306. font-family: 'douyuFont';
  307. font-size: 14px;
  308. color: #3df6ff;
  309. }
  310. .label-m {
  311. position: absolute;
  312. bottom: 2px;
  313. width: 100%;
  314. font-size: 10px;
  315. text-align: center;
  316. color: #fff;
  317. }
  318. }
  319. .right-modal {
  320. width: calc(100% - 105px);
  321. height: 95px;
  322. margin-left: 10px;
  323. display: flex;
  324. flex-direction: column;
  325. justify-content: space-around;
  326. .modal-zl {
  327. height: 24px;
  328. display: flex;
  329. justify-content: space-between;
  330. .left-zl {
  331. display: flex;
  332. justify-content: space-between;
  333. align-items: center;
  334. width: calc(80% - 10px);
  335. padding: 0px 10px;
  336. margin-right: 10px;
  337. box-sizing: border-box;
  338. background-color: rgba(6, 57, 97, 0.3);
  339. .label-left {
  340. .pic {
  341. display: inline-block;
  342. width: 6px;
  343. height: 6px;
  344. border-radius: 50%;
  345. margin-right: 5px;
  346. }
  347. span {
  348. color: #ccd6df;
  349. font-size: 14px;
  350. }
  351. }
  352. .value-left {
  353. .text {
  354. font-family: 'douyuFont';
  355. font-size: 14px;
  356. margin-right: 5px;
  357. }
  358. span {
  359. font-size: 12px;
  360. color: #ccd6df;
  361. }
  362. }
  363. }
  364. &:nth-child(1) .left-zl .pic {
  365. background-color: #51cfff;
  366. }
  367. &:nth-child(2) .left-zl .pic {
  368. background-color: #ffb85b;
  369. }
  370. &:nth-child(3) .left-zl .pic {
  371. background-color: #a091ff;
  372. }
  373. &:nth-child(1) .left-zl .text {
  374. color: #51cfff;
  375. }
  376. &:nth-child(2) .left-zl .text {
  377. color: #ffb85b;
  378. }
  379. &:nth-child(3) .left-zl .text {
  380. color: #a091ff;
  381. }
  382. .right-zl {
  383. width: 20%;
  384. display: flex;
  385. justify-content: center;
  386. align-items: center;
  387. background-color: rgba(6, 57, 97, 0.3);
  388. .text {
  389. font-family: 'douyuFont';
  390. font-size: 14px;
  391. }
  392. span {
  393. margin-left: 5px;
  394. }
  395. }
  396. &:nth-child(1) .right-zl {
  397. color: #51cfff;
  398. }
  399. &:nth-child(2) .right-zl {
  400. color: #ffb85b;
  401. }
  402. &:nth-child(3) .right-zl {
  403. color: #a091ff;
  404. }
  405. }
  406. }
  407. }
  408. .modal-card2 {
  409. position: absolute;
  410. top: 240px;
  411. left: 50%;
  412. transform: translate(-50%, 0);
  413. height: 60px;
  414. width: 90%;
  415. margin: 10px 0;
  416. padding: 0 10px;
  417. display: flex;
  418. justify-content: space-between;
  419. align-items: center;
  420. box-sizing: border-box;
  421. background: url('../../../../../assets/images/company/area3.png') no-repeat center;
  422. background-size: 100% 100%;
  423. .modal-wind {
  424. position: relative;
  425. width: 50%;
  426. height: 34px;
  427. .text {
  428. position: absolute;
  429. top: 50%;
  430. left: 40px;
  431. transform: translate(0, -50%);
  432. color: #fff;
  433. font-size: 14px;
  434. }
  435. .num {
  436. position: absolute;
  437. top: 50%;
  438. right: 45px;
  439. transform: translate(0, -50%);
  440. color: #fff;
  441. font-family: 'douyuFont';
  442. font-size: 14px;
  443. }
  444. .dw {
  445. position: absolute;
  446. top: 50%;
  447. right: 12px;
  448. transform: translate(0, -50%);
  449. color: #fff;
  450. }
  451. &:nth-child(1) {
  452. background: url('../../../../../assets/images/company/green.png') no-repeat center;
  453. background-size: 100% 100%;
  454. }
  455. &:nth-child(2) {
  456. background: url('../../../../../assets/images/company/purple.png') no-repeat center;
  457. background-size: 100% 100%;
  458. }
  459. &:nth-child(1) .num {
  460. color: #31fbcc;
  461. }
  462. &:nth-child(2) .num {
  463. color: #97a3fa;
  464. }
  465. }
  466. }
  467. .modal-card3 {
  468. position: absolute;
  469. top: 302px;
  470. left: 50%;
  471. transform: translate(-50%, 0);
  472. height: 110px;
  473. width: 90%;
  474. padding: 0px 10px;
  475. box-sizing: border-box;
  476. display: flex;
  477. justify-content: space-between;
  478. align-items: center;
  479. background: url('../../../../../assets/images/company/area3.png') no-repeat center;
  480. background-size: 100% 100%;
  481. .warn-left {
  482. position: relative;
  483. width: 206px;
  484. height: 85px;
  485. background: url('../../../../../assets/images/company/warn-left.png') no-repeat center;
  486. .vent-l {
  487. position: absolute;
  488. top: 10px;
  489. left: 0;
  490. width: 80%;
  491. display: flex;
  492. justify-content: space-around;
  493. }
  494. .gas-l {
  495. position: absolute;
  496. top: 52px;
  497. left: 0;
  498. width: 80%;
  499. display: flex;
  500. justify-content: space-around;
  501. }
  502. }
  503. .warn-c {
  504. position: relative;
  505. width: 90px;
  506. height: 92px;
  507. background: url('../../../../../assets/images/company/warn-center.png') no-repeat center;
  508. .warn-icon {
  509. position: absolute;
  510. left: 50%;
  511. top: 50%;
  512. transform: translate(-50%, -85%);
  513. width: 50px;
  514. height: 50px;
  515. background: url('../../../../../assets/images/company/icon1.png') no-repeat center;
  516. }
  517. }
  518. .warn-right {
  519. position: relative;
  520. width: 206px;
  521. height: 85px;
  522. background: url('../../../../../assets/images/company/warn-right.png') no-repeat center;
  523. .fire-r {
  524. position: absolute;
  525. top: 10px;
  526. right: 0;
  527. width: 80%;
  528. display: flex;
  529. justify-content: space-around;
  530. }
  531. .dust-r {
  532. position: absolute;
  533. top: 52px;
  534. right: 0;
  535. width: 80%;
  536. display: flex;
  537. justify-content: space-around;
  538. }
  539. }
  540. .warn-label {
  541. font-family: 'douyuFont';
  542. font-size: 14px;
  543. color: #31fbcc;
  544. line-height: 27px;
  545. }
  546. .warn-value {
  547. color: #fff;
  548. font-size: 14px;
  549. }
  550. }
  551. }
  552. </style>