fix(short-drama-agent-front): 修正分镜诊断状态与响应式布局
This commit is contained in:
1 parent
1da56e0d46
commit
b34dc02e39
23 files changed
+796
-273
No files matched your search
@@ -0,0 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
import { NPopover } from 'naive-ui'
|
||||
import { onScopeDispose, ref } from 'vue'
|
||||
|
||||
/** 工作区图标操作共用的悬浮说明。 */
|
||||
const props = defineProps<{
|
||||
/** 与按钮无障碍名称一致的操作说明。 */
|
||||
label: string
|
||||
/** 按钮仅在手机端隐藏文字时,只在对应窄屏显示说明。 */
|
||||
mobileOnly?: boolean
|
||||
}>()
|
||||
/** 与项目工具栏隐藏文字的断点保持一致。 */
|
||||
const compactMedia = props.mobileOnly ? window.matchMedia('(max-width: 639px)') : null
|
||||
/** 跨屏幕尺寸时同步提示开关,桌面文字按钮不重复提示。 */
|
||||
const compact = ref(compactMedia?.matches ?? false)
|
||||
/**
|
||||
* 同步当前按钮是否处于仅显示图标的窄屏。
|
||||
* @param event 屏幕断点变化事件
|
||||
*/
|
||||
function syncCompact(event: MediaQueryListEvent) {
|
||||
compact.value = event.matches
|
||||
}
|
||||
compactMedia?.addEventListener('change', syncCompact)
|
||||
onScopeDispose(() => compactMedia?.removeEventListener('change', syncCompact))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是图标操作的统一悬浮说明,不额外增加布局容器 -->
|
||||
<NPopover trigger="hover" placement="bottom-end" :disabled="mobileOnly && !compact">
|
||||
<template #trigger><slot /></template>
|
||||
{{ label }}
|
||||
</NPopover>
|
||||
</template>
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { Download } from '@lucide/vue'
|
||||
import { NButton, NPopover } from 'naive-ui'
|
||||
import { NButton } from 'naive-ui'
|
||||
import WorkspaceActionTooltip from './WorkspaceActionTooltip.vue'
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
/** 工作区标签栏的直接导出入口。 */
|
||||
@@ -43,21 +44,18 @@ watch(
|
||||
class="tabs-toolbar-actions workspace-export-action"
|
||||
:style="{ '--export-button-size': `${buttonSize}px` }"
|
||||
>
|
||||
<NPopover trigger="hover" placement="bottom-end">
|
||||
<template #trigger>
|
||||
<NButton
|
||||
quaternary
|
||||
size="small"
|
||||
class="icon-button workspace-export-button"
|
||||
:aria-label="label"
|
||||
:disabled="disabled"
|
||||
@click="emit('export')"
|
||||
>
|
||||
<template #icon><Download :size="18" aria-hidden="true" /></template>
|
||||
</NButton>
|
||||
</template>
|
||||
{{ label }}
|
||||
</NPopover>
|
||||
<WorkspaceActionTooltip :label="label">
|
||||
<NButton
|
||||
quaternary
|
||||
size="small"
|
||||
class="icon-button workspace-export-button"
|
||||
:aria-label="label"
|
||||
:disabled="disabled"
|
||||
@click="emit('export')"
|
||||
>
|
||||
<template #icon><Download :size="18" aria-hidden="true" /></template>
|
||||
</NButton>
|
||||
</WorkspaceActionTooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -68,9 +66,10 @@ watch(
|
||||
@apply items-stretch self-stretch shrink-0 flex-nowrap;
|
||||
}
|
||||
.workspace-export-action .n-button.workspace-export-button {
|
||||
width: var(--export-button-size);
|
||||
/* 项目手机工具栏统一紧凑尺寸,其余场景继续跟随标签栏高度。 */
|
||||
width: var(--app-toolbar-icon-size, var(--export-button-size));
|
||||
min-width: 0;
|
||||
height: 100%;
|
||||
align-self: stretch;
|
||||
height: var(--app-toolbar-icon-size, 100%);
|
||||
align-self: center;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user