fix: 优化字段编辑弹窗样式
- 去除弹窗标题 - 描述文字显示选择字段提示 - 关闭按钮置顶,不随内容滚动 - 内容区域独立滚动
This commit is contained in:
@@ -9,13 +9,7 @@ import { cn } from '@/lib/utils';
|
|||||||
import { useGenerator } from './hooks/useGenerator';
|
import { useGenerator } from './hooks/useGenerator';
|
||||||
import { getGeneratorById } from '@/lib/generators';
|
import { getGeneratorById } from '@/lib/generators';
|
||||||
import type { FieldConfig, GenerateResult } from '@/types/testDataGenerator';
|
import type { FieldConfig, GenerateResult } from '@/types/testDataGenerator';
|
||||||
import {
|
import { Dialog, DialogContent, DialogHeader, DialogDescription } from '@/components/ui/dialog';
|
||||||
Dialog,
|
|
||||||
DialogContent,
|
|
||||||
DialogHeader,
|
|
||||||
DialogTitle,
|
|
||||||
DialogDescription,
|
|
||||||
} from '@/components/ui/dialog';
|
|
||||||
|
|
||||||
// 生成唯一 ID 的辅助函数
|
// 生成唯一 ID 的辅助函数
|
||||||
function generateId(): string {
|
function generateId(): string {
|
||||||
@@ -309,17 +303,18 @@ export default function TestDataGeneratorPage() {
|
|||||||
|
|
||||||
{/* 字段编辑弹窗 */}
|
{/* 字段编辑弹窗 */}
|
||||||
<Dialog open={isEditorOpen} onOpenChange={setIsEditorOpen}>
|
<Dialog open={isEditorOpen} onOpenChange={setIsEditorOpen}>
|
||||||
<DialogContent className="w-[calc(100vw-2rem)] max-w-[360px] max-h-[calc(100vh-4rem)] overflow-y-auto">
|
<DialogContent className="w-[calc(100vw-2rem)] max-w-[360px] max-h-[calc(100vh-4rem)] overflow-hidden p-0">
|
||||||
<DialogHeader>
|
<DialogHeader className="px-6 pt-6 pb-0">
|
||||||
<DialogTitle>{t('testDataGenerator_fieldConfig')}</DialogTitle>
|
|
||||||
<DialogDescription>{t('testDataGenerator_selectFieldToEdit')}</DialogDescription>
|
<DialogDescription>{t('testDataGenerator_selectFieldToEdit')}</DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
{selectedField && selectedIndex !== null && (
|
<div className="overflow-y-auto max-h-[calc(100vh-8rem)] px-6 pb-6">
|
||||||
<FieldEditor
|
{selectedField && selectedIndex !== null && (
|
||||||
field={selectedField}
|
<FieldEditor
|
||||||
onChange={(updatedField) => handleUpdateField(selectedIndex, updatedField)}
|
field={selectedField}
|
||||||
/>
|
onChange={(updatedField) => handleUpdateField(selectedIndex, updatedField)}
|
||||||
)}
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user