whistle.mock-plugins 1.2.1-beta.6 → 1.2.2-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.
@@ -171,3 +171,5 @@
171
171
  /**![setting](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkyNC44IDYyNS43bC02NS41LTU2YzMuMS0xOSA0LjctMzguNCA0LjctNTcuOHMtMS42LTM4LjgtNC43LTU3LjhsNjUuNS01NmEzMi4wMyAzMi4wMyAwIDAwOS4zLTM1LjJsLS45LTIuNmE0NDMuNzQgNDQzLjc0IDAgMDAtNzkuNy0xMzcuOWwtMS44LTIuMWEzMi4xMiAzMi4xMiAwIDAwLTM1LjEtOS41bC04MS4zIDI4LjljLTMwLTI0LjYtNjMuNS00NC05OS43LTU3LjZsLTE1LjctODVhMzIuMDUgMzIuMDUgMCAwMC0yNS44LTI1LjdsLTIuNy0uNWMtNTIuMS05LjQtMTA2LjktOS40LTE1OSAwbC0yLjcuNWEzMi4wNSAzMi4wNSAwIDAwLTI1LjggMjUuN2wtMTUuOCA4NS40YTM1MS44NiAzNTEuODYgMCAwMC05OSA1Ny40bC04MS45LTI5LjFhMzIgMzIgMCAwMC0zNS4xIDkuNWwtMS44IDIuMWE0NDYuMDIgNDQ2LjAyIDAgMDAtNzkuNyAxMzcuOWwtLjkgMi42Yy00LjUgMTIuNS0uOCAyNi41IDkuMyAzNS4ybDY2LjMgNTYuNmMtMy4xIDE4LjgtNC42IDM4LTQuNiA1Ny4xIDAgMTkuMiAxLjUgMzguNCA0LjYgNTcuMUw5OSA2MjUuNWEzMi4wMyAzMi4wMyAwIDAwLTkuMyAzNS4ybC45IDIuN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gMy42IDggOCA4aDU4NGM0LjQgMCA4LTMuNiA4LTh2LTU2YzAtNC40LTMuNi04LTgtOHptMCAyODRIMzI4Yy00LjQgMC04IDMuNi04IDh2NTZjMCA0LjQgMy42IDggOCA4aDU4NGM0LjQgMCA4LTMuNiA4LTh2LTU2YzAtNC40LTMuNi04LTgtOHpNMTA0IDIyOGE1NiA1NiAwIDEwMTEyIDAgNTYgNTYgMCAxMC0xMTIgMHptMCAyODRhNTYgNTYgMCAxMDExMiAwIDU2IDU2IDAgMTAtMTEyIDB6bTAgMjg0YTU2IDU2IDAgMTAxMTIgMCA1NiA1NiAwIDEwLTExMiAweiIgLz48L3N2Zz4=) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whistle.mock-plugins",
3
- "version": "1.2.1-beta.6",
3
+ "version": "1.2.2-beta.2",
4
4
  "description": "Whistle 插件,用于快速创建 API 模拟数据",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -39,6 +39,7 @@
39
39
  "jest": "^29.7.0",
40
40
  "react": "^18.2.0",
41
41
  "react-dom": "^18.2.0",
42
+ "react-resizable": "^3.0.5",
42
43
  "react-sortablejs": "^6.1.4",
43
44
  "sortablejs": "^1.15.3",
44
45
  "react-markdown": "^8.0.7",
@@ -15,6 +15,7 @@ import {
15
15
  FileTextOutlined, PlusCircleOutlined, SettingOutlined,
16
16
  SearchOutlined, FilterOutlined, ReloadOutlined, DownOutlined, QuestionCircleOutlined, CopyOutlined
17
17
  } from '@ant-design/icons';
18
+ // 移除 react-resizable,改用原生实现
18
19
  import '../styles/interface-management.css';
19
20
  import axios from 'axios';
20
21
 
@@ -97,13 +98,27 @@ const InterfaceManagement = () => {
97
98
  const [tableConfig, setTableConfig] = useState(() => {
98
99
  const cached = localStorage.getItem('interface-table-config');
99
100
  const defaultVisibleColumns = COLUMN_CONFIG.map(col => col.key);
100
- return cached ? JSON.parse(cached) : {
101
+ const defaultConfig = {
101
102
  sortOrder: null,
102
103
  sortField: null,
103
104
  pageSize: 10,
104
105
  current: 1,
105
- visibleColumns: defaultVisibleColumns
106
+ visibleColumns: defaultVisibleColumns,
107
+ columnWidths: {
108
+ currentResponse: 180
109
+ }
106
110
  };
111
+
112
+ if (cached) {
113
+ const parsedConfig = JSON.parse(cached);
114
+ // 确保 columnWidths 存在
115
+ if (!parsedConfig.columnWidths) {
116
+ parsedConfig.columnWidths = { currentResponse: 180 };
117
+ }
118
+ return parsedConfig;
119
+ }
120
+
121
+ return defaultConfig;
107
122
  });
108
123
 
109
124
  // 保存表格配置到localStorage
@@ -675,7 +690,12 @@ const InterfaceManagement = () => {
675
690
  // 重置列配置
676
691
  const handleResetColumns = () => {
677
692
  const defaultColumns = COLUMN_CONFIG.map(col => col.key);
678
- saveTableConfig({ visibleColumns: defaultColumns });
693
+ saveTableConfig({
694
+ visibleColumns: defaultColumns,
695
+ columnWidths: {
696
+ currentResponse: 180
697
+ }
698
+ });
679
699
  };
680
700
 
681
701
  // 切换列配置面板显示
@@ -706,6 +726,61 @@ const InterfaceManagement = () => {
706
726
  message.success('数据已刷新');
707
727
  };
708
728
 
729
+ // 可调整大小的表头组件(使用原生实现)
730
+ const ResizableTitle = (props) => {
731
+ const { onResize, width, columnKey, ...restProps } = props;
732
+
733
+ if (!width || !onResize) {
734
+ return <th {...restProps} />;
735
+ }
736
+
737
+ const handleMouseDown = (e) => {
738
+ e.preventDefault();
739
+ e.stopPropagation();
740
+
741
+ const startX = e.clientX;
742
+ const startWidth = width;
743
+
744
+ const handleMouseMove = (moveEvent) => {
745
+ const deltaX = moveEvent.clientX - startX;
746
+ const newWidth = Math.max(50, startWidth + deltaX); // 最小宽度 50px
747
+ onResize(columnKey, newWidth);
748
+ };
749
+
750
+ const handleMouseUp = () => {
751
+ document.removeEventListener('mousemove', handleMouseMove);
752
+ document.removeEventListener('mouseup', handleMouseUp);
753
+ document.body.style.cursor = '';
754
+ document.body.style.userSelect = '';
755
+ };
756
+
757
+ document.addEventListener('mousemove', handleMouseMove);
758
+ document.addEventListener('mouseup', handleMouseUp);
759
+ document.body.style.cursor = 'col-resize';
760
+ document.body.style.userSelect = 'none';
761
+ };
762
+
763
+ return (
764
+ <th {...restProps} style={{ ...restProps.style, position: 'relative' }}>
765
+ {restProps.children}
766
+ <span
767
+ className="column-resize-handle"
768
+ onMouseDown={handleMouseDown}
769
+ onClick={(e) => e.stopPropagation()}
770
+ />
771
+ </th>
772
+ );
773
+ };
774
+
775
+ // 处理列宽调整
776
+ const handleResize = (columnKey, newWidth) => {
777
+ const newColumnWidths = {
778
+ ...tableConfig.columnWidths,
779
+ [columnKey]: newWidth
780
+ };
781
+ saveTableConfig({ columnWidths: newColumnWidths });
782
+ };
783
+
709
784
  // 批量操作接口状态
710
785
  const handleBatchOperation = async (active) => {
711
786
  if (!selectedRowKeys || selectedRowKeys.length === 0) {
@@ -803,7 +878,12 @@ const InterfaceManagement = () => {
803
878
  title: '当前响应',
804
879
  dataIndex: 'activeResponseId',
805
880
  key: 'currentResponse',
806
- width: 180,
881
+ width: tableConfig.columnWidths?.currentResponse || 180,
882
+ onHeaderCell: (column) => ({
883
+ width: column.width,
884
+ columnKey: 'currentResponse',
885
+ onResize: handleResize,
886
+ }),
807
887
  render: (activeResponseId, record) => {
808
888
  // 如果没有响应数据,返回空
809
889
  if (!record.responses || !Array.isArray(record.responses) || record.responses.length === 0) {
@@ -822,6 +902,7 @@ const InterfaceManagement = () => {
822
902
  style={{ width: '100%' }}
823
903
  onChange={(value) => handleResponseSwitch(record.id, value)}
824
904
  disabled={record.proxyType !== 'response'}
905
+ getPopupContainer={(trigger) => trigger.parentNode}
825
906
  >
826
907
  {record.responses.map(resp => (
827
908
  <Option key={resp.id} value={resp.id}>
@@ -1333,6 +1414,11 @@ const InterfaceManagement = () => {
1333
1414
  selectedRowKeys,
1334
1415
  onChange: onSelectChange,
1335
1416
  }}
1417
+ components={{
1418
+ header: {
1419
+ cell: ResizableTitle,
1420
+ },
1421
+ }}
1336
1422
  size="middle"
1337
1423
  pagination={{
1338
1424
  current: tableConfig.current,
@@ -5,8 +5,8 @@
5
5
  import React, { useState, useEffect } from 'react';
6
6
  import { useHistory } from 'react-router-dom';
7
7
  import AppLayout from '../components/AppLayout';
8
- import { Card, Row, Col, Button, Modal, Form, Input, message, Switch, Empty, Spin, Typography, Tooltip, Badge, Select, Pagination } from 'antd';
9
- import { PlusOutlined, EditOutlined, DeleteOutlined, ApiOutlined, ExportOutlined, InfoCircleOutlined, CalendarOutlined, SortAscendingOutlined } from '@ant-design/icons';
8
+ import { Card, Row, Col, Button, Modal, Form, Input, message, Switch, Empty, Spin, Typography, Tooltip, Badge, Select, Pagination, Table, Space, Tag } from 'antd';
9
+ import { PlusOutlined, EditOutlined, DeleteOutlined, ApiOutlined, ExportOutlined, InfoCircleOutlined, CalendarOutlined, SortAscendingOutlined, AppstoreOutlined, UnorderedListOutlined } from '@ant-design/icons';
10
10
  import '../styles/mock-data.css';
11
11
  import axios from 'axios';
12
12
 
@@ -40,7 +40,8 @@ const MockData = () => {
40
40
  sortBy: 'name', // name, createdAt, interfaceCount, active
41
41
  sortOrder: 'ascend', // ascend, descend
42
42
  pageSize: 12,
43
- current: 1
43
+ current: 1,
44
+ viewMode: 'card' // card, list
44
45
  };
45
46
  });
46
47
 
@@ -368,6 +369,10 @@ const MockData = () => {
368
369
  saveListConfig({ current: page, pageSize });
369
370
  };
370
371
 
372
+ const handleViewModeChange = (mode) => {
373
+ saveListConfig({ viewMode: mode, current: 1 });
374
+ };
375
+
371
376
  // 获取排序后的功能列表
372
377
  const getSortedFeatures = () => {
373
378
  const sorted = [...mockFeatures].sort((a, b) => {
@@ -516,6 +521,139 @@ const MockData = () => {
516
521
  );
517
522
  };
518
523
 
524
+ // 渲染列表视图
525
+ const renderListView = () => {
526
+ const columns = [
527
+ {
528
+ title: '状态',
529
+ dataIndex: 'active',
530
+ key: 'active',
531
+ width: 100,
532
+ render: (active, record) => (
533
+ <Switch
534
+ checked={active}
535
+ onChange={(checked, e) => {
536
+ e.stopPropagation();
537
+ handleToggleActive(record.id, active);
538
+ }}
539
+ checkedChildren="启用"
540
+ unCheckedChildren="禁用"
541
+ />
542
+ ),
543
+ },
544
+ {
545
+ title: '功能名称',
546
+ dataIndex: 'name',
547
+ key: 'name',
548
+ ellipsis: { tooltip: true },
549
+ render: (name) => (
550
+ <Text strong style={{ fontSize: '14px' }}>{name}</Text>
551
+ ),
552
+ },
553
+ {
554
+ title: '功能描述',
555
+ dataIndex: 'description',
556
+ key: 'description',
557
+ ellipsis: { tooltip: true },
558
+ render: (description) => (
559
+ <Text type="secondary">{description || '无描述'}</Text>
560
+ ),
561
+ },
562
+ {
563
+ title: '接口数量',
564
+ dataIndex: 'interfaceCount',
565
+ key: 'interfaceCount',
566
+ width: 100,
567
+ align: 'center',
568
+ render: (count) => (
569
+ <Badge count={count || 0} showZero style={{ backgroundColor: '#1890ff' }} />
570
+ ),
571
+ },
572
+ {
573
+ title: '创建时间',
574
+ dataIndex: 'createdAt',
575
+ key: 'createdAt',
576
+ width: 120,
577
+ render: (createdAt) => (
578
+ <Text type="secondary">
579
+ {createdAt ? new Date(createdAt).toLocaleDateString() : '未知日期'}
580
+ </Text>
581
+ ),
582
+ },
583
+ {
584
+ title: '操作',
585
+ key: 'action',
586
+ width: 200,
587
+ fixed: 'right',
588
+ render: (_, record) => (
589
+ <Space size="small">
590
+ <Tooltip title="管理接口">
591
+ <Button
592
+ type="link"
593
+ size="small"
594
+ icon={<ApiOutlined />}
595
+ onClick={(e) => {
596
+ e.stopPropagation();
597
+ viewInterfaces(record);
598
+ }}
599
+ >
600
+ 接口
601
+ </Button>
602
+ </Tooltip>
603
+ <Tooltip title="编辑">
604
+ <Button
605
+ type="link"
606
+ size="small"
607
+ icon={<EditOutlined />}
608
+ onClick={(e) => {
609
+ e.stopPropagation();
610
+ openModal(record);
611
+ }}
612
+ />
613
+ </Tooltip>
614
+ <Tooltip title="导出">
615
+ <Button
616
+ type="link"
617
+ size="small"
618
+ icon={<ExportOutlined />}
619
+ onClick={(e) => {
620
+ e.stopPropagation();
621
+ exportFeatureConfig(record);
622
+ }}
623
+ />
624
+ </Tooltip>
625
+ <Tooltip title="删除">
626
+ <Button
627
+ type="link"
628
+ size="small"
629
+ danger
630
+ icon={<DeleteOutlined />}
631
+ onClick={(e) => {
632
+ e.stopPropagation();
633
+ deleteFeature(record.id);
634
+ }}
635
+ />
636
+ </Tooltip>
637
+ </Space>
638
+ ),
639
+ },
640
+ ];
641
+
642
+ return (
643
+ <Table
644
+ columns={columns}
645
+ dataSource={getPaginatedFeatures()}
646
+ rowKey="id"
647
+ pagination={false}
648
+ onRow={(record) => ({
649
+ onClick: () => viewInterfaces(record),
650
+ style: { cursor: 'pointer' }
651
+ })}
652
+ rowClassName={(record) => !record.active ? 'inactive-row' : ''}
653
+ />
654
+ );
655
+ };
656
+
519
657
  return (
520
658
  <AppLayout>
521
659
  <div className="page-container">
@@ -584,7 +722,7 @@ const MockData = () => {
584
722
  </div>
585
723
  </Col>
586
724
 
587
- {/* 排序控制区域 */}
725
+ {/* 排序和视图控制区域 */}
588
726
  <Col xs={24} sm={12} md={8} lg={9}>
