From 640274b7c7b1467d2c82eb2e8141f2694b34ef8b Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Sat, 29 Aug 2026 12:17:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(i18n):=20slash=20=E5=AD=90=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E9=80=89=E9=A1=B9=E6=94=B9=E7=94=A8=20labelKey=20?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=A9=BA=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 4aac18f7 将选项结构改为 labelKey/descriptionKey 后,slash 菜单的 工作模式/权限/执行环境/网络四个子菜单仍读取已不存在的 label/description 字段,导致菜单项标签与描述渲染为空。统一改为 t(labelKey)/t(descriptionKey)。 Co-Authored-By: Claude Fable 5 --- static/src/components/input/InputComposer.vue | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/static/src/components/input/InputComposer.vue b/static/src/components/input/InputComposer.vue index c21c50ba..e0d15d15 100644 --- a/static/src/components/input/InputComposer.vue +++ b/static/src/components/input/InputComposer.vue @@ -1751,12 +1751,12 @@ const permissionSlashMenuItems = computed(() => { const lockedByPlan = props.currentWorkMode === 'plan'; return options.map((opt) => ({ id: `perm:${opt.value}`, - label: opt.label, + label: t(opt.labelKey), description: lockedByPlan ? t('input.permissionLockedReadonlyDesc') : opt.value === current - ? t('input.optionWithCurrent', { desc: opt.description || '' }) - : opt.description || '', + ? t('input.optionWithCurrent', { desc: t(opt.descriptionKey) }) + : t(opt.descriptionKey), disabled: lockedByPlan, action: () => emit('change-permission-mode', opt.value) })); @@ -1769,12 +1769,12 @@ const executionSlashMenuItems = computed(() => { const lockedByPlan = props.currentWorkMode === 'plan'; return options.map((opt) => ({ id: `exec:${opt.value}`, - label: opt.label, + label: t(opt.labelKey), description: lockedByPlan ? t('input.executionLockedSandboxDesc') : opt.value === current - ? t('input.optionWithCurrent', { desc: opt.description || '' }) - : opt.description || '', + ? t('input.optionWithCurrent', { desc: t(opt.descriptionKey) }) + : t(opt.descriptionKey), disabled: lockedByPlan, action: () => emit('change-execution-mode', opt.value) })); @@ -1817,11 +1817,11 @@ const networkSlashMenuItems = computed(() => { const current = String(props.currentNetworkPermission || ''); return options.map((opt) => ({ id: `network:${opt.value}`, - label: opt.label, + label: t(opt.labelKey), description: opt.value === current - ? t('input.optionWithCurrent', { desc: opt.description || '' }) - : opt.description || '', + ? t('input.optionWithCurrent', { desc: t(opt.descriptionKey) }) + : t(opt.descriptionKey), action: () => emit('change-network-permission', opt.value) })); }); @@ -1832,11 +1832,11 @@ const workModeSlashMenuItems = computed(() => { const current = String(props.currentWorkMode || ''); return options.map((opt) => ({ id: `workmode:${opt.value}`, - label: opt.label, + label: t(opt.labelKey), description: opt.value === current - ? t('input.optionWithCurrent', { desc: opt.description || '' }) - : opt.description || '', + ? t('input.optionWithCurrent', { desc: t(opt.descriptionKey) }) + : t(opt.descriptionKey), action: () => emit('change-work-mode', opt.value) })); });