data.ts 14 KB

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