data.ts 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. /**
  2. * 张家峁煤自燃监测预警页面数据
  3. *
  4. * 当前阶段后端接口尚未提供,页面先使用本地模拟数据,
  5. * 后续接入接口时只需要替换本文件中的模拟常量即可。
  6. */
  7. export interface GoafOverviewItem {
  8. label: string;
  9. value: number;
  10. }
  11. export interface DeviceInstallItem {
  12. name: string;
  13. installed: number;
  14. running: number;
  15. }
  16. export interface OverallWarning {
  17. level: number;
  18. levelText: string;
  19. levelName: string;
  20. total: number;
  21. color: string;
  22. }
  23. export interface WarningRow {
  24. id: number;
  25. name: string;
  26. seam: string;
  27. level: string;
  28. safetyLevel?: string;
  29. status?: string;
  30. }
  31. export interface AlertItem {
  32. id: number;
  33. time: string;
  34. level: number;
  35. location: string;
  36. message: string;
  37. }
  38. export interface BundleRow {
  39. point: string;
  40. o2: string;
  41. co: number;
  42. ch4: string;
  43. c2h4: string;
  44. temp: number;
  45. status: '正常' | '关注' | '预警';
  46. }
  47. export interface FiberTrend {
  48. times: string[];
  49. maxTemp: number[];
  50. avgTemp: number[];
  51. maxValue: number;
  52. avgValue: number;
  53. pointCount: number;
  54. }
  55. export interface RiskLevel {
  56. level: number;
  57. name: string;
  58. range: string;
  59. colorName: string;
  60. color: string;
  61. }
  62. export interface ManualOption {
  63. label: string;
  64. value: string;
  65. score: number;
  66. }
  67. export interface ManualField {
  68. key: string;
  69. label: string;
  70. value: string;
  71. options: ManualOption[];
  72. }
  73. export interface ManualGroup {
  74. key: string;
  75. title: string;
  76. fields: ManualField[];
  77. }
  78. export interface EvaluationResult {
  79. score: number;
  80. level: number;
  81. levelText: string;
  82. color: string;
  83. highlightLevel: number;
  84. target: string;
  85. time: string;
  86. source: string;
  87. suggestion: string;
  88. }
  89. export const GOAF_OVERVIEW: GoafOverviewItem[] = [
  90. { label: '矿井采空区总数', value: 28 },
  91. { label: '已封闭采空区数', value: 6 },
  92. { label: '回撤工作面采空区数', value: 4 },
  93. { label: '回采工作面采空区数', value: 12 },
  94. { label: '停产工作面采空区数', value: 6 },
  95. ];
  96. export const INSTALLED_DEVICES: DeviceInstallItem[] = [
  97. { name: '束管监测', installed: 15, running: 13 },
  98. { name: '光纤测温', installed: 15, running: 13 },
  99. { name: '密闭监测', installed: 15, running: 13 },
  100. ];
  101. export const OVERALL_WARNING: OverallWarning = {
  102. level: 4,
  103. levelText: 'IV',
  104. levelName: '高风险',
  105. total: 12,
  106. color: '#ff9d1c',
  107. };
  108. export const WARNING_ROWS: WarningRow[] = [
  109. { id: 1, name: '12采空区', seam: '5-2煤', level: '一般风险', status: '回采中' },
  110. { id: 2, name: '14采空区', seam: '5-2煤', level: '一般风险', status: '回撤中' },
  111. { id: 3, name: '16采空区', seam: '5-1煤', level: '一般风险', status: '停产' },
  112. { id: 4, name: '18采空区', seam: '5-2煤', level: '低风险', status: '回采中' },
  113. { id: 5, name: '20采空区', seam: '5-1煤', level: '中等风险', status: '回采中' },
  114. { id: 6, name: '22采空区', seam: '5-2煤', level: '低风险', status: '已封闭' },
  115. { id: 7, name: '24采空区', seam: '4-2煤', level: '一般风险', status: '回采中' },
  116. { id: 8, name: '26采空区', seam: '4-2煤', level: '低风险', status: '已封闭' },
  117. { id: 9, name: '28采空区', seam: '5-1煤', level: '中等风险', status: '回撤中' },
  118. { id: 10, name: '30采空区', seam: '5-2煤', level: '一般风险', status: '停产' },
  119. { id: 11, name: '32采空区', seam: '4-2煤', level: '低风险', status: '已封闭' },
  120. { id: 12, name: '34采空区', seam: '5-1煤', level: '一般风险', status: '回采中' },
  121. ];
  122. export const ALERTS: AlertItem[] = [
  123. { id: 1, time: '09:28:16', level: 4, location: '12采空区', message: '束管测点 CO 浓度上升至 24ppm' },
  124. { id: 2, time: '09:16:42', level: 3, location: '20采空区', message: '密闭内 O₂ 浓度低于 15%,请关注' },
  125. { id: 3, time: '08:57:03', level: 2, location: '14采空区', message: '光纤测温 3# 测点温度波动 1.8℃' },
  126. { id: 4, time: '08:35:27', level: 4, location: '28采空区', message: '回风顺槽 CH₄ 浓度达到 0.86%' },
  127. { id: 5, time: '08:12:51', level: 2, location: '18采空区', message: '风速传感器数据短时中断,已恢复' },
  128. ];
  129. export const BUNDLE_ROWS: BundleRow[] = [
  130. { point: '12采空区-1#', o2: '18.62', co: 16, ch4: '0.42', c2h4: '0.00', temp: 26.4, status: '正常' },
  131. { point: '12采空区-2#', o2: '17.85', co: 24, ch4: '0.56', c2h4: '0.02', temp: 28.1, status: '关注' },
  132. { point: '14采空区-1#', o2: '19.04', co: 9, ch4: '0.35', c2h4: '0.00', temp: 25.2, status: '正常' },
  133. { point: '16采空区-1#', o2: '16.92', co: 31, ch4: '0.63', c2h4: '0.04', temp: 30.6, status: '预警' },
  134. { point: '20采空区-1#', o2: '18.11', co: 18, ch4: '0.48', c2h4: '0.01', temp: 27.3, status: '正常' },
  135. { point: '28采空区-1#', o2: '17.36', co: 27, ch4: '0.74', c2h4: '0.03', temp: 29.4, status: '关注' },
  136. ];
  137. export const FIBER_TREND: FiberTrend = {
  138. times: [
  139. '00:00',
  140. '01:00',
  141. '02:00',
  142. '03:00',
  143. '04:00',
  144. '05:00',
  145. '06:00',
  146. '07:00',
  147. '08:00',
  148. '09:00',
  149. '10:00',
  150. '11:00',
  151. '12:00',
  152. '13:00',
  153. '14:00',
  154. '15:00',
  155. '16:00',
  156. '17:00',
  157. '18:00',
  158. '19:00',
  159. '20:00',
  160. '21:00',
  161. '22:00',
  162. '23:00',
  163. ],
  164. maxTemp: [
  165. 24.1, 23.8, 23.6, 23.4, 23.5, 24.0, 25.2, 26.8, 28.4, 30.1, 31.6, 32.6, 33.1, 32.8, 32.2, 31.5, 30.6, 29.4, 28.2, 27.3, 26.6, 26.0, 25.4, 24.8,
  166. ],
  167. avgTemp: [
  168. 22.2, 22.0, 21.9, 21.8, 21.9, 22.1, 22.6, 23.2, 23.9, 24.5, 25.1, 25.6, 25.9, 25.8, 25.6, 25.3, 24.9, 24.5, 24.1, 23.8, 23.4, 23.1, 22.8, 22.5,
  169. ],
  170. maxValue: 33.1,
  171. avgValue: 23.9,
  172. pointCount: 15,
  173. };
  174. export const RISK_LEVELS: RiskLevel[] = [
  175. { level: 1, name: 'I 低风险', range: '0-20', colorName: '绿色', color: '#7ed321' },
  176. { level: 2, name: 'II 较低风险', range: '20-40', colorName: '蓝色', color: '#3df6ff' },
  177. { level: 3, name: 'III 中等风险', range: '40-60', colorName: '黄色', color: '#ffd15c' },
  178. { level: 4, name: 'IV 高风险', range: '60-80', colorName: '橙色', color: '#ff9d1c' },
  179. { level: 5, name: 'V 极高风险', range: '80-100', colorName: '红色', color: '#ff4d4f' },
  180. ];
  181. export const MANUAL_GROUPS: ManualGroup[] = [
  182. {
  183. key: 'pre',
  184. title: '采前评价',
  185. fields: [
  186. {
  187. key: 'spontaneous',
  188. label: '自燃倾向性',
  189. value: '自燃',
  190. options: [
  191. { label: '不易自燃', value: '不易自燃', score: 3 },
  192. { label: '自燃', value: '自燃', score: 10 },
  193. { label: '容易自燃', value: '容易自燃', score: 18 },
  194. ],
  195. },
  196. {
  197. key: 'sealQuality',
  198. label: '封闭质量',
  199. value: '一般',
  200. options: [
  201. { label: '好', value: '好', score: 2 },
  202. { label: '一般', value: '一般', score: 8 },
  203. { label: '差', value: '差', score: 15 },
  204. ],
  205. },
  206. {
  207. key: 'residualCoal',
  208. label: '遗煤厚度(m)',
  209. value: '1.0',
  210. options: [
  211. { label: '0.5', value: '0.5', score: 3 },
  212. { label: '1.0', value: '1.0', score: 7 },
  213. { label: '1.5', value: '1.5', score: 11 },
  214. { label: '2.0', value: '2.0', score: 15 },
  215. ],
  216. },
  217. {
  218. key: 'advanceSpeed',
  219. label: '推进速度(m/d)',
  220. value: '3.5',
  221. options: [
  222. { label: '4.8', value: '4.8', score: 3 },
  223. { label: '3.5', value: '3.5', score: 7 },
  224. { label: '2.5', value: '2.5', score: 11 },
  225. { label: '1.5', value: '1.5', score: 15 },
  226. ],
  227. },
  228. {
  229. key: 'airLeakage',
  230. label: '漏风强度',
  231. value: '中',
  232. options: [
  233. { label: '低', value: '低', score: 3 },
  234. { label: '中', value: '中', score: 8 },
  235. { label: '高', value: '高', score: 15 },
  236. ],
  237. },
  238. ],
  239. },
  240. {
  241. key: 'condition',
  242. title: '开采条件',
  243. fields: [
  244. {
  245. key: 'roof',
  246. label: '顶板岩性',
  247. value: '泥岩',
  248. options: [
  249. { label: '砂岩', value: '砂岩', score: 3 },
  250. { label: '泥岩', value: '泥岩', score: 8 },
  251. { label: '复合顶板', value: '复合顶板', score: 12 },
  252. ],
  253. },
  254. {
  255. key: 'structure',
  256. label: '地质构造',
  257. value: '较复杂',
  258. options: [
  259. { label: '简单', value: '简单', score: 3 },
  260. { label: '较复杂', value: '较复杂', score: 8 },
  261. { label: '复杂', value: '复杂', score: 12 },
  262. ],
  263. },
  264. {
  265. key: 'miningMethod',
  266. label: '采煤方法',
  267. value: '综放',
  268. options: [
  269. { label: '综采', value: '综采', score: 4 },
  270. { label: '综放', value: '综放', score: 10 },
  271. ],
  272. },
  273. {
  274. key: 'ventMode',
  275. label: '通风方式',
  276. value: 'U型',
  277. options: [
  278. { label: 'U型', value: 'U型', score: 4 },
  279. { label: 'W型', value: 'W型', score: 8 },
  280. { label: 'U+L型', value: 'U+L型', score: 10 },
  281. ],
  282. },
  283. {
  284. key: 'sealMode',
  285. label: '封闭方式',
  286. value: '永久密闭',
  287. options: [
  288. { label: '永久密闭', value: '永久密闭', score: 3 },
  289. { label: '临时密闭', value: '临时密闭', score: 8 },
  290. { label: '未封闭', value: '未封闭', score: 13 },
  291. ],
  292. },
  293. ],
  294. },
  295. {
  296. key: 'monitor',
  297. title: '监测数据',
  298. fields: [
  299. {
  300. key: 'o2',
  301. label: 'O₂浓度(%)',
  302. value: '15-18',
  303. options: [
  304. { label: '≥18', value: '≥18', score: 3 },
  305. { label: '15-18', value: '15-18', score: 7 },
  306. { label: '10-15', value: '10-15', score: 12 },
  307. { label: '<10', value: '<10', score: 16 },
  308. ],
  309. },
  310. {
  311. key: 'co',
  312. label: 'CO浓度(ppm)',
  313. value: '10-24',
  314. options: [
  315. { label: '<10', value: '<10', score: 3 },
  316. { label: '10-24', value: '10-24', score: 7 },
  317. { label: '24-50', value: '24-50', score: 12 },
  318. { label: '>50', value: '>50', score: 16 },
  319. ],
  320. },
  321. {
  322. key: 'ch4',
  323. label: 'CH₄浓度(%)',
  324. value: '0.5-1.0',
  325. options: [
  326. { label: '<0.5', value: '<0.5', score: 3 },
  327. { label: '0.5-1.0', value: '0.5-1.0', score: 6 },
  328. { label: '>1.0', value: '>1.0', score: 10 },
  329. ],
  330. },
  331. {
  332. key: 'temperature',
  333. label: '温度(℃)',
  334. value: '26-30',
  335. options: [
  336. { label: '<26', value: '<26', score: 3 },
  337. { label: '26-30', value: '26-30', score: 7 },
  338. { label: '30-35', value: '30-35', score: 12 },
  339. { label: '>35', value: '>35', score: 16 },
  340. ],
  341. },
  342. ],
  343. },
  344. ];
  345. export const SUGGESTIONS: Record<number, string> = {
  346. 1: '保持现有监测频次,按计划开展日常巡检,关注束管测点气体变化趋势。',
  347. 2: '关注束管测点变化趋势,定期校验传感器,保持采空区密闭完好。',
  348. 3: '加密束管采样频次,加强回风顺槽气体分析;对高温测点进行连续测温跟踪;必要时调整推进速度并落实注浆与注氮措施。',
  349. 4: '立即加密监测并核查高温测点,落实注浆、注氮等综合防灭火措施,必要时调整推进速度。',
  350. 5: '立即停止作业并撤出受影响区域人员,启动应急预案,实施连续监测与注浆注氮措施。',
  351. };
  352. const LEVEL_TEXT: Record<number, string> = {
  353. 1: 'I 低风险',
  354. 2: 'II 较低风险',
  355. 3: 'III 中等风险',
  356. 4: 'IV 高风险',
  357. 5: 'V 极高风险',
  358. };
  359. export const INITIAL_EVALUATION: EvaluationResult = {
  360. score: 58.6,
  361. level: 3,
  362. levelText: 'III 高风险',
  363. color: '#ff9d1c',
  364. highlightLevel: 4,
  365. target: '12采空区工作面',
  366. time: '2026-10-12 09:30',
  367. source: '人工录入',
  368. suggestion: SUGGESTIONS[3],
  369. };
  370. /** 按 0-20 / 20-40 / 40-60 / 60-80 / 80-100 划分风险等级 */
  371. export function getRiskLevel(score: number): { level: number; name: string; color: string } {
  372. if (score < 20) return { level: 1, name: LEVEL_TEXT[1], color: RISK_LEVELS[0].color };
  373. if (score < 40) return { level: 2, name: LEVEL_TEXT[2], color: RISK_LEVELS[1].color };
  374. if (score < 60) return { level: 3, name: LEVEL_TEXT[3], color: RISK_LEVELS[2].color };
  375. if (score < 80) return { level: 4, name: LEVEL_TEXT[4], color: RISK_LEVELS[3].color };
  376. return { level: 5, name: LEVEL_TEXT[5], color: RISK_LEVELS[4].color };
  377. }
  378. /** 根据人工录入的各项得分计算 0-100 的风险分值 */
  379. export function calcManualScore(groups: ManualGroup[]): number {
  380. let score = 0;
  381. let maxScore = 0;
  382. groups.forEach((group) => {
  383. group.fields.forEach((field) => {
  384. const selected = field.options.find((option) => option.value === field.value);
  385. score += selected?.score ?? 0;
  386. maxScore += Math.max(...field.options.map((option) => option.score));
  387. });
  388. });
  389. if (!maxScore) return 0;
  390. return Math.round((score / maxScore) * 1000) / 10;
  391. }
  392. /** 深度复制人工录入表单,避免多个标签页共享同一份可变数据 */
  393. export function createManualGroups(): ManualGroup[] {
  394. return MANUAL_GROUPS.map((group) => ({
  395. ...group,
  396. fields: group.fields.map((field) => ({
  397. ...field,
  398. options: field.options.map((option) => ({ ...option })),
  399. })),
  400. }));
  401. }
  402. export interface SelfIgnitionPageData {
  403. overview: GoafOverviewItem[];
  404. devices: DeviceInstallItem[];
  405. overall: OverallWarning;
  406. warnings: WarningRow[];
  407. alerts: AlertItem[];
  408. bundleRows: BundleRow[];
  409. fiber: FiberTrend;
  410. }
  411. /** 生成页面数据副本;数据接口就绪后替换此函数即可 */
  412. export function createSelfIgnitionData(): SelfIgnitionPageData {
  413. return {
  414. overview: GOAF_OVERVIEW.map((item) => ({ ...item })),
  415. devices: INSTALLED_DEVICES.map((item) => ({ ...item })),
  416. overall: { ...OVERALL_WARNING },
  417. warnings: WARNING_ROWS.map((item) => ({ ...item })),
  418. alerts: ALERTS.map((item) => ({ ...item })),
  419. bundleRows: BUNDLE_ROWS.map((item) => ({ ...item })),
  420. fiber: {
  421. ...FIBER_TREND,
  422. times: [...FIBER_TREND.times],
  423. maxTemp: [...FIBER_TREND.maxTemp],
  424. avgTemp: [...FIBER_TREND.avgTemp],
  425. },
  426. };
  427. }
  428. /* ==================== 设备实时监测与分析 ==================== */
  429. export interface SensorReading {
  430. label: string;
  431. value: string;
  432. }
  433. export interface SensorGroup {
  434. name: string;
  435. rows: SensorReading[];
  436. }
  437. export const SENSOR_GROUPS: SensorGroup[] = [
  438. {
  439. name: '工作面#1',
  440. rows: [
  441. { label: '回风隅角氧气', value: '20.9%' },
  442. { label: '回风巷一氧化碳', value: '12ppm' },
  443. { label: '回风巷温度', value: '26.5℃' },
  444. ],
  445. },
  446. {
  447. name: '工作面#2',
  448. rows: [
  449. { label: '回风隅角氧气', value: '20.8%' },
  450. { label: '回风巷一氧化碳', value: '15ppm' },
  451. { label: '回风巷温度', value: '27.1℃' },
  452. ],
  453. },
  454. ];
  455. export const NATURAL_FIRE_STAGE = {
  456. levelText: 'IV',
  457. levelName: '高风险',
  458. color: '#ff9d1c',
  459. };
  460. export const ALERT_ADVICE = '加密束管采样频次,加强回风顺槽气体分析;对高温测点进行连续测温跟踪;必要时调整推进速度并落实注浆与注氮措施。';
  461. export interface FiberChartData {
  462. categories: string[];
  463. solid: number[];
  464. dashed: number[];
  465. peakIndex: number;
  466. }
  467. export const FIBER_CHART_DATA: FiberChartData = {
  468. categories: ['测点01', '测点02', '测点03', '测点04', '测点05', '测点06', '测点07', '测点08', '测点09', '测点10', '测点11', '测点12'],
  469. solid: [120, 180, 140, 160, 110, 140, 130, 210, 800, 520, 360, 280],
  470. dashed: [160, 200, 170, 190, 140, 170, 150, 240, 700, 480, 320, 260],
  471. peakIndex: 8,
  472. };
  473. export interface BundleMonitorRow {
  474. deviceNo: string;
  475. o2: string;
  476. n2: string;
  477. co: number;
  478. co2: string;
  479. ch4: string;
  480. c2h4: string;
  481. c2h6: string;
  482. c2h2: string;
  483. }
  484. const BUNDLE_DEVICE_NAMES = ['1#束管', '2#束管', '3#束管', '4#束管'];
  485. export const BUNDLE_MONITOR_ROWS: BundleMonitorRow[] = Array.from({ length: 40 }, (_, index) => {
  486. return {
  487. deviceNo: BUNDLE_DEVICE_NAMES[index % 4],
  488. o2: (20.9 - (index % 12) * 0.08).toFixed(2),
  489. n2: (78.1 + (index % 9) * 0.06).toFixed(2),
  490. co: 6 + (index % 15) * 2,
  491. co2: (0.03 + (index % 10) * 0.005).toFixed(3),
  492. ch4: (0.18 + (index % 8) * 0.03).toFixed(2),
  493. c2h4: (index % 5 === 0 ? 0.02 : 0).toFixed(2),
  494. c2h6: (index % 6 === 0 ? 0.01 : 0).toFixed(2),
  495. c2h2: (index % 7 === 0 ? 0.01 : 0).toFixed(2),
  496. };
  497. });
  498. export interface DeviceMonitorRow {
  499. deviceNo: string;
  500. o2: string;
  501. co: number;
  502. co2: string;
  503. ch4: string;
  504. temp: string;
  505. pressureDiff: string;
  506. }
  507. export const DEVICE_MONITOR_ROWS: DeviceMonitorRow[] = Array.from({ length: 40 }, (_, index) => {
  508. return {
  509. deviceNo: `${(index % 4) + 1}#密闭`,
  510. o2: (20.4 - (index % 10) * 0.07).toFixed(2),
  511. co: 8 + (index % 12) * 2,
  512. co2: (0.04 + (index % 9) * 0.004).toFixed(3),
  513. ch4: (0.22 + (index % 8) * 0.03).toFixed(2),
  514. temp: (25.8 + (index % 10) * 0.5).toFixed(1),
  515. pressureDiff: (12 + (index % 7) * 3).toFixed(0),
  516. };
  517. });