monitorTypes.ts 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733
  1. import { AuditStatus, DeleteStatus, EnableStatus } from './types.ts'
  2. // 启用/禁用状态枚举
  3. export enum DisabledStatus {
  4. DISABLED = 1, // 禁用
  5. ENABLED = 0 // 启用
  6. }
  7. // 备件标识枚举 是否备件 (0否 1是)
  8. export enum IsSpare {
  9. NO = 0,
  10. YES = 1
  11. }
  12. // 设备通信协议类型枚举
  13. export enum DeviceProtocolType {
  14. SNMP = 'SNMP', // 简单网络管理协议(网络设备管理)
  15. HTTP = 'HTTP', // 超文本传输协议(Web服务)
  16. MODBUS = 'MODBUS', // Modbus协议(工业自动化标准通信协议)
  17. MQTT = 'MQTT', // 消息队列遥测传输(物联网消息协议)
  18. SOCKET = 'SOCKET', // Socket通信(基础网络通信)
  19. OPC = 'OPC', // OPC统一架构(工业设备互操作性标准)
  20. RS485 = 'RS485', // RS485串行通信(工业现场总线)
  21. TCP = 'TCP' // TCP网络协议(可靠的网络传输协议)
  22. }
  23. // 设备通信协议类型中文映射
  24. export const DeviceProtocolTypeNameMap: Record<DeviceProtocolType, string> = {
  25. [DeviceProtocolType.SNMP]: 'SNMP',
  26. [DeviceProtocolType.HTTP]: 'HTTP',
  27. [DeviceProtocolType.MODBUS]: 'MODBUS',
  28. [DeviceProtocolType.MQTT]: 'MQTT',
  29. [DeviceProtocolType.SOCKET]: 'SOCKET',
  30. [DeviceProtocolType.OPC]: 'OPC',
  31. [DeviceProtocolType.RS485]: 'RS485',
  32. [DeviceProtocolType.TCP]: 'TCP'
  33. };
  34. // 统一的监控指标类型枚举
  35. export enum MetricType {
  36. TEMPERATURE = 'temperature',
  37. HUMIDITY = 'humidity',
  38. VOLTAGE = 'voltage',
  39. CPU_USAGE = 'cpu_usage',
  40. MEMORY_USAGE = 'memory_usage',
  41. DISK_USAGE = 'disk_usage',
  42. NETWORK_TRAFFIC = 'network_traffic',
  43. PING_TIME = 'ping_time',
  44. PACKET_LOSS = 'packet_loss',
  45. SNMP_RESPONSE_TIME = 'snmp_response_time',
  46. SNMP_ERRORS = 'snmp_errors',
  47. HTTP_RESPONSE_TIME = 'http_response_time',
  48. HTTP_STATUS = 'http_status',
  49. TCP_CONNECTION_TIME = 'tcp_connection_time',
  50. CONNECTION_STATUS = 'connection_status'
  51. }
  52. // 监控类型中文映射
  53. export const MetricTypeNameMap: Record<MetricType, string> = {
  54. [MetricType.TEMPERATURE]: '温度',
  55. [MetricType.HUMIDITY]: '湿度',
  56. [MetricType.VOLTAGE]: '电压',
  57. [MetricType.CPU_USAGE]: 'CPU使用率',
  58. [MetricType.MEMORY_USAGE]: '内存使用率',
  59. [MetricType.DISK_USAGE]: '磁盘使用率',
  60. [MetricType.NETWORK_TRAFFIC]: '网络流量',
  61. [MetricType.PING_TIME]: 'Ping时间',
  62. [MetricType.PACKET_LOSS]: '丢包率',
  63. [MetricType.SNMP_RESPONSE_TIME]: 'SNMP响应时间',
  64. [MetricType.SNMP_ERRORS]: 'SNMP错误数',
  65. [MetricType.HTTP_RESPONSE_TIME]: 'HTTP响应时间',
  66. [MetricType.HTTP_STATUS]: 'HTTP状态码',
  67. [MetricType.TCP_CONNECTION_TIME]: 'TCP连接时间',
  68. [MetricType.CONNECTION_STATUS]: '连接状态'
  69. };
  70. // 处理类型枚举
  71. export enum HandleType {
  72. CONFIRM = 'confirm',
  73. RESOLVE = 'resolve',
  74. IGNORE = 'ignore'
  75. }
  76. // 处理类型中文映射
  77. export const HandleTypeNameMap: Record<HandleType, string> = {
  78. [HandleType.CONFIRM]: '确认',
  79. [HandleType.RESOLVE]: '解决',
  80. [HandleType.IGNORE]: '忽略'
  81. };
  82. // 问题类型枚举
  83. export enum ProblemType {
  84. DEVICE = 'device',
  85. NETWORK = 'network',
  86. POWER = 'power',
  87. CONSTRUCTION = 'construction',
  88. OTHER = 'other'
  89. }
  90. // 问题类型中文映射
  91. export const ProblemTypeNameMap: Record<ProblemType, string> = {
  92. [ProblemType.DEVICE]: '设备故障',
  93. [ProblemType.NETWORK]: '网络故障',
  94. [ProblemType.POWER]: '电源故障',
  95. [ProblemType.CONSTRUCTION]: '施工影响',
  96. [ProblemType.OTHER]: '其他原因'
  97. };
  98. // 通知类型枚举
  99. export enum NotifyType {
  100. SMS = 'sms',
  101. EMAIL = 'email',
  102. WECHAT = 'wechat'
  103. }
  104. // 通知类型中文映射
  105. export const NotifyTypeNameMap: Record<NotifyType, string> = {
  106. [NotifyType.SMS]: '短信',
  107. [NotifyType.EMAIL]: '邮件',
  108. [NotifyType.WECHAT]: '微信'
  109. };
  110. // 告警等级枚举
  111. export enum AlertLevel {
  112. MINOR = 0, // 次要
  113. NORMAL = 1, // 一般
  114. IMPORTANT = 2, // 重要
  115. URGENT = 3 // 紧急
  116. }
  117. // 告警等级中文映射
  118. export const AlertLevelNameMap: Record<AlertLevel, string> = {
  119. [AlertLevel.MINOR]: '次要',
  120. [AlertLevel.NORMAL]: '一般',
  121. [AlertLevel.IMPORTANT]: '重要',
  122. [AlertLevel.URGENT]: '紧急'
  123. };
  124. // 告警等级颜色映射
  125. export const AlertLevelColorMap: Record<AlertLevel, string> = {
  126. [AlertLevel.MINOR]: 'blue',
  127. [AlertLevel.NORMAL]: 'orange',
  128. [AlertLevel.IMPORTANT]: 'red',
  129. [AlertLevel.URGENT]: 'purple'
  130. };
  131. // 设备状态枚举(资产管理)
  132. export enum DeviceStatus {
  133. NORMAL = 0, // 正常
  134. MAINTAIN = 1, // 维护中
  135. FAULT = 2, // 故障
  136. OFFLINE = 3 // 下线
  137. }
  138. // 设备分类枚举
  139. export enum DeviceCategory {
  140. SERVER = 1, // 服务器
  141. NETWORK = 2, // 网络设备
  142. STORAGE = 3, // 存储设备
  143. SECURITY = 4, // 安全设备
  144. OTHER = 5 // 其他设备
  145. }
  146. // 区域枚举
  147. export enum AreaType {
  148. AREA_A = 1, // A区
  149. AREA_B = 2, // B区
  150. AREA_C = 3, // C区
  151. AREA_OTHER = 4 // 其他区域
  152. }
  153. // 资产状态枚举
  154. export enum AssetStatus {
  155. IN_USE = 0, // 使用中
  156. IDLE = 1, // 闲置
  157. REPAIR = 2, // 维修中
  158. SCRAPPED = 3 // 已报废
  159. }
  160. // 网络状态枚举
  161. export enum NetworkStatus {
  162. CONNECTED = 0, // 已连接
  163. DISCONNECTED = 1, // 已断开
  164. UNSTABLE = 2 // 不稳定
  165. }
  166. // 丢包状态枚举
  167. export enum PacketLossStatus {
  168. NORMAL = 0, // 正常
  169. HIGH = 1 // 丢包
  170. }
  171. // 设备状态中文映射(资产管理)
  172. export const DeviceStatusNameMap: Record<DeviceStatus, string> = {
  173. [DeviceStatus.NORMAL]: '正常',
  174. [DeviceStatus.MAINTAIN]: '维护中',
  175. [DeviceStatus.FAULT]: '故障',
  176. [DeviceStatus.OFFLINE]: '下线'
  177. };
  178. // 设备状态颜色映射(资产管理)
  179. export const DeviceStatusColorMap: Record<DeviceStatus, string> = {
  180. [DeviceStatus.NORMAL]: 'green',
  181. [DeviceStatus.MAINTAIN]: 'blue',
  182. [DeviceStatus.FAULT]: 'red',
  183. [DeviceStatus.OFFLINE]: 'gray'
  184. };
  185. // 设备分类中文映射
  186. export const DeviceCategoryNameMap: Record<DeviceCategory, string> = {
  187. [DeviceCategory.SERVER]: '服务器',
  188. [DeviceCategory.NETWORK]: '网络设备',
  189. [DeviceCategory.STORAGE]: '存储设备',
  190. [DeviceCategory.SECURITY]: '安全设备',
  191. [DeviceCategory.OTHER]: '其他设备'
  192. };
  193. // 告警状态枚举
  194. export enum AlertStatus {
  195. PENDING = 'pending',
  196. HANDLING = 'handling',
  197. RESOLVED = 'resolved',
  198. IGNORED = 'ignored'
  199. }
  200. // 告警状态中文映射
  201. export const AlertStatusNameMap: Record<AlertStatus, string> = {
  202. [AlertStatus.PENDING]: '待处理',
  203. [AlertStatus.HANDLING]: '处理中',
  204. [AlertStatus.RESOLVED]: '已解决',
  205. [AlertStatus.IGNORED]: '已忽略'
  206. };
  207. // 告警状态颜色映射
  208. export const AlertStatusColorMap: Record<AlertStatus, string> = {
  209. [AlertStatus.PENDING]: 'red',
  210. [AlertStatus.HANDLING]: 'blue',
  211. [AlertStatus.RESOLVED]: 'green',
  212. [AlertStatus.IGNORED]: 'gray'
  213. };
  214. // 设备在线状态枚举
  215. export enum OnlineStatus {
  216. ONLINE = 'online',
  217. OFFLINE = 'offline'
  218. }
  219. // 设备在线状态中文映射
  220. export const OnlineStatusNameMap: Record<OnlineStatus, string> = {
  221. [OnlineStatus.ONLINE]: '在线',
  222. [OnlineStatus.OFFLINE]: '离线'
  223. };
  224. // 设备在线状态颜色映射
  225. export const OnlineStatusColorMap: Record<OnlineStatus, string> = {
  226. [OnlineStatus.ONLINE]: 'green',
  227. [OnlineStatus.OFFLINE]: 'red'
  228. };
  229. // 工单状态枚举
  230. export enum WorkOrderStatus {
  231. PENDING = '待受理', // 待受理
  232. PROCESSING = '处理中', // 处理中
  233. REASSIGNED = '已改派', // 已改派
  234. COMPLETED = '已完成', // 已完成
  235. CLOSED = '已关闭' // 已关闭
  236. }
  237. // 工单状态中文映射
  238. export const WorkOrderStatusNameMap: Record<WorkOrderStatus, string> = {
  239. [WorkOrderStatus.PENDING]: '待受理',
  240. [WorkOrderStatus.PROCESSING]: '处理中',
  241. [WorkOrderStatus.REASSIGNED]: '已改派',
  242. [WorkOrderStatus.COMPLETED]: '已完成',
  243. [WorkOrderStatus.CLOSED]: '已关闭'
  244. };
  245. // 工单状态颜色映射
  246. export const WorkOrderStatusColorMap: Record<WorkOrderStatus, string> = {
  247. [WorkOrderStatus.PENDING]: 'orange',
  248. [WorkOrderStatus.PROCESSING]: 'blue',
  249. [WorkOrderStatus.REASSIGNED]: 'purple',
  250. [WorkOrderStatus.COMPLETED]: 'green',
  251. [WorkOrderStatus.CLOSED]: 'gray'
  252. };
  253. // 工单优先级枚举
  254. export enum WorkOrderPriority {
  255. NORMAL = 0, // 普通
  256. IMPORTANT = 1, // 重要
  257. URGENT = 2 // 紧急
  258. }
  259. // 工单优先级中文映射
  260. export const WorkOrderPriorityNameMap: Record<WorkOrderPriority, string> = {
  261. [WorkOrderPriority.NORMAL]: '普通',
  262. [WorkOrderPriority.IMPORTANT]: '重要',
  263. [WorkOrderPriority.URGENT]: '紧急'
  264. };
  265. // 工单优先级颜色映射
  266. export const WorkOrderPriorityColorMap: Record<WorkOrderPriority, string> = {
  267. [WorkOrderPriority.NORMAL]: 'green',
  268. [WorkOrderPriority.IMPORTANT]: 'orange',
  269. [WorkOrderPriority.URGENT]: 'red'
  270. };
  271. // 工单操作类型枚举
  272. export enum WorkOrderAction {
  273. CREATE = 'create',
  274. ACCEPT = 'accept',
  275. HANDLE = 'handle',
  276. AUDIT = 'audit',
  277. CLOSE = 'close'
  278. }
  279. // 工单操作类型中文映射
  280. export const WorkOrderActionNameMap: Record<WorkOrderAction, string> = {
  281. [WorkOrderAction.CREATE]: '创建',
  282. [WorkOrderAction.ACCEPT]: '接受',
  283. [WorkOrderAction.HANDLE]: '处理',
  284. [WorkOrderAction.AUDIT]: '审核',
  285. [WorkOrderAction.CLOSE]: '关闭'
  286. };
  287. // 服务器类型枚举
  288. export enum ServerType {
  289. STANDARD = 'standard',
  290. NETWORK = 'network',
  291. STORAGE = 'storage',
  292. SPECIAL = 'special'
  293. }
  294. // 服务器类型中文映射
  295. export const ServerTypeNameMap: Record<ServerType, string> = {
  296. [ServerType.STANDARD]: '标准服务器',
  297. [ServerType.NETWORK]: '网络设备',
  298. [ServerType.STORAGE]: '存储设备',
  299. [ServerType.SPECIAL]: '特殊设备'
  300. };
  301. // 图表类型映射
  302. export const AlertTypeMap = {
  303. temperature: { text: '温度异常', color: 'orange' },
  304. humidity: { text: '湿度异常', color: 'blue' },
  305. offline: { text: '设备离线', color: 'red' }
  306. } as const;
  307. // 工单状态映射
  308. export const StatusMap = {
  309. unread: { text: '未读', color: 'red' },
  310. read: { text: '已读', color: 'blue' },
  311. processed: { text: '已处理', color: 'green' }
  312. } as const;
  313. // 定义JSON数据结构接口
  314. // 附件类型定义
  315. export interface Attachment {
  316. /** 附件ID */
  317. id: string;
  318. /** 附件名称 */
  319. name: string;
  320. /** 附件访问地址 */
  321. url: string;
  322. /** 附件类型(如image/jpeg, application/pdf等) */
  323. type: string;
  324. /** 附件大小(字节) */
  325. size: number;
  326. /** 上传时间 */
  327. upload_time: string;
  328. }
  329. // 通知项配置类型定义
  330. interface NotifyItem {
  331. /** 通知项ID */
  332. id: string;
  333. /** 通知项类型 */
  334. type: string;
  335. /** 是否启用 */
  336. enabled: boolean;
  337. /** 通知配置参数 */
  338. config: Record<string, unknown>;
  339. }
  340. // 监控配置类型定义
  341. export interface MonitorConfig {
  342. /** 监控间隔(秒) */
  343. interval: number;
  344. /** 监控指标列表 */
  345. metrics: Array<{
  346. /** 指标名称 */
  347. name: string;
  348. /** 指标类型 */
  349. type: string;
  350. /** 是否启用 */
  351. enabled: boolean;
  352. /** 阈值设置 */
  353. threshold?: {
  354. /** 最小阈值 */
  355. min?: number;
  356. /** 最大阈值 */
  357. max?: number;
  358. };
  359. }>;
  360. /** 通知设置 */
  361. notification: {
  362. /** 是否启用通知 */
  363. enabled: boolean;
  364. /** 通知渠道列表 */
  365. channels: string[];
  366. };
  367. }
  368. // 告警规则类型定义
  369. export interface AlertRuleConfig {
  370. /** 规则列表 */
  371. rules: Array<{
  372. /** 监控指标 */
  373. metric: string;
  374. /** 触发条件(如>、<、=等) */
  375. condition: string;
  376. /** 阈值 */
  377. threshold: number;
  378. /** 持续时间(秒) */
  379. duration: number;
  380. /** 告警等级 */
  381. level: AlertLevel;
  382. }>;
  383. /** 动作列表 */
  384. actions: Array<{
  385. /** 动作类型 */
  386. type: string;
  387. /** 动作目标 */
  388. target: string;
  389. /** 通知模板 */
  390. template?: string;
  391. }>;
  392. }
  393. // 数据格式配置类型定义
  394. export interface DataSchema {
  395. /** 版本号 */
  396. version: string;
  397. /** 属性定义 */
  398. properties: Record<string, {
  399. /** 数据类型 */
  400. type: string;
  401. /** 描述 */
  402. description?: string;
  403. /** 是否必填 */
  404. required?: boolean;
  405. /** 格式(如日期格式) */
  406. format?: string;
  407. /** 枚举值列表 */
  408. enum?: string[];
  409. }>;
  410. /** 必填字段列表 */
  411. required: string[];
  412. }
  413. // 图标配置类型定义
  414. export interface IconConfig {
  415. /** 图标尺寸 */
  416. size: {
  417. /** 宽度 */
  418. width: number;
  419. /** 高度 */
  420. height: number;
  421. };
  422. /** 支持的文件格式 */
  423. format: string[];
  424. /** 最大文件大小(KB) */
  425. maxSize: number;
  426. }
  427. // 告警等级配置类型定义
  428. export interface AlertLevelConfig {
  429. /** 等级定义 */
  430. levels: Record<string, {
  431. /** 等级名称 */
  432. name: string;
  433. /** 等级颜色 */
  434. color: string;
  435. /** 优先级 */
  436. priority: number;
  437. /** 是否自动升级 */
  438. autoEscalation?: boolean;
  439. /** 升级延迟时间(分钟) */
  440. escalationDelay?: number;
  441. }>;
  442. /** 默认等级 */
  443. default: string;
  444. }
  445. // 监控项配置类型定义
  446. export interface MonitorItemConfig {
  447. /** 监控项列表 */
  448. items: Array<{
  449. /** 监控项名称 */
  450. name: string;
  451. /** 描述 */
  452. description: string;
  453. /** 监控项类型 */
  454. type: string;
  455. /** 单位 */
  456. unit: string;
  457. /** 默认是否启用 */
  458. defaultEnabled: boolean;
  459. /** 默认阈值 */
  460. defaultThresholds?: {
  461. /** 最小阈值 */
  462. min?: number;
  463. /** 最大阈值 */
  464. max?: number;
  465. };
  466. }>;
  467. }
  468. // 常用语列表类型定义
  469. export interface CommonPhrase {
  470. /** 常用语ID */
  471. id: string;
  472. /** 分类 */
  473. category: string;
  474. /** 内容 */
  475. content: string;
  476. /** 标签列表 */
  477. tags: string[];
  478. }
  479. // SLA配置类型定义
  480. export interface SLAConfig {
  481. /** 响应时间(分钟) */
  482. responseTime: number;
  483. /** 解决时间(分钟) */
  484. resolveTime: number;
  485. /** 工作时间 */
  486. workingHours: {
  487. /** 开始时间(HH:mm) */
  488. start: string;
  489. /** 结束时间(HH:mm) */
  490. end: string;
  491. /** 工作日(0-6,0代表周日) */
  492. workDays: number[];
  493. };
  494. /** 升级规则 */
  495. escalationRules: Array<{
  496. /** 超时时间(分钟) */
  497. timeout: number;
  498. /** 动作 */
  499. action: string;
  500. /** 目标(如用户ID、角色等) */
  501. target: string[];
  502. }>;
  503. }
  504. // 流程配置类型定义
  505. export interface WorkflowConfig {
  506. /** 流程步骤 */
  507. steps: Array<{
  508. /** 步骤名称 */
  509. name: string;
  510. /** 允许操作的角色 */
  511. roles: string[];
  512. /** 可执行的动作 */
  513. actions: string[];
  514. /** 下一步可能的步骤 */
  515. nextSteps: string[];
  516. /** 自动超时时间(分钟) */
  517. autoTimeout?: number;
  518. }>;
  519. /** 初始步骤 */
  520. initialStep: string;
  521. }
  522. // 告警处理记录表
  523. export interface AlertHandleLog {
  524. /** 主键ID */
  525. id: number;
  526. /** 关联的告警ID */
  527. alert_id: number;
  528. /** 处理人ID */
  529. handler_id: number;
  530. /** 处理类型 */
  531. handle_type: HandleType;
  532. /** 问题类型 */
  533. problem_type: ProblemType;
  534. /** 处理结果 */
  535. handle_result?: string;
  536. /** 附件列表 */
  537. attachments?: Attachment[];
  538. /** 是否禁用通知 (0否 1是) */
  539. notify_disabled?: number;
  540. /** 禁用的通知项配置 */
  541. notify_items?: NotifyItem[];
  542. /** 处理时间 */
  543. handle_time: Date;
  544. /** 是否删除 (0否 1是) */
  545. is_deleted?: DeleteStatus;
  546. /** 创建时间 */
  547. created_at: Date;
  548. /** 更新时间 */
  549. updated_at: Date;
  550. }
  551. // 告警通知配置表
  552. export interface AlertNotifyConfig {
  553. /** 主键ID */
  554. id: number;
  555. /** 关联的设备ID */
  556. device_id: number;
  557. /** 告警等级 */
  558. alert_level: AlertLevel;
  559. /** 通知类型 */
  560. notify_type: NotifyType;
  561. /** 通知模板 */
  562. notify_template?: string;
  563. /** 通知用户ID列表 */
  564. notify_users?: number[];
  565. /** 短信通知手机号(当notify_type为SMS时使用) */
  566. phone_number?: string;
  567. /** 是否启用 (0否 1是) */
  568. is_enabled?: EnableStatus;
  569. /** 是否删除 (0否 1是) */
  570. is_deleted?: DeleteStatus;
  571. /** 创建时间 */
  572. created_at: Date;
  573. /** 更新时间 */
  574. updated_at: Date;
  575. }
  576. // 设备告警规则表
  577. export interface DeviceAlertRule {
  578. /** 主键ID */
  579. id: number;
  580. /** 关联的设备ID */
  581. device_id: number;
  582. /** 监控指标类型 */
  583. metric_type: string;
  584. /** 最小阈值 */
  585. min_value?: number;
  586. /** 最大阈值 */
  587. max_value?: number;
  588. /** 持续时间(秒) */
  589. duration_seconds?: number;
  590. /** 告警等级 */
  591. alert_level: AlertLevel;
  592. /** 告警消息模板 */
  593. alert_message?: string;
  594. /** 是否启用 (0否 1是) */
  595. is_enabled?: EnableStatus;
  596. /** 是否删除 (0否 1是) */
  597. is_deleted?: DeleteStatus;
  598. /** 创建时间 */
  599. created_at: Date;
  600. /** 更新时间 */
  601. updated_at: Date;
  602. }
  603. // 设备告警记录表
  604. export interface DeviceAlert {
  605. /** 主键ID */
  606. id: number;
  607. /** 关联的设备ID */
  608. device_id: number;
  609. /** 设备名称 */
  610. device_name: string;
  611. /** 监控指标类型 */
  612. metric_type: string;
  613. /** 触发值 */
  614. metric_value: number;
  615. /** 告警等级 */
  616. alert_level: AlertLevel;
  617. /** 告警消息 */
  618. alert_message: string;
  619. /** 状态 */
  620. status: AlertStatus;
  621. /** 是否删除 (0否 1是) */
  622. is_deleted?: DeleteStatus;
  623. /** 创建时间 */
  624. created_at: Date;
  625. /** 更新时间 */
  626. updated_at: Date;
  627. }
  628. // 设备分类图标表
  629. export interface DeviceCategoryIcon {
  630. /** 主键ID */
  631. id: number;
  632. /** 关联的设备分类ID */
  633. category_id: number;
  634. /** 分类图标 */
  635. icon?: string;
  636. /** 图标名称 */
  637. icon_name?: string;
  638. /** 图标类型(svg/url等) */
  639. icon_type?: string;
  640. /** 排序 */
  641. sort?: number;
  642. /** 是否为默认图标 (0否 1是) */
  643. is_default?: number;
  644. /** 是否禁用 (0否 1是) */
  645. is_disabled?: number;
  646. /** 是否被删除 (0否 1是) */
  647. is_deleted?: number;
  648. /** 创建时间 */
  649. created_at: Date;
  650. /** 更新时间 */
  651. updated_at: Date;
  652. }
  653. // 设备实例表
  654. export interface DeviceInstance {
  655. /** 关联资产ID */
  656. id: number;
  657. /** 设备类型ID */
  658. type_id: number;
  659. /** 通信协议(SNMP/HTTP/RS485/TCP等) */
  660. protocol: DeviceProtocolType;
  661. /** 通信地址 */
  662. address: string;
  663. /** 状态地址 */
  664. status_address?: string;
  665. /** 连接配置 */
  666. connection_config?: string;
  667. /** 采集间隔(秒) */
  668. collect_interval?: number;
  669. /** 最后采集时间 */
  670. last_collect_time?: Date;
  671. /** 备注 */
  672. remark?: string;
  673. /** 是否启用 (0否 1是) */
  674. is_enabled?: number;
  675. /** 是否删除 (0否 1是) */
  676. is_deleted?: number;
  677. /** 创建时间 */
  678. created_at: Date;
  679. /** 更新时间 */
  680. updated_at: Date;
  681. /** 资产名称(来自zichan_info表) */
  682. asset_name?: string;
  683. /** 设备分类(来自zichan_info表) */
  684. device_category?: DeviceCategory;
  685. /** 归属区域(来自zichan_info表) */
  686. area?: AreaType;
  687. /** 供应商(来自zichan_info表) */
  688. supplier?: string;
  689. /** 设备状态(来自zichan_info表) */
  690. device_status?: DeviceStatus;
  691. }
  692. // 设备监控数据表
  693. export interface DeviceMonitorData {
  694. /** 主键ID */
  695. id: number;
  696. /** 关联的设备ID */
  697. device_id: number;
  698. /** 监控指标类型(temperature/humidity/smoke/water等) */
  699. metric_type: string;
  700. /** 监控值 */
  701. metric_value: number;
  702. /** 单位 */
  703. unit?: string;
  704. /** 状态 */
  705. status?: DeviceStatus;
  706. /** 采集时间 */
  707. collect_time: Date;
  708. /** 是否删除 (0否 1是) */
  709. is_deleted?: DeleteStatus;
  710. /** 创建时间 */
  711. created_at: Date;
  712. /** 更新时间 */
  713. updated_at: Date;
  714. }
  715. // 设备类型表
  716. export interface DeviceType {
  717. /** 主键ID */
  718. id: number;
  719. /** 类型名称 */
  720. name: string;
  721. /** 类型编码 */
  722. code: string;
  723. /** 设备类型图片URL */
  724. image_url?: string;
  725. /** 类型描述 */
  726. description?: string;
  727. /** 是否启用 (0否 1是) */
  728. is_enabled?: number;
  729. /** 是否删除 (0否 1是) */
  730. is_deleted?: number;
  731. /** 创建时间 */
  732. created_at: Date;
  733. /** 更新时间 */
  734. updated_at: Date;
  735. }
  736. // 操作日志表
  737. export interface OperationLog {
  738. /** 主键ID */
  739. id: number;
  740. /** 操作人ID */
  741. operator_id: number;
  742. /** 操作类型 */
  743. operation_type: string;
  744. /** 操作内容 */
  745. operation_content?: string;
  746. /** 操作结果 */
  747. operation_result?: string;
  748. /** 操作IP */
  749. ip_address?: string;
  750. /** 是否删除 (0否 1是) */
  751. is_deleted?: number;
  752. /** 创建时间 */
  753. created_at: Date;
  754. /** 更新时间 */
  755. updated_at: Date;
  756. }
  757. // 机柜信息表
  758. export interface RackInfo {
  759. /** 主键ID */
  760. id: number;
  761. /** 机柜名称 */
  762. rack_name?: string;
  763. /** 机柜编号 */
  764. rack_code?: string;
  765. /** 机柜可容纳设备数量,默认42U */
  766. capacity?: number;
  767. /** 机柜X轴位置坐标 */
  768. position_x?: number;
  769. /** 机柜Y轴位置坐标 */
  770. position_y?: number;
  771. /** 机柜Z轴位置坐标 */
  772. position_z?: number;
  773. /** 机柜所在区域 */
  774. area?: string;
  775. /** 机柜所在机房 */
  776. room?: string;
  777. /** 备注信息 */
  778. remark?: string;
  779. /** 是否禁用 (0否 1是) */
  780. is_disabled?: EnableStatus;
  781. /** 是否被删除 (0否 1是) */
  782. is_deleted?: DeleteStatus;
  783. /** 创建时间 */
  784. created_at: Date;
  785. /** 更新时间 */
  786. updated_at: Date;
  787. }
  788. // 机柜服务器表
  789. export interface RackServer {
  790. /** 主键ID */
  791. id: number;
  792. /** 关联的机柜ID */
  793. rack_id: number;
  794. /** 关联的资产ID */
  795. asset_id: number;
  796. /** 设备安装的起始U位 */
  797. start_position: number;
  798. /** 设备占用U数 */
  799. size?: number;
  800. /** 服务器类型 */
  801. server_type?: number;
  802. /** 备注信息 */
  803. remark?: string;
  804. /** 是否禁用 (0否 1是) */
  805. is_disabled?: EnableStatus;
  806. /** 是否被删除 (0否 1是) */
  807. is_deleted?: DeleteStatus;
  808. /** 创建时间 */
  809. created_at: Date;
  810. /** 更新时间 */
  811. updated_at: Date;
  812. }
  813. // 机柜服务器类型表
  814. export interface RackServerType {
  815. /** 主键ID */
  816. id: number;
  817. /** 类型名称 */
  818. name: string;
  819. /** 类型编码 */
  820. code: string;
  821. /** 类型图片 */
  822. image_url?: string;
  823. /** 类型描述 */
  824. description?: string;
  825. /** 是否启用 (0否 1是) */
  826. is_enabled?: EnableStatus;
  827. /** 是否被删除 (0否 1是) */
  828. is_deleted?: DeleteStatus;
  829. /** 创建时间 */
  830. created_at: Date;
  831. /** 更新时间 */
  832. updated_at: Date;
  833. }
  834. // // 工单表
  835. // export interface WorkOrder {
  836. // /** 主键ID */
  837. // id: number;
  838. // /** 工单标题 */
  839. // title: string;
  840. // /** 关联设备ID */
  841. // device_id?: number;
  842. // /** 关联告警ID */
  843. // alert_id?: number;
  844. // /** 工单模板ID */
  845. // template_id?: number;
  846. // /** 工单内容 */
  847. // content?: string;
  848. // /** 工单状态 */
  849. // status: WorkOrderStatus;
  850. // /** 优先级 */
  851. // priority: WorkOrderPriority;
  852. // /** 创建人ID */
  853. // creator_id: number;
  854. // /** 处理人ID */
  855. // handler_id?: number;
  856. // /** 审核人ID */
  857. // auditor_id?: number;
  858. // /** 截止时间 */
  859. // deadline?: Date;
  860. // /** 处理结果 */
  861. // handle_result?: string;
  862. // /** 审核结果 */
  863. // audit_result?: string;
  864. // /** 是否删除 (0否 1是) */
  865. // is_deleted?: number;
  866. // /** 创建时间 */
  867. // created_at: Date;
  868. // /** 更新时间 */
  869. // updated_at: Date;
  870. // }
  871. // // 工单处理记录表
  872. // export interface WorkOrderLog {
  873. // /** 主键ID */
  874. // id: number;
  875. // /** 工单ID */
  876. // work_order_id: number;
  877. // /** 操作人ID */
  878. // operator_id: number;
  879. // /** 操作类型 */
  880. // action: WorkOrderAction;
  881. // /** 处理内容 */
  882. // content?: string;
  883. // /** 是否删除 (0否 1是) */
  884. // is_deleted?: number;
  885. // /** 创建时间 */
  886. // created_at: Date;
  887. // /** 更新时间 */
  888. // updated_at: Date;
  889. // }
  890. // // 工单模板表
  891. // export interface WorkOrderTemplate {
  892. // /** 主键ID */
  893. // id: number;
  894. // /** 模板名称 */
  895. // name: string;
  896. // /** 模板内容 */
  897. // content?: string;
  898. // /** 是否需要审核 (0否 1是) */
  899. // need_audit: number;
  900. // /** 默认处理人 */
  901. // default_handler_id?: number;
  902. // /** 默认完成时限(小时) */
  903. // default_deadline_hours?: number;
  904. // /** 常用语列表 */
  905. // common_phrases?: CommonPhrase[];
  906. // /** SLA配置 */
  907. // sla_config?: SLAConfig;
  908. // /** 流程配置 */
  909. // workflow_config?: WorkflowConfig;
  910. // /** 是否启用 (0否 1是) */
  911. // is_enabled?: number;
  912. // /** 是否删除 (0否 1是) */
  913. // is_deleted?: number;
  914. // /** 创建时间 */
  915. // created_at: Date;
  916. // /** 更新时间 */
  917. // updated_at: Date;
  918. // }
  919. // 资产信息表
  920. export interface ZichanInfo {
  921. /** 主键ID */
  922. id: number;
  923. /** 资产名称 */
  924. asset_name?: string;
  925. /** 设备分类 */
  926. device_category?: DeviceCategory;
  927. /** 归属区域 */
  928. area?: AreaType;
  929. /** 供应商 */
  930. supplier?: string;
  931. /** 使用地址 */
  932. use_address?: string;
  933. /** 运行情况 */
  934. operation_status?: string;
  935. /** 是否审核 (0否 1是) */
  936. is_audited?: number;
  937. /** 审核状态 */
  938. audit_status?: AuditStatus;
  939. /** 资产状态 */
  940. asset_status?: AssetStatus;
  941. /** 入库数量 */
  942. stock_quantity?: number;
  943. /** 质保时间 */
  944. warranty_time?: Date;
  945. /** 品牌 */
  946. brand?: string;
  947. /** IP地址 */
  948. ip_address?: string;
  949. /** 设备状态 */
  950. device_status?: DeviceStatus;
  951. /** 网络状态 */
  952. network_status?: NetworkStatus;
  953. /** 丢包率 */
  954. packet_loss?: number;
  955. /** 图片 */
  956. images?: string;
  957. /** 是否备件 (0否 1是) */
  958. is_spare?: number;
  959. /** 是否被禁用 (0否 1是) */
  960. is_disabled?: number;
  961. /** 是否被删除 (0否 1是) */
  962. is_deleted?: number;
  963. /** 资产位置经度 */
  964. longitude?: number;
  965. /** 资产位置纬度 */
  966. latitude?: number;
  967. /** CPU信息 */
  968. cpu?: string;
  969. /** 内存信息 */
  970. memory?: string;
  971. /** 硬盘信息 */
  972. disk?: string;
  973. /** 创建时间 */
  974. created_at: Date;
  975. /** 更新时间 */
  976. updated_at: Date;
  977. }
  978. // 资产分类表
  979. export interface ZichanCategory {
  980. /** 主键ID */
  981. id: number;
  982. /** 分类名称 */
  983. name: string;
  984. /** 分类编码 */
  985. code: string;
  986. /** 分类图片 */
  987. image_url?: string;
  988. /** 分类描述 */
  989. description?: string;
  990. /** 是否启用 (0否 1是) */
  991. is_enabled?: EnableStatus;
  992. /** 是否被删除 (0否 1是) */
  993. is_deleted?: DeleteStatus;
  994. /** 创建时间 */
  995. created_at: Date;
  996. /** 更新时间 */
  997. updated_at: Date;
  998. }
  999. // 资产归属区域
  1000. export interface ZichanArea {
  1001. /** 主键ID */
  1002. id: number;
  1003. /** 区域名称 */
  1004. name: string;
  1005. /** 区域编码 */
  1006. code: string;
  1007. /** 区域图片 */
  1008. image_url?: string;
  1009. /** 区域描述 */
  1010. description?: string;
  1011. /** 是否启用 (0否 1是) */
  1012. is_enabled?: EnableStatus;
  1013. /** 是否被删除 (0否 1是) */
  1014. is_deleted?: DeleteStatus;
  1015. /** 创建时间 */
  1016. created_at: Date;
  1017. /** 更新时间 */
  1018. updated_at: Date;
  1019. }
  1020. // 资产流转记录表
  1021. export interface ZichanTransLog {
  1022. /** 主键ID */
  1023. id: number;
  1024. /** 资产流转 */
  1025. asset_transfer?: AssetTransferType;
  1026. /** 资产ID */
  1027. asset_id?: number;
  1028. /** 人员 */
  1029. person?: string;
  1030. /** 部门 */
  1031. department?: string;
  1032. /** 电话 */
  1033. phone?: string;
  1034. /** 流转事由 */
  1035. transfer_reason?: string;
  1036. /** 流转时间 */
  1037. transfer_time?: Date | string;
  1038. /** 是否被禁用 (0否 1是) */
  1039. is_disabled?: number;
  1040. /** 是否被删除 (0否 1是) */
  1041. is_deleted?: number;
  1042. /** 创建时间 */
  1043. created_at: Date;
  1044. /** 更新时间 */
  1045. updated_at: Date;
  1046. /** 关联的资产信息(查询时后端关联返回) */
  1047. asset_info?: ZichanInfo;
  1048. }
  1049. // 文件库接口
  1050. export interface FileLibrary {
  1051. /** 主键ID */
  1052. id: number;
  1053. /** 文件名称 */
  1054. file_name: string;
  1055. /** 原始文件名 */
  1056. original_filename?: string;
  1057. /** 文件路径 */
  1058. file_path: string;
  1059. /** 文件类型 */
  1060. file_type: string;
  1061. /** 文件大小(字节) */
  1062. file_size: number;
  1063. /** 上传用户ID */
  1064. uploader_id?: number;
  1065. /** 上传者名称 */
  1066. uploader_name?: string;
  1067. /** 文件分类 */
  1068. category_id?: number;
  1069. /** 文件标签 */
  1070. tags?: string;
  1071. /** 文件描述 */
  1072. description?: string;
  1073. /** 下载次数 */
  1074. download_count: number;
  1075. /** 是否禁用 (0否 1是) */
  1076. is_disabled?: EnableStatus;
  1077. /** 是否被删除 (0否 1是) */
  1078. is_deleted?: DeleteStatus;
  1079. /** 创建时间 */
  1080. created_at: string;
  1081. /** 更新时间 */
  1082. updated_at: string;
  1083. }
  1084. // 文件分类接口
  1085. export interface FileCategory {
  1086. id: number;
  1087. name: string;
  1088. code: string;
  1089. description?: string;
  1090. is_deleted?: DeleteStatus;
  1091. created_at: string;
  1092. updated_at: string;
  1093. }
  1094. // 资产流转类型枚举
  1095. export enum AssetTransferType {
  1096. STOCK = 0, // 在库
  1097. BORROW = 1, // 借用
  1098. RETURN = 2, // 归还
  1099. LOST = 3, // 遗失
  1100. MAINTAIN = 4 // 维护保养
  1101. }
  1102. // 资产流转类型名称映射
  1103. export const AssetTransferTypeNameMap: Record<AssetTransferType, string> = {
  1104. [AssetTransferType.STOCK]: '在库',
  1105. [AssetTransferType.BORROW]: '借用',
  1106. [AssetTransferType.RETURN]: '归还',
  1107. [AssetTransferType.LOST]: '遗失',
  1108. [AssetTransferType.MAINTAIN]: '维护保养'
  1109. };
  1110. // 资产流转类型颜色映射
  1111. export const AssetTransferTypeColorMap: Record<AssetTransferType, string> = {
  1112. [AssetTransferType.STOCK]: 'green',
  1113. [AssetTransferType.BORROW]: 'blue',
  1114. [AssetTransferType.RETURN]: 'cyan',
  1115. [AssetTransferType.LOST]: 'red',
  1116. [AssetTransferType.MAINTAIN]: 'orange'
  1117. };
  1118. // 添加图表类型定义(从大屏移植)
  1119. export interface CategoryChartData {
  1120. 设备分类: string;
  1121. 设备数: number;
  1122. }
  1123. export interface CategoryChartDataWithPercent extends CategoryChartData {
  1124. 百分比: string;
  1125. }
  1126. export interface OnlineRateChartData {
  1127. time_interval: string;
  1128. online_devices: number;
  1129. total_devices: number;
  1130. }
  1131. export interface StateChartData {
  1132. 资产流转: string;
  1133. 设备数: number;
  1134. }
  1135. export interface StateChartDataWithPercent extends StateChartData {
  1136. 百分比: string;
  1137. }
  1138. export interface AlarmChartData {
  1139. time_interval: string;
  1140. total_devices: number;
  1141. }
  1142. export interface AlarmDeviceData {
  1143. deviceName: string;
  1144. alarmCount: number;
  1145. rank: number;
  1146. }
  1147. // 设备与资产信息结合的接口
  1148. export interface DeviceWithAssetInfo {
  1149. id: number;
  1150. asset_name?: string;
  1151. device_category?: number;
  1152. ip_address?: string;
  1153. device_status?: DeviceStatus;
  1154. network_status?: NetworkStatus;
  1155. packet_loss?: PacketLossStatus;
  1156. cpu?: string;
  1157. memory?: string;
  1158. disk?: string;
  1159. is_deleted?: number;
  1160. }
  1161. // 地图标记数据接口 - 基础定义
  1162. export interface MarkerData {
  1163. longitude: number;
  1164. latitude: number;
  1165. isOnline?: string;
  1166. asset_name?: string;
  1167. type_image_url?: string;
  1168. }
  1169. // 设备地图监控视图设备接口
  1170. export interface MapViewDevice extends MarkerData {
  1171. id: number;
  1172. name?: string;
  1173. type_code: string;
  1174. device_category?: DeviceCategory;
  1175. device_status?: DeviceStatus;
  1176. description?: string;
  1177. address?: string;
  1178. protocol?: DeviceProtocolType;
  1179. last_update_time?: string;
  1180. area_code?: string;
  1181. area_name?: string;
  1182. image_url?: string;
  1183. }
  1184. // 设备地图筛选条件
  1185. export interface DeviceMapFilter {
  1186. type_code?: string;
  1187. device_category?: DeviceCategory[];
  1188. device_status?: DeviceStatus;
  1189. area_code?: string[];
  1190. keyword?: string;
  1191. device_id?: number;
  1192. }
  1193. // 设备地图统计数据接口
  1194. export interface DeviceMapStats {
  1195. total: number;
  1196. online: number;
  1197. offline: number;
  1198. error: number;
  1199. normal?: number;
  1200. fault?: number;
  1201. categoryStats?: {
  1202. category: DeviceCategory;
  1203. count: number;
  1204. name: string;
  1205. }[];
  1206. }
  1207. // 设备树统计数据类型
  1208. export type DeviceTreeStats = Record<string, {
  1209. total: number;
  1210. online: number;
  1211. offline: number;
  1212. error: number;
  1213. }>;
  1214. // 设备地图响应数据接口
  1215. export interface DeviceMapDataResponse {
  1216. data: MapViewDevice[];
  1217. stats: DeviceMapStats;
  1218. total?: number;
  1219. page?: number;
  1220. pageSize?: number;
  1221. }
  1222. // 设备地图统计响应接口
  1223. export interface DeviceMapStatsResponse {
  1224. data: DeviceMapStats;
  1225. }
  1226. // 设备树节点类型枚举
  1227. export enum DeviceTreeNodeType {
  1228. CATEGORY = 'category',
  1229. DEVICE = 'device'
  1230. }
  1231. // 设备树节点状态枚举
  1232. export enum DeviceTreeNodeStatus {
  1233. NORMAL = 'normal',
  1234. ERROR = 'error',
  1235. OFFLINE = 'offline',
  1236. WARNING = 'warning'
  1237. }
  1238. // 设备树节点接口
  1239. export interface DeviceTreeNode {
  1240. key: string;
  1241. title: string;
  1242. type: DeviceTreeNodeType;
  1243. status?: DeviceTreeNodeStatus;
  1244. icon?: string | null;
  1245. isLeaf?: boolean;
  1246. children?: DeviceTreeNode[];
  1247. }
  1248. export interface DeadlineInfo {
  1249. /** 进度百分比 */
  1250. progress: number;
  1251. /** 剩余时间 */
  1252. remainingTime: string;
  1253. /** 是否超时 */
  1254. isOverdue: boolean;
  1255. /** 进度颜色 */
  1256. color: string;
  1257. /** 进度文本 */
  1258. text: string;
  1259. }
  1260. export interface WorkOrderStatusHistory {
  1261. /** 状态 */
  1262. status: WorkOrderStatus;
  1263. /** 操作人 */
  1264. operator: string;
  1265. /** 操作时间 */
  1266. operateTime: string;
  1267. /** 备注 */
  1268. remark?: string;
  1269. }
  1270. export interface WorkOrder {
  1271. /** 工单ID */
  1272. id: string;
  1273. /** 工单编号 */
  1274. order_no: string;
  1275. /** 工单标题 */
  1276. title: string;
  1277. /** 关联设备ID */
  1278. device_id?: string;
  1279. /** 设备名称 */
  1280. device_name: string;
  1281. /** 问题描述 */
  1282. problem_desc: string;
  1283. /** 问题分类 */
  1284. problem_type: string;
  1285. /** 故障等级 */
  1286. priority: WorkOrderPriority;
  1287. /** 工单状态 */
  1288. status: WorkOrderStatus;
  1289. /** 创建人ID */
  1290. creator_id: string;
  1291. /** 创建人姓名 */
  1292. creator_name: string;
  1293. /** 截止日期 */
  1294. deadline: string;
  1295. /** 创建时间 */
  1296. created_at: string;
  1297. /** 更新时间 */
  1298. updated_at: string;
  1299. /** 结果反馈 */
  1300. feedback?: string;
  1301. /** 附件列表 */
  1302. attachments?: Array<{
  1303. id: string;
  1304. name: string;
  1305. url: string;
  1306. size: number;
  1307. type: string;
  1308. }>;
  1309. /** 当前处理人ID */
  1310. assignee_id?: string;
  1311. /** 当前处理人姓名 */
  1312. assignee_name?: string;
  1313. /** 状态历史记录 */
  1314. statusHistory?: Array<{
  1315. status: string;
  1316. timestamp: string;
  1317. operator: string;
  1318. }>;
  1319. }
  1320. export interface WorkOrderSettings {
  1321. statusOptions: string[];
  1322. priorityOptions: string[];
  1323. }