infoCenter.data.ts 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. import { BasicColumn } from '/@/components/Table';
  2. import { ModuleDataChart } from '/@/views/vent/deviceManager/configurationTable/types';
  3. import { h } from 'vue'; // 引入vue的h函数用于创建VNode
  4. // 系统数据排名
  5. export const sysDataColumn: BasicColumn[] = [
  6. {
  7. title: '',
  8. align: 'center',
  9. width: 60,
  10. // 修正customRender的类型和返回值
  11. customRender: ({ index }: { index: number }) => {
  12. // 确保index是数字类型,避免算术运算错误
  13. const numIndex = Number(index);
  14. let rankImg = '';
  15. if (numIndex === 0) {
  16. rankImg = '/src/assets/images/dataCenter/infoCenter/rank-1.png';
  17. } else if (numIndex === 1) {
  18. rankImg = '/src/assets/images/dataCenter/infoCenter/rank-2.png';
  19. } else if (numIndex === 2) {
  20. rankImg = '/src/assets/images/dataCenter/infoCenter/rank-3.png';
  21. } else {
  22. rankImg = '/src/assets/images/dataCenter/infoCenter/rank-4.png';
  23. }
  24. return h(
  25. 'div',
  26. {
  27. style: {
  28. width: '80px',
  29. height: '35px',
  30. backgroundImage: `url(${rankImg})`,
  31. backgroundSize: '100% 100%',
  32. backgroundRepeat: 'no-repeat',
  33. position: 'relative',
  34. margin: '0 15px',
  35. },
  36. },
  37. [
  38. // 排名文字
  39. h(
  40. 'span',
  41. {
  42. style: {
  43. position: 'absolute',
  44. top: '50%',
  45. left: '50%',
  46. transform: 'translate(-50%, -50%)',
  47. color: '#fff',
  48. fontSize: '14px',
  49. fontWeight: 'bold',
  50. },
  51. },
  52. `NO.${index + 1}`
  53. ), // 显示NO.1、NO.2等
  54. ]
  55. );
  56. },
  57. },
  58. {
  59. title: '系统名称',
  60. dataIndex: 'sysName',
  61. align: 'center',
  62. },
  63. {
  64. title: '数量',
  65. dataIndex: 'sysNum',
  66. align: 'center',
  67. },
  68. ];
  69. // 系统接入情况数据
  70. export const sysData = [
  71. {
  72. sysName: 'wscc',
  73. sysNum: 32,
  74. },
  75. {
  76. sysName: 'wscc',
  77. sysNum: 33,
  78. },
  79. {
  80. sysName: 'wscc',
  81. sysNum: 34,
  82. },
  83. {
  84. sysName: 'wscc',
  85. sysNum: 35,
  86. },
  87. {
  88. sysName: 'wscc',
  89. sysNum: 35,
  90. },
  91. {
  92. sysName: 'wscc',
  93. sysNum: 35,
  94. },
  95. ];
  96. //系统接入情况
  97. export const accessStatusColumn: BasicColumn[] = [
  98. {
  99. title: '序号',
  100. align: 'center',
  101. customRender: ({ index }: { index: number }) => `${index + 1}`,
  102. },
  103. {
  104. title: '系统名称',
  105. dataIndex: 'sysName',
  106. align: 'center',
  107. },
  108. {
  109. title: '系统接入时间',
  110. dataIndex: 'accessTime',
  111. align: 'center',
  112. },
  113. {
  114. title: '点位数量',
  115. dataIndex: 'pointNum',
  116. align: 'center',
  117. },
  118. {
  119. title: '运行状态',
  120. dataIndex: 'runStatus',
  121. align: 'center',
  122. },
  123. {
  124. title: '数据更新时间',
  125. dataIndex: 'dataUpdateTime',
  126. align: 'center',
  127. },
  128. {
  129. title: '操作',
  130. dataIndex: 'action',
  131. width: 200,
  132. align: 'center',
  133. slots: { customRender: 'action' },
  134. },
  135. ];
  136. // 系统接入情况数据
  137. export const accessStatusData = [
  138. {
  139. sysName: '1',
  140. accessTime: '2025.10.01',
  141. pointNum: 32,
  142. runStatus: '1',
  143. dataUpdateTime: '2025.10.01',
  144. },
  145. {
  146. sysName: '2',
  147. accessTime: '2025.10.02',
  148. pointNum: 32,
  149. runStatus: '2',
  150. dataUpdateTime: '2025.10.02',
  151. },
  152. {
  153. sysName: '3',
  154. accessTime: '2025.10.02',
  155. pointNum: 32,
  156. runStatus: '3',
  157. dataUpdateTime: '2025.10.02',
  158. },
  159. {
  160. sysName: '3',
  161. accessTime: '2025.10.02',
  162. pointNum: 32,
  163. runStatus: '3',
  164. dataUpdateTime: '2025.10.02',
  165. },
  166. ];
  167. // 每日采集数据表格属性
  168. export const dailyNumOption: ModuleDataChart = {
  169. type: 'bar',
  170. readFrom: '',
  171. legend: { show: false },
  172. xAxis: [{ show: true }],
  173. yAxis: [{ show: true, name: '', position: 'left' }],
  174. series: [{ readFrom: 'history', xprop: 'time', yprop: 'val', label: '' }],
  175. };
  176. // 每日采集数据
  177. export const dailyNumData = {
  178. history: [
  179. {
  180. time: '2025-10-13',
  181. val: '113',
  182. },
  183. {
  184. time: '2025-10-14',
  185. val: '153',
  186. },
  187. {
  188. time: '2025-10-15',
  189. val: '163',
  190. },
  191. {
  192. time: '2025-10-16',
  193. val: '193',
  194. },
  195. {
  196. time: '2025-10-17',
  197. val: '203',
  198. },
  199. {
  200. time: '2025-10-18',
  201. val: '203',
  202. },
  203. {
  204. time: '2025-10-19',
  205. val: '223',
  206. },
  207. {
  208. time: '2025-10-20',
  209. val: '183',
  210. },
  211. {
  212. time: '2025-10-21',
  213. val: '153',
  214. },
  215. {
  216. time: '2025-10-22',
  217. val: '183',
  218. },
  219. {
  220. time: '2025-10-23',
  221. val: '153',
  222. },
  223. ],
  224. };