refactor: 工作区批量工具由抽屉改为大弹窗

This commit is contained in:
GouJ committed 2026-09-26 20:56:45 +08:00
1 parent 8af3cacb10
commit 291c731678
1 file changed
+20 -37
+20 -37
View File
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { NButton, NDrawer, NDrawerContent } from 'naive-ui'
import { Settings2, X } from '@lucide/vue'
import { NButton, NModal, NScrollbar } from 'naive-ui'
import { Settings2 } from '@lucide/vue'
/** 所有业务抽屉挂到 body,以完整视口为边界;triggerless 允许业务页把入口放进自己的工具栏。 */
/** 批量设置与回执属于临时操作,统一使用大尺寸弹窗;完整制作流程继续保留独立页面。 */
withDefaults(defineProps<{ title: string; label?: string; hasReceipt?: boolean; triggerless?: boolean }>(), {
label: '操作与回执',
triggerless: false
@@ -24,50 +24,33 @@ const open = defineModel<boolean>('open', { default: false })
<span class="workspace-tools-label">{{ label }}</span
><span v-if="hasReceipt" class="text-xs text-muted"> · 有回执</span>
</NButton>
<NDrawer
<NModal
v-model:show="open"
to="body"
width="min(960px, 100%)"
placement="right"
:block-scroll="true"
display-directive="show"
class="workspace-tools-drawer"
preset="card"
:title="title"
:style="{ width: 'min(1040px, calc(100vw - 32px))' }"
class="workspace-tools-modal"
:mask-closable="true"
:close-on-esc="true"
: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
class="icon-button"
aria-label="关闭操作面板"
title="关闭操作面板"
@click="open = false"
><template #icon><X :size="18" /></template
></NButton></div
></template>
<slot />
</NDrawerContent>
</NDrawer>
<NScrollbar class="workspace-tools-scroll">
<div class="workspace-tools-body"><slot /></div>
</NScrollbar>
</NModal>
</template>
<style>
/* 本组件专属布局与 Naive 内部结构覆盖。 */
@reference "../../styles/styles.css";
.workspace-tools-drawer .n-drawer-header {
@apply bg-(--app-subtle) p-4;
.workspace-tools-modal {
@apply max-h-[calc(100dvh-32px)];
}
.workspace-tools-drawer .n-drawer-body {
@apply bg-(--app-body) p-0;
.workspace-tools-modal .n-card__content {
@apply min-h-0 p-0;
}
.workspace-tools-drawer {
--n-header-padding: 16px;
--n-body-padding: 16px;
@apply max-w-full;
}
.workspace-tools-heading {
@apply flex items-center justify-between gap-4 w-full text-[15px];
.workspace-tools-scroll {
@apply max-h-[calc(100dvh-130px)];
}
.workspace-tools-body {
@apply p-4;