Files
ysch-question-front/README.md
T

39 lines
2.2 KiB
Markdown
Raw 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.
# 问卷前端 question-front(ysch-question-front)
问卷应用 R1「先行跑通」前端:Vue3 + TS + Vite5 + view-ui-plus 1.3.24(模板 Notice),端口 8091。链路:**新建问卷(自动挂接 FC 表单)→ iframe 内用 FC 设计器编辑 → 发布投放(链接+二维码)→ FC 填写页提交 → 回收明细与基础统计**。表单定义/版本/校验/答卷权威全在 form-center(FC),提交入口永远在 FC 填写页 `#/f/{code}`(本应用不建第二提交入口)。
配套后端:`ysch-question-service`(question-center,Spring Boot 2.7.18,端口 8090)。
## 前端路由(UserBase app_module 菜单契约)
modId 对应 app_module.custom_id(稳定契约;前端解析顺序=模块 path → 模块名 → modId,path 配错也有兜底):
| custom_id (modId) | 菜单名(建议=路由 title) | 模块 path | 角色 |
|---|---|---|---|
| 1 | 问卷列表 | `/` | 管理端入口 |
| 2 | 新建问卷 | `/new` | 新建向导(子页,parentId=1) |
| 3 | 我的问卷 | `/my` | 教师/学生填写入口 |
| 4 | 未挂接表单 | `/orphans` | FC/问卷侧对账(子页,parentId=1) |
深层子页**不配菜单**:`/edit`(编辑容器)、`/publish`(发布投放)、`/answers`(回收明细)、`/stats`(基础统计),modId 契约 11~14,高亮挂父菜单 1。
## 启动(本地 dev)
```bash
npm install --legacy-peer-deps # 本机 npm 10.8.2 需此参(arborist peer 解析 bug)
npm run dev # 8091;代理 /api→8090、/fcapi→8086、/static→主题通道
```
打开 http://localhost:8091 → 登录后见问卷菜单(平台 GetUserMod 未配置时自动用本地兜底菜单)。
## 测试与构建
```bash
npx tsc --noEmit # 类型检查(vue-tsc 1.8 本机崩溃勿用,以 tsc --noEmit 为准)
npm run build # vite build(dist/)
```
## 红线(沿任务书 §7)
不迁旧数据;不做家长问卷;不跨校;不建第二答卷提交入口;不改 form-center/flow-center/svc-hall/Notice/UserBase/BasePlatform;不 import FC 在途未提交类;OAPI 只用已提交的 schema/answer/answers 三端点;`appCode` 恒为 `question`。