index.vue 10 KB

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