chore(templates): 只保留 template-07,删除其余 9 套模板
汇吉采仅使用 template-07(后端绑定 + .env.development),其余
template-01~06、08~10 为多租户 SaaS 平台时代遗留,全部删除:
- 删除 app/templates/ 下 9 套模板目录及注册表内对应配置
- 删除 public/images/template-{01,03,09,10} 图片目录
- 删除 templates/cloud-website 下 9 张模板预览图
- 三处 template-01 兜底(nuxt.config / useTemplate / default.vue)改为 07
- 清理指向已删模板的注释,README 模板系统章节同步更新
模板动态加载机制保留:新增模板 = 建目录 + 在 app/templates/index.ts 注册
This commit is contained in:
@@ -5,9 +5,8 @@ import type { CaseItem } from '~/app/types'
|
||||
* 映射为前端模板约定的 CaseItem(字段:id / title / clientName …)。
|
||||
*
|
||||
* 后端 cms-case 控制器返回的是 caseId / caseName / customer,
|
||||
* 而 website-template 的全部模板组件(template-01 ~ template-07)均按
|
||||
* id / title / clientName 渲染,故在此统一做一次字段归一化,
|
||||
* 避免 8 套模板各自散落做字段转换。
|
||||
* 而前端模板组件(template-07)按 id / title / clientName 渲染,
|
||||
* 故在此统一做一次字段归一化,避免各页面散落做字段转换。
|
||||
*/
|
||||
export function normalizeCaseItem(raw: any): CaseItem {
|
||||
if (!raw) return raw
|
||||
|
||||
@@ -6,7 +6,7 @@ type RuntimeConfig = ReturnType<typeof useRuntimeConfig>
|
||||
/** app_template 表行(仅取解析目录名所需字段) */
|
||||
interface AppTemplateRow {
|
||||
id?: number
|
||||
/** 模板标识,形如 'template-08',与前端 app/templates/<code>/ 目录一一对应 */
|
||||
/** 模板标识,形如 'template-07',与前端 app/templates/<code>/ 目录一一对应 */
|
||||
code?: string
|
||||
name?: string
|
||||
}
|
||||
@@ -93,7 +93,7 @@ async function getTemplateMap(config: RuntimeConfig): Promise<Map<number, string
|
||||
/**
|
||||
* 按模板主键反查模板标识(code)
|
||||
*
|
||||
* @returns 形如 'template-08';查不到返回 ''(调用方回退主键推导)
|
||||
* @returns 形如 'template-07';查不到返回 ''(调用方回退主键推导)
|
||||
*/
|
||||
export async function getTemplateCodeById(
|
||||
templateId: number | string | null | undefined,
|
||||
|
||||
Reference in New Issue
Block a user