Skip to content

Commit 5f0e2f3

Browse files
committed
修正
1 parent e5fe58a commit 5f0e2f3

File tree

4 files changed

+59
-67
lines changed

4 files changed

+59
-67
lines changed

src/components/editor/action/EditorActionAdd.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export const EditorActionAdd = ({
121121

122122
return (
123123
<form onSubmit={onSubmit}>
124-
<Card className="mb-2 pt-4">
124+
<Card className="mb-2 pb-8 pt-4 overflow-auto h-[calc(100vh-6rem)]">
125125
<div className="flex items-center mb-4">
126126
<CardTitle className="mb-0" icon={isNew ? 'add' : 'edit'}>
127127
<span>{isNew ? '添加' : '编辑'}动作</span>

src/components/editor/action/EditorActions.tsx

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -95,66 +95,66 @@ export const EditorActions = ({ control }: EditorActionsProps) => {
9595

9696
return (
9797
<div className="flex flex-wrap md:flex-nowrap min-h-[calc(100vh-6rem)]">
98-
<div className="flex flex-col w-full h-[calc(100vh-6rem)] m-4.5 md:w-1/2 md:mr-8 pb-8 overflow-auto ">
99-
<div>
100-
<EditorActionAdd
101-
control={control}
102-
action={editingAction}
103-
onSubmit={onSubmit}
104-
onCancel={() => setEditingAction(undefined)}
105-
/>
106-
</div>
98+
<div className="md:w-1/2 md:mr-8 w-full">
99+
<EditorActionAdd
100+
control={control}
101+
action={editingAction}
102+
onSubmit={onSubmit}
103+
onCancel={() => setEditingAction(undefined)}
104+
/>
107105
</div>
108106

109-
<div className="p-2 -mx-2 w-full h-[calc(100vh-6rem)] md:w-1/2 pb-8 overflow-auto">
110-
<DndContext
111-
sensors={sensors}
112-
onDragStart={handleDragStart}
113-
onDragOver={handleDragOver}
114-
onDragEnd={handleDragEnd}
115-
onDragCancel={handleDragEnd}
116-
>
117-
<SortableContext
118-
items={actions.map(getId)}
119-
strategy={verticalListSortingStrategy}
107+
<div className=" md:w-1/2 w-full">
108+
<div className="overflow-auto h-[calc(100vh-6rem)] p-2 pt-0 pb-8 -mx-2">
109+
<DndContext
110+
sensors={sensors}
111+
onDragStart={handleDragStart}
112+
onDragOver={handleDragOver}
113+
onDragEnd={handleDragEnd}
114+
onDragCancel={handleDragEnd}
120115
>
121-
<ul>
122-
{actions.map((action, i) => (
123-
<li key={getId(action)} className="mt-2">
124-
<Sortable id={getId(action)}>
125-
{(attrs) => (
126-
<EditorActionItem
127-
action={action}
128-
editing={isEditing(action)}
129-
onEdit={() =>
130-
setEditingAction(
131-
isEditing(action) ? undefined : action,
132-
)
133-
}
134-
onDuplicate={() => handleDuplicate(i)}
135-
onRemove={() => remove(i)}
136-
{...attrs}
137-
/>
138-
)}
139-
</Sortable>
140-
</li>
141-
))}
142-
</ul>
143-
</SortableContext>
144-
145-
<DragOverlay>
146-
{draggingAction && (
147-
<EditorActionItem
148-
editing={isEditing(draggingAction)}
149-
action={draggingAction}
150-
/>
151-
)}
152-
</DragOverlay>
153-
</DndContext>
154-
155-
{actions.length === 0 && (
156-
<NonIdealState title="暂无动作" className="my-4" icon="inbox" />
157-
)}
116+
<SortableContext
117+
items={actions.map(getId)}
118+
strategy={verticalListSortingStrategy}
119+
>
120+
<ul>
121+
{actions.map((action, i) => (
122+
<li key={getId(action)} className="mt-2">
123+
<Sortable id={getId(action)}>
124+
{(attrs) => (
125+
<EditorActionItem
126+
action={action}
127+
editing={isEditing(action)}
128+
onEdit={() =>
129+
setEditingAction(
130+
isEditing(action) ? undefined : action,
131+
)
132+
}
133+
onDuplicate={() => handleDuplicate(i)}
134+
onRemove={() => remove(i)}
135+
{...attrs}
136+
/>
137+
)}
138+
</Sortable>
139+
</li>
140+
))}
141+
</ul>
142+
</SortableContext>
143+
144+
<DragOverlay>
145+
{draggingAction && (
146+
<EditorActionItem
147+
editing={isEditing(draggingAction)}
148+
action={draggingAction}
149+
/>
150+
)}
151+
</DragOverlay>
152+
</DndContext>
153+
154+
{actions.length === 0 && (
155+
<NonIdealState title="暂无动作" className="my-4" icon="inbox" />
156+
)}
157+
</div>
158158
</div>
159159
</div>
160160
)

src/components/editor/operator/EditorOperatorItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const EditorOperatorItem = ({
3434
}技能:${skillUsage}`
3535

3636
return (
37-
<div className="aspect-[5/1] h-large">
37+
<div className="h-[72px] w-[calc(5*72px)]">
3838
<Card
3939
elevation={Elevation.TWO}
4040
className={clsx(

tailwind.config.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ module.exports = {
66
transitionDuration: {
77
DEFAULT: '150ms',
88
},
9-
aspectRatio: {
10-
'5/1': '5 / 1',
11-
},
12-
height: {
13-
small: '45px',
14-
medium: '54px',
15-
large: '72px',
16-
},
179
},
1810
},
1911
plugins: [],

0 commit comments

Comments
 (0)