feat(admin): 新增UUID生成工具并优化模板管理

- 新增 uuid.ts 工具函数,提供原生和兼容性 UUID 生成方案
- 更新模板详情页面,使用 generateUUID() 替代 crypto.randomUUID()
- 模板列表新增页码字段显示
- 优化模板列表组件代码格式,改进可读性
- 更新 Git 提交消息规范文档,强制使用中文描述和具体要求
This commit is contained in:
2026-03-19 11:16:01 +08:00
parent d1f6044a6c
commit 7d49143ae0
4 changed files with 39 additions and 7 deletions

View File

@ -7,6 +7,7 @@ import { onMounted, ref } from 'vue'
import { useRoute } from 'vue-router'
import { useRouterPush } from '@/hooks/common/router'
import { fetchAddTemplate, fetchTemplateDetail } from '@/service/api/template'
import { generateUUID } from '@/utils/uuid'
import { useUpload } from './hooks/useUpload'
import TemplateCanvas from './modules/TemplateCanvas.vue'
import TemplateSettings from './modules/TemplateSettings.vue'
@ -64,7 +65,7 @@ function handleUploadTrigger() {
* 处理区域生成
*/
function handleGenerate() {
const groupId = crypto.randomUUID()
const groupId = generateUUID()
const newRegions: Region[] = []
// 计算起始编号:查找现有的最大 Qx 编号
@ -85,7 +86,7 @@ function handleGenerate() {
for (let c = 0; c < genSettings.value.cols; c++) {
const index = maxNum + r * genSettings.value.cols + c + 1 // 计算当前区域的编号
newRegions.push({
id: crypto.randomUUID(),
id: generateUUID(),
groupId,
x: currentX + c * (genSettings.value.w + genSettings.value.gapX),
y: currentY + r * (genSettings.value.h + genSettings.value.gapY),

View File

@ -66,6 +66,11 @@ const { columns, columnChecks, data, getData, getDataByPage, loading, mobilePagi
title: '模板ID',
align: 'center',
},
{
key: 'PageNo',
title: '页码',
align: 'center',
},
{
key: 'competitionId',
title: '关联比赛',