whistle.mock-plugins 1.1.3-dev.16 → 1.1.3-dev.17

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.16",
3
+ "version": "1.1.3-dev.17",
4
4
  "description": "Whistle 插件,用于快速创建 API 模拟数据",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -15,7 +15,7 @@ import {
15
15
  import {
16
16
  PlusOutlined, EditOutlined, DeleteOutlined,
17
17
  FileTextOutlined, PlusCircleOutlined, SettingOutlined,
18
- SearchOutlined, FilterOutlined, ReloadOutlined, DownOutlined
18
+ SearchOutlined, FilterOutlined, ReloadOutlined, DownOutlined, QuestionCircleOutlined
19
19
  } from '@ant-design/icons';
20
20
  import '../styles/interface-management.css';
21
21
  import axios from 'axios';
@@ -1318,7 +1318,7 @@ const InterfaceManagement = () => {
1318
1318
  }}
1319
1319
  >
1320
1320
  <Collapse
1321
- defaultActiveKey={editingInterface ? ['1', '2'] : ['1', '2', '3']}
1321
+ defaultActiveKey={editingInterface ? ['3'] : ['1', '2', '3']}
1322
1322
  style={{ marginBottom: '16px' }}
1323
1323
  ghost
1324
1324
  >
@@ -1656,30 +1656,42 @@ const InterfaceManagement = () => {
1656
1656
  />
1657
1657
  </div>
1658
1658
  ))}
1659
- <Button
1660
- type="dashed"
1661
- onClick={() => add()}
1662
- icon={<PlusOutlined />}
1663
- style={{ width: '100%', marginTop: '8px' }}
1664
- >
1665
- 添加参数匹配规则
1666
- </Button>
1667
- {fields.length > 0 && (
1668
- <div style={{
1669
- fontSize: '12px',
1670
- color: '#666',
1671
- marginTop: '8px',
1672
- padding: '8px',
1673
- backgroundColor: '#f5f5f5',
1674
- borderRadius: '4px'
1675
- }}>
1676
- <div><strong>说明:</strong></div>
1677
- <div>• <strong>精确匹配</strong>:参数值完全相等</div>
1678
- <div>• <strong>包含</strong>:参数值包含指定内容</div>
1679
- <div>• <strong>正则</strong>:参数值符合正则表达式</div>
1680
- <div>• <strong>嵌套路径</strong>:使用点号分隔,如 data.user.id</div>
1681
- </div>
1682
- )}
1659
+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', marginTop: '8px' }}>
1660
+ <Button
1661
+ type="dashed"
1662
+ onClick={() => add()}
1663
+ icon={<PlusOutlined />}
1664
+ style={{ flex: 1 }}
1665
+ >
1666
+ 添加参数匹配规则
1667
+ </Button>
1668
+ <Popover
1669
+ content={
1670
+ <div style={{ maxWidth: '300px' }}>
1671
+ <div style={{ marginBottom: '8px', fontWeight: 'bold' }}>匹配规则说明:</div>
1672
+ <div style={{ lineHeight: '1.6' }}>
1673
+ <div>• <strong>精确匹配</strong>:参数值完全相等</div>
1674
+ <div>• <strong>包含</strong>:参数值包含指定内容</div>
1675
+ <div>• <strong>正则</strong>:参数值符合正则表达式</div>
1676
+ <div>• <strong>嵌套路径</strong>:使用点号分隔,如 data.user.id</div>
1677
+ </div>
1678
+ </div>
1679
+ }
1680
+ title="参数匹配规则"
1681
+ trigger="click"
1682
+ placement="top"
1683
+ >
1684
+ <Button
1685
+ type="text"
1686
+ icon={<QuestionCircleOutlined />}
1687
+ style={{
1688
+ color: '#999',
1689
+ padding: '4px'
1690
+ }}
1691
+ size="small"
1692
+ />
1693
+ </Popover>
1694
+ </div>
1683
1695
  </>
1684
1696
  )}
1685
1697
  </Form.List>
@@ -1236,6 +1236,18 @@
1236
1236
  font-size: 12px !important;
1237
1237
  }
1238
1238
 
1239
+ /* 参数匹配规则帮助按钮样式 */
1240
+ .interface-modal .ant-popover-inner-content {
1241
+ padding: 12px;
1242
+ }
1243
+
1244
+ .interface-modal .ant-popover-title {
1245
+ font-weight: 600;
1246
+ color: #262626;
1247
+ padding: 8px 12px;
1248
+ border-bottom: 1px solid #f0f0f0;
1249
+ }
1250
+
1239
1251
  /* 分页器样式 */
1240
1252
  .interface-table .ant-pagination-options {
1241
1253
  margin-right: 16px;