whistle.mock-plugins 1.2.1-beta.1 → 1.2.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION.md +1 -1
- package/app/public/js/index.js +1 -1
- package/app/public/js/index.js.LICENSE.txt +2 -0
- package/package.json +1 -1
- package/ui/src/components/interface-management/DataManagementModal.js +2 -2
- package/ui/src/components/interface-management/ResponseContentEditor.js +21 -25
- package/ui/src/styles/interface-management.css +31 -0
|
@@ -150,6 +150,8 @@
|
|
|
150
150
|
|
|
151
151
|
/** */
|
|
152
152
|
|
|
153
|
+
/** */
|
|
154
|
+
|
|
153
155
|
/** */
|
|
154
156
|
|
|
155
157
|
/** */
|
package/package.json
CHANGED
|
@@ -65,11 +65,11 @@ const DataManagementModal = ({ visible, onCancel, interfaceItem, onSaved }) => {
|
|
|
65
65
|
open={visible}
|
|
66
66
|
onOk={handleOk}
|
|
67
67
|
onCancel={onCancel}
|
|
68
|
-
width={
|
|
68
|
+
width={1040}
|
|
69
69
|
destroyOnClose
|
|
70
70
|
okText="保存"
|
|
71
71
|
cancelText="取消"
|
|
72
|
-
bodyStyle={{ maxHeight: '
|
|
72
|
+
bodyStyle={{ maxHeight: '80vh', overflow: 'auto', padding: '24px' }}
|
|
73
73
|
>
|
|
74
74
|
<Form form={form} layout="vertical" initialValues={{ responses: [], activeResponseId: '' }}>
|
|
75
75
|
<Form.Item name="responses" hidden>
|
|
@@ -12,7 +12,8 @@ import {
|
|
|
12
12
|
CheckCircleOutlined,
|
|
13
13
|
EditOutlined,
|
|
14
14
|
FullscreenOutlined,
|
|
15
|
-
FullscreenExitOutlined
|
|
15
|
+
FullscreenExitOutlined,
|
|
16
|
+
MenuOutlined
|
|
16
17
|
} from '@ant-design/icons';
|
|
17
18
|
import { generateResponseId } from './utils';
|
|
18
19
|
|
|
@@ -30,6 +31,7 @@ const ResponseContentEditor = ({
|
|
|
30
31
|
const [isEditing, setIsEditing] = useState(false);
|
|
31
32
|
const [editingName, setEditingName] = useState('');
|
|
32
33
|
const [isTextareaFullscreen, setIsTextareaFullscreen] = useState(false);
|
|
34
|
+
const [showSorting, setShowSorting] = useState(false);
|
|
33
35
|
|
|
34
36
|
// 查找激活的响应
|
|
35
37
|
const activeResponseIndex = responses.findIndex(r => r.id === activeResponseId);
|
|
@@ -279,6 +281,17 @@ const ResponseContentEditor = ({
|
|
|
279
281
|
}
|
|
280
282
|
extra={
|
|
281
283
|
<Space size="small">
|
|
284
|
+
{enableSorting && (
|
|
285
|
+
<Button
|
|
286
|
+
type="default"
|
|
287
|
+
icon={<MenuOutlined />}
|
|
288
|
+
onClick={() => setShowSorting(!showSorting)}
|
|
289
|
+
size="small"
|
|
290
|
+
style={{ display: 'flex', alignItems: 'center', gap: '4px' }}
|
|
291
|
+
>
|
|
292
|
+
排序
|
|
293
|
+
</Button>
|
|
294
|
+
)}
|
|
282
295
|
<Button
|
|
283
296
|
type="default"
|
|
284
297
|
icon={<PlusCircleOutlined />}
|
|
@@ -329,11 +342,8 @@ const ResponseContentEditor = ({
|
|
|
329
342
|
style={{ marginBottom: 16 }}
|
|
330
343
|
bodyStyle={{ padding: '16px' }}
|
|
331
344
|
>
|
|
332
|
-
{enableSorting && Array.isArray(sortableList) && sortableList.length > 1 && (
|
|
333
|
-
<div style={{ marginBottom:
|
|
334
|
-
<div style={{ marginBottom: '8px' }}>
|
|
335
|
-
<label style={{ fontSize: '12px', color: '#666', fontWeight: 'bold' }}>响应排序(拖拽调整顺序)</label>
|
|
336
|
-
</div>
|
|
345
|
+
{enableSorting && showSorting && Array.isArray(sortableList) && sortableList.length > 1 && (
|
|
346
|
+
<div style={{ marginBottom: 12 }}>
|
|
337
347
|
<ReactSortable
|
|
338
348
|
list={sortableList}
|
|
339
349
|
setList={(newState) => {
|
|
@@ -341,31 +351,17 @@ const ResponseContentEditor = ({
|
|
|
341
351
|
handleAfterSort(newState);
|
|
342
352
|
}}
|
|
343
353
|
animation={150}
|
|
344
|
-
handle={undefined}
|
|
345
354
|
ghostClass="sortable-ghost"
|
|
355
|
+
style={{ display: 'flex', gap: 8, overflowX: 'auto', paddingBottom: 4 }}
|
|
346
356
|
>
|
|
347
357
|
{sortableList.map((item) => (
|
|
348
358
|
<div
|
|
349
359
|
key={item.id}
|
|
350
|
-
|
|
351
|
-
display: 'flex',
|
|
352
|
-
alignItems: 'center',
|
|
353
|
-
justifyContent: 'space-between',
|
|
354
|
-
padding: '6px 10px',
|
|
355
|
-
border: '1px solid #f0f0f0',
|
|
356
|
-
borderRadius: '4px',
|
|
357
|
-
marginBottom: '6px',
|
|
358
|
-
background: item.id === activeResponseId ? '#e6f7ff' : '#fff',
|
|
359
|
-
cursor: 'move'
|
|
360
|
-
}}
|
|
360
|
+
className={`sortable-chip${item.id === activeResponseId ? ' sortable-chip-active' : ''}`}
|
|
361
361
|
onClick={() => handleResponseSelect(item.id)}
|
|
362
|
-
title=
|
|
362
|
+
title={item.name || '未命名响应'}
|
|
363
363
|
>
|
|
364
|
-
|
|
365
|
-
<Badge status={item.id === activeResponseId ? 'processing' : 'default'} />
|
|
366
|
-
<span style={{ fontWeight: 500 }}>{item.name || '未命名响应'}</span>
|
|
367
|
-
</div>
|
|
368
|
-
<div style={{ color: '#999', fontSize: 12 }}>拖拽</div>
|
|
364
|
+
{item.name || '未命名响应'}
|
|
369
365
|
</div>
|
|
370
366
|
))}
|
|
371
367
|
</ReactSortable>
|
|
@@ -503,7 +499,7 @@ const ResponseContentEditor = ({
|
|
|
503
499
|
|
|
504
500
|
<div style={{ position: 'relative' }}>
|
|
505
501
|
<TextArea
|
|
506
|
-
rows={
|
|
502
|
+
rows={18}
|
|
507
503
|
placeholder="请输入响应内容..."
|
|
508
504
|
style={{
|
|
509
505
|
fontFamily: 'Monaco, Menlo, "Ubuntu Mono", monospace',
|
|
@@ -1144,6 +1144,37 @@
|
|
|
1144
1144
|
background: #e6f4ff;
|
|
1145
1145
|
}
|
|
1146
1146
|
|
|
1147
|
+
/* 紧凑排序 Chips */
|
|
1148
|
+
.sortable-chip {
|
|
1149
|
+
display: inline-flex;
|
|
1150
|
+
align-items: center;
|
|
1151
|
+
padding: 2px 10px;
|
|
1152
|
+
height: 24px;
|
|
1153
|
+
border: 1px solid #e6e6e6;
|
|
1154
|
+
border-radius: 12px;
|
|
1155
|
+
background: #fff;
|
|
1156
|
+
font-size: 12px;
|
|
1157
|
+
color: #595959;
|
|
1158
|
+
cursor: move;
|
|
1159
|
+
user-select: none;
|
|
1160
|
+
white-space: nowrap;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
.sortable-chip:hover {
|
|
1164
|
+
border-color: #bfbfbf;
|
|
1165
|
+
box-shadow: 0 1px 2px rgba(0,0,0,0.06);
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
.sortable-chip-active {
|
|
1169
|
+
background: #e6f7ff;
|
|
1170
|
+
border-color: #91d5ff;
|
|
1171
|
+
color: #1677ff;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
.sortable-ghost {
|
|
1175
|
+
opacity: 0.6;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1147
1178
|
/* 接口弹窗样式 */
|
|
1148
1179
|
.interface-modal .ant-modal-header {
|
|
1149
1180
|
border-bottom: 1px solid #f0f0f0;
|