589
727
  <div className="sort-controls">
590
728
  <div className="control-group">
@@ -615,8 +753,30 @@ const MockData = () => {
615
753
  </div>
616
754
  </Col>
617
755
 
756
+ {/* 视图切换区域 */}
757
+ <Col xs={24} sm={12} md={4} lg={3}>
758
+ <div className="view-mode-controls">
759
+ <Button.Group>
760
+ <Tooltip title="卡片视图">
761
+ <Button
762
+ type={listConfig.viewMode === 'card' ? 'primary' : 'default'}
763
+ icon={<AppstoreOutlined />}
764
+ onClick={() => handleViewModeChange('card')}
765
+ />
766
+ </Tooltip>
767
+ <Tooltip title="列表视图">
768
+ <Button
769
+ type={listConfig.viewMode === 'list' ? 'primary' : 'default'}
770
+ icon={<UnorderedListOutlined />}
771
+ onClick={() => handleViewModeChange('list')}
772
+ />
773
+ </Tooltip>
774
+ </Button.Group>
775
+ </div>
776
+ </Col>
777
+
618
778
  {/* 分页控制区域 */}
619
- <Col xs={24} sm={24} md={8} lg={9}>
779
+ <Col xs={24} sm={24} md={12} lg={6}>
620
780
  <div className="pagination-controls">
621
781
  <div className="control-group">
622
782
  <span className="control-label">每页显示</span>
@@ -649,9 +809,13 @@ const MockData = () => {
649
809
  </div>
650
810
  ) : mockFeatures.length > 0 ? (
651
811
  <>
652
- <Row gutter={[20, 20]} className="feature-grid">
653
- {getPaginatedFeatures().map(feature => renderFeatureCard(feature))}
654
- </Row>
812
+ {listConfig.viewMode === 'card' ? (
813
+ <Row gutter={[20, 20]} className="feature-grid">
814
+ {getPaginatedFeatures().map(feature => renderFeatureCard(feature))}
815
+ </Row>
816
+ ) : (
817
+ renderListView()
818
+ )}
655
819
 
656
820
  {/* 分页组件 */}
657
821
  {mockFeatures.length > listConfig.pageSize && (
@@ -294,10 +294,23 @@
294
294
  .interface-table td {
295
295
  padding: 12px 16px !important;
296
296
  white-space: nowrap;
297
- overflow: hidden;
297
+ overflow: visible !important;
298
298
  text-overflow: ellipsis;
299
299
  }
300
300
 
301
+ /* 确保表格容器不裁剪下拉菜单 */
302
+ .interface-list-container {
303
+ overflow: visible !important;
304
+ }
305
+
306
+ .interface-list-container .ant-table-container {
307
+ overflow: visible !important;
308
+ }
309
+
310
+ .interface-list-container .ant-table-body {
311
+ overflow: visible !important;
312
+ }
313
+
301
314
  /* 卡片视图样式 */
302
315
  .interface-card-view {
303
316
  padding-bottom: 20px;
@@ -1283,3 +1296,35 @@
1283
1296
  .interface-table .ant-pagination-options {
1284
1297
  margin-right: 16px;
1285
1298
  }
1299
+
1300
+ /* 可调整列宽样式 */
1301
+ .column-resize-handle {
1302
+ position: absolute;
1303
+ right: -5px;
1304
+ top: 0;
1305
+ bottom: 0;
1306
+ width: 10px;
1307
+ cursor: col-resize;
1308
+ z-index: 1;
1309
+ user-select: none;
1310
+ }
1311
+
1312
+ .column-resize-handle:hover {
1313
+ background-color: rgba(24, 144, 255, 0.2);
1314
+ }
1315
+
1316
+ .column-resize-handle::after {
1317
+ content: '';
1318
+ position: absolute;
1319
+ right: 4px;
1320
+ top: 50%;
1321
+ transform: translateY(-50%);
1322
+ width: 2px;
1323
+ height: 20px;
1324
+ background-color: #d9d9d9;
1325
+ transition: background-color 0.3s;
1326
+ }
1327
+
1328
+ .column-resize-handle:hover::after {
1329
+ background-color: #1890ff;
1330
+ }
@@ -1115,4 +1115,71 @@ input:checked + .slider:before {
1115
1115
  .ant-card-extra {
1116
1116
  margin-right: 60px;
1117
1117
  }
1118
+ }
1119
+
1120
+ /* 视图切换控制样式 */
1121
+ .view-mode-controls {
1122
+ display: flex;
1123
+ justify-content: flex-end;
1124
+ align-items: center;
1125
+ }
1126
+
1127
+ .view-mode-controls .ant-btn-group {
1128
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
1129
+ }
1130
+
1131
+ /* 列表视图样式 */
1132
+ .feature-list-card .ant-table-wrapper {
1133
+ margin-top: 0;
1134
+ }
1135
+
1136
+ .feature-list-card .ant-table {
1137
+ font-size: 14px;
1138
+ }
1139
+
1140
+ .feature-list-card .ant-table-thead > tr > th {
1141
+ background-color: #fafafa;
1142
+ font-weight: 600;
1143
+ color: #262626;
1144
+ padding: 16px;
1145
+ }
1146
+
1147
+ .feature-list-card .ant-table-tbody > tr > td {
1148
+ padding: 16px;
1149
+ }
1150
+
1151
+ .feature-list-card .ant-table-tbody > tr:hover {
1152
+ background-color: #f5f5f5;
1153
+ }
1154
+
1155
+ .feature-list-card .ant-table-tbody > tr.inactive-row {
1156
+ background-color: #fafafa;
1157
+ opacity: 0.7;
1158
+ }
1159
+
1160
+ .feature-list-card .ant-table-tbody > tr.inactive-row:hover {
1161
+ background-color: #f0f0f0;
1162
+ }
1163
+
1164
+ /* 列表视图中的操作按钮样式 */
1165
+ .feature-list-card .ant-btn-link {
1166
+ padding: 4px 8px;
1167
+ height: auto;
1168
+ }
1169
+
1170
+ /* 响应式调整 */
1171
+ @media (max-width: 768px) {
1172
+ .view-mode-controls {
1173
+ justify-content: center;
1174
+ margin-top: 12px;
1175
+ }
1176
+
1177
+ .feature-list-card .ant-table {
1178
+ font-size: 13px;
1179
+ }
1180
+
1181
+ .feature-list-card .ant-table-thead > tr > th,
1182
+ .feature-list-card .ant-table-tbody > tr > td {
1183
+ padding: 12px 8px;
1184
+ }
1118
1185
  }