@tencent-rtc/trtc-agent-skills 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +172 -0
  3. package/README.zh.md +173 -0
  4. package/bin/cli.js +434 -0
  5. package/knowledge-base/index.yaml +454 -0
  6. package/knowledge-base/platform-slice-template.md +233 -0
  7. package/knowledge-base/scenario-spec.md +350 -0
  8. package/knowledge-base/scenarios/conference/base/general-conference.md +365 -0
  9. package/knowledge-base/scenarios/conference/base/webinar-conference.md +130 -0
  10. package/knowledge-base/scenarios/conference/medical/1v1-video-consultation.md +145 -0
  11. package/knowledge-base/scenarios/conference/medical/medical-multidoctor-consultation.md +113 -0
  12. package/knowledge-base/scenarios/live/entertainment-live-room.md +118 -0
  13. package/knowledge-base/slice-spec.md +546 -0
  14. package/knowledge-base/slices/conference/web/ai-tools.md +225 -0
  15. package/knowledge-base/slices/conference/web/beauty-effects.md +188 -0
  16. package/knowledge-base/slices/conference/web/device-control.md +338 -0
  17. package/knowledge-base/slices/conference/web/login-auth.md +261 -0
  18. package/knowledge-base/slices/conference/web/network-quality.md +190 -0
  19. package/knowledge-base/slices/conference/web/official-roomkit-api.md +298 -0
  20. package/knowledge-base/slices/conference/web/official-roomkit-login-ui.md +246 -0
  21. package/knowledge-base/slices/conference/web/participant-list.md +238 -0
  22. package/knowledge-base/slices/conference/web/participant-management.md +718 -0
  23. package/knowledge-base/slices/conference/web/prejoin-check.md +293 -0
  24. package/knowledge-base/slices/conference/web/room-call.md +213 -0
  25. package/knowledge-base/slices/conference/web/room-chat.md +426 -0
  26. package/knowledge-base/slices/conference/web/room-lifecycle.md +534 -0
  27. package/knowledge-base/slices/conference/web/room-schedule.md +281 -0
  28. package/knowledge-base/slices/conference/web/screen-share.md +211 -0
  29. package/knowledge-base/slices/conference/web/video-layout.md +675 -0
  30. package/knowledge-base/slices/conference/web/virtual-background.md +197 -0
  31. package/knowledge-base/slices/conference/web/webinar-interaction.md +206 -0
  32. package/knowledge-base/slices/live/anchor-lifecycle.md +122 -0
  33. package/knowledge-base/slices/live/anchor-preview.md +90 -0
  34. package/knowledge-base/slices/live/anchor-room-config.md +104 -0
  35. package/knowledge-base/slices/live/audience-list.md +86 -0
  36. package/knowledge-base/slices/live/audience-manage.md +92 -0
  37. package/knowledge-base/slices/live/audience-watch.md +85 -0
  38. package/knowledge-base/slices/live/audio.md +116 -0
  39. package/knowledge-base/slices/live/barrage.md +88 -0
  40. package/knowledge-base/slices/live/beauty.md +99 -0
  41. package/knowledge-base/slices/live/coguest-apply.md +105 -0
  42. package/knowledge-base/slices/live/device-control.md +91 -0
  43. package/knowledge-base/slices/live/error-codes.md +167 -0
  44. package/knowledge-base/slices/live/gift.md +84 -0
  45. package/knowledge-base/slices/live/ios/.gitkeep +0 -0
  46. package/knowledge-base/slices/live/ios/anchor-lifecycle.md +313 -0
  47. package/knowledge-base/slices/live/ios/anchor-preview.md +228 -0
  48. package/knowledge-base/slices/live/ios/anchor-room-config.md +257 -0
  49. package/knowledge-base/slices/live/ios/audience-list.md +353 -0
  50. package/knowledge-base/slices/live/ios/audience-manage.md +381 -0
  51. package/knowledge-base/slices/live/ios/audience-watch.md +286 -0
  52. package/knowledge-base/slices/live/ios/audio.md +373 -0
  53. package/knowledge-base/slices/live/ios/barrage.md +285 -0
  54. package/knowledge-base/slices/live/ios/beauty.md +323 -0
  55. package/knowledge-base/slices/live/ios/coguest-apply.md +506 -0
  56. package/knowledge-base/slices/live/ios/device-control.md +286 -0
  57. package/knowledge-base/slices/live/ios/error-codes.md +270 -0
  58. package/knowledge-base/slices/live/ios/gift.md +315 -0
  59. package/knowledge-base/slices/live/ios/live-list.md +269 -0
  60. package/knowledge-base/slices/live/ios/login-auth.md +247 -0
  61. package/knowledge-base/slices/live/live-list.md +82 -0
  62. package/knowledge-base/slices/live/login-auth.md +78 -0
  63. package/package.json +34 -0
  64. package/skills/trtc/SKILL.md +326 -0
  65. package/skills/trtc/room-builder/SKILL.md +138 -0
  66. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/README.md +108 -0
  67. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/docs/backend-contract.zh-CN.md +162 -0
  68. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/docs/integration.zh-CN.md +154 -0
  69. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/docs/theme.zh-CN.md +78 -0
  70. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/index.html +12 -0
  71. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/package.json +28 -0
  72. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/postcss.config.js +5 -0
  73. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/App.vue +25 -0
  74. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/ConsultationManagePanel.vue +838 -0
  75. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/LanguageSwitch.vue +102 -0
  76. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/LoadingSpinner.vue +6 -0
  77. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalAlert.vue +34 -0
  78. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalBusinessPanel.vue +148 -0
  79. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalButton.vue +49 -0
  80. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalConfirmDialog.vue +68 -0
  81. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalDataPanel.vue +196 -0
  82. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalRecordPanel.vue +270 -0
  83. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/PrescriptionPanel.vue +363 -0
  84. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/config/basic-info-config.ts +29 -0
  85. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/config/lib-generate-test-usersig-es.min.d.ts +4 -0
  86. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/config/lib-generate-test-usersig-es.min.js +2 -0
  87. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/config/runtime-config.ts +12 -0
  88. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/env.d.ts +32 -0
  89. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/ConsultationChatPanel.vue +123 -0
  90. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/ConsultationMembersPanel.vue +230 -0
  91. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/ConsultationTranscriptionPanel.vue +135 -0
  92. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/ConsultationVideoStage.vue +113 -0
  93. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/InviteDoctorDialog.vue +132 -0
  94. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/KickMemberConfirmDialog.vue +50 -0
  95. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/types.ts +77 -0
  96. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/useConsultationChat.ts +97 -0
  97. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/useConsultationDevices.ts +48 -0
  98. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/useConsultationParticipants.ts +121 -0
  99. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/useConsultationPermissions.ts +25 -0
  100. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/utils.ts +70 -0
  101. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/en-US/index.ts +553 -0
  102. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/index.ts +25 -0
  103. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/medicalTranslate.ts +85 -0
  104. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/state.ts +49 -0
  105. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/zh-CN/index.ts +463 -0
  106. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/main.ts +12 -0
  107. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/mock/appointments.ts +96 -0
  108. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/mock/users.ts +79 -0
  109. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/router/index.ts +63 -0
  110. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/index.ts +25 -0
  111. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/integration/appointmentService.ts +77 -0
  112. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/integration/authService.ts +38 -0
  113. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/integration/launchContext.ts +31 -0
  114. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/integration/userService.ts +35 -0
  115. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/mock/appointmentService.ts +43 -0
  116. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/mock/authService.ts +33 -0
  117. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/mock/userService.ts +43 -0
  118. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/types.ts +135 -0
  119. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/shared/icons.ts +53 -0
  120. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/styles/index.css +106 -0
  121. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/styles/tailwind.css +3 -0
  122. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/styles/theme.css +209 -0
  123. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/utils/auth.ts +50 -0
  124. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/utils/format.ts +24 -0
  125. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/utils/navigation.ts +12 -0
  126. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/utils/session.ts +28 -0
  127. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/DoctorConsultationView.vue +777 -0
  128. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/DoctorDashboardView.vue +678 -0
  129. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/LoginView.vue +441 -0
  130. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/PatientConsultationFinishedView.vue +185 -0
  131. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/PatientConsultationView.vue +1003 -0
  132. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/PatientSelectDoctorView.vue +317 -0
  133. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/PatientWaitingView.vue +454 -0
  134. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/tsconfig.json +21 -0
  135. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/tsconfig.node.json +8 -0
  136. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/vite.config.ts +17 -0
  137. package/skills/trtc/room-builder/templates/scenarios/medical-consultation//346/216/245/345/205/245/350/257/264/346/230/216.md +6 -0
  138. package/skills/trtc/room-builder/tools/render_ai_instructions.py +226 -0
  139. package/skills/trtc-apply/SKILL.md +97 -0
  140. package/skills/trtc-apply/guardrails/apply_lib/__init__.py +0 -0
  141. package/skills/trtc-apply/guardrails/apply_lib/__pycache__/__init__.cpython-313.pyc +0 -0
  142. package/skills/trtc-apply/guardrails/apply_lib/__pycache__/rule_parser.cpython-313.pyc +0 -0
  143. package/skills/trtc-apply/guardrails/apply_lib/rule_parser.py +268 -0
  144. package/skills/trtc-docs/SKILL.md +207 -0
  145. package/skills/trtc-onboarding/SKILL.md +839 -0
  146. package/skills/trtc-onboarding/reference/path-a1-demo.md +103 -0
  147. package/skills/trtc-onboarding/reference/path-a2-integrate.md +693 -0
  148. package/skills/trtc-onboarding/reference/path-b-troubleshoot.md +115 -0
  149. package/skills/trtc-onboarding/reference/path-c-expand.md +43 -0
  150. package/skills/trtc-onboarding/reference/reporting-protocol.md +174 -0
  151. package/skills/trtc-onboarding/reference/supported-matrix.md +100 -0
  152. package/skills/trtc-onboarding/reference/usersig-handling.md +140 -0
  153. package/skills/trtc-search/SKILL.md +221 -0
  154. package/skills/trtc-topic/SKILL.md +638 -0
  155. package/skills/trtc-topic/guardrails/__pycache__/gate_slice_read.cpython-313.pyc +0 -0
  156. package/skills/trtc-topic/guardrails/__pycache__/gate_slice_write.cpython-313.pyc +0 -0
  157. package/skills/trtc-topic/guardrails/__pycache__/stop_require_apply_evidence.cpython-313.pyc +0 -0
  158. package/skills/trtc-topic/guardrails/gate_slice_read.py +133 -0
  159. package/skills/trtc-topic/guardrails/gate_slice_write.py +169 -0
  160. package/skills/trtc-topic/guardrails/stop_require_apply_evidence.py +97 -0
  161. package/skills/trtc-topic/references/execution-units.yaml +58 -0
  162. package/skills/trtc-topic/runtime/README.md +50 -0
  163. package/skills/trtc-topic/runtime/RUNTIME.md +128 -0
  164. package/skills/trtc-topic/runtime/lib/__init__.py +0 -0
  165. package/skills/trtc-topic/runtime/lib/platforms.py +194 -0
  166. package/skills/trtc-topic/runtime/package-lock.json +1211 -0
  167. package/skills/trtc-topic/runtime/package.json +13 -0
  168. package/skills/trtc-topic/runtime/telemetry-bridge.mjs +339 -0
  169. package/skills/trtc-topic/runtime/telemetry_collector.py +293 -0
  170. package/skills/trtc-topic/scripts/STATE-MACHINE-GUIDE.md +186 -0
  171. package/skills/trtc-topic/scripts/__pycache__/apply.cpython-313.pyc +0 -0
  172. package/skills/trtc-topic/scripts/apply.py +581 -0
  173. package/skills/trtc-topic/scripts/finalize_session.py +113 -0
  174. package/skills/trtc-topic/scripts/init_slice_queue.py +96 -0
  175. package/skills/trtc-topic/scripts/lib/__pycache__/state_machine.cpython-313.pyc +0 -0
  176. package/skills/trtc-topic/scripts/lib/state_machine.py +328 -0
  177. package/skills/trtc-topic/scripts/next_slice.py +137 -0
  178. package/skills/trtc-topic/tests/README.md +70 -0
  179. package/skills/trtc-topic/tests/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
  180. package/skills/trtc-topic/tests/__pycache__/conftest.cpython-313-pytest-9.0.3.pyc +0 -0
  181. package/skills/trtc-topic/tests/__pycache__/test_apply_cli.cpython-313-pytest-9.0.2.pyc +0 -0
  182. package/skills/trtc-topic/tests/__pycache__/test_apply_cli.cpython-313-pytest-9.0.3.pyc +0 -0
  183. package/skills/trtc-topic/tests/__pycache__/test_end_to_end.cpython-313-pytest-9.0.2.pyc +0 -0
  184. package/skills/trtc-topic/tests/__pycache__/test_end_to_end.cpython-313-pytest-9.0.3.pyc +0 -0
  185. package/skills/trtc-topic/tests/__pycache__/test_finalize_session.cpython-313-pytest-9.0.2.pyc +0 -0
  186. package/skills/trtc-topic/tests/__pycache__/test_finalize_session.cpython-313-pytest-9.0.3.pyc +0 -0
  187. package/skills/trtc-topic/tests/__pycache__/test_gates.cpython-313-pytest-9.0.2.pyc +0 -0
  188. package/skills/trtc-topic/tests/__pycache__/test_gates.cpython-313-pytest-9.0.3.pyc +0 -0
  189. package/skills/trtc-topic/tests/__pycache__/test_session_resolver.cpython-313-pytest-9.0.2.pyc +0 -0
  190. package/skills/trtc-topic/tests/__pycache__/test_session_resolver.cpython-313-pytest-9.0.3.pyc +0 -0
  191. package/skills/trtc-topic/tests/__pycache__/test_state_machine.cpython-313-pytest-9.0.2.pyc +0 -0
  192. package/skills/trtc-topic/tests/__pycache__/test_state_machine.cpython-313-pytest-9.0.3.pyc +0 -0
  193. package/skills/trtc-topic/tests/__pycache__/test_stop_require_apply.cpython-313-pytest-9.0.2.pyc +0 -0
  194. package/skills/trtc-topic/tests/__pycache__/test_stop_require_apply.cpython-313-pytest-9.0.3.pyc +0 -0
  195. package/skills/trtc-topic/tests/__pycache__/test_topic_skill_invariants.cpython-313-pytest-9.0.2.pyc +0 -0
  196. package/skills/trtc-topic/tests/__pycache__/test_topic_skill_invariants.cpython-313-pytest-9.0.3.pyc +0 -0
  197. package/skills/trtc-topic/tests/conftest.py +72 -0
  198. package/skills/trtc-topic/tests/test_apply_cli.py +480 -0
  199. package/skills/trtc-topic/tests/test_end_to_end.py +305 -0
  200. package/skills/trtc-topic/tests/test_finalize_session.py +51 -0
  201. package/skills/trtc-topic/tests/test_gates.py +316 -0
  202. package/skills/trtc-topic/tests/test_session_resolver.py +260 -0
  203. package/skills/trtc-topic/tests/test_state_machine.py +414 -0
  204. package/skills/trtc-topic/tests/test_stop_require_apply.py +99 -0
  205. package/skills/trtc-topic/tests/test_topic_skill_invariants.py +130 -0
