@melt-js/comps-vue3-med 0.0.0-stage → 2026.11.9

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.
package/README.md CHANGED
@@ -1,3 +1,89 @@
1
- # Temporary Holding Version
1
+ # @melt-js/comps-vue3-med
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 医疗(med)领域 Vue 3 远程组件包,基于 [`comps-vue3-ele`](../comps-vue3-ele) 模板创建:同一套 Vite 6 + hel-micro 远程包工具链,UI 框架为 `element-plus`,组件面向院内业务场景。
4
+
5
+ | 项 | 值 |
6
+ | --- | --- |
7
+ | npm 包名 | `@melt-js/comps-vue3-med` |
8
+ | hel 组名(`appGroupName` / `LIB_NAME`) | `comps-vue3-med` |
9
+ | 本地联调地址 | `http://localhost:20094` |
10
+ | UI 框架 | `element-plus` 2 |
11
+
12
+ ## 组件
13
+
14
+ | 组件 | 说明 | 主要属性 |
15
+ | --- | --- | --- |
16
+ | `MedPatientCard` | 患者信息卡:头像、姓名/性别/年龄、床号、住院号、主诊断、标签 | `name`、`gender`、`age`、`bedNo`、`admissionNo`、`diagnosis`、`tags` |
17
+ | `MedVitalSign` | 生命体征指标卡,按正常/偏离/异常三档变色 | `label`、`value`、`unit`、`status`、`reference` |
18
+ | `MedExamTimeline` | 检查/检验进度时间轴,节点状态 done / active / pending | `title`、`items`(`title`、`time`、`status`、`desc`) |
19
+ | `App` | 展示页:上面三个组件的组合示例 | `name` |
20
+
21
+ 组件名统一带 `Med` 前缀,宿主可按 `/^Med/` 批量注册:
22
+
23
+ ```ts
24
+ Object.entries(lib).forEach(([name, comp]) => {
25
+ if (/^Med[A-Z]/.test(name)) app.component(name, comp)
26
+ })
27
+ ```
28
+
29
+ ## 目录说明
30
+
31
+ ```
32
+ src/
33
+ main.ts 入口:libReady 暴露组件;独立访问时挂载调试页
34
+ loadApp.ts 独立开发页的挂载逻辑
35
+ components/
36
+ index.ts 对外暴露的组件集合
37
+ types.ts 共享类型(MedExamItem / MedExamStatus)
38
+ App.vue 展示页
39
+ MedPatientCard.vue 患者信息卡
40
+ MedVitalSign.vue 生命体征指标卡
41
+ MedExamTimeline.vue 检查进度时间轴
42
+ configs/subApp.ts hel 组名,与 package.json appGroupName 一致
43
+ entrance/
44
+ libProperties.ts 暴露给使用方的组件对象
45
+ libTypes.ts 类型入口 + rollup 打包入口(产出 hel_proxy 空壳代理)
46
+ vite.config.ts dev/preview 用本地绝对地址,build 由 appInfo 推导(unpkg)
47
+ appInfo.mjs hel-dev-utils 子应用元信息(dev / build 自动切换 homePage)
48
+ rollup.config.js 产出 hel_proxy / hel_proxy_es
49
+ scripts/ check_name、meta、prepublishOnly、check-tdz
50
+ ```
51
+
52
+ 组件样式全部用 `scoped` + `--el-*` 变量,随 `hel_dist` 一起下发;`element-plus/dist/index.css` 在 `src/main.ts` 全量引入,组件按需 `import { ElTag } from 'element-plus'`。
53
+
54
+ ## 本地开发 / 构建
55
+
56
+ ```bash
57
+ pnpm comps-med:dev # 或在当前目录 pnpm dev,起 20094 端口
58
+ pnpm comps-med:build # 发布用产物:资源地址指向 unpkg
59
+ pnpm comps-med:build:local # 本地联调用产物:资源地址指向 http://localhost:20094
60
+ pnpm comps-med:preview # 预览 hel_dist 里的构建产物
61
+ ```
62
+
63
+ - 端口固定 20094 且开启 `strictPort`:产物里的资源地址是绝对值,端口漂移会导致宿主加载不到。
64
+ - 直接访问 <http://localhost:20094> 可单独调试组件;`index.html` 显式引入 Vue 3 CDN 并带 `data-helappend="0"`,宿主解析该页时会跳过它,使用宿主 `bindVueRuntime` 注入的那份 vue,不会出现双 vue。
65
+ - 新增组件三步:`components/` 下加组件 → `components/index.ts` 导出 → `playground.config.mjs` 补一行后跑 `pnpm gen:schema`(`dev` / `build_dist` 会自动跑)。
66
+
67
+ ## 产物与发布
68
+
69
+ `pnpm build` 产出:
70
+
71
+ - `hel_dist/`:`vite build` 的 umd 产物 + `hel-meta.json` + `hel_proxy/entry.js`
72
+ - `hel_proxy/`、`hel_proxy_es/`:消费方 `npm i @melt-js/comps-vue3-med` 后 import 到的空壳代理
73
+
74
+ `pnpm build` 的 `index.html`、`hel-meta.json`(`webDirPath` / `htmlIndexSrc` / 资源清单)里的地址都是
75
+ `https://unpkg.com/@melt-js/comps-vue3-med@<version>/hel_dist/...`;`pnpm build:local` 则全部指向 `http://localhost:20094/`,仅用于本地联调。
76
+
77
+ 发布相关脚本:
78
+
79
+ - `prepublishOnly`:校验 `package.json` 版本号与 `hel_dist/hel-meta.json` 的 `build_version` 一致,拒绝发布 localhost / 127.0.0.1 的本地产物。
80
+ - `publish:stage`:`pnpm run build && npx -y npm@11 stage publish`,走 npm stage 发布。
81
+
82
+ ## 与 comps-vue3-ele 的差异
83
+
84
+ | 项 | comps-vue3-ele | comps-vue3-med |
85
+ | --- | --- | --- |
86
+ | 包名 / 组名 | `@melt-js/comps-vue3-ele` | `@melt-js/comps-vue3-med` |
87
+ | 端口 | 20050 | 20094 |
88
+ | 组件 | `App`、`HelloWorld` | `App`、`MedPatientCard`、`MedVitalSign`、`MedExamTimeline` |
89
+ | 场景 | Element Plus 演示 | 医疗:患者信息、生命体征、检查进度 |