From dea414739ea512f6e8f145e88030f743a50111fd Mon Sep 17 00:00:00 2001 From: Vicky <10212746+haifeng-jiang@user.noreply.gitee.com> Date: Thu, 29 Oct 2026 15:44:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(tag):=20=E6=A0=87=E7=AD=BE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE=E8=AF=AD=E4=B9=89?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 客户端按语义码判断板块归属(如推荐页「上新」横滑),标签改名或换语言 都不再影响;新增/编辑弹窗增加语义码输入并做格式校验,留空则按名称兜底。 --- .../contentManagement/TagManagementView.vue | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/views/contentManagement/TagManagementView.vue b/src/views/contentManagement/TagManagementView.vue index af5cd24..43121d3 100644 --- a/src/views/contentManagement/TagManagementView.vue +++ b/src/views/contentManagement/TagManagementView.vue @@ -33,6 +33,7 @@ const DEFAULT_TAG_COLOR = '#E5484D' const emptyForm = () => ({ locales: { zh: '' }, bgColor: DEFAULT_TAG_COLOR, + code: '', sort: 1, status: 1 }) @@ -66,6 +67,7 @@ function openEdit(row) { Object.assign(form, { locales, bgColor: row.bgColor || DEFAULT_TAG_COLOR, + code: row.code || '', sort: row.sort ?? 0, status: row.status ?? 1 }) @@ -83,12 +85,18 @@ async function save() { ElMessage.warning(`请填写${languageLabel(missing)}名称`) return } + const code = (form.code || '').trim().toUpperCase() + if (code && !/^[A-Z][A-Z0-9_]{0,31}$/.test(code)) { + ElMessage.warning('语义码需为大写字母、数字或下划线,且以字母开头') + return + } saving.value = true try { const payload = { name: locales.zh, locales, bgColor: form.bgColor || DEFAULT_TAG_COLOR, + code, sort: form.sort, status: form.status } @@ -209,6 +217,16 @@ onMounted(load) + + +
+ 客户端按语义码判断板块(如「上新」横滑),改名或换语言都不受影响。 +
+
@@ -236,4 +254,11 @@ onMounted(load) height: 16px; border-radius: 4px; } + +.form-hint { + margin-top: 4px; + font-size: 12px; + line-height: 1.5; + color: var(--el-text-color-secondary); +}