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