index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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 :airKjStatus="airKjStatus" />
  12. </div>
  13. <!-- 一通三防风险分析与预警 -->
  14. <div class="area-card1">
  15. <riskWarn :earlyWarn="earlyWarn" />
  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 :shareData="shareData" />
  31. </div>
  32. </div>
  33. <div class="right-area">
  34. <!-- 关键场景通防综合监测 -->
  35. <div class="area-card">
  36. <sceneKey :compositeData="compositeData" />
  37. </div>
  38. <!-- 通风巷道长度统计 -->
  39. <div class="area-card1">
  40. <windRoad :roadData="roadData" />
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="area-card2" v-show="isShowDialog">
  46. <dialogModal ref="dialogModalRef" @close-dialog="closeDialog" :title="dialogTitle" :centerDetail="centerDetail" />
  47. </div>
  48. </div>
  49. </template>
  50. <script lang="ts" setup>
  51. import { ref, reactive, 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, getList } from './clique.api';
  60. const dialogModalRef = ref();
  61. let mainTitle = ref('国家能源神东煤炭集团');
  62. // let mainTitle = ref('XXXX集团');
  63. const isShowDialog = ref(false);
  64. const dialogTitle = ref('');
  65. //矿井通风状态数据
  66. let airKjStatus = reactive<any[]>([]);
  67. //风险分析与预警数据
  68. let earlyWarn = ref<any[]>([]);
  69. //通防综合监测数据
  70. let compositeData = ref<any[]>([]);
  71. //地图区域详情数据
  72. let centerDetail = ref({});
  73. //文件共享中心数据
  74. let shareData = reactive<any[]>([]);
  75. //通风巷道长度统计数据
  76. let roadData = reactive({
  77. totallength: 0,
  78. data: [],
  79. data1: [],
  80. });
  81. // https获取监测数据
  82. let timer: null | NodeJS.Timeout = null;
  83. function getMonitor() {
  84. timer = setTimeout(async () => {
  85. await getHomeDataList();
  86. await getLists();
  87. if (timer) {
  88. timer = null;
  89. }
  90. getMonitor();
  91. }, 5000);
  92. }
  93. //获取公司端首页数据
  94. async function getHomeDataList() {
  95. let res = await getHomeData();
  96. console.log(res, '公司端首页数据----------');
  97. if (res && res.length > 0) {
  98. earlyWarn.value = res;
  99. roadData.totallength = res[0] && res[0].sys_data ? res[0].sys_data.totallength : 0;
  100. roadData.data.length = 0;
  101. roadData.data1.length = 0;
  102. airKjStatus.length = 0;
  103. res.forEach((el) => {
  104. airKjStatus.push({
  105. deviceName: el.sys_data.deviceName,
  106. jf: el.sys_data.zongjinfeng,
  107. xf: el.sys_data.xufengliang,
  108. hf: el.sys_data.zonghuifeng,
  109. });
  110. roadData.data.push(el.sys_data.totallength);
  111. roadData.data1.push(el.sys_data.deviceName);
  112. });
  113. compositeData.value = res[0].majorpath_data;
  114. centerDetail.value = res[0];
  115. }
  116. }
  117. //获取文件共享中心数据
  118. async function getLists() {
  119. let res = await getList();
  120. if (res.length != 0) {
  121. shareData.length = 0;
  122. res.forEach((el) => {
  123. shareData.push({ title: el.sysOrgName, value: el.tolalNum, value1: el.approveNum });
  124. });
  125. }
  126. }
  127. function showDetail(code, label, leftV, topV) {
  128. if (code) {
  129. dialogTitle.value = label;
  130. isShowDialog.value = true;
  131. }
  132. nextTick(() => {
  133. const tooltipDom = document.getElementById('detailModal') as HTMLElement;
  134. tooltipDom.style.left = leftV;
  135. tooltipDom.style.top = topV;
  136. });
  137. }
  138. function closeDialog() {
  139. isShowDialog.value = false;
  140. }
  141. onMounted(() => {
  142. getHomeDataList();
  143. getLists();
  144. getMonitor();
  145. });
  146. onUnmounted(() => {
  147. if (timer) {
  148. clearTimeout(timer);
  149. timer = null;
  150. }
  151. });
  152. </script>
  153. <style lang="less" scoped>
  154. @font-face {
  155. font-family: 'douyuFont';
  156. src: url('../../../../assets/font/douyuFont.otf');
  157. }
  158. // @font-face {
  159. // font-family: 'yjsz';
  160. // src: url('../../../../assets/font/yjsz.TTF');
  161. // }
  162. .company-home {
  163. width: 100%;
  164. height: 100%;
  165. position: relative;
  166. background: url('../../../../assets/images/company/home-pageBg.png') no-repeat center;
  167. background-size: 100% 100%;
  168. .top-bg {
  169. width: 100%;
  170. height: 97px;
  171. background: url('../../../../assets/images/company/top-bg.png') no-repeat center;
  172. position: absolute;
  173. z-index: 1;
  174. .main-title {
  175. height: 96px;
  176. color: #fff;
  177. font-family: 'douyuFont';
  178. font-size: 20px;
  179. letter-spacing: 2px;
  180. display: flex;
  181. justify-content: center;
  182. align-items: center;
  183. }
  184. }
  185. .company-content {
  186. position: absolute;
  187. left: 0;
  188. top: 0;
  189. width: 100%;
  190. height: 100%;
  191. background: url('../../../../assets/images/company/content-bg.png') no-repeat;
  192. background-size: 100% 100%;
  193. .area-content {
  194. position: absolute;
  195. top: 45px;
  196. width: 100%;
  197. height: calc(100% - 45px);
  198. padding: 0px 20px 20px 20px;
  199. box-sizing: border-box;
  200. display: flex;
  201. justify-content: space-between;
  202. .left-area {
  203. width: 23%;
  204. height: 100%;
  205. margin-right: 15px;
  206. display: flex;
  207. flex-direction: column;
  208. justify-content: space-between;
  209. align-items: center;
  210. .area-card {
  211. width: 100%;
  212. height: calc(60% - 15px);
  213. margin-bottom: 15px;
  214. background: url('../../../../assets/images/company/area-card.png') no-repeat;
  215. background-size: 100% 100%;
  216. }
  217. .area-card1 {
  218. width: 100%;
  219. height: 40%;
  220. background: url('../../../../assets/images/company/area-card1.png') no-repeat;
  221. background-size: 100% 100%;
  222. }
  223. }
  224. .center-area {
  225. width: calc(54% - 30px);
  226. height: 100%;
  227. position: relative;
  228. .center-bg {
  229. position: absolute;
  230. bottom: 269px;
  231. left: 50%;
  232. transform: translate(-50%, 0);
  233. height: calc(100% - 325px);
  234. width: 100%;
  235. background: url('../../../../assets/images/company/home-dz.png') no-repeat center;
  236. background-position: 50% 90%;
  237. .bg-map {
  238. width: 100%;
  239. height: 100%;
  240. background: url('../../../../assets/images/company/home-map.png') no-repeat center;
  241. background-size: 100% 100%;
  242. }
  243. }
  244. .area-card2 {
  245. position: absolute;
  246. right: 0;
  247. top: 62px;
  248. width: 568px;
  249. height: 437px;
  250. background: url('../../../../assets/images/company/area-card2.png') no-repeat;
  251. background-size: 100% 100%;
  252. // pointer-events: auto;
  253. }
  254. .area-card3 {
  255. position: absolute;
  256. right: 0;
  257. bottom: 0px;
  258. width: 100%;
  259. height: 269px;
  260. background: url('../../../../assets/images/company/area-card3.png') no-repeat;
  261. background-size: 100% 100%;
  262. }
  263. }
  264. .right-area {
  265. width: 23%;
  266. height: 100%;
  267. margin-left: 15px;
  268. display: flex;
  269. flex-direction: column;
  270. justify-content: space-between;
  271. align-items: center;
  272. // pointer-events: auto;
  273. .area-card {
  274. width: 100%;
  275. height: calc(60% - 15px);
  276. margin-bottom: 15px;
  277. background: url('../../../../assets/images/company/area-card.png') no-repeat;
  278. background-size: 100% 100%;
  279. }
  280. .area-card1 {
  281. width: 100%;
  282. height: 40%;
  283. background: url('../../../../assets/images/company/area-card1.png') no-repeat;
  284. background-size: 100% 100%;
  285. }
  286. }
  287. }
  288. }
  289. }
  290. </style>