Skip to content

Commit e4a2d7a

Browse files
committed
fix(ui): 改进模型编辑对话框滚动体验
移除 TextModelEditModal 和 ImageModelEditModal 内部的 NScrollbar, 改用 NModal 原生的全局滚动,用户在任何位置都能滚动表单内容。 Closes #204
1 parent 5b79924 commit e4a2d7a

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

packages/ui/src/components/ImageModelEditModal.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
:segmented="true"
1010
@update:show="(value) => !value && close()"
1111
>
12-
<NScrollbar style="max-height: 68vh;">
13-
<form @submit.prevent="save">
12+
<form @submit.prevent="save">
1413
<NForm label-placement="left" label-width="auto" size="small">
1514
<!-- 基本信息区域 -->
1615
<NFormItem :label="t('image.config.displayName.label')">
@@ -145,9 +144,8 @@
145144
@update:paramOverrides="updateParamOverrides"
146145
/>
147146
</NForm>
148-
</form>
149-
</NScrollbar>
150-
147+
</form>
148+
151149
<template #action>
152150
<NSpace justify="space-between" align="center" style="width: 100%;">
153151
<!-- 左侧:连接测试 -->
@@ -216,7 +214,7 @@ import { computed, watch, nextTick } from 'vue'
216214
217215
import { useI18n } from 'vue-i18n'
218216
import {
219-
NModal, NScrollbar, NSpace, NInput, NInputNumber,
217+
NModal, NSpace, NInput, NInputNumber,
220218
NCheckbox, NSelect, NButton, NTag, NTooltip, NText,
221219
NDivider, NH4, NForm, NFormItem, NImage
222220
} from 'naive-ui'

packages/ui/src/components/TextModelEditModal.vue

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
<NModal
33
:show="show"
44
preset="card"
5-
:style="{ width: '90vw', maxWidth: '1000px', maxHeight: '90vh' }"
5+
:style="{ width: '90vw', maxWidth: '1000px' }"
66
:title="modalTitle.value"
77
size="large"
88
:bordered="false"
99
:segmented="true"
1010
@update:show="handleUpdateShow"
1111
>
12-
<NScrollbar v-if="formReady" style="max-height: 75vh;">
13-
<form @submit.prevent="handleSubmit">
12+
<form v-if="formReady" @submit.prevent="handleSubmit">
1413
<NForm label-placement="left" label-width="auto" size="small">
1514
<NFormItem v-if="!isEditing" :label="t('modelManager.modelKey')">
1615
<NInput
@@ -139,12 +138,11 @@
139138
:param-overrides="form.paramOverrides"
140139
@update:paramOverrides="updateParamOverrides"
141140
/>
142-
</form>
143-
</NScrollbar>
141+
</form>
144142

145-
<div v-else style="height: 200px; display: flex; align-items: center; justify-content: center;">
143+
<NFlex v-else justify="center" align="center" style="height: 200px;">
146144
<NSpin />
147-
</div>
145+
</NFlex>
148146

149147
<template #action>
150148
<NSpace justify="space-between" align="center" style="width: 100%;">
@@ -187,7 +185,6 @@ import { computed, inject, nextTick } from 'vue'
187185
import { useI18n } from 'vue-i18n'
188186
import {
189187
NModal,
190-
NScrollbar,
191188
NForm,
192189
NFormItem,
193190
NH4,
@@ -196,6 +193,7 @@ import {
196193
NCheckbox,
197194
NSelect,
198195
NSpace,
196+
NFlex,
199197
NButton,
200198
NDivider,
201199
NText,

0 commit comments

Comments
 (0)