surfaceMonitor.data.ts 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. /** 接入状态映射(Mine.accessStatus:1已接入、0未接入) */
  12. export const accessStatusMap: Record<string, string> = {
  13. '1': '已接入',
  14. '0': '未接入',
  15. };
  16. /** 隐蔽工作面判断结果映射(Mine.judgeResult:0数据不足、1疑似、2正常) */
  17. export const judgeResultMap: Record<string, string> = {
  18. '0': '数据不足',
  19. '1': '疑似',
  20. '2': '正常',
  21. };
  22. /** 风量闭合结果映射(Mine.m3Closed:0数据不足、1不闭合、2闭合) */
  23. export const m3ClosedMap: Record<string, string> = {
  24. '0': '数据不足',
  25. '1': '不闭合',
  26. '2': '闭合',
  27. };
  28. /** 隐蔽工作面判识全览实时表格列(getMineData → Mine) */
  29. export const columns: BasicColumn[] = [
  30. {
  31. title: '矿井名称',
  32. dataIndex: 'mineName',
  33. fixed: 'left',
  34. width: 220,
  35. },
  36. {
  37. title: '矿编码',
  38. dataIndex: 'mineCode',
  39. width: 110,
  40. },
  41. // {
  42. // title: '矿井全称',
  43. // dataIndex: 'corpName',
  44. // width: 220,
  45. // ellipsis: true,
  46. // },
  47. {
  48. title: '接入状态',
  49. dataIndex: 'accessStatus',
  50. width: 110,
  51. customRender: ({ text }) => {
  52. const label = accessStatusMap[String(text)] ?? '-';
  53. const color = String(text) === '1' ? StatusColorEnum.green : StatusColorEnum.red;
  54. return h('span', { style: { color, fontWeight: 'bold' } }, label);
  55. },
  56. },
  57. {
  58. title: '煤矿状态',
  59. dataIndex: 'mkMineStatus',
  60. width: 110,
  61. },
  62. // {
  63. // title: '父级组织',
  64. // dataIndex: 'parentArea',
  65. // width: 120,
  66. // ellipsis: true,
  67. // },
  68. {
  69. title: '判识结果',
  70. dataIndex: 'judgeResult',
  71. width: 110,
  72. customRender: ({ text }) => {
  73. const label = judgeResultMap[String(text)] ?? '-';
  74. const color = String(text) === '1' ? StatusColorEnum.red : String(text) === '2' ? StatusColorEnum.green : StatusColorEnum.gray;
  75. return h('span', { style: { color, fontWeight: 'bold' } }, label);
  76. },
  77. },
  78. {
  79. title: '风量闭合',
  80. dataIndex: 'm3Closed',
  81. width: 110,
  82. customRender: ({ text }) => {
  83. const label = m3ClosedMap[String(text)] ?? '-';
  84. const color = String(text) === '1' ? StatusColorEnum.red : String(text) === '2' ? StatusColorEnum.green : StatusColorEnum.gray;
  85. return h('span', { style: { color, fontWeight: 'bold' } }, label);
  86. },
  87. },
  88. {
  89. title: '风量异常数',
  90. dataIndex: 'm3Exception',
  91. width: 110,
  92. },
  93. {
  94. title: '测风地点数',
  95. dataIndex: 'mineAreaList',
  96. width: 110,
  97. customRender: ({ text }) => (Array.isArray(text) ? text.length : '-'),
  98. },
  99. {
  100. title: '测风装置数',
  101. dataIndex: 'windrectList',
  102. width: 110,
  103. customRender: ({ text }) => (Array.isArray(text) ? text.length : '-'),
  104. },
  105. {
  106. title: '上次实时数据上传时间',
  107. dataIndex: 'lastCdssTime',
  108. width: 180,
  109. },
  110. // {
  111. // title: '上次定义数据上传时间',
  112. // dataIndex: 'lastCddyTime',
  113. // width: 180,
  114. // },
  115. ];
  116. /** 历史数据表格列(暂无接口,先用同构占位列) */
  117. export const historyColumns: BasicColumn[] = [
  118. {
  119. title: '矿井名称',
  120. dataIndex: 'mineName',
  121. fixed: 'left',
  122. width: 180,
  123. },
  124. {
  125. title: '矿编码',
  126. dataIndex: 'mineCode',
  127. width: 110,
  128. },
  129. {
  130. title: '接入状态',
  131. dataIndex: 'accessStatus',
  132. width: 110,
  133. customRender: ({ text }) => accessStatusMap[String(text)] ?? '-',
  134. },
  135. {
  136. title: '测风地点数',
  137. dataIndex: 'mineAreaList',
  138. width: 110,
  139. customRender: ({ text }) => (Array.isArray(text) ? text.length : '-'),
  140. },
  141. {
  142. title: '测风装置数',
  143. dataIndex: 'windrectList',
  144. width: 110,
  145. customRender: ({ text }) => (Array.isArray(text) ? text.length : '-'),
  146. },
  147. {
  148. title: '上次实时数据上传时间',
  149. dataIndex: 'lastCdssTime',
  150. width: 180,
  151. },
  152. ];
  153. /** 实时监测查询表单(getMineData:deptId 必填) */
  154. export const schemas: FormSchema[] = [
  155. {
  156. label: '矿井名称',
  157. field: 'mineName',
  158. component: 'Input',
  159. colProps: { span: 6 },
  160. componentProps: {
  161. placeholder: '请输入矿井名称',
  162. },
  163. },
  164. {
  165. label: '接入状态',
  166. field: 'accessStatus',
  167. component: 'Select',
  168. colProps: { span: 6 },
  169. componentProps: {
  170. options: [
  171. { label: '已接入', value: 1 },
  172. { label: '未接入', value: 0 },
  173. ],
  174. },
  175. },
  176. {
  177. label: '判识结果',
  178. field: 'judgeResult',
  179. component: 'Select',
  180. colProps: { span: 6 },
  181. componentProps: {
  182. options: [
  183. { label: '数据不足', value: 0 },
  184. { label: '疑似', value: 1 },
  185. { label: '正常', value: 2 },
  186. ],
  187. },
  188. },
  189. {
  190. label: '风量闭合',
  191. field: 'm3Closed',
  192. component: 'Select',
  193. colProps: { span: 6 },
  194. componentProps: {
  195. options: [
  196. { label: '数据不足', value: 0 },
  197. { label: '不闭合', value: 1 },
  198. { label: '闭合', value: 2 },
  199. ],
  200. },
  201. },
  202. ];
  203. /** 历史数据查询表单(暂无接口,占位) */
  204. export const historySchemas: FormSchema[] = [];