infoCenter.data.ts 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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: '设备id',
  60. dataIndex: 'sub_id',
  61. align: 'center',
  62. ifShow: false,
  63. },
  64. {
  65. title: '设备名称',
  66. dataIndex: 'strName',
  67. align: 'center',
  68. },
  69. {
  70. title: '数量',
  71. dataIndex: 'total_num',
  72. align: 'center',
  73. },
  74. ];
  75. //系统接入情况
  76. export const accessStatusColumn: BasicColumn[] = [
  77. {
  78. title: '序号',
  79. align: 'center',
  80. customRender: ({ index }: { index: number }) => `${index + 1}`,
  81. },
  82. {
  83. title: '设备名称',
  84. dataIndex: 'devicekind_dictText',
  85. align: 'center',
  86. },
  87. {
  88. title: '设备接入时间',
  89. dataIndex: 'createTime',
  90. align: 'center',
  91. },
  92. {
  93. title: '点位数量',
  94. dataIndex: 'monitorPointNum',
  95. align: 'center',
  96. },
  97. {
  98. title: '运行状态',
  99. dataIndex: 'netStatus',
  100. align: 'center',
  101. },
  102. {
  103. title: '数据更新时间',
  104. dataIndex: 'dataUpdateTime',
  105. align: 'center',
  106. },
  107. {
  108. title: '操作',
  109. dataIndex: 'action',
  110. width: 200,
  111. align: 'center',
  112. slots: { customRender: 'action' },
  113. },
  114. ];
  115. // 每日采集数据表格属性
  116. export const dailyNumOption: ModuleDataChart = {
  117. type: 'bar',
  118. readFrom: '',
  119. legend: { show: false },
  120. xAxis: [{ show: true }],
  121. yAxis: [{ show: true, name: '', position: 'left' }],
  122. series: [{ readFrom: 'collectDataByDayList', xprop: 'day', yprop: 'total_count', label: '' }],
  123. };
  124. export const deviceData = {
  125. monitorParamsCount: 1727,
  126. deviceCount: 4,
  127. databaseDiskUsage: 10165,
  128. collectDataByStationList: [
  129. {
  130. sub_id: '1696417397868986370',
  131. strName: '调试http协议束管',
  132. total_num: 258,
  133. },
  134. {
  135. sub_id: '1696417397868986370',
  136. strName: '调试http协议束管',
  137. total_num: 256,
  138. },
  139. {
  140. sub_id: '1696417397868986370',
  141. strName: '调试http协议束管',
  142. total_num: 254,
  143. },
  144. {
  145. sub_id: '1696417397868986370',
  146. strName: '调试http协议束管',
  147. total_num: 252,
  148. },
  149. ],
  150. collectTotalNum: 258,
  151. collectDataByDayList: [
  152. {
  153. day: '2025-10-29',
  154. total_count: '30',
  155. },
  156. {
  157. day: '2025-10-30',
  158. total_count: '165',
  159. },
  160. {
  161. day: '2025-10-31',
  162. total_count: '63',
  163. },
  164. {
  165. day: '2025-11-01',
  166. total_count: '30',
  167. },
  168. {
  169. day: '2025-11-02',
  170. total_count: '165',
  171. },
  172. {
  173. day: '2025-11-03',
  174. total_count: '63',
  175. },
  176. {
  177. day: '2025-11-04',
  178. total_count: '30',
  179. },
  180. {
  181. day: '2025-11-05',
  182. total_count: '165',
  183. },
  184. {
  185. day: '2025-11-06',
  186. total_count: '63',
  187. },
  188. ],
  189. };