index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <div class="company-home">
  3. <div class="top-bg">
  4. <div class="main-title">{{ mainTitle }}</div>
  5. </div>
  6. <div class="company-content">
  7. <div class="area-content">
  8. <div class="left-area">
  9. <!-- 矿井通风状态监测 -->
  10. <div class="area-card">
  11. <mineWind />
  12. </div>
  13. <!-- 一通三防风险分析与预警 -->
  14. <div class="area-card1">
  15. <riskWarn />
  16. </div>
  17. </div>
  18. <div class="center-area">
  19. <!-- 地图底图 -->
  20. <div class="center-bg">
  21. <div class="bg-map">
  22. <iconLight @show-detail="showDetail" />
  23. </div>
  24. </div>
  25. <!-- 榆家梁矿 -->
  26. <!-- <div class="area-card2">
  27. </div> -->
  28. <!-- 文件共享中心 -->
  29. <div class="area-card3">
  30. <fileShare />
  31. </div>
  32. </div>
  33. <div class="right-area">
  34. <!-- 关键场景通防综合监测 -->
  35. <div class="area-card">
  36. <sceneKey />
  37. </div>
  38. <!-- 通风巷道长度统计 -->
  39. <div class="area-card1">
  40. <windRoad />
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="area-card2" v-show="isShowDialog">
  46. <dialogModal ref="dialogModalRef" @close-dialog="closeDialog" />
  47. </div>
  48. </div>
  49. </template>
  50. <script lang="ts" setup>
  51. import { ref, nextTick,onMounted,onUnmounted } from 'vue';
  52. import mineWind from './components/mine-wind.vue';
  53. import riskWarn from './components/risk-warn.vue';
  54. import fileShare from './components/file-share.vue';
  55. import windRoad from './components/wind-road.vue';
  56. import sceneKey from './components/scene-key.vue';
  57. import iconLight from './components/icon-light.vue';
  58. import dialogModal from './components/dialog-modal.vue';
  59. import {getHomeData} from './clique.api'
  60. const dialogModalRef = ref();
  61. // let mainTitle = ref('国家能源神东煤炭集团');
  62. let mainTitle = ref('XXXX集团');
  63. const isShowDialog = ref(false);
  64. // https获取监测数据
  65. let timer: null | NodeJS.Timeout = null;
  66. function getMonitor() {
  67. timer = setTimeout(
  68. async () => {
  69. await getHomeDataList();
  70. if (timer) {
  71. timer = null;
  72. }
  73. getMonitor();
  74. },
  75. 5000
  76. );
  77. }
  78. //获取公司端首页数据
  79. async function getHomeDataList(){
  80. let res=await getHomeData()
  81. console.log(res,'公司端首页数据----------')
  82. }
  83. function showDetail(code, leftV, topV) {
  84. if (code) {
  85. isShowDialog.value = true;
  86. }
  87. nextTick(() => {
  88. const tooltipDom = document.getElementById('detailModal') as HTMLElement;
  89. tooltipDom.style.left = leftV;
  90. tooltipDom.style.top = topV;
  91. });
  92. }
  93. function closeDialog() {
  94. isShowDialog.value = false;
  95. }
  96. onMounted(()=>{
  97. getMonitor()
  98. })
  99. onUnmounted(() => {
  100. if (timer) {
  101. clearTimeout(timer);
  102. timer = null;
  103. }
  104. });
  105. </script>
  106. <style lang="less" scoped>
  107. @font-face {
  108. font-family: 'douyuFont';
  109. src: url('../../../../assets/font/douyuFont.otf');
  110. }
  111. // @font-face {
  112. // font-family: 'yjsz';
  113. // src: url('../../../../assets/font/yjsz.TTF');
  114. // }
  115. .company-home {
  116. width: 100%;
  117. height: 100%;
  118. position: relative;
  119. background: url('../../../../assets/images/company/home-pageBg.png') no-repeat center;
  120. background-size: 100% 100%;
  121. .top-bg {
  122. width: 100%;
  123. height: 97px;
  124. background: url('../../../../assets/images/company/top-bg.png') no-repeat center;
  125. position: absolute;
  126. z-index: 1;
  127. .main-title {
  128. height: 96px;
  129. color: #fff;
  130. font-family: 'douyuFont';
  131. font-size: 20px;
  132. letter-spacing: 2px;
  133. display: flex;
  134. justify-content: center;
  135. align-items: center;
  136. }
  137. }
  138. .company-content {
  139. position: absolute;
  140. left: 0;
  141. top: 0;
  142. width: 100%;
  143. height: 100%;
  144. background: url('../../../../assets/images/company/content-bg.png') no-repeat;
  145. background-size: 100% 100%;
  146. .area-content {
  147. position: absolute;
  148. top: 45px;
  149. width: 100%;
  150. height: calc(100% - 45px);
  151. padding: 0px 20px 20px 20px;
  152. box-sizing: border-box;
  153. display: flex;
  154. justify-content: space-between;
  155. .left-area {
  156. width: 23%;
  157. height: 100%;
  158. margin-right: 15px;
  159. display: flex;
  160. flex-direction: column;
  161. justify-content: space-between;
  162. align-items: center;
  163. .area-card {
  164. width: 100%;
  165. height: calc(60% - 15px);
  166. margin-bottom: 15px;
  167. background: url('../../../../assets/images/company/area-card.png') no-repeat;
  168. background-size: 100% 100%;
  169. }
  170. .area-card1 {
  171. width: 100%;
  172. height: 40%;
  173. background: url('../../../../assets/images/company/area-card1.png') no-repeat;
  174. background-size: 100% 100%;
  175. }
  176. }
  177. .center-area {
  178. width: calc(54% - 30px);
  179. height: 100%;
  180. position: relative;
  181. .center-bg {
  182. position: absolute;
  183. bottom: 269px;
  184. left: 50%;
  185. transform: translate(-50%, 0);
  186. height: calc(100% - 325px);
  187. width: 100%;
  188. background: url('../../../../assets/images/company/home-dz.png') no-repeat center;
  189. background-position: 50% 90%;
  190. .bg-map {
  191. width: 100%;
  192. height: 100%;
  193. background: url('../../../../assets/images/company/home-map.png') no-repeat center;
  194. background-size: 100% 100%;
  195. }
  196. }
  197. .area-card2 {
  198. position: absolute;
  199. right: 0;
  200. top: 62px;
  201. width: 568px;
  202. height: 437px;
  203. background: url('../../../../assets/images/company/area-card2.png') no-repeat;
  204. background-size: 100% 100%;
  205. // pointer-events: auto;
  206. }
  207. .area-card3 {
  208. position: absolute;
  209. right: 0;
  210. bottom: 0px;
  211. width: 100%;
  212. height: 269px;
  213. background: url('../../../../assets/images/company/area-card3.png') no-repeat;
  214. background-size: 100% 100%;
  215. }
  216. }
  217. .right-area {
  218. width: 23%;
  219. height: 100%;
  220. margin-left: 15px;
  221. display: flex;
  222. flex-direction: column;
  223. justify-content: space-between;
  224. align-items: center;
  225. // pointer-events: auto;
  226. .area-card {
  227. width: 100%;
  228. height: calc(60% - 15px);
  229. margin-bottom: 15px;
  230. background: url('../../../../assets/images/company/area-card.png') no-repeat;
  231. background-size: 100% 100%;
  232. }
  233. .area-card1 {
  234. width: 100%;
  235. height: 40%;
  236. background: url('../../../../assets/images/company/area-card1.png') no-repeat;
  237. background-size: 100% 100%;
  238. }
  239. }
  240. }
  241. }
  242. }
  243. </style>