fix(frontend): 调整工作台文件总览与快捷指令菜单

将文件管理区从单目录文件表格修正为多根目录常驻的文件夹总览,
点击目录时仅展开和聚焦,不再切换为单独目录列表。

同时修复快捷指令右键菜单的透明背景与粘贴语义,
统一为“粘贴到命令输入框”且不自动发送,并同步多语言文案。

顺带收紧快捷指令编辑弹窗的最小尺寸、初始尺寸与视口上限,
降低小分辨率下的弹窗溢出概率。
This commit is contained in:
yinjianm
2026-03-26 02:04:07 +08:00
parent 3f6e2bffc6
commit b1f036fdc6
15 changed files with 517 additions and 208 deletions
@@ -6,6 +6,8 @@
:style="{
width: resizableWidth ? `${resizableWidth}px` : undefined,
height: resizableHeight ? `${resizableHeight}px` : undefined,
maxWidth: 'calc(100vw - 2rem)',
maxHeight: 'calc(100vh - 2rem)',
}"
>
<h2 class="m-0 mb-6 text-center text-xl font-semibold">{{ isEditing ? t('quickCommands.form.titleEdit', '编辑快捷指令') : t('quickCommands.form.titleAdd', '添加快捷指令') }}</h2>
@@ -179,8 +181,8 @@ const isSubmitting = ref(false);
const modalContentRef = ref<HTMLElement | null>(null);
const commandTextareaRef = ref<HTMLTextAreaElement | null>(null);
const R_MIN_WIDTH = 800; // 可调整大小的最小宽度 (像素)
const R_MIN_HEIGHT = 700; // 可调整大小的最小高度 (像素)
const R_MIN_WIDTH = 680; // 可调整大小的最小宽度 (像素)
const R_MIN_HEIGHT = 520; // 可调整大小的最小高度 (像素)
const placeholder = t('quickCommands.form.commandPlaceholder') + 'echo "Hello,\${USERNAME}"'
const { width: resizableWidth, height: resizableHeight } = useResizable(modalContentRef, {
@@ -237,8 +239,8 @@ watch(() => formData.command, (newCommand) => {
// 初始化表单数据 (如果是编辑模式)
onMounted(() => {
if (typeof window !== 'undefined') {
let initialW = Math.min(window.innerWidth * 0.9, 1152); // 目标 90vw,最大 1152px
let initialH = window.innerHeight * 0.85; // 目标 85vh
let initialW = Math.min(window.innerWidth * 0.82, 960); // 目标 82vw,最大 960px
let initialH = Math.min(window.innerHeight * 0.78, 720); // 目标 78vh,最大 720px
initialW = Math.max(R_MIN_WIDTH, initialW);
initialH = Math.max(R_MIN_HEIGHT, initialH);