refactor: 精简导航并扩大工作区内容显示面积

This commit is contained in:
GouJ committed 2026-09-01 17:45:40 +08:00
1 parent 70ab4ba48f
commit 0279c701b4
15 files changed
+1256 -821

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
<script setup lang="ts">
import { inject } from 'vue'
import { NButton, NDrawer, NDrawerContent } from 'naive-ui'
import { Settings2, X } from '@lucide/vue'
import { workspaceHostKey } from './workspaceContext'
/** 低频配置、批量动作与回执在抽屉中查看,开关面板不影响页面查询和后台任务。 */
withDefaults(defineProps<{ title: string; label?: string; hasReceipt?: boolean }>(), { label: '操作与回执' })
const open = defineModel<boolean>('open', { default: false })
const host = inject(workspaceHostKey, undefined)
</script>
<template>
<NButton
class="workspace-tools-trigger"
data-workspace-tools
aria-haspopup="dialog"
:aria-expanded="open"
@click="open = true"
>
<template #icon><Settings2 :size="15" /></template>
{{ label }}<span v-if="hasReceipt" class="text-xs text-muted"> · 有回执</span>
</NButton>
<NDrawer
v-model:show="open"
:to="host ?? undefined"
width="min(960px, 100%)"
placement="right"
:block-scroll="false"
display-directive="show"
class="workspace-tools-drawer"
:aria-label="title"
>
<NDrawerContent :native-scrollbar="false" body-content-class="workspace-tools-body">
<template #header
><div class="workspace-tools-heading">
<span>{{ title }}</span
><NButton quaternary circle aria-label="关闭操作面板" @click="open = false"
><X :size="18"
/></NButton></div
></template>
<slot />
<template #footer><span class="text-xs text-muted">关闭面板不会取消已提交的后台任务。</span></template>
</NDrawerContent>
</NDrawer>
</template>