windSpeedOverlimit.data.ts 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. import type { BasicColumn, FormSchema } from '/@/components/Table';
  2. import { h } from 'vue';
  3. import { StatusColorEnum } from '/@/enums/jeecgEnum';
  4. /** 顶部统计卡片 */
  5. export const boardData = [
  6. { label: '风速超限报警', value: '-' },
  7. { label: '风量不足报警', value: '-' },
  8. { label: '风量不闭合报警', value: '-' },
  9. { label: '今日已处理报警', value: '-' },
  10. ];
  11. /** 报警级别映射 */
  12. export const alarmLevelMap: Record<string, { label: string; color: string }> = {
  13. '1': { label: '一级', color: StatusColorEnum.red },
  14. '2': { label: '二级', color: StatusColorEnum.orange },
  15. '3': { label: '三级', color: StatusColorEnum.yellow },
  16. };
  17. /** 报警状态映射 */
  18. export const alarmStatusMap: Record<string, { label: string; color: string }> = {
  19. '0': { label: '未处理', color: StatusColorEnum.red },
  20. '1': { label: '处理中', color: StatusColorEnum.orange },
  21. '2': { label: '已处理', color: StatusColorEnum.green },
  22. };
  23. /** 超限报警列表表格列 */
  24. export const columns: BasicColumn[] = [
  25. {
  26. title: '煤矿名称',
  27. dataIndex: 'mineName',
  28. fixed: 'left',
  29. width: 180,
  30. },
  31. {
  32. title: '测风点名称',
  33. dataIndex: 'pointName',
  34. width: 160,
  35. },
  36. {
  37. title: '监测区域',
  38. dataIndex: 'monitorArea',
  39. width: 120,
  40. },
  41. {
  42. title: '报警类型',
  43. dataIndex: 'alarmType',
  44. width: 120,
  45. customRender: ({ text }) => {
  46. const map: Record<string, string> = {
  47. windSpeedOver: '风速超限',
  48. windVolumeLow: '风量不足',
  49. windVolumeUnclosed: '风量不闭合',
  50. };
  51. return map[text] || text;
  52. },
  53. },
  54. {
  55. title: '实测值',
  56. dataIndex: 'measuredValue',
  57. width: 100,
  58. },
  59. {
  60. title: '标准/阈值',
  61. dataIndex: 'thresholdValue',
  62. width: 100,
  63. },
  64. {
  65. title: '偏差',
  66. dataIndex: 'deviation',
  67. width: 90,
  68. customRender: ({ text }) => (text != null ? `${text}%` : '-'),
  69. },
  70. {
  71. title: '报警级别',
  72. dataIndex: 'alarmLevel',
  73. width: 90,
  74. customRender: ({ text }) => {
  75. const info = alarmLevelMap[text];
  76. return info ? h('span', { style: { color: info.color, fontWeight: 'bold' } }, info.label) : text;
  77. },
  78. },
  79. {
  80. title: '报警时间',
  81. dataIndex: 'alarmTime',
  82. width: 170,
  83. },
  84. {
  85. title: '状态',
  86. dataIndex: 'status',
  87. width: 90,
  88. customRender: ({ text }) => {
  89. const info = alarmStatusMap[text];
  90. return info ? h('span', { style: { color: info.color } }, info.label) : text;
  91. },
  92. },
  93. ];
  94. /** 测风点监测地点列表表格列 */
  95. export const pointListColumns: BasicColumn[] = [
  96. {
  97. title: '测风点编号',
  98. dataIndex: 'pointCode',
  99. width: 130,
  100. },
  101. {
  102. title: '监测地点名称',
  103. dataIndex: 'locationName',
  104. width: 200,
  105. },
  106. {
  107. title: '类型',
  108. dataIndex: 'pointType',
  109. width: 120,
  110. customRender: ({ text }) => {
  111. const map: Record<string, string> = {
  112. totalInlet: '总进风',
  113. totalOutlet: '总回风',
  114. workingFace: '工作面',
  115. districtReturn: '采区回风',
  116. headingFace: '掘进面',
  117. };
  118. return map[text] || text;
  119. },
  120. },
  121. {
  122. title: '当前状态',
  123. dataIndex: 'currentStatus',
  124. width: 100,
  125. customRender: ({ text }) => {
  126. const color = text === 'normal' ? StatusColorEnum.green : StatusColorEnum.red;
  127. const label = text === 'normal' ? '正常' : '异常';
  128. return h('span', { style: { color, fontWeight: 'bold' } }, label);
  129. },
  130. },
  131. ];
  132. /** 查询表单 */
  133. export const schemas: FormSchema[] = [
  134. {
  135. label: '煤矿名称',
  136. field: 'deptId',
  137. component: 'MineCascader',
  138. colProps: { span: 6 },
  139. rules: [],
  140. },
  141. {
  142. label: '报警类型',
  143. field: 'alarmType',
  144. component: 'Select',
  145. colProps: { span: 6 },
  146. componentProps: {
  147. options: [
  148. { label: '全部', value: '' },
  149. { label: '风速超限', value: 'windSpeedOver' },
  150. { label: '风量不足', value: 'windVolumeLow' },
  151. { label: '风量不闭合', value: 'windVolumeUnclosed' },
  152. ],
  153. },
  154. rules: [],
  155. },
  156. {
  157. label: '报警级别',
  158. field: 'alarmLevel',
  159. component: 'Select',
  160. colProps: { span: 6 },
  161. componentProps: {
  162. options: [
  163. { label: '全部', value: '' },
  164. { label: '一级', value: '1' },
  165. { label: '二级', value: '2' },
  166. { label: '三级', value: '3' },
  167. ],
  168. },
  169. rules: [],
  170. },
  171. {
  172. label: '日期范围',
  173. field: 'dateRange',
  174. component: 'RangePicker',
  175. colProps: { span: 8 },
  176. componentProps: {
  177. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  178. showTime: { format: 'HH:mm:ss' },
  179. },
  180. rules: [],
  181. },
  182. ];
  183. /** 处理记录表格列 */
  184. export const handleRecordColumns: BasicColumn[] = [
  185. {
  186. title: '煤矿名称',
  187. dataIndex: 'mineName',
  188. fixed: 'left',
  189. width: 180,
  190. },
  191. {
  192. title: '报警类型',
  193. dataIndex: 'alarmType',
  194. width: 120,
  195. customRender: ({ text }) => {
  196. const map: Record<string, string> = {
  197. windSpeedOver: '风速超限',
  198. windVolumeLow: '风量不足',
  199. windVolumeUnclosed: '风量不闭合',
  200. };
  201. return map[text] || text;
  202. },
  203. },
  204. {
  205. title: '测风点名称',
  206. dataIndex: 'pointName',
  207. width: 160,
  208. },
  209. {
  210. title: '处理人',
  211. dataIndex: 'handler',
  212. width: 100,
  213. },
  214. {
  215. title: '处理情况',
  216. dataIndex: 'handleContent',
  217. width: 250,
  218. ellipsis: true,
  219. },
  220. {
  221. title: '处理时间',
  222. dataIndex: 'handleTime',
  223. width: 170,
  224. },
  225. ];