diff --git a/spc-vue/.gitignore b/spc-vue/.gitignore new file mode 100644 index 0000000..804bd4a --- /dev/null +++ b/spc-vue/.gitignore @@ -0,0 +1,3 @@ +node_modules +dist +*.local diff --git a/spc-vue/README.md b/spc-vue/README.md new file mode 100644 index 0000000..265db89 --- /dev/null +++ b/spc-vue/README.md @@ -0,0 +1,31 @@ +# SPC 控制图 Vue 验证项目 + +这个目录是一个独立的 Vue 3 + Vite + ECharts 项目,用于验证 `Cmd_Spc` 的 WASM 计算结果。每一种控制图都拆成独立路由,方便后续把单个页面或组件集成到其他项目。 + +## 本地运行 + +```powershell +cd spc-vue +npm install +npm run dev +``` + +开发环境会通过 Vite 插件把主项目的 `../public/wasm` 映射到 `/wasm`。执行 `npm run build` 时会自动把 `smart_math.js` 和 `smart_math.wasm` 复制到 `dist/wasm`。 + +## 页面路由 + +- `/overview`:SPC 总览和关键指标 +- `/xbar-r`:Xbar 控制图,控制限来自 XR 结果 +- `/r-chart`:R 极差控制图 +- `/xbar-s`:Xbar 控制图,控制限来自 XS 结果 +- `/s-chart`:S 标准差控制图 +- `/cpk`:过程能力与直方图 + +## 接口校验重点 + +`KinematicsWebAPI::func` 会把业务返回统一包装成顶层 `success: true`,所以页面不会只判断顶层 `success`。SPC 调用成功必须同时满足: + +- 顶层 `success !== false` +- `res_data` 存在 +- `res_data.error` 不存在 +- `res_data.XR`、`res_data.XS`、`res_data.Cpk` 都存在 diff --git a/spc-vue/index.html b/spc-vue/index.html new file mode 100644 index 0000000..1474ca1 --- /dev/null +++ b/spc-vue/index.html @@ -0,0 +1,13 @@ + + +
+ + + +SPC Vue
+{{ eyebrow }}
+{{ description }}
+{{ JSON.stringify(value || {}, null, 2) }}
+ Overview
++ 页面启动后会自动调用一次 `Cmd_Spc`。左侧可以替换 n、k、规格限和测量数据,所有控制图页面共用同一份计算结果。 +
+使用子组均值和极差验证过程中心与短期组内波动,适合小子组连续型数据。
+使用子组均值和样本标准差验证过程稳定性,适合子组容量较大或需要标准差口径的场景。
+结合规格限、直方图和正态曲线,检查过程能力指标与数据分布是否相互印证。
+