diff --git a/.env.dev b/.env.dev new file mode 100644 index 0000000..2c3f734 --- /dev/null +++ b/.env.dev @@ -0,0 +1,9 @@ +# 开发环境(vite dev --mode dev 加载;build 产物不读任何 .env.*) +# 问卷后端走 /api 同源相对路径(vite proxy → localhost:8090); +# FC 后端走 /fcapi 同源代理(→ localhost:8086,rewrite 去前缀); +# FC 前端(设计器/填写页 iframe src)直连其 dev 地址 localhost:8089 +VITE_BASE_HOST=http://base.yunhaixingtong.com +VITE_SSO_HOST=http://sso.yunhaixingtong.com +VITE_SERVICE_HOST= +VITE_FC_FRONT=http://localhost:8089 +VITE_IS_MOCK=false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..976295e --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +# scratch +.temp + +# vite 配置 bundle 临时产物 +vite.config.*.timestamp-* diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..521a9f7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps=true diff --git a/README.md b/README.md index 1f5c61b..445717d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,38 @@ -# ysch-question-front +# 问卷前端 question-front(ysch-question-front) -managed by projman \ No newline at end of file +问卷应用 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`。 diff --git a/index.html b/index.html new file mode 100644 index 0000000..84516b9 --- /dev/null +++ b/index.html @@ -0,0 +1,47 @@ + + + +
+ + + + + + + +{{ item.name }}
+ +匿名问卷同链接:FC 填写页自动探测未登录并切匿名通道。
+手机扫码填写
+尚未发布。保存配置并点击「发布问卷」后,此处生成填写链接与二维码。
+发布顺序:FC 设计器内保存题目 → 设计器内点发布 → 此处「发布问卷」核验钉版。
+