fix(i18n): slash 子菜单选项改用 labelKey 渲染,修复显示空白

4aac18f7 将选项结构改为 labelKey/descriptionKey 后,slash 菜单的
工作模式/权限/执行环境/网络四个子菜单仍读取已不存在的 label/description
字段,导致菜单项标签与描述渲染为空。统一改为 t(labelKey)/t(descriptionKey)。
This commit is contained in:
JOJO 2026-08-29 12:17:26 +08:00
parent 0b3d98d91b
commit 69c5953fe7

View File

@ -1751,12 +1751,12 @@ const permissionSlashMenuItems = computed<SlashMenuItem[]>(() => {
const lockedByPlan = props.currentWorkMode === 'plan'; const lockedByPlan = props.currentWorkMode === 'plan';
return options.map((opt) => ({ return options.map((opt) => ({
id: `perm:${opt.value}`, id: `perm:${opt.value}`,
label: opt.label, label: t(opt.labelKey),
description: lockedByPlan description: lockedByPlan
? t('input.permissionLockedReadonlyDesc') ? t('input.permissionLockedReadonlyDesc')
: opt.value === current : opt.value === current
? t('input.optionWithCurrent', { desc: opt.description || '' }) ? t('input.optionWithCurrent', { desc: t(opt.descriptionKey) })
: opt.description || '', : t(opt.descriptionKey),
disabled: lockedByPlan, disabled: lockedByPlan,
action: () => emit('change-permission-mode', opt.value) action: () => emit('change-permission-mode', opt.value)
})); }));
@ -1769,12 +1769,12 @@ const executionSlashMenuItems = computed<SlashMenuItem[]>(() => {
const lockedByPlan = props.currentWorkMode === 'plan'; const lockedByPlan = props.currentWorkMode === 'plan';
return options.map((opt) => ({ return options.map((opt) => ({
id: `exec:${opt.value}`, id: `exec:${opt.value}`,
label: opt.label, label: t(opt.labelKey),
description: lockedByPlan description: lockedByPlan
? t('input.executionLockedSandboxDesc') ? t('input.executionLockedSandboxDesc')
: opt.value === current : opt.value === current
? t('input.optionWithCurrent', { desc: opt.description || '' }) ? t('input.optionWithCurrent', { desc: t(opt.descriptionKey) })
: opt.description || '', : t(opt.descriptionKey),
disabled: lockedByPlan, disabled: lockedByPlan,
action: () => emit('change-execution-mode', opt.value) action: () => emit('change-execution-mode', opt.value)
})); }));
@ -1817,11 +1817,11 @@ const networkSlashMenuItems = computed<SlashMenuItem[]>(() => {
const current = String(props.currentNetworkPermission || ''); const current = String(props.currentNetworkPermission || '');
return options.map((opt) => ({ return options.map((opt) => ({
id: `network:${opt.value}`, id: `network:${opt.value}`,
label: opt.label, label: t(opt.labelKey),
description: description:
opt.value === current opt.value === current
? t('input.optionWithCurrent', { desc: opt.description || '' }) ? t('input.optionWithCurrent', { desc: t(opt.descriptionKey) })
: opt.description || '', : t(opt.descriptionKey),
action: () => emit('change-network-permission', opt.value) action: () => emit('change-network-permission', opt.value)
})); }));
}); });
@ -1832,11 +1832,11 @@ const workModeSlashMenuItems = computed<SlashMenuItem[]>(() => {
const current = String(props.currentWorkMode || ''); const current = String(props.currentWorkMode || '');
return options.map((opt) => ({ return options.map((opt) => ({
id: `workmode:${opt.value}`, id: `workmode:${opt.value}`,
label: opt.label, label: t(opt.labelKey),
description: description:
opt.value === current opt.value === current
? t('input.optionWithCurrent', { desc: opt.description || '' }) ? t('input.optionWithCurrent', { desc: t(opt.descriptionKey) })
: opt.description || '', : t(opt.descriptionKey),
action: () => emit('change-work-mode', opt.value) action: () => emit('change-work-mode', opt.value)
})); }));
}); });