whistle.mock-plugins 1.1.3-dev.13 → 1.1.3-dev.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whistle.mock-plugins",
3
- "version": "1.1.3-dev.13",
3
+ "version": "1.1.3-dev.15",
4
4
  "description": "Whistle 插件,用于快速创建 API 模拟数据",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -1034,10 +1034,16 @@ const InterfaceManagement = () => {
1034
1034
  <Dropdown
1035
1035
  overlay={
1036
1036
  <Menu
1037
- selectedKeys={selectedGroup ? [selectedGroup] : []}
1038
- onClick={({ key }) => setSelectedGroup(key === selectedGroup ? null : key)}
1037
+ selectedKeys={selectedGroup ? [selectedGroup] : ['ALL_GROUPS']}
1038
+ onClick={({ key }) => {
1039
+ if (key === 'ALL_GROUPS') {
1040
+ setSelectedGroup(null);
1041
+ } else {
1042
+ setSelectedGroup(key === selectedGroup ? null : key);
1043
+ }
1044
+ }}
1039
1045
  >
1040
- <Menu.Item key={null}>全部分组</Menu.Item>
1046
+ <Menu.Item key="ALL_GROUPS">全部分组</Menu.Item>
1041
1047
  {groups.map(group => (
1042
1048
  <Menu.Item key={group}>
1043
1049
  {group} ({interfaces.filter(item => item.group === group).length})
@@ -1256,36 +1262,73 @@ const InterfaceManagement = () => {
1256
1262
 
1257
1263
  {/* 接口编辑/创建模态框 */}
1258
1264
  <Modal
1259
- title={editingInterface ? '编辑接口' : '添加接口'}
1265
+ title={
1266
+ <div style={{
1267
+ fontSize: '18px',
1268
+ fontWeight: 600,
1269
+ color: '#262626',
1270
+ display: 'flex',
1271
+ alignItems: 'center',
1272
+ gap: '8px'
1273
+ }}>
1274
+ <span>{editingInterface ? '编辑接口' : '添加接口'}</span>
1275
+ <Badge
1276
+ count="配置向导"
1277
+ style={{
1278
+ backgroundColor: '#f0f9ff',
1279
+ color: '#1677ff',
1280
+ fontSize: '11px',
1281
+ fontWeight: 'normal'
1282
+ }}
1283
+ />
1284
+ </div>
1285
+ }
1260
1286
  open={modalVisible}
1261
1287
  onOk={handleSubmit}
1262
1288
  onCancel={handleCancel}
1263
- width={800}
1289
+ width={900}
1264
1290
  destroyOnClose
1265
1291
  okText={editingInterface ? '保存' : '创建'}
1266
1292
  cancelText="取消"
1267
- bodyStyle={{ maxHeight: '70vh', overflow: 'auto', padding: '24px' }}
1293
+ bodyStyle={{
1294
+ maxHeight: '75vh',
1295
+ overflow: 'auto',
1296
+ padding: '0',
1297
+ background: '#fafafa'
1298
+ }}
1299
+ className="interface-modal"
1268
1300
  >
1269
- <Form
1270
- form={form}
1271
- layout="vertical"
1272
- initialValues={{
1273
- name: '',
1274
- group: '',
1275
- pattern: '',
1276
- proxyType: 'response',
1277
- statusCode: '200',
1278
- contentType: 'application/json; charset=utf-8',
1279
- responses: [],
1280
- httpMethod: 'ALL',
1281
- targetUrl: '',
1282
- headerItems: [],
1283
- paramMatchers: [],
1284
- responseDelay: '0'
1285
- }}
1286
- >
1287
- {/* 基础信息表单项 */}
1288
- <div style={{ display: 'flex', flexDirection: 'row', gap: '16px' }}>
1301
+ <div style={{ padding: '24px' }}>
1302
+ <Form
1303
+ form={form}
1304
+ layout="vertical"
1305
+ initialValues={{
1306
+ name: '',
1307
+ group: '',
1308
+ pattern: '',
1309
+ proxyType: 'response',
1310
+ statusCode: '200',
1311
+ contentType: 'application/json; charset=utf-8',
1312
+ responses: [],
1313
+ httpMethod: 'ALL',
1314
+ targetUrl: '',
1315
+ headerItems: [],
1316
+ paramMatchers: [],
1317
+ responseDelay: '0'
1318
+ }}
1319
+ >
1320
+ {/* 第一步:基础信息 */}
1321
+ <Card
1322
+ title={
1323
+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
1324
+ <Badge count="1" style={{ backgroundColor: '#1677ff' }} />
1325
+ <span>基础信息</span>
1326
+ </div>
1327
+ }
1328
+ style={{ marginBottom: '16px' }}
1329
+ bodyStyle={{ padding: '20px' }}
1330
+ >
1331
+ <div style={{ display: 'flex', flexDirection: 'row', gap: '16px' }}>
1289
1332
  <div style={{ flex: 1 }}>
1290
1333
  <Form.Item
1291
1334
  name="name"
@@ -1329,10 +1372,22 @@ const InterfaceManagement = () => {
1329
1372
  ))}
1330
1373
  </Select>
1331
1374
  </Form.Item>
1332
- </div>
1333
- </div>
1334
-
1335
- <div style={{ display: 'flex', flexDirection: 'row', gap: '16px' }}>
1375
+ </div>
1376
+ </div>
1377
+ </Card>
1378
+
1379
+ {/* 第二步:URL配置 */}
1380
+ <Card
1381
+ title={
1382
+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
1383
+ <Badge count="2" style={{ backgroundColor: '#1677ff' }} />
1384
+ <span>URL配置</span>
1385
+ </div>
1386
+ }
1387
+ style={{ marginBottom: '16px' }}
1388
+ bodyStyle={{ padding: '20px' }}
1389
+ >
1390
+ <div style={{ display: 'flex', flexDirection: 'row', gap: '16px' }}>
1336
1391
  <div style={{ flex: 1 }}>
1337
1392
  <Form.Item
1338
1393
  name="pattern"
@@ -1472,7 +1527,20 @@ const InterfaceManagement = () => {
1472
1527
  <div style={{ flex: 1 }}>
1473
1528
  {/* 这里可以留空或添加其他字段 */}
1474
1529
  </div>
1475
- </div>
1530
+ </div>
1531
+ </Card>
1532
+
1533
+ {/* 第三步:高级配置 */}
1534
+ <Card
1535
+ title={
1536
+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
1537
+ <Badge count="3" style={{ backgroundColor: '#1677ff' }} />
1538
+ <span>高级配置</span>
1539
+ </div>
1540
+ }
1541
+ style={{ marginBottom: '16px' }}
1542
+ bodyStyle={{ padding: '20px' }}
1543
+ >
1476
1544
 
1477
1545
  {/* 根据proxyType显示不同的表单项 */}
1478
1546
  <Form.Item noStyle shouldUpdate={(prevValues, currentValues) => prevValues.proxyType !== currentValues.proxyType}>
@@ -1733,7 +1801,9 @@ const InterfaceManagement = () => {
1733
1801
  return null;
1734
1802
  }}
1735
1803
  </Form.Item>
1736
- </Form>
1804
+ </Card>
1805
+ </Form>
1806
+ </div>
1737
1807
  </Modal>
1738
1808
 
1739
1809
  {/* 使用拆分后的预览模态框组件 */}
@@ -1144,6 +1144,59 @@
1144
1144
  background: #e6f4ff;
1145
1145
  }
1146
1146
 
1147
+ /* 接口弹窗样式 */
1148
+ .interface-modal .ant-modal-header {
1149
+ border-bottom: 1px solid #f0f0f0;
1150
+ padding: 16px 24px;
1151
+ margin-bottom: 0;
1152
+ }
1153
+
1154
+ .interface-modal .ant-modal-body {
1155
+ padding: 0;
1156
+ }
1157
+
1158
+ .interface-modal .ant-card {
1159
+ border: 1px solid #e8e8e8;
1160
+ border-radius: 8px;
1161
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
1162
+ }
1163
+
1164
+ .interface-modal .ant-card-head {
1165
+ background: #fafafa;
1166
+ border-bottom: 1px solid #f0f0f0;
1167
+ padding: 0 20px;
1168
+ min-height: 48px;
1169
+ }
1170
+
1171
+ .interface-modal .ant-card-head-title {
1172
+ font-size: 14px;
1173
+ font-weight: 600;
1174
+ color: #262626;
1175
+ padding: 12px 0;
1176
+ }
1177
+
1178
+ .interface-modal .ant-form-item-label > label {
1179
+ font-size: 13px;
1180
+ font-weight: 500;
1181
+ color: #434343;
1182
+ }
1183
+
1184
+ .interface-modal .ant-form-item {
1185
+ margin-bottom: 16px;
1186
+ }
1187
+
1188
+ .interface-modal .ant-input,
1189
+ .interface-modal .ant-select-selector {
1190
+ border-radius: 6px;
1191
+ border: 1px solid #d9d9d9;
1192
+ }
1193
+
1194
+ .interface-modal .ant-input:focus,
1195
+ .interface-modal .ant-select-focused .ant-select-selector {
1196
+ border-color: #4096ff;
1197
+ box-shadow: 0 0 0 2px rgba(64, 150, 255, 0.1);
1198
+ }
1199
+
1147
1200
  /* 分页器样式 */
1148
1201
  .interface-table .ant-pagination-options {
1149
1202
  margin-right: 16px;