fireAreaJudgeAnalysis.data.ts 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. import { alarmCellRender } from '/@/views/monitor/sealedMonitor/monitor.data';
  4. export const boardData = [
  5. {
  6. label: '存在风险情况数量',
  7. value: '10',
  8. },
  9. {
  10. label: '低风险',
  11. value: '27',
  12. },
  13. {
  14. label: '一般风险',
  15. value: '27',
  16. },
  17. {
  18. label: '较高风险',
  19. value: '27',
  20. },
  21. {
  22. label: '高风险',
  23. value: '27',
  24. },
  25. ];
  26. // 实时数据相关
  27. export const columns: BasicColumn[] = [
  28. {
  29. title: '序号',
  30. align: 'center',
  31. width: 80,
  32. customRender: ({ index }: { index: number }) => `${index + 1}`,
  33. },
  34. {
  35. title: '区域',
  36. dataIndex: 'areaName',
  37. width: 100,
  38. },
  39. {
  40. title: '煤矿名称',
  41. dataIndex: 'mineName',
  42. width: 160,
  43. },
  44. {
  45. title: '密闭名称',
  46. dataIndex: 'devicePos',
  47. width: 100,
  48. },
  49. {
  50. title: '所属煤层',
  51. dataIndex: 'coalSeamName',
  52. width: 100,
  53. },
  54. {
  55. title: '自燃倾向性',
  56. dataIndex: 'coalSeamLevel',
  57. width: 100,
  58. },
  59. {
  60. title: '空气温度(℃)',
  61. dataIndex: 'temperature',
  62. width: 100,
  63. },
  64. {
  65. title: 'O2浓度(ppm)',
  66. dataIndex: 'o2Val',
  67. width: 100,
  68. },
  69. {
  70. title: 'C2H4浓度(ppm)',
  71. dataIndex: 'c2h4Val',
  72. width: 100,
  73. },
  74. {
  75. title: 'C2H2浓度(ppm)',
  76. dataIndex: 'c2h2Val',
  77. width: 100,
  78. },
  79. {
  80. title: 'CO浓度(ppm)',
  81. dataIndex: 'coVal',
  82. width: 100,
  83. },
  84. {
  85. title: '出水温度(℃)',
  86. dataIndex: 'temperature',
  87. width: 100,
  88. },
  89. {
  90. title: '监测时长(天)',
  91. dataIndex: 'daysMonitored',
  92. width: 100,
  93. // 自定义渲染函数,计算并显示天数差
  94. customRender: ({ record }) => {
  95. // 校验预警时间是否存在
  96. if (!record?.createTime) {
  97. return '0';
  98. }
  99. const alarmDate = new Date(record.createTime);
  100. alarmDate.setHours(0, 0, 0, 0);
  101. const alarmTime = alarmDate.getTime();
  102. if (isNaN(alarmTime)) {
  103. return '0';
  104. }
  105. const nowDate = new Date();
  106. nowDate.setHours(0, 0, 0, 0);
  107. const nowTime = nowDate.getTime();
  108. const diffDays = Math.floor((nowTime - alarmTime) / 86400000);
  109. return Math.max(diffDays, 0).toString();
  110. },
  111. },
  112. {
  113. title: '风险分析',
  114. dataIndex: 'alarmName',
  115. width: 100,
  116. customRender({ record }) {
  117. return alarmCellRender(record);
  118. },
  119. },
  120. {
  121. title: '预警时间',
  122. dataIndex: 'createTime',
  123. width: 100,
  124. },
  125. {
  126. title: '是否解决',
  127. customRender: () => '未解决',
  128. width: 100,
  129. },
  130. ];
  131. export const searchFormSchema: FormSchema[] = [
  132. {
  133. field: 'mineName',
  134. label: '所属执法处',
  135. component: 'Select',
  136. componentProps: {
  137. options: [
  138. { label: '执法一处', value: '0' },
  139. { label: '执法二处', value: '1' },
  140. { label: '执法三处', value: '2' },
  141. ],
  142. },
  143. colProps: { span: 6 },
  144. },
  145. {
  146. field: 'mineName',
  147. label: '所属区域',
  148. component: 'Select',
  149. componentProps: {
  150. options: [
  151. { label: '执法一处', value: '0' },
  152. { label: '执法二处', value: '1' },
  153. { label: '执法三处', value: '2' },
  154. ],
  155. },
  156. colProps: { span: 6 },
  157. },
  158. {
  159. field: 'mineName',
  160. label: '煤矿名称',
  161. component: 'Input',
  162. colProps: { span: 6 },
  163. },
  164. {
  165. field: 'mineNameAbbr',
  166. label: '煤矿简称',
  167. component: 'Input',
  168. colProps: { span: 6 },
  169. },
  170. {
  171. field: 'productStatus',
  172. label: '生产状态',
  173. component: 'Select',
  174. componentProps: {
  175. options: [
  176. { label: '拟建矿井', value: '0' },
  177. { label: '正常生产矿井', value: '1' },
  178. { label: '长期停产矿井', value: '2' },
  179. ],
  180. },
  181. colProps: { span: 6 },
  182. },
  183. {
  184. field: 'riskLevel',
  185. label: '自燃情况',
  186. component: 'Select',
  187. componentProps: {
  188. options: [
  189. { label: 'Ⅰ类容易自燃', value: '0' },
  190. { label: 'Ⅱ类自燃', value: '1' },
  191. { label: 'Ⅲ类不易自燃', value: '2' },
  192. ],
  193. },
  194. colProps: { span: 6 },
  195. },
  196. ];