Files
smart_wasm/spc-vue/README.md
2026-06-29 09:37:23 +08:00

35 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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 总览和关键指标
- `/run-chart`:基本趋势图,显示原始序列、均值线、中位线、规格限和移动平均线
- `/histogram`:频数直方图,只显示分箱频数和规格限,不叠加正态曲线
- `/normal-curve`:正态曲线,单独显示拟合分布和规格限
- `/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` 都存在