LeafPage.vue 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238
  1. <template>
  2. <div class="dashboard-container">
  3. <!-- 内容区域 -->
  4. <div class="content-area">
  5. <!-- 顶部信息卡片 -->
  6. <div class="top-info">
  7. <div class="info-card">
  8. <div class="card-title">
  9. <div class="info-details">
  10. <div class="label">{{ basicInfo.mineName }}</div>
  11. <!-- <div class="value">西川煤矿分公司</div> -->
  12. <div class="tag" :style="{ backgroundColor: getAlarmColor(basicInfo.alarmLevel), color: '#fff' }">{{
  13. getRiskText(basicInfo.alarmLevel)
  14. }}</div>
  15. </div>
  16. <div>
  17. <a-button class="btn" @click="handleGoToPageQuery('/warningAnalysis/connectAnalysis')">数据看板</a-button>
  18. </div>
  19. <div class="info-border">
  20. <div class="info-border-icon"></div>
  21. <div class="info-border-line"></div>
  22. <div class="info-border-icon"></div>
  23. </div>
  24. </div>
  25. <div class="card-details">
  26. <div v-for="item in basicInfoColumns" :key="item.key" class="info-card-item">
  27. <div class="card-label">{{ item.label }}</div>
  28. <div class="card-value-wrapper">
  29. <span
  30. v-if="['accessStatus', 'status', 'gasLevelName', 'alarmLevel', 'gjMineStatus'].includes(item.key)"
  31. class="status-dot"
  32. :style="{ backgroundColor: getBasicInfoColor(item.key), boxShadow: `0 0 10px ${getBasicInfoColor(item.key)}` }"
  33. ></span>
  34. <span class="card-value-text" :style="{ color: getBasicInfoColor(item.key) }">
  35. {{ getBasicInfoValue(item.key) }}
  36. </span>
  37. </div>
  38. <div class="card-border">
  39. <div class="card-border-icon"></div>
  40. <div class="card-border-line"></div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. <!-- 预警统计 -->
  47. <div class="warning-statistics">
  48. <div class="statistics-header">
  49. <div class="title">预警统计</div>
  50. <div class="btn-group">
  51. <!-- <button class="btn">预警级别</button> -->
  52. </div>
  53. </div>
  54. <div class="statistics-content">
  55. <div class="stat-item high-risk">
  56. <div class="icon">
  57. <div class="icon-top"></div>
  58. <div class="icon-bottom"></div>
  59. </div>
  60. <div class="text">高风险<span class="text-sub">(需立即处理)</span></div>
  61. <div class="count">{{ alarmStatistics.alarm4 }}</div>
  62. </div>
  63. <div class="stat-item medium-risk">
  64. <div class="icon">
  65. <div class="icon-top"></div>
  66. <div class="icon-bottom"></div>
  67. </div>
  68. <div class="text">较高风险<span class="text-sub">(需立即处理)</span></div>
  69. <div class="count">{{ alarmStatistics.alarm3 }}</div>
  70. </div>
  71. <div class="stat-item normal-risk">
  72. <div class="icon">
  73. <div class="icon-top"></div>
  74. <div class="icon-bottom"></div>
  75. </div>
  76. <div class="text">一般风险<span class="text-sub">(需立即处理)</span></div>
  77. <div class="count">{{ alarmStatistics.alarm2 }}</div>
  78. </div>
  79. <div class="stat-item low-risk">
  80. <div class="icon">
  81. <div class="icon-top"></div>
  82. <div class="icon-bottom"></div>
  83. </div>
  84. <div class="text">低风险<span class="text-sub">(需立即处理)</span></div>
  85. <div class="count">{{ alarmStatistics.alarm1 }}</div>
  86. </div>
  87. </div>
  88. </div>
  89. <!-- 预警数据详情 -->
  90. <div class="warning-details">
  91. <div class="details-header">
  92. <div class="title">预警数据详情</div>
  93. <div class="btn-group">
  94. <button class="btn" @click="collapseAll">收起所有分组</button>
  95. <button class="btn" @click="expandAll">展开详情</button>
  96. </div>
  97. </div>
  98. <div class="details-content">
  99. <!-- 第一个预警项 -->
  100. <div v-for="(item, index) in goafMonitorData" :key="index" class="warning-item">
  101. <div class="item-header">
  102. <div class="header-left">
  103. <div class="icon"></div>
  104. <div class="name">老空区密闭名称: {{ item.devicePos }}</div>
  105. <div class="risk-level" :style="{ backgroundColor: getAlarmColor(item.alarmLevel), color: '#fff' }">
  106. {{ getRiskText(item.alarmLevel) }}
  107. </div>
  108. </div>
  109. <a-button class="expand-btn" @click="toggleExpand(index)">
  110. {{ isExpanded(index) ? '收起' : '展开' }}
  111. <div class="arrow-icon-wrapper">
  112. <div class="arrow-icon" :class="{ rotate: isExpanded(index) }"></div>
  113. </div>
  114. </a-button>
  115. </div>
  116. <div class="item-body">
  117. <div class="data-row">
  118. <div v-for="(col, colIndex) in dataColumns" :key="colIndex" class="data-col">
  119. <div class="col-title">{{ col.label }}</div>
  120. <div class="col-value" :style="{ color: getColValueColor(col, item) }">
  121. <span
  122. v-if="col.type !== 'text'"
  123. class="status-dot"
  124. :style="{
  125. backgroundColor: getColValueColor(col, item),
  126. boxShadow: `0 0 10px ${getColValueColor(col, item)}`,
  127. }"
  128. ></span>
  129. {{ getColDisplayText(col, item) }}
  130. </div>
  131. <div class="col-icon"></div>
  132. </div>
  133. </div>
  134. </div>
  135. <div class="monitoring-indicators" v-show="isExpanded(index)">
  136. <div class="indicator-group">
  137. <div class="group-title">
  138. <div class="title-icon-top"></div>
  139. <div class="title-icon-bottom"></div>
  140. <div class="title-content">
  141. 密闭墙内<br />
  142. 监测指标
  143. </div>
  144. </div>
  145. <div class="indicator-area">
  146. <div v-for="(ind, indIndex) in indicatorColumns" :key="'inner-' + indIndex" class="indicator-item">
  147. <div class="label">{{ ind.label }}:</div>
  148. <!-- 墙内数据直接取 item[key],例如 item.coVal -->
  149. <div class="value" :title="getDataValue(item, ind.key)">{{ getDataValue(item, ind.key) }} {{ ind.unit }}</div>
  150. </div>
  151. </div>
  152. </div>
  153. <div class="indicator-group">
  154. <div class="group-title">
  155. <div class="title-icon-top icon-outer"></div>
  156. <div class="title-icon-bottom"></div>
  157. <div class="title-content">
  158. 密闭墙外<br />
  159. 监测指标
  160. </div>
  161. </div>
  162. <div class="indicator-area">
  163. <div v-for="(ind, indIndex) in indicatorColumns" :key="'outer-' + indIndex" class="indicator-item">
  164. <div class="label">{{ ind.label }}:</div>
  165. <!-- 墙外数据+ Out item[key],例如 item.coValOut -->
  166. <div class="value" :title="getDataValue(item, ind.key + 'Out')">{{ getDataValue(item, ind.key + 'Out') }} {{ ind.unit }}</div>
  167. </div>
  168. </div>
  169. </div>
  170. <div class="indicator-group">
  171. <div class="group-title">
  172. <div class="title-icon-top icon-result"></div>
  173. <div class="title-icon-bottom"></div>
  174. <div class="title-content"> 预警结果 </div>
  175. </div>
  176. <div class="indicator-area indicator-result">
  177. <div v-for="(res, resIndex) in resultColumns" :key="'result-' + resIndex" class="indicator-item">
  178. <div class="label">{{ res.label }}:</div>
  179. <div v-if="res.key == 'alarmLevel'" :title="getRiskText(item.alarmLevel)" class="value">{{ getRiskText(item.alarmLevel) }}</div>
  180. <div v-else class="value" :title="getDataValue(item, res.key)">{{ getDataValue(item, res.key) }}</div>
  181. </div>
  182. <!-- 需要占位符以保持网格对齐,保留一个空的 placeholder -->
  183. <div class="indicator-item placeholder-item"></div>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. </div>
  190. <!-- 异常超限报警 -->
  191. <div class="abnormal-alarm">
  192. <div class="alarm-header">
  193. <div class="title">异常超限报警</div>
  194. <div class="btn-group">
  195. <!-- <button class="btn">收起图表</button> -->
  196. </div>
  197. </div>
  198. <div class="alarm-content">
  199. <div v-for="(alarm, index) in alarmColumns" :key="index" class="alarm-item">
  200. <div class="alarm-name">{{ alarm.label }}</div>
  201. <div class="alarm-count">{{ mineAlarmData[alarm.key] ?? '-' }}</div>
  202. <div class="alarm-border">
  203. <div class="alarm-border-icon"></div>
  204. <div class="alarm-border-line"></div>
  205. </div>
  206. <div class="alarm-border-bottom"></div>
  207. </div>
  208. </div>
  209. </div>
  210. <!-- 历史数据折线图 -->
  211. <div class="historical-data">
  212. <div class="chart-header">
  213. <div class="title">历史数据分析图表</div>
  214. <div class="btn-group">
  215. <button class="btn" @click="toggleChartVisibility">
  216. {{ isChartVisible ? '收起图表' : '展开图表' }}
  217. </button>
  218. </div>
  219. </div>
  220. <div class="chart-content" v-show="isChartVisible">
  221. <ConnectAnalysis ref="connectAnalysisRef" />
  222. </div>
  223. </div>
  224. </div>
  225. </div>
  226. </template>
  227. <script setup lang="ts">
  228. import { useRouter, useRoute } from 'vue-router';
  229. import { useAppStore } from '/@/store/modules/app';
  230. import { computed, ref, watch, onMounted, nextTick } from 'vue';
  231. import { useMineDepartmentStore } from '/@/store/modules/mine';
  232. import { getGoafAlarmNum, getGoafData, getMineData, getProvinceAlarm } from '../overhaul.api';
  233. import { StatusColorEnum } from '/@/enums/jeecgEnum';
  234. import ConnectAnalysis from '/@/views/analysis/warningAnalysis/connectAnalysis/index.vue';
  235. const appStore = useAppStore();
  236. const mineStore = useMineDepartmentStore();
  237. // 路由实例
  238. const router = useRouter();
  239. const route = useRoute();
  240. // 1. 定义数据类型接口
  241. interface GoafMonitorItem {
  242. devicePos?: string;
  243. [key: string]: any; // 允许其他动态属性
  244. }
  245. /**
  246. * 风险等级映射配置
  247. */
  248. const RISK_LEVEL_MAP: Record<string, { text: string; color: string }> = {
  249. '4': { text: '高风险', color: StatusColorEnum.red },
  250. '3': { text: '较高风险', color: StatusColorEnum.gold },
  251. '2': { text: '一般风险', color: StatusColorEnum.yellow },
  252. '1': { text: '低风险', color: StatusColorEnum.blue },
  253. '0': { text: '无风险', color: '#333' }, // 假设 0 为无风险或默认
  254. };
  255. // 顶部的基础信息部分
  256. const basicInfoColumns = [
  257. { label: '组织机构', key: 'parentArea' },
  258. { label: '瓦斯等级', key: 'gasLevelName' },
  259. { label: '煤层自燃倾向性', key: 'coalSeamLevel' },
  260. { label: '生产状态', key: 'gjMineStatus' },
  261. { label: '预警结果', key: 'alarmLevel' },
  262. { label: '预警时间', key: 'createTime' },
  263. { label: '持续时间', key: 'chixuTime' },
  264. { label: '接入状态', key: 'accessStatus' },
  265. { label: '数据联网状态', key: 'status' },
  266. { label: '设备数量', key: 'accessGoafNum' },
  267. ];
  268. // 1. 预警数据详情 - 顶部指标列配置
  269. const dataColumns = [
  270. { label: '密闭墙内自燃发火隐患', key: 'fireAlarm.alarmName', colorKey: 'fireAlarm.alarmLevel', type: 'alarm' },
  271. { label: '密闭墙外自燃发火隐患', key: 'fireAlarmOut.alarmName', colorKey: 'fireAlarmOut.alarmLevel', type: 'alarm' },
  272. { label: '爆炸三角', key: 'explosionAlarm.alarmName', colorKey: 'explosionAlarm.alarmLevel', type: 'alarm' },
  273. { label: '压差预警', key: 'sourcePressureAlarm.alarmName', colorKey: 'sourcePressureAlarm.alarmLevel', type: 'alarm' },
  274. { label: '漏风状态判定', key: 'leakageAlarm.alarmName', colorKey: 'leakageAlarm.alarmLevel', type: 'alarm' },
  275. { label: '设备状态', key: 'linkStatus', type: 'status' },
  276. { label: '检查时间', key: 'readTime', type: 'text' },
  277. ];
  278. // 2. 监测指标通用配置 (用于墙内和墙外)
  279. const indicatorColumns = [
  280. { label: 'CO', key: 'coVal', unit: 'ppm' },
  281. { label: 'CO2', key: 'co2Val', unit: '%' },
  282. { label: 'CH4', key: 'ch4Val', unit: '%' },
  283. { label: 'O2', key: 'o2Val', unit: '%' },
  284. { label: 'C2H2', key: 'c2h2Val', unit: 'ppm' },
  285. { label: 'C2H4', key: 'c2h4Val', unit: 'ppm' },
  286. { label: '温度', key: 'temperature', unit: '°C' },
  287. ];
  288. // 3. 预警结果配置
  289. const resultColumns = [
  290. { label: '数据来源', key: 'readTime', value: '最近2天' }, // 静态数据可以直接写死在配置里,或者从 item 取
  291. { label: '预警结果', key: 'alarmLevel', value: '异常' }, // 这里假设是静态展示,如果是动态可改为 key: 'resultStatus'
  292. ];
  293. // 4. 异常超限报警配置
  294. const alarmColumns = [
  295. { label: '甲烷超限', key: 'ch4Val' },
  296. { label: '氧气超限', key: 'o2Val' },
  297. { label: '一氧化碳超限', key: 'coVal' },
  298. { label: '二氧化碳超限', key: 'co2Val' },
  299. { label: '乙烯超限', key: 'c2h4Val' },
  300. { label: '乙炔超限', key: 'c2h2Val' },
  301. { label: '压差超限', key: 'sourcePressure' },
  302. { label: '温度超限', key: 'temperature' },
  303. ];
  304. const basicInfo = ref<any>({}); //煤矿基础信息数据
  305. const alarmStatistics = ref<any>({}); //预警统计数据
  306. const goafMonitorData = ref<GoafMonitorItem[]>([]); //密闭监测详情数据
  307. const mineAlarmData = ref<any>({}); // 煤矿预警数据
  308. const connectAnalysisRef = ref<any>(null); // 连接分析组件实例
  309. const isChartVisible = ref(true); // 控制图表显示/隐藏的状态
  310. // 1. 用于存储展开状态的索引集合 (key: index, value: boolean)
  311. const expandedIndices = ref<Record<number, boolean>>({});
  312. // 2. 切换展开/收起状态的方法
  313. const toggleExpand = (index: number) => {
  314. expandedIndices.value[index] = !expandedIndices.value[index];
  315. };
  316. // 3. 判断是否展开
  317. const isExpanded = (index: number) => {
  318. return !!expandedIndices.value[index];
  319. };
  320. // 4. 展开所有详情
  321. const expandAll = () => {
  322. goafMonitorData.value.forEach((_, index) => {
  323. expandedIndices.value[index] = true;
  324. });
  325. };
  326. // 5. 收起所有分组
  327. const collapseAll = () => {
  328. // 清空对象即可,或者遍历设为 false
  329. expandedIndices.value = {};
  330. };
  331. // 切换图表显示状态
  332. const toggleChartVisibility = () => {
  333. isChartVisible.value = !isChartVisible.value;
  334. };
  335. /**
  336. * 获取设备状态信息 (文本和颜色)
  337. * @param status 0: 断开, 1: 正常
  338. */
  339. const getlinkStatusInfo = (status?: number | string) => {
  340. if (status === 1 || status === '1') {
  341. return { text: '正常', color: '#52c41a' }; // 绿色
  342. }
  343. return { text: '断开', color: '#ff4d4f' }; // 红色
  344. };
  345. /**
  346. * 获取列显示的文本
  347. */
  348. const getColDisplayText = (col: any, item: any) => {
  349. const rawValue = getDataValue(item, col.key);
  350. if (col.type === 'status') {
  351. return getlinkStatusInfo(rawValue).text;
  352. }
  353. // 默认直接返回原始值或经过 getDataValue 处理后的值
  354. return rawValue;
  355. };
  356. /**
  357. * 获取列显示的颜色
  358. */
  359. const getColValueColor = (col: any, item: any) => {
  360. // 如果是报警类型,使用原有的报警颜色逻辑
  361. if (col.type === 'alarm' && col.colorKey) {
  362. return getAlarmColor(getDataValue(item, col.colorKey));
  363. }
  364. // 如果是设备状态类型,使用状态颜色逻辑
  365. if (col.type === 'status') {
  366. return getlinkStatusInfo(getDataValue(item, col.key)).color;
  367. }
  368. // 默认黑色
  369. return '#333';
  370. };
  371. /**
  372. * 获取风险等级对应的文本
  373. * @param level 报警级别 '1', '2', '3', '4'
  374. */
  375. const getRiskText = (level?: string | number) => {
  376. if (!level && level !== 0) return '-';
  377. return RISK_LEVEL_MAP[String(level)]?.text || '未知';
  378. };
  379. /**
  380. * 根据点分字符串路径获取对象值 (例如: 'fireAlarm.alarmName')
  381. * @param item 数据对象
  382. * @param path 路径字符串
  383. * @param defaultValue 默认值
  384. */
  385. const getDataValue = (item: any, path: string, defaultValue: string = '-') => {
  386. if (!item || !path) return defaultValue;
  387. const val = path.split('.').reduce((acc, part) => acc && acc[part], item);
  388. return val ?? defaultValue;
  389. };
  390. /**
  391. * 获取报警颜色
  392. * @param level 报警级别 '1', '2', '3', '4'
  393. */
  394. const getAlarmColor = (level?: string | number) => {
  395. if (!level && level !== 0) return '#333'; // 默认颜色
  396. return RISK_LEVEL_MAP[String(level)]?.color;
  397. };
  398. /**
  399. * 获取基础信息的显示内容(包含文本和颜色)
  400. */
  401. const getBasicInfoDisplay = (key: string) => {
  402. const value = basicInfo.value[key];
  403. // 默认返回黑色文本
  404. const defaultResult = { text: value ?? '-', color: '#333' };
  405. if (key === 'accessStatus') {
  406. // 1: 已接入 (绿色), 其他: 未接入 (红色)
  407. return value === 1 ? { text: '已接入', color: '#52c41a' } : { text: '未接入', color: StatusColorEnum.red };
  408. }
  409. if (key === 'status') {
  410. // 1: 在线 (绿色), 其他: 离线 (红色)
  411. return value === 1 ? { text: '在线', color: '#52c41a' } : { text: '离线', color: StatusColorEnum.red };
  412. }
  413. if (key === 'alarmLevel') {
  414. // 根据风险等级获取颜色
  415. const levelStr = String(value);
  416. const riskInfo = RISK_LEVEL_MAP[levelStr];
  417. if (riskInfo) {
  418. return { text: riskInfo.text, color: riskInfo.color };
  419. }
  420. return { text: '未知', color: '#333' };
  421. }
  422. if (key === 'gasLevelName') {
  423. // 瓦斯等级特殊处理
  424. const val = String(value);
  425. if (val.includes('低瓦斯')) {
  426. return { text: val, color: StatusColorEnum.blue }; // 蓝色
  427. } else if (val.includes('高瓦斯')) {
  428. return { text: val, color: StatusColorEnum.gold }; // 橙色/金色
  429. } else if (val.includes('突出')) {
  430. return { text: val, color: StatusColorEnum.red }; // 红色
  431. }
  432. return { text: val, color: '#333' };
  433. }
  434. if (key === 'gjMineStatus') {
  435. // 生产状态特殊处理
  436. const val = String(value);
  437. if (val.includes('正常生产')) {
  438. return { text: val, color: '#52c41a' }; // 绿色
  439. } else if (val.includes('拟建')) {
  440. return { text: val, color: StatusColorEnum.blue }; // 蓝色
  441. } else {
  442. // 其余状态均显示绿色
  443. return { text: val, color: StatusColorEnum.red };
  444. }
  445. }
  446. return defaultResult;
  447. };
  448. /**
  449. * 获取基础信息值的文本(兼容旧逻辑,如果只需要文本)
  450. */
  451. const getBasicInfoValue = (key: string) => {
  452. return getBasicInfoDisplay(key).text;
  453. };
  454. /**
  455. * 获取基础信息值的颜色
  456. */
  457. const getBasicInfoColor = (key: string) => {
  458. return getBasicInfoDisplay(key).color;
  459. };
  460. /**
  461. * 通用页面跳转方法
  462. * @param record 当前行数据
  463. * @param path 目标路径
  464. */
  465. function handleGoToPageQuery(path: string) {
  466. router
  467. .push({
  468. path,
  469. })
  470. .catch((err) => {
  471. console.error('跳转失败:', err);
  472. });
  473. }
  474. async function fetchLeafData() {
  475. try {
  476. // 异步获取所有接口数据(并行请求提升性能)
  477. const [goafAlarmNum, goafData, mineData, alarmData] = await Promise.all([
  478. getGoafAlarmNum(appStore.simpleMapParams), // 预警统计
  479. getGoafData(appStore.simpleMapParams), // 密闭监测数据
  480. getMineData(appStore.simpleMapParams), // 煤矿基础信息数据
  481. getProvinceAlarm(appStore.simpleMapParams), // 预警信息列表
  482. ]);
  483. alarmStatistics.value = goafAlarmNum[0];
  484. goafMonitorData.value = goafData.records;
  485. basicInfo.value = mineData.records[0];
  486. mineAlarmData.value = alarmData.records[0];
  487. nextTick(() => {
  488. if (connectAnalysisRef.value && typeof connectAnalysisRef.value.generateChart === 'function') {
  489. connectAnalysisRef.value.generateChart();
  490. }
  491. });
  492. } catch (error) {
  493. console.error('数据获取/配置更新失败:', error);
  494. }
  495. }
  496. onMounted(() => {
  497. fetchLeafData();
  498. console.log('当前页面的参数:', mineStore.getRoot);
  499. });
  500. // 页面逻辑代码
  501. </script>
  502. <style scoped>
  503. .dashboard-container {
  504. display: flex;
  505. flex-direction: column;
  506. height: 100%;
  507. overflow: scroll;
  508. }
  509. .content-area {
  510. flex: 1;
  511. padding: 20px;
  512. background-color: #f0f8ff;
  513. }
  514. .top-info {
  515. width: 100%;
  516. height: 200px;
  517. margin-bottom: 20px;
  518. }
  519. .info-card {
  520. width: 100%;
  521. height: 100%;
  522. display: flex;
  523. flex-direction: row;
  524. background-image: url('/@/assets/images/overHaul/leafPage/info-card-bg.png');
  525. background-repeat: no-repeat;
  526. background-size: 100%;
  527. border-radius: 8px;
  528. padding: 20px;
  529. }
  530. .card-title {
  531. width: 20%;
  532. position: relative;
  533. display: flex;
  534. flex-direction: column;
  535. justify-content: space-between;
  536. padding: 8px 10px 8px 50px;
  537. .btn {
  538. color: #fff;
  539. background-color: #2b6ff0;
  540. &:hover {
  541. background-color: #397af3;
  542. }
  543. }
  544. }
  545. .info-border {
  546. position: absolute;
  547. top: 20px;
  548. left: 20px;
  549. .info-border-icon {
  550. width: 16px;
  551. height: 16px;
  552. background-image: url('/@/assets/images/overHaul/leafPage/info-card-icon1.svg');
  553. background-repeat: no-repeat;
  554. background-size: 100%;
  555. }
  556. .info-border-line {
  557. width: 1px;
  558. height: 95px;
  559. border-left: 2px dotted #397af3;
  560. margin-left: 7px;
  561. }
  562. }
  563. .info-details {
  564. display: flex;
  565. flex-direction: column;
  566. justify-content: space-between;
  567. padding: 8px 0;
  568. .label {
  569. font-size: 16px;
  570. color: #000;
  571. }
  572. .value {
  573. font-size: 16px;
  574. color: #000;
  575. }
  576. .tag {
  577. width: fit-content;
  578. height: 24px;
  579. padding: 2px 8px;
  580. border-radius: 15px;
  581. font-size: 12px;
  582. background-color: #ff6b6b;
  583. color: white;
  584. }
  585. }
  586. .card-details {
  587. width: 80%;
  588. display: grid;
  589. grid-template-columns: repeat(5, 1fr);
  590. gap: 8px;
  591. }
  592. .info-card-item {
  593. max-width: 245px;
  594. height: 70px;
  595. position: relative;
  596. padding: 8px 10px 8px 40px;;
  597. background-color: #f1f7ff;
  598. border-radius: 4px;
  599. text-align: left;
  600. }
  601. .card-border {
  602. width: 20px;
  603. height: 50px;
  604. position: absolute;
  605. top: 14px;
  606. left: 15px;
  607. .card-border-icon{
  608. width: 16px;
  609. height: 16px;
  610. background-image: url('/@/assets/images/overHaul/leafPage/info-card-icon.svg');
  611. background-repeat: no-repeat;
  612. background-size: 100%;
  613. }
  614. .card-border-line{
  615. width: 1px;
  616. height: 30px;
  617. border-left: 2px dotted #397af3;
  618. margin-left: 7px;
  619. }
  620. }
  621. .card-label {
  622. font-size: 16px;
  623. color: #000;
  624. font-weight: bold;
  625. margin-bottom: 8px;
  626. }
  627. .card-value-wrapper {
  628. display: flex;
  629. align-items: center;
  630. gap: 6px;
  631. }
  632. .status-dot {
  633. width: 8px;
  634. height: 8px;
  635. border-radius: 50%;
  636. display: inline-block;
  637. flex-shrink: 0;
  638. }
  639. .card-value-text {
  640. font-size: 14px;
  641. color: #333;
  642. font-weight: bold;
  643. }
  644. .warning-statistics {
  645. background-color: #ffffff;
  646. margin-bottom: 20px;
  647. padding: 10px 12px;
  648. border-radius: 4px;
  649. }
  650. .statistics-header {
  651. display: flex;
  652. justify-content: space-between;
  653. align-items: center;
  654. margin-bottom: 10px;
  655. }
  656. .title {
  657. font-size: 16px;
  658. font-weight: bold;
  659. color: #333;
  660. }
  661. .btn-group {
  662. display: flex;
  663. gap: 8px;
  664. }
  665. .btn {
  666. color: #2b6ff0;
  667. padding: 6px 12px;
  668. border: 1px solid #2b6ff0;
  669. border-radius: 4px;
  670. background-color: #E9F0FE;
  671. cursor: pointer;
  672. font-size: 12px;
  673. }
  674. .btn:hover {
  675. background-color: #f5f5f5;
  676. }
  677. .statistics-content {
  678. display: flex;
  679. gap: 50px;
  680. }
  681. .stat-item {
  682. flex: 1;
  683. padding: 16px 50px 10px 90px;
  684. text-align: left;
  685. position: relative;
  686. overflow: hidden;
  687. background-image: url('/@/assets/images/overHaul/leafPage/high-risk-bg.png');
  688. background-repeat: no-repeat;
  689. background-size: 100%;
  690. .icon {
  691. position: absolute;
  692. top: 15px;
  693. left: 20px;
  694. }
  695. .text {
  696. font-size: 16px;
  697. color: #000;
  698. font-weight: bold;
  699. .text-sub {
  700. font-size: 12px;
  701. color: #989587;
  702. }
  703. }
  704. .count {
  705. font-size: 24px;
  706. font-weight: bold;
  707. }
  708. .icon-top{
  709. width: 40px;
  710. height: 40px;
  711. background-image: url('/@/assets/images/overHaul/leafPage/high-risk-icon1.svg');
  712. background-repeat: no-repeat;
  713. background-size: 100%;;
  714. }
  715. .icon-bottom{
  716. width: 40px;
  717. height: 20px;
  718. background-image: url('/@/assets/images/overHaul/leafPage/high-risk-icon2.png');
  719. background-repeat: no-repeat;
  720. background-size: 100%;
  721. margin-top: -5px;
  722. }
  723. }
  724. .stat-item.high-risk {
  725. background-image: url('/@/assets/images/overHaul/leafPage/high-risk-bg.png');
  726. .icon-top {
  727. background-image: url('/@/assets/images/overHaul/leafPage/high-risk-icon1.svg');
  728. }
  729. .icon-bottom {
  730. background-image: url('/@/assets/images/overHaul/leafPage/high-risk-icon2.png');
  731. }
  732. .count {
  733. color: #FF0000;
  734. }
  735. }
  736. .stat-item.medium-risk {
  737. background-image: url('/@/assets/images/overHaul/leafPage/medium-risk-bg.png');
  738. .icon-top {
  739. background-image: url('/@/assets/images/overHaul/leafPage/medium-risk-icon1.svg');
  740. }
  741. .icon-bottom {
  742. background-image: url('/@/assets/images/overHaul/leafPage/medium-risk-icon2.png');
  743. }
  744. .count {
  745. color: #FF7700;
  746. }
  747. }
  748. .stat-item.normal-risk {
  749. background-image: url('/@/assets/images/overHaul/leafPage/normal-risk-bg.png');
  750. .icon-top {
  751. background-image: url('/@/assets/images/overHaul/leafPage/normal-risk-icon1.svg');
  752. }
  753. .icon-bottom {
  754. background-image: url('/@/assets/images/overHaul/leafPage/normal-risk-icon2.png');
  755. }
  756. .count {
  757. color: #D5C702;
  758. }
  759. }
  760. .stat-item.low-risk {
  761. background-image: url('/@/assets/images/overHaul/leafPage/low-risk-bg.png');
  762. .icon-top {
  763. background-image: url('/@/assets/images/overHaul/leafPage/low-risk-icon1.svg');
  764. }
  765. .icon-bottom {
  766. background-image: url('/@/assets/images/overHaul/leafPage/low-risk-icon2.png');
  767. }
  768. .count {
  769. color: #0070FF;
  770. }
  771. }
  772. .warning-details {
  773. background-color: #ffffff;
  774. margin-bottom: 20px;
  775. padding: 10px 12px;
  776. border-radius: 4px;
  777. }
  778. .details-header {
  779. display: flex;
  780. justify-content: space-between;
  781. align-items: center;
  782. margin-bottom: 16px;
  783. }
  784. .warning-item {
  785. margin-bottom: 20px;
  786. background-color: rgba(218, 234, 251, 0.5);
  787. border-radius: 8px;
  788. padding: 16px;
  789. }
  790. .item-header {
  791. display: flex;
  792. justify-content: space-between;
  793. align-items: center;
  794. padding-bottom: 10px;
  795. margin-bottom: 16px;
  796. border-bottom: 1px solid rgba(43, 111, 240, 0.2);
  797. .icon {
  798. width: 16px;
  799. height: 16px;
  800. background-image: url('/@/assets/images/overHaul/leafPage/info-card-icon1.svg');
  801. background-repeat: no-repeat;
  802. background-size: 100%;
  803. }
  804. .name {
  805. font-size: 16px;
  806. font-weight: bold;
  807. color: #333;
  808. margin: 0 15px 0px 5px;
  809. }
  810. .risk-level {
  811. width: fit-content;
  812. height: 24px;
  813. padding: 2px 8px;
  814. border-radius: 15px;
  815. font-size: 12px;
  816. background-color: #ff6b6b;
  817. color: white;
  818. }
  819. .header-left {
  820. display: flex;
  821. align-items: center;
  822. }
  823. .expand-btn {
  824. color: #2b6ff0;
  825. display: flex;
  826. align-items: center;
  827. gap: 4px;
  828. padding: 6px 12px;
  829. border: 1px solid #2b6ff0;
  830. border-radius: 4px;
  831. background-color: #E9F0FE;
  832. cursor: pointer;
  833. font-size: 12px;
  834. }
  835. .expand-btn:hover {
  836. color: #1a5cc8;
  837. }
  838. .arrow-icon-wrapper {
  839. width: 16px;
  840. height: 16px;
  841. position: relative;
  842. display: inline-block;
  843. }
  844. .arrow-icon {
  845. width: 16px;
  846. height: 16px;
  847. position: absolute;
  848. top: 50%;
  849. left: 50%;
  850. transform: translate(-50%, -50%);
  851. background-image: url('/@/assets/images/overHaul/leafPage/icon-down.png');
  852. background-repeat: no-repeat;
  853. background-size: 100% 100%;
  854. transition: transform 0.3s ease;
  855. }
  856. .arrow-icon.rotate {
  857. transform: translate(-50%, -50%) rotate(180deg);
  858. }
  859. }
  860. .data-row {
  861. display: grid;
  862. grid-template-columns: repeat(7, 1fr);
  863. gap: 12px;
  864. margin-bottom: 8px;
  865. }
  866. .data-col {
  867. width: 100%;
  868. height: 80px;
  869. position: relative;
  870. display: flex;
  871. flex-direction: column;
  872. align-items: start;
  873. justify-content: center ;
  874. padding: 0 16px 0 30px;
  875. background-image: url('/@/assets/images/overHaul/leafPage/warning-item-bg.png');
  876. background-repeat: no-repeat;
  877. background-size: 100% 100%;
  878. border-radius: 4px;
  879. font-size: 12px;
  880. .col-title {
  881. color: #000;
  882. font-size: 14px;
  883. margin-bottom: 5px;
  884. }
  885. .col-value {
  886. color: #000;
  887. font-size: 14px;
  888. .status-dot {
  889. width: 8px;
  890. height: 8px;
  891. border-radius: 50%;
  892. display: inline-block;
  893. }
  894. }
  895. .col-icon {
  896. position: absolute;
  897. top: 10px;
  898. left: 10px;
  899. width: 18px;
  900. height: 18px;
  901. background-image: url('/@/assets/images/overHaul/leafPage/info-card-icon.svg');
  902. background-repeat: no-repeat;
  903. background-size: 100%;
  904. }
  905. }
  906. .monitoring-indicators {
  907. display: flex;
  908. gap: 20px;
  909. margin-top: 20px;
  910. }
  911. .indicator-group {
  912. display: flex;
  913. background-color: white;
  914. border-radius: 8px;
  915. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  916. min-width: 0;
  917. flex: 1;
  918. }
  919. .indicator-group:nth-child(1) {
  920. flex: 4;
  921. }
  922. .indicator-group:nth-child(2) {
  923. flex: 4;
  924. }
  925. .indicator-group:nth-child(3) {
  926. flex: 2;
  927. }
  928. .group-title {
  929. width: 120px;
  930. display: flex;
  931. flex-direction: column;
  932. align-items: center;
  933. text-align: center;
  934. justify-content: center;
  935. font-size: 14px;
  936. font-weight: bold;
  937. color: #000;
  938. background-color: rgba(192, 222, 255, 0.6);
  939. .title-icon-top {
  940. width: 30px;
  941. height: 30px;
  942. background-image: url('/@/assets/images/overHaul/leafPage/icon-top1.svg');
  943. background-repeat: no-repeat;
  944. background-size: 100%;
  945. margin-bottom: -5px;
  946. }
  947. .icon-outer{
  948. background-image: url('/@/assets/images/overHaul/leafPage/icon-top2.svg');
  949. }
  950. .icon-result{
  951. background-image: url('/@/assets/images/overHaul/leafPage/icon-top3.svg');
  952. }
  953. .title-icon-bottom{
  954. width: 50px;
  955. height: 23px;
  956. background-image: url('/@/assets/images/overHaul/leafPage/icon-bottom.png');
  957. background-repeat: no-repeat;
  958. background-size: 100%;
  959. }
  960. }
  961. .indicator-area {
  962. width: calc(100% - 120px);
  963. display: grid;
  964. grid-template-columns: repeat(3, 1fr);
  965. gap: 10px;
  966. padding: 10px 16px;
  967. }
  968. .indicator-result {
  969. grid-template-columns: repeat(1, 1fr);
  970. }
  971. .indicator-item {
  972. height: 30px;
  973. line-height: 30px;
  974. display: flex;
  975. justify-content: space-between;
  976. background: linear-gradient(90deg, rgba(192, 222, 255, 0.5) 0%, rgba(192, 222, 255, 0.2) 100%);
  977. border-radius: 4px;
  978. margin-bottom: 8px;
  979. padding: 0 4px;
  980. .value {
  981. overflow: hidden;
  982. text-overflow: ellipsis;
  983. white-space: nowrap;
  984. min-width: 0;
  985. flex: 1;
  986. text-align: right;
  987. }
  988. }
  989. /* 预警结果只有两行,用来占位的 item */
  990. .placeholder-item {
  991. visibility: hidden;
  992. height: 30px;
  993. margin-bottom: 8px;
  994. background: transparent;
  995. pointer-events: none;
  996. }
  997. .indicator-result .indicator-item:last-of-type {
  998. margin-bottom: 8px;
  999. }
  1000. .indicator-item:last-child {
  1001. border-bottom: none;
  1002. }
  1003. .abnormal-alarm {
  1004. background-color: #fff;
  1005. margin-bottom: 20px;
  1006. padding: 10px 12px;
  1007. border-radius: 4px;
  1008. }
  1009. .alarm-header {
  1010. display: flex;
  1011. justify-content: space-between;
  1012. align-items: center;
  1013. margin-bottom: 16px;
  1014. }
  1015. .alarm-content {
  1016. display: flex;
  1017. flex-wrap: wrap;
  1018. gap: 16px;
  1019. }
  1020. .alarm-item {
  1021. flex: 1;
  1022. min-width: 120px;
  1023. height: 70px;
  1024. position: relative;
  1025. padding: 8px 10px 8px 40px;;
  1026. background-color: rgba(215, 233, 253, 0.9);
  1027. border-radius: 4px;
  1028. text-align: left;
  1029. }
  1030. .alarm-name {
  1031. font-size: 16px;
  1032. color: #000;
  1033. font-weight: bold;
  1034. margin-bottom: 8px;
  1035. }
  1036. .alarm-count {
  1037. font-size: 14px;
  1038. color: #333;
  1039. font-weight: bold;
  1040. }
  1041. .alarm-border {
  1042. width: 20px;
  1043. height: 50px;
  1044. position: absolute;
  1045. top: 14px;
  1046. left: 15px;
  1047. .alarm-border-icon{
  1048. width: 16px;
  1049. height: 16px;
  1050. background-image: url('/@/assets/images/overHaul/leafPage/info-card-icon.svg');
  1051. background-repeat: no-repeat;
  1052. background-size: 100%;
  1053. }
  1054. .alarm-border-line{
  1055. width: 1px;
  1056. height: 30px;
  1057. border-left: 2px dotted #397af3;
  1058. margin-left: 7px;
  1059. }
  1060. }
  1061. .alarm-border-bottom{
  1062. width: 30px;
  1063. height: 30px;
  1064. background-image: url('/@/assets/images/overHaul/leafPage/alarm-card-icon.png');
  1065. background-repeat: no-repeat;
  1066. background-size: 100%;
  1067. position: absolute;
  1068. right: 0;
  1069. bottom: 0;
  1070. }
  1071. .historical-data {
  1072. background-color: #fff;
  1073. margin-bottom: 20px;
  1074. padding: 10px 12px;
  1075. border-radius: 4px;
  1076. }
  1077. .chart-header {
  1078. display: flex;
  1079. justify-content: space-between;
  1080. align-items: center;
  1081. }
  1082. .chart-content {
  1083. padding: 0;
  1084. height: 600px;
  1085. overflow: hidden;
  1086. position: relative;
  1087. }
  1088. /* 深度选择器:重置 ConnectAnalysis 的样式以适配嵌入环境 */
  1089. :deep(.connectAnalysis) {
  1090. margin: 0 !important;
  1091. width: 100% !important;
  1092. height: 100% !important;
  1093. border: none !important;
  1094. box-shadow: none !important;
  1095. padding: 0 !important;
  1096. display: flex;
  1097. flex-direction: column;
  1098. }
  1099. :deep(.filter-area) {
  1100. width: 100%;
  1101. }
  1102. :deep(.echart-box) {
  1103. /* 让图表区域占据剩余所有高度 */
  1104. flex: 1;
  1105. height: auto !important;
  1106. display: flex;
  1107. flex-direction: column;
  1108. padding: 10px;
  1109. }
  1110. :deep(.echart-content) {
  1111. flex: 1;
  1112. height: auto !important;
  1113. min-height: 300px;
  1114. }
  1115. </style>