@@ -0,0 +1,162 @@
1
+ # 后端接口契约建议
2
+
3
+ 本文说明客户业务系统接入医疗音视频模板时,建议提供的最小后端接口。字段可按客户实际系统调整,但建议在 `src/services/adapters/integration/` 中转换为模板内部统一结构。
4
+
5
+ ## 1. 登录签名接口
6
+
7
+ 前端拿到客户业务 token 后,请求客户服务端签发音视频登录信息。
8
+
9
+ ```http
10
+ POST /api/rtc/signature
11
+ Authorization: Bearer <customer-token>
12
+ Content-Type: application/json
13
+ ```
14
+
15
+ 请求:
16
+
17
+ ```json
18
+ {
19
+ "userId": "doctor_001"
20
+ }
21
+ ```
22
+
23
+ 响应:
24
+
25
+ ```json
26
+ {
27
+ "sdkAppId": 0,
28
+ "userId": "doctor_001",
29
+ "userSig": "server-generated-usersig",
30
+ "expireTime": 604800
31
+ }
32
+ ```
33
+
34
+ 说明:
35
+
36
+ - `userId` 必须和医生、患者、会诊医生在业务系统中的身份保持一致。
37
+ - `userSig` 必须由客户服务端生成,不建议在前端生成。
38
+
39
+ ## 2. 当前用户接口
40
+
41
+ ```http
42
+ GET /api/medical/users/me
43
+ Authorization: Bearer <customer-token>
44
+ ```
45
+
46
+ 响应:
47
+
48
+ ```json
49
+ {
50
+ "userId": "doctor_001",
51
+ "userName": "李医生",
52
+ "avatarUrl": "",
53
+ "role": "doctor",
54
+ "title": "主任医师",
55
+ "department": "心内科",
56
+ "hospital": "示例医院"
57
+ }
58
+ ```
59
+
60
+ ## 3. 预约详情接口
61
+
62
+ ```http
63
+ GET /api/medical/appointments/{appointmentId}
64
+ Authorization: Bearer <customer-token>
65
+ ```
66
+
67
+ 响应:
68
+
69
+ ```json
70
+ {
71
+ "id": "APT10001",
72
+ "roomId": "medical-room-APT10001",
73
+ "doctorId": "doctor_001",
74
+ "patientId": "patient_001",
75
+ "consultantDoctorIds": ["doctor_002"],
76
+ "scheduleStartTime": 1760000000,
77
+ "scheduleEndTime": 1760001800,
78
+ "chiefComplaint": "咳嗽 3 天",
79
+ "allergyHistory": "无",
80
+ "medicalHistory": "无重大疾病史",
81
+ "patientAge": 35,
82
+ "patientGender": "男",
83
+ "patientPhone": "138****5678"
84
+ }
85
+ ```
86
+
87
+ 说明:
88
+
89
+ - `roomId` 建议由客户后端生成并持久化。
90
+ - 时间戳建议统一使用秒。
91
+ - `doctorId`、`patientId`、`consultantDoctorIds` 应和音视频登录 `userId` 一致。
92
+
93
+ ## 4. 医生今日预约列表
94
+
95
+ ```http
96
+ GET /api/medical/doctors/{doctorId}/appointments?date=2026-05-13
97
+ Authorization: Bearer <customer-token>
98
+ ```
99
+
100
+ 响应:
101
+
102
+ ```json
103
+ {
104
+ "list": [
105
+ {
106
+ "id": "APT10001",
107
+ "roomId": "medical-room-APT10001",
108
+ "doctorId": "doctor_001",
109
+ "patientId": "patient_001",
110
+ "scheduleStartTime": 1760000000,
111
+ "scheduleEndTime": 1760001800,
112
+ "chiefComplaint": "咳嗽 3 天",
113
+ "allergyHistory": "无",
114
+ "medicalHistory": "无重大疾病史",
115
+ "patientAge": 35,
116
+ "patientGender": "男",
117
+ "patientPhone": "138****5678"
118
+ }
119
+ ]
120
+ }
121
+ ```
122
+
123
+ ## 5. 患者预约列表
124
+
125
+ ```http
126
+ GET /api/medical/patients/{patientId}/appointments
127
+ Authorization: Bearer <customer-token>
128
+ ```
129
+
130
+ 响应结构同医生预约列表。
131
+
132
+ ## 6. 会诊医生列表
133
+
134
+ ```http
135
+ GET /api/medical/doctors?keyword=心内科
136
+ Authorization: Bearer <customer-token>
137
+ ```
138
+
139
+ 响应:
140
+
141
+ ```json
142
+ {
143
+ "list": [
144
+ {
145
+ "userId": "doctor_002",
146
+ "userName": "王医生",
147
+ "avatarUrl": "",
148
+ "role": "doctor",
149
+ "title": "副主任医师",
150
+ "department": "心内科",
151
+ "hospital": "示例医院"
152
+ }
153
+ ]
154
+ }
155
+ ```
156
+
157
+ ## 7. 接入建议
158
+
159
+ - 页面层不要直接请求客户接口。
160
+ - 在 `src/services/adapters/integration/` 中完成接口请求和字段映射。
161
+ - 客户接口返回字段可以不同,但最终应转换为 `MedicalUser` 和 `MedicalAppointment`。
162
+ - 预约取消、改期、过期等状态建议由客户后端统一管理,前端只展示接口结果。
@@ -0,0 +1,154 @@
1
+ # 医疗场景源码接入说明
2
+
3
+ 本文面向客户前端团队,说明如何基于当前源码模板完成真实业务数据接入和 UI 定制。
4
+
5
+ ## 1. 接入定位
6
+
7
+ 当前项目是一套医疗音视频问诊前端源码模板。建议按下面职责理解:
8
+
9
+ | 区域 | 职责 |
10
+ | --- | --- |
11
+ | 左侧音视频区 | SDK 房间、音视频流、设备控制、呼叫接听 |
12
+ | 中间业务区 | 客户 EMR / HIS / PACS / 处方 / 随访等业务页面 |
13
+ | 右侧协同区 | 聊天、实时转写、成员管理、会诊邀请 |
14
+ | service 适配层 | 将客户接口数据转换为模板内部统一结构 |
15
+
16
+ 医疗业务主数据由客户系统管理,模板只提供音视频链路和前端接入示例。
17
+
18
+ ## 2. 推荐接入顺序
19
+
20
+ 1. 设置 `VITE_MEDICAL_MODE=integration`。
21
+ 2. 改造 `src/services/adapters/integration/authService.ts`,打通业务入口参数。
22
+ 3. 改造 `src/services/adapters/integration/userService.ts`,接入医生和患者信息。
23
+ 4. 改造 `src/services/adapters/integration/appointmentService.ts`,接入预约单和 `roomId`。
24
+ 5. 将测试 UserSig 逻辑替换为客户服务端签发。
25
+ 6. 替换 `src/components/MedicalBusinessPanel.vue`,接入客户业务系统。
26
+ 7. 按客户品牌规范调整页面文案、颜色和布局。
27
+
28
+ ## 3. 入口参数
29
+
30
+ `integration` 模式默认从 URL 读取启动参数。
31
+
32
+ 医生入口示例:
33
+
34
+ ```text
35
+ ?role=doctor&userId=doctor_001&appointmentId=APT10001&patientId=patient_001&token=xxxx
36
+ ```
37
+
38
+ 患者入口示例:
39
+
40
+ ```text
41
+ ?role=patient&userId=patient_001&appointmentId=APT10001&doctorId=doctor_001&token=xxxx
42
+ ```
43
+
44
+ | 参数 | 必填 | 说明 |
45
+ | --- | --- | --- |
46
+ | `role` | 是 | `doctor` 或 `patient` |
47
+ | `userId` | 是 | 当前登录用户 ID,需要和 SDK 登录 ID 一致 |
48
+ | `appointmentId` | 建议传 | 当前预约单 ID |
49
+ | `doctorId` | 建议传 | 当前预约单主治医生 ID,患者入口建议携带 |
50
+ | `patientId` | 建议传 | 当前预约单患者 ID,医生入口建议携带 |
51
+ | `token` | 建议传 | 客户业务 token |
52
+
53
+ 如果客户通过 SSO、宿主应用或 WebView 注入上下文,可以改造 `getLaunchContext()`。
54
+
55
+ ## 4. 用户数据
56
+
57
+ 用户数据统一由 `userService` 提供,模板内部结构为:
58
+
59
+ ```ts
60
+ interface MedicalUser {
61
+ userId: string;
62
+ userName: string;
63
+ avatarUrl: string;
64
+ role: 'doctor' | 'patient';
65
+ title?: string;
66
+ department?: string;
67
+ hospital?: string;
68
+ }
69
+ ```
70
+
71
+ 客户接口字段建议在 `integration/userService.ts` 中转换,不建议页面直接依赖客户后端字段。
72
+
73
+ ## 5. 预约与 roomId
74
+
75
+ 预约数据统一由 `appointmentService` 提供,模板内部结构为:
76
+
77
+ ```ts
78
+ interface MedicalAppointment {
79
+ id: string;
80
+ roomId: string;
81
+ doctorId: string;
82
+ patientId: string;
83
+ scheduleStartTime: number;
84
+ scheduleEndTime: number;
85
+ chiefComplaint: string;
86
+ allergyHistory: string;
87
+ medicalHistory: string;
88
+ patientAge: number;
89
+ patientGender: string;
90
+ patientPhone: string;
91
+ }
92
+ ```
93
+
94
+ 建议客户后端生成并持久化 `roomId`,前端只读取该 `roomId` 并进入对应音视频房间。
95
+
96
+ 注意事项:
97
+
98
+ - `doctorId`、`patientId` 必须和 SDK 登录 `userId` 一致。
99
+ - `scheduleStartTime`、`scheduleEndTime` 使用秒级时间戳。
100
+ - 同一预约单的 `roomId` 必须稳定。
101
+ - 预约取消、改期、过期状态建议由客户后端统一管理。
102
+
103
+ ## 6. 业务区替换
104
+
105
+ 医生端中间业务区入口:
106
+
107
+ - `src/components/MedicalBusinessPanel.vue`
108
+
109
+ 正式接入建议设置:
110
+
111
+ ```bash
112
+ VITE_MEDICAL_BUSINESS_PANEL_MODE=slot
113
+ ```
114
+
115
+ 客户可以保留外层容器,只替换内部组件,也可以直接替换整个 `MedicalBusinessPanel.vue`。
116
+
117
+ ## 7. MDT 会诊
118
+
119
+ 当前模板支持主治医生邀请会诊医生加入房间。
120
+
121
+ 权限默认如下:
122
+
123
+ | 能力 | 主治医生 | 会诊医生 | 患者 |
124
+ | --- | --- | --- | --- |
125
+ | 邀请会诊医生 | 是 | 否 | 否 |
126
+ | 移出成员 | 是 | 否 | 否 |
127
+ | 管理患者设备 | 是 | 否 | 否 |
128
+ | 查看业务工作区 | 是 | 否 | 否 |
129
+ | 聊天 / 转写 | 是 | 是 | 可按客户策略保留 |
130
+ | 参与音视频 | 是 | 是 | 是 |
131
+
132
+ 相关逻辑:
133
+
134
+ - `src/features/consultation/components/ConsultationVideoStage.vue`
135
+ - `src/features/consultation/useConsultationParticipants.ts`
136
+ - `src/features/consultation/useConsultationPermissions.ts`
137
+
138
+ ## 8. 后端接口与主题定制
139
+
140
+ 更多说明见:
141
+
142
+ - `docs/backend-contract.zh-CN.md`
143
+ - `docs/theme.zh-CN.md`
144
+
145
+ ## 9. demo-only 内容
146
+
147
+ 以下内容仅用于本地演示:
148
+
149
+ - `src/mock/*` 中的医生、患者和预约数据。
150
+ - `PatientSelectDoctorView.vue` 患者选择医生流程。
151
+ - 病历、处方、检查资料示例组件。
152
+ - 问诊结束页中的处方和结果展示。
153
+
154
+ 正式接入时,请替换为客户业务系统数据或隐藏对应入口。
@@ -0,0 +1,78 @@
1
+ # 医疗场景主题定制说明
2
+
3
+ 本文说明如何调整医疗问诊模板的品牌色和基础视觉风格。
4
+
5
+ ## 1. 样式入口
6
+
7
+ ```text
8
+ src/styles/
9
+ index.css
10
+ tailwind.css
11
+ theme.css
12
+ ```
13
+
14
+ - `index.css`:全局样式入口。
15
+ - `tailwind.css`:Tailwind CSS 引入入口。
16
+ - `theme.css`:主题变量和基础样式。
17
+
18
+ ## 2. 推荐优先修改的变量
19
+
20
+ 主题变量位于 `src/styles/theme.css` 的 `:root` 中。
21
+
22
+ | 变量 | 用途 |
23
+ | --- | --- |
24
+ | `--primary` | 主品牌色,默认用于主要按钮、医生端高亮 |
25
+ | `--primary-hover` | 主按钮 hover 色 |
26
+ | `--medical-success` | 成功、在线、接通等状态 |
27
+ | `--medical-warning` | 提醒、待处理状态 |
28
+ | `--medical-info` | 信息提示和患者侧辅助色 |
29
+ | `--medical-urgent` | 紧急、危险状态 |
30
+ | `--background` | 页面背景 |
31
+ | `--foreground` | 默认文字颜色 |
32
+ | `--border` | 默认边框颜色 |
33
+
34
+ ## 3. 品牌色替换建议
35
+
36
+ 如果客户只需要替换品牌色,优先调整:
37
+
38
+ ```css
39
+ :root {
40
+ --primary: #0d9488;
41
+ --primary-hover: #0f766e;
42
+ --medical-success: #10b981;
43
+ --ring: #0d9488;
44
+ }
45
+ ```
46
+
47
+ `theme.css` 已将医疗状态色注册为 Tailwind 颜色 token,例如 `bg-medical-success`、`from-primary`、`to-primary-hover`。页面中仍存在少量历史 Tailwind 任意颜色类,如果需要完整品牌化,建议继续替换为主题 token 对应的语义化 class。
48
+
49
+ ## 4. 页面文案和品牌名称
50
+
51
+ 常见修改文件:
52
+
53
+ - `src/views/LoginView.vue`
54
+ - `src/views/DoctorDashboardView.vue`
55
+ - `src/views/PatientSelectDoctorView.vue`
56
+ - `src/views/PatientWaitingView.vue`
57
+ - `src/views/PatientConsultationFinishedView.vue`
58
+
59
+ 建议使用客户真实品牌名称替换“示例医疗平台”,并保留“源码模板 / 业务插槽示例”等说明,避免用户误解为完整医疗业务系统。
60
+
61
+ ## 5. 推荐优先调整的基础组件
62
+
63
+ 为了减少页面模板中重复的 Tailwind class,常用交互样式已收敛到以下组件:
64
+
65
+ ```text
66
+ src/components/
67
+ MedicalButton.vue
68
+ MedicalAlert.vue
69
+ MedicalConfirmDialog.vue
70
+ LoadingSpinner.vue
71
+ ```
72
+
73
+ - `MedicalButton.vue`:统一按钮的 `variant`、`size`、`loading`、`disabled` 行为。客户替换主按钮风格时,优先改这里。
74
+ - `MedicalAlert.vue`:统一权限提醒、错误提示、信息提示的视觉样式。
75
+ - `MedicalConfirmDialog.vue`:统一危险操作二次确认弹窗,例如医生结束问诊。
76
+ - `LoadingSpinner.vue`:统一按钮内 loading 图标。
77
+
78
+ 页面中仍保留 `flex`、`grid`、`gap`、`p-*` 等布局类,方便二开时直接理解结构;品牌色、圆角、按钮状态等视觉规范优先通过上述组件和 `theme.css` 调整。
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Medical Demo</title>
7
+ </head>
8
+ <body>
9
+ <div id="app"></div>
10
+ <script type="module" src="/src/main.ts"></script>
11
+ </body>
12
+ </html>
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@tencentcloud/room-uikit-medical-vue3",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "vite --force",
7
+ "build": "vue-tsc --noEmit --skipLibCheck && vite build",
8
+ "preview": "vite preview"
9
+ },
10
+ "dependencies": {
11
+ "lucide-vue-next": "^1.0.0",
12
+ "tw-animate-css": "1.3.8",
13
+ "vue": "^3.4.0",
14
+ "vue-router": "^4.4.3",
15
+ "@tencentcloud/uikit-base-component-vue3": "1.4.3",
16
+ "tuikit-atomicx-vue3": "^5.9.1"
17
+ },
18
+ "devDependencies": {
19
+ "@tailwindcss/postcss": "^4.2.2",
20
+ "@types/node": "^18.19.31",
21
+ "@vitejs/plugin-vue": "^5.0.4",
22
+ "sass": "^1.77.8",
23
+ "tailwindcss": "4.1.12",
24
+ "typescript": "^5.5.4",
25
+ "vite": "^5.2.8",
26
+ "vue-tsc": "^2.0.6"
27
+ }
28
+ }
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ plugins: {
3
+ '@tailwindcss/postcss': {},
4
+ },
5
+ };
@@ -0,0 +1,25 @@
1
+ <script setup lang="ts">
2
+ import { watch } from 'vue';
3
+ import { UIKitProvider } from '@tencentcloud/uikit-base-component-vue3';
4
+ import { medicalLanguage } from '@/i18n/state';
5
+ import { initMedicalI18n } from '@/i18n';
6
+
7
+ initMedicalI18n();
8
+
9
+ watch(
10
+ medicalLanguage,
11
+ () => {
12
+ document.documentElement.lang = medicalLanguage.value;
13
+ },
14
+ { immediate: true }
15
+ );
16
+ </script>
17
+
18
+ <template>
19
+ <UIKitProvider
20
+ :theme="{ themeStyle: 'light', primaryColor: 'theme' }"
21
+ :language="medicalLanguage"
22
+ >
23
+ <router-view />
24
+ </UIKitProvider>
25
+ </template>