mock_data_service.dart 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. import 'package:flutter/material.dart';
  2. import 'package:asr_client/models/task.dart';
  3. import 'package:asr_client/models/report.dart';
  4. import 'package:asr_client/models/user_profile.dart';
  5. import 'package:asr_client/theme/app_colors.dart';
  6. abstract final class MockDataService {
  7. static const userProfile = UserProfile(
  8. name: '陈志远',
  9. role: '试验检测员',
  10. employeeId: 'T-0417',
  11. avatarText: '陈',
  12. monthlyCount: 128,
  13. passRate: '96%',
  14. activeProjects: 4,
  15. );
  16. static final taskSections = [
  17. const TaskSection(
  18. title: '进行中',
  19. tasks: [
  20. Task(
  21. id: 't1',
  22. title: '混凝土坍落度试验',
  23. project: 'G15 沈海高速 · K1120+300',
  24. status: TaskStatus.recording,
  25. progress: 0.6,
  26. recordedCount: 3,
  27. totalCount: 5,
  28. footNote: '3 / 5 指标已录',
  29. timeInfo: '02:47',
  30. ),
  31. ],
  32. ),
  33. const TaskSection(
  34. title: '待检测',
  35. tasks: [
  36. Task(
  37. id: 't2',
  38. title: '钢筋原材拉伸试验',
  39. project: 'G15 沈海高速 · 钢筋进场批 B-0712',
  40. status: TaskStatus.pending,
  41. footNote: '指标模板 · 屈服/抗拉/伸长率',
  42. timeInfo: '今日截止',
  43. ),
  44. Task(
  45. id: 't3',
  46. title: '路基压实度检测',
  47. project: '越南 河内-海防高速 · 第 3 标段',
  48. status: TaskStatus.pending,
  49. footNote: '灌砂法 · 3 个测点',
  50. timeInfo: '今日',
  51. ),
  52. Task(
  53. id: 't4',
  54. title: '水泥胶砂强度',
  55. project: 'G15 沈海高速 · 水泥进场',
  56. status: TaskStatus.scheduled,
  57. footNote: '28d 龄期 · 抗压',
  58. timeInfo: '明日',
  59. ),
  60. ],
  61. ),
  62. const TaskSection(
  63. title: '今日已完成',
  64. tasks: [
  65. Task(
  66. id: 't5',
  67. title: '沥青混合料马歇尔试验',
  68. project: 'G15 沈海高速 · 面层 AC-20',
  69. status: TaskStatus.completed,
  70. footNote: '报告已生成',
  71. timeInfo: '08:52',
  72. ),
  73. ],
  74. ),
  75. ];
  76. static final reportGroups = [
  77. ReportDateGroup(
  78. label: '今天',
  79. reports: [
  80. Report(
  81. id: 'r1',
  82. name: '沥青混合料马歇尔试验',
  83. project: 'G15 沈海 · 08:52 · 报告 R-2071',
  84. status: ReportStatus.ok,
  85. date: DateTime.now(),
  86. reportId: 'R-2071',
  87. fields: const [
  88. ReportField(key: '检测项', value: '马歇尔稳定度'),
  89. ReportField(key: '稳定度', value: '8.6 kN(≥8.0)'),
  90. ReportField(key: '流值', value: '3.2 mm(2–4)'),
  91. ReportField(key: '空隙率', value: '4.1 %(3–6)'),
  92. ],
  93. verdict: '✓ 各项合格',
  94. ),
  95. Report(
  96. id: 'r2',
  97. name: '混凝土抗压强度(试块)',
  98. project: 'G15 沈海 · 08:10 · 报告 R-2070',
  99. status: ReportStatus.warn,
  100. date: DateTime.now(),
  101. reportId: 'R-2070',
  102. ),
  103. ],
  104. ),
  105. ReportDateGroup(
  106. label: '昨天',
  107. reports: [
  108. Report(
  109. id: 'r3',
  110. name: '路基压实度检测',
  111. project: '越南河内-海防 · 16:30 · R-2065',
  112. status: ReportStatus.ok,
  113. date: DateTime.now().subtract(const Duration(days: 1)),
  114. reportId: 'R-2065',
  115. ),
  116. Report(
  117. id: 'r4',
  118. name: '钢筋原材拉伸试验',
  119. project: 'G15 沈海 · 14:02 · 草稿未定稿',
  120. status: ReportStatus.draft,
  121. date: DateTime.now().subtract(const Duration(days: 1)),
  122. ),
  123. Report(
  124. id: 'r5',
  125. name: '水泥胶砂强度 28d',
  126. project: 'G15 沈海 · 10:20 · R-2061',
  127. status: ReportStatus.ok,
  128. date: DateTime.now().subtract(const Duration(days: 1)),
  129. reportId: 'R-2061',
  130. ),
  131. ],
  132. ),
  133. ];
  134. static List<SettingsSection> settingsSections(VoidCallback? onServerTap) => [
  135. SettingsSection(
  136. title: '采集设置',
  137. items: [
  138. SettingsItem(
  139. icon: '🎙️',
  140. label: '语音输入与麦克风',
  141. iconBgColor: AppColors.appBg,
  142. iconColor: AppColors.appDark,
  143. ),
  144. SettingsItem(
  145. icon: '🔤',
  146. label: '工程术语热词表',
  147. iconBgColor: AppColors.aiBg,
  148. iconColor: AppColors.ai,
  149. value: '已启用',
  150. ),
  151. SettingsItem(
  152. icon: '📥',
  153. label: '离线暂存与补传',
  154. iconBgColor: AppColors.warnBg,
  155. iconColor: const Color(0xFF8A6D00),
  156. value: '2 条待传',
  157. ),
  158. ],
  159. ),
  160. SettingsSection(
  161. title: '我的工作',
  162. items: [
  163. SettingsItem(
  164. icon: '🗂️',
  165. label: '我负责的项目',
  166. iconBgColor: AppColors.midBg,
  167. iconColor: const Color(0xFF1C7A6D),
  168. value: '4',
  169. ),
  170. SettingsItem(
  171. icon: '📊',
  172. label: '我的检测统计',
  173. iconBgColor: AppColors.okBg,
  174. iconColor: AppColors.ok,
  175. ),
  176. ],
  177. ),
  178. SettingsSection(
  179. title: '账户',
  180. items: [
  181. SettingsItem(
  182. icon: '🔔',
  183. label: '消息与告警',
  184. iconBgColor: AppColors.bg,
  185. iconColor: AppColors.ink2,
  186. ),
  187. SettingsItem(
  188. icon: '🛡️',
  189. label: '账号与安全',
  190. iconBgColor: AppColors.bg,
  191. iconColor: AppColors.ink2,
  192. ),
  193. SettingsItem(
  194. icon: '⎋',
  195. label: '退出登录',
  196. iconBgColor: AppColors.dangerBg,
  197. iconColor: AppColors.danger,
  198. ),
  199. ],
  200. ),
  201. ];
  202. }