index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <template>
  2. <div style="position: relative; width: 100%; height: 100%;">
  3. <div class="home-container" v-if="pageType == 'home'">
  4. <div class="header">
  5. <div class="head-time">
  6. <span>2022/03/28</span>
  7. <span>星期一</span>
  8. <span>13:46:37</span>
  9. </div>
  10. <div class="main-title">通防智能管控系统</div>
  11. </div>
  12. <div class="home-contents">
  13. <div class="left-content">
  14. <!-- 局部通风机 -->
  15. <div class="monitor-box">
  16. <fanMonitor @goDetail="goDetail" :fandata="fanLocalList" />
  17. </div>
  18. <!-- 主通风机 -->
  19. <div class="monitor-box monitor-box1">
  20. <mainMonitor @goDetail="goDetail"/>
  21. </div>
  22. <!-- 通风设备远程控制 -->
  23. <div class="monitor-box">
  24. <windDevice @goDetail="goDetail"/>
  25. </div>
  26. </div>
  27. <div class="center-content">
  28. <!-- 三维模型 -->
  29. <div class="three-box">
  30. <div class="three-nav">
  31. <div class="nav-item" v-for="(item, index) in navList" :key="index">
  32. <div class="item-label">{{ item.name }}</div>
  33. <div class="item-value">
  34. <div v-if="item.isShow" class="bg-box" v-for="(ite, ind) in item.valList" :key="ind">
  35. <div class="box-line"></div>
  36. <div class="value-text">{{ ite.val }}</div>
  37. </div>
  38. <div v-else class="value-text1">{{ item.val }}</div>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="three-modal" id="modalBox">
  43. <!-- <iframe id="iframe" ref="iframe" src="http://10.10.150.72:8091/user/autologin" scrolling="auto" frameborder="0" width="100%" height="100%"></iframe> -->
  44. </div>
  45. </div>
  46. <!-- 风量监测 -->
  47. <div class="wind-box">
  48. <windMonitor @goDetail="goDetail"/>
  49. </div>
  50. </div>
  51. <div class="right-content">
  52. <!-- 关键通风路线 -->
  53. <div class="monitor-box">
  54. <windLine @goDetail="goDetail"/>
  55. </div>
  56. <!-- 工作面智能管控 -->
  57. <div class="monitor-box monitor-box1">
  58. <workMonitor @goDetail="goDetail"/>
  59. </div>
  60. <!-- 设备预警 -->
  61. <div class="monitor-box">
  62. <deviceWarn @goDetail="goDetail"/>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <DeviceMonitor v-else-if="pageType" :pageType="pageType" @goHome="goHome"/>
  68. <div id="content" style="width: 100%; height: 100%; position: fixed;"></div>
  69. </div>
  70. </template>
  71. <script lang="ts" setup>
  72. import { reactive, onMounted, ref, nextTick } from 'vue';
  73. import fanMonitor from './components/fan-monitor.vue';
  74. import mainMonitor from './components/main-monitor.vue';
  75. import windDevice from './components/wind-device.vue';
  76. import windMonitor from './components/wind-monitor.vue';
  77. import windLine from './components/wind-line.vue';
  78. import workMonitor from './components/work-monitor.vue';
  79. import deviceWarn from './components/device-warn.vue';
  80. import { useGlobSetting } from '/@/hooks/setting';
  81. import { list } from './clique.api';
  82. import DeviceMonitor from '../../monitorManager/deviceMonitor/index.vue'
  83. let timer: NodeJS.Timeout | null = null;
  84. let fanLocalList = reactive<any[]>([]); //局部风机数据
  85. let navList = reactive([
  86. { name: '总风量(m³/min)', isShow: true, valList: [{ val: '2' }, { val: '1' }, { val: '3' }, { val: '3' }, { val: '0' }] },
  87. { name: '总阻力(Pa)', isShow: true, valList: [{ val: '0' }, { val: '2' }, { val: '4' }, { val: '6' }, { val: '3' }] },
  88. { name: '等积孔(m²)', isShow: true, valList: [{ val: '1' }, { val: '0' }, { val: '.' }, { val: '5' }, { val: '4' }] },
  89. { name: '外部漏风率', isShow: false, val: '6%' },
  90. { name: '有效风量率', isShow: false, val: '91.5%' },
  91. ]);
  92. const loading = ref(false);
  93. const globSetting = useGlobSetting();
  94. const openQianKun = globSetting.openQianKun;
  95. let actions;
  96. const pageType = ref('home')
  97. function goDetail(deviceType) {
  98. pageType.value = deviceType
  99. changeModalBox()
  100. }
  101. function goHome() {
  102. pageType.value = 'home'
  103. nextTick(() => {
  104. changeModalBox()
  105. })
  106. }
  107. function changeModalBox() {
  108. if (pageType.value === 'home') {
  109. const dom = document.getElementById('modalBox') as HTMLElement
  110. if (dom && dom.parentElement) {
  111. const contentDom = document.getElementById('content') as HTMLElement
  112. contentDom?.setAttribute('style', `top: ${dom.parentElement.offsetTop + 20}px; left: ${dom.parentElement.offsetLeft + 20}px; width: ${dom.offsetWidth - 40}px; height: ${dom.offsetHeight - 40}px; position: fixed;`)
  113. }
  114. } else {
  115. const dom = document.getElementById('modalBox') as HTMLElement
  116. if (dom && dom.parentElement) {
  117. const contentDom = document.getElementById('content') as HTMLElement
  118. contentDom?.setAttribute('style', `top:0px; left: 0px; width: 100%; height: 100%; position: fixed;`)
  119. }
  120. }
  121. }
  122. function getList() {
  123. list({}).then((res) => {
  124. console.log(res, 'res-----------');
  125. fanLocalList.length = 0
  126. fanLocalList.push(res.fanlocal)
  127. console.log(fanLocalList, '---------');
  128. });
  129. }
  130. onMounted(() => {
  131. changeModalBox()
  132. const renderModal = () => {
  133. const element = document.getElementById('__qiankun_microapp_wrapper_for_micro_vent_3_d_modal__')
  134. if(element){
  135. element?.setAttribute('style', 'width: 100%; height: 100%');
  136. }else{
  137. setTimeout(() => {
  138. renderModal()
  139. }, 2000)
  140. }
  141. }
  142. renderModal()
  143. timer = Number(
  144. setInterval(() => {
  145. getList();
  146. }, 3000)
  147. );
  148. })
  149. </script>
  150. <style lang="less" scoped>
  151. @font-face {
  152. font-family: 'douyuFont';
  153. src: url('../../../../assets/font/douyuFont.otf');
  154. }
  155. @font-face {
  156. font-family: 'yjsz';
  157. src: url('../../../../assets/font/yjsz.TTF');
  158. }
  159. .home-container {
  160. width: 100%;
  161. height: 100%;
  162. position: relative;
  163. .header {
  164. width: 100%;
  165. height: 76px;
  166. position: relative;
  167. background: url('../../../../assets//images//home-container/header-nav.png') no-repeat;
  168. .head-time {
  169. position: absolute;
  170. top: 14px;
  171. left: 15px;
  172. color: #b5c9e9;
  173. font-size: 14px;
  174. span {
  175. margin-right: 20px;
  176. letter-spacing: 2px;
  177. }
  178. }
  179. .main-title {
  180. position: absolute;
  181. left: 50%;
  182. top: 50%;
  183. transform: translate(-50%, -50%);
  184. color: #fff;
  185. font-size: 24px;
  186. font-family: 'douyuFont';
  187. }
  188. }
  189. .home-contents {
  190. display: flex;
  191. justify-content: space-between;
  192. height: calc(100% - 76px);
  193. padding: 10px;
  194. box-sizing: border-box;
  195. .left-content {
  196. display: flex;
  197. flex-direction: column;
  198. flex: 1;
  199. justify-content: space-between;
  200. height: 100%;
  201. .monitor-box {
  202. display: flex;
  203. flex: 1;
  204. width: 100%;
  205. background: url('../../../../assets/images/home-container/dialog.png') no-repeat;
  206. background-size: 100% 100%;
  207. }
  208. .monitor-box1 {
  209. margin: 15px 0px;
  210. }
  211. }
  212. .center-content {
  213. display: flex;
  214. flex-direction: column;
  215. justify-content: space-between;
  216. flex: 2;
  217. height: 100%;
  218. margin: 0px 10px;
  219. .three-box {
  220. position: relative;
  221. display: flex;
  222. background-color: #fff;
  223. flex: 2;
  224. width: 100%;
  225. margin-bottom: 15px;
  226. background: url('../../../../assets/images/home-container/three-dialog.png') no-repeat;
  227. background-size: 100% 100%;
  228. .three-nav {
  229. position: absolute;
  230. left: 50%;
  231. top: 38px;
  232. transform: translate(-50%, 0);
  233. width: 812px;
  234. height: 89px;
  235. padding: 0px 20px;
  236. box-sizing: border-box;
  237. display: flex;
  238. justify-content: space-around;
  239. align-items: center;
  240. background: url('../../../../assets/images/home-container/three-nav.png') no-repeat;
  241. .nav-item {
  242. display: flex;
  243. flex: 1;
  244. flex-direction: column;
  245. justify-content: space-around;
  246. align-items: center;
  247. height: 80%;
  248. .item-label {
  249. color: #98f5ff;
  250. }
  251. .item-value {
  252. position: relative;
  253. width: 125px;
  254. height: 37px;
  255. padding: 0px 5px;
  256. box-sizing: border-box;
  257. display: flex;
  258. justify-content: space-between;
  259. align-items: center;
  260. background: url('../../../../assets/images/home-container/item-value.png') no-repeat;
  261. .bg-box {
  262. position: relative;
  263. width: 20px;
  264. height: 26px;
  265. border-bottom: 2px solid #063493;
  266. background: linear-gradient(to right, rgba(1, 194, 249), rgba(0, 125, 252));
  267. .box-line {
  268. position: absolute;
  269. left: 0;
  270. top: 50%;
  271. transform: translate(0, -50%);
  272. height: 1px;
  273. width: 100%;
  274. background-color: rgba(6, 52, 147, 0.6);
  275. }
  276. .value-text {
  277. position: absolute;
  278. left: 50%;
  279. top: 50%;
  280. transform: translate(-50%, -50%);
  281. color: #fff;
  282. font-size: 22px;
  283. font-family: 'yjsz';
  284. font-weight: 500;
  285. }
  286. }
  287. .value-text1 {
  288. width: 100%;
  289. text-align: center;
  290. color: #fff;
  291. font-size: 22px;
  292. font-family: 'yjsz';
  293. font-weight: 500;
  294. }
  295. }
  296. }
  297. }
  298. .three-modal {
  299. width: 100%;
  300. height: 100%;
  301. padding: 20px 17px 20px 15px;
  302. box-sizing: border-box;
  303. }
  304. }
  305. .wind-box {
  306. display: flex;
  307. flex: 1;
  308. width: 100%;
  309. background: url('../../../../assets/images/home-container/dialog1.png') no-repeat;
  310. background-size: 100% 100%;
  311. }
  312. }
  313. .right-content {
  314. display: flex;
  315. flex-direction: column;
  316. justify-content: space-between;
  317. flex: 1;
  318. height: 100%;
  319. .monitor-box {
  320. display: flex;
  321. flex: 1;
  322. width: 100%;
  323. background: url('../../../../assets/images/home-container/dialog.png') no-repeat;
  324. background-size: 100% 100%;
  325. }
  326. .monitor-box1 {
  327. margin: 15px 0px;
  328. }
  329. }
  330. }
  331. }
  332. // #__qiankun_microapp_wrapper_for_micro_vent_3_d_modal__{
  333. // width: 100% !important;
  334. // height: 100% !important;
  335. // }
  336. </style>