whistle.mock-plugins 1.1.3-dev.9 → 1.2.0-beta.3

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.
@@ -520,24 +520,22 @@ const MockData = () => {
520
520
  return (
521
521
  <AppLayout>
522
522
  <div className="page-container">
523
- {/* V2版本标识 */}
524
- <div style={{
525
- position: 'absolute',
526
- top: '10px',
527
- right: '10px',
528
- backgroundColor: '#52c41a',
529
- color: 'white',
530
- padding: '4px 8px',
531
- borderRadius: '4px',
532
- fontSize: '12px',
533
- zIndex: 1000
534
- }}>
535
- V2版本
536
- </div>
537
-
538
523
  <div className="page-title-bar">
539
- <div>
540
- <h1 className="page-title">功能模块管理</h1>
524
+ <div className="title-section">
525
+ <div className="title-with-badge">
526
+ <h1 className="page-title">功能模块管理</h1>
527
+ <Badge
528
+ count="V2"
529
+ style={{
530
+ backgroundColor: '#52c41a',
531
+ fontSize: '12px',
532
+ height: '20px',
533
+ lineHeight: '20px',
534
+ borderRadius: '10px',
535
+ marginLeft: '12px'
536
+ }}
537
+ />
538
+ </div>
541
539
  <div className="page-description">
542
540
  创建和管理功能模块,为每个功能配置独立的接口
543
541
  </div>
@@ -561,117 +559,147 @@ const MockData = () => {
561
559
  </div>
562
560
  </div>
563
561
 
564
- {/* 排序和分页控制栏 */}
562
+ {/* 控制面板 */}
565
563
  {mockFeatures.length > 0 && !loading && (
566
- <div style={{
567
- marginBottom: 16,
568
- padding: '12px 16px',
569
- background: '#fafafa',
570
- borderRadius: '6px',
571
- display: 'flex',
572
- justifyContent: 'space-between',
573
- alignItems: 'center',
574
- flexWrap: 'wrap',
575
- gap: '8px'
576
- }}>
577
- <div style={{ display: 'flex', alignItems: 'center', gap: '12px', flexWrap: 'wrap' }}>
578
- <span style={{ fontSize: '14px', color: '#666' }}>
579
- <SortAscendingOutlined /> 排序:
580
- </span>
581
- <Select
582
- value={listConfig.sortBy}
583
- onChange={handleSortChange}
584
- style={{ width: 120 }}
585
- size="small"
586
- >
587
- <Select.Option value="name">名称</Select.Option>
588
- <Select.Option value="createdAt">创建时间</Select.Option>
589
- <Select.Option value="interfaceCount">接口数量</Select.Option>
590
- <Select.Option value="active">状态</Select.Option>
591
- </Select>
592
- <Select
593
- value={listConfig.sortOrder}
594
- onChange={handleSortOrderChange}
595
- style={{ width: 80 }}
596
- size="small"
597
- >
598
- <Select.Option value="ascend">升序</Select.Option>
599
- <Select.Option value="descend">降序</Select.Option>
600
- </Select>
601
- </div>
602
-
603
- <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
604
- <span style={{ fontSize: '14px', color: '#666' }}>每页显示:</span>
605
- <Select
606
- value={listConfig.pageSize}
607
- onChange={handlePageSizeChange}
608
- style={{ width: 80 }}
609
- size="small"
610
- >
611
- <Select.Option value={8}>8</Select.Option>
612
- <Select.Option value={12}>12</Select.Option>
613
- <Select.Option value={16}>16</Select.Option>
614
- <Select.Option value={24}>24</Select.Option>
615
- </Select>
616
- <span style={{ fontSize: '14px', color: '#999' }}>
617
- 共 {mockFeatures.length} 个功能模块
618
- </span>
619
- </div>
620
- </div>
564
+ <Card className="control-panel-card" style={{ marginBottom: 24 }}>
565
+ <Row gutter={[24, 16]} align="middle">
566
+ {/* 统计信息区域 */}
567
+ <Col xs={24} sm={12} md={8} lg={6}>
568
+ <div className="stats-section">
569
+ <div className="stats-item">
570
+ <span className="stats-number">{mockFeatures.length}</span>
571
+ <span className="stats-label">功能模块</span>
572
+ </div>
573
+ <div className="stats-item">
574
+ <span className="stats-number">
575
+ {mockFeatures.filter(f => f.active).length}
576
+ </span>
577
+ <span className="stats-label">已启用</span>
578
+ </div>
579
+ <div className="stats-item">
580
+ <span className="stats-number">
581
+ {mockFeatures.reduce((sum, f) => sum + (f.interfaceCount || 0), 0)}
582
+ </span>
583
+ <span className="stats-label">接口总数</span>
584
+ </div>
585
+ </div>
586
+ </Col>
587
+
588
+ {/* 排序控制区域 */}
589
+ <Col xs={24} sm={12} md={8} lg={9}>
590
+ <div className="sort-controls">
591
+ <div className="control-group">
592
+ <span className="control-label">
593
+ <SortAscendingOutlined /> 排序方式
594
+ </span>
595
+ <Select
596
+ value={listConfig.sortBy}
597
+ onChange={handleSortChange}
598
+ style={{ width: 120 }}
599
+ size="middle"
600
+ >
601
+ <Select.Option value="name">名称</Select.Option>
602
+ <Select.Option value="createdAt">创建时间</Select.Option>
603
+ <Select.Option value="interfaceCount">接口数量</Select.Option>
604
+ <Select.Option value="active">状态</Select.Option>
605
+ </Select>
606
+ <Select
607
+ value={listConfig.sortOrder}
608
+ onChange={handleSortOrderChange}
609
+ style={{ width: 80 }}
610
+ size="middle"
611
+ >
612
+ <Select.Option value="ascend">升序</Select.Option>
613
+ <Select.Option value="descend">降序</Select.Option>
614
+ </Select>
615
+ </div>
616
+ </div>
617
+ </Col>
618
+
619
+ {/* 分页控制区域 */}
620
+ <Col xs={24} sm={24} md={8} lg={9}>
621
+ <div className="pagination-controls">
622
+ <div className="control-group">
623
+ <span className="control-label">每页显示</span>
624
+ <Select
625
+ value={listConfig.pageSize}
626
+ onChange={handlePageSizeChange}
627
+ style={{ width: 80 }}
628
+ size="middle"
629
+ >
630
+ <Select.Option value={8}>8</Select.Option>
631
+ <Select.Option value={12}>12</Select.Option>
632
+ <Select.Option value={16}>16</Select.Option>
633
+ <Select.Option value={24}>24</Select.Option>
634
+ </Select>
635
+ <span className="page-info">
636
+ 第 {(listConfig.current - 1) * listConfig.pageSize + 1}-{Math.min(listConfig.current * listConfig.pageSize, mockFeatures.length)} 条
637
+ </span>
638
+ </div>
639
+ </div>
640
+ </Col>
641
+ </Row>
642
+ </Card>
621
643
  )}
622
644
 
623
- <div className="feature-list-container">
645
+ <Card className="feature-list-card">
624
646
  {loading ? (
625
- <div className="loading">
626
- <div className="loading-spinner"></div>
627
- <div>正在加载功能模块...</div>
647
+ <div className="loading-state">
648
+ <Spin size="large" />
649
+ <div className="loading-text">正在加载功能模块...</div>
628
650
  </div>
629
651
  ) : mockFeatures.length > 0 ? (
630
652
  <>
631
- <Row gutter={[16, 16]}>
653
+ <Row gutter={[20, 20]} className="feature-grid">
632
654
  {getPaginatedFeatures().map(feature => renderFeatureCard(feature))}
633
655
  </Row>
634
656
 
635
657
  {/* 分页组件 */}
636
658
  {mockFeatures.length > listConfig.pageSize && (
637
- <div style={{
638
- marginTop: 24,
639
- textAlign: 'center',
640
- padding: '16px',
641
- borderTop: '1px solid #f0f0f0'
642
- }}>
659
+ <div className="pagination-wrapper">
643
660
  <Pagination
644
661
  current={listConfig.current}
645
662
  pageSize={listConfig.pageSize}
646
663
  total={mockFeatures.length}
647
664
  onChange={handlePageChange}
648
665
  onShowSizeChange={handlePageChange}
649
- showSizeChanger={true}
666
+ showSizeChanger={false}
650
667
  showQuickJumper={true}
651
668
  showTotal={(total, range) =>
652
669
  `第 ${range[0]}-${range[1]} 条,共 ${total} 个功能模块`
653
670
  }
654
- pageSizeOptions={['8', '12', '16', '24']}
655
671
  size="default"
672
+ className="custom-pagination"
656
673
  />
657
674
  </div>
658
675
  )}
659
676
  </>
660
677
  ) : (
661
- <div className="empty-data">
662
- <div className="empty-icon">📂</div>
663
- <div className="empty-text">暂无功能,请点击"新建功能"按钮创建</div>
678
+ <Empty
679
+ className="custom-empty"
680
+ image={
681
+ <div className="empty-image">
682
+ <ApiOutlined style={{ fontSize: 64, color: '#d9d9d9' }} />
683
+ </div>
684
+ }
685
+ description={
686
+ <div className="empty-description">
687
+ <div className="empty-title">暂无功能模块</div>
688
+ <div className="empty-subtitle">创建您的第一个功能模块,开始管理接口</div>
689
+ </div>
690
+ }
691
+ >
664
692
  <div className="empty-actions">
665
- <button className="create-button" onClick={() => openModal()}>
693
+ <Button type="primary" icon={<PlusOutlined />} onClick={() => openModal()}>
666
694
  创建新功能
667
- </button>
668
- <button className="import-button-large" onClick={importFeatureConfig}>
669
- 导入已有功能
670
- </button>
695
+ </Button>
696
+ <Button icon={<ExportOutlined />} onClick={importFeatureConfig}>
697
+ 导入功能
698
+ </Button>
671
699
  </div>
672
- </div>
700
+ </Empty>
673
701
  )}
674
- </div>
702
+ </Card>
675
703
  </div>
676
704
 
677
705
  <Modal
@@ -221,10 +221,37 @@ body {
221
221
  margin-right: 24px;
222
222
  }
223
223
 
224
+ .logo-icon-group {
225
+ position: relative;
226
+ width: 32px;
227
+ height: 32px;
228
+ margin-right: 12px;
229
+ display: flex;
230
+ align-items: center;
231
+ justify-content: center;
232
+ }
233
+
224
234
  .logo-icon {
225
235
  font-size: 24px;
226
236
  color: #1890ff;
227
- margin-right: 12px;
237
+ }
238
+
239
+ .logo-icon-primary {
240
+ position: relative;
241
+ z-index: 2;
242
+ font-size: 22px;
243
+ }
244
+
245
+ .logo-icon-secondary {
246
+ position: absolute;
247
+ top: -2px;
248
+ right: -6px;
249
+ font-size: 16px;
250
+ color: #52c41a;
251
+ background: white;
252
+ border-radius: 50%;
253
+ box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
254
+ padding: 2px;
228
255
  }
229
256
 
230
257
  .logo-text {
@@ -232,6 +259,10 @@ body {
232
259
  font-size: 18px;
233
260
  font-weight: 600;
234
261
  white-space: nowrap;
262
+ background: linear-gradient(135deg, #1890ff, #52c41a);
263
+ -webkit-background-clip: text;
264
+ -webkit-text-fill-color: transparent;
265
+ letter-spacing: -0.5px;
235
266
  }
236
267
 
237
268
  .collapse-button {
@@ -332,6 +363,11 @@ body {
332
363
  }
333
364
 
334
365
  .dark-theme .logo-text,
335
- .dark-theme .logo-icon {
366
+ .dark-theme .logo-icon-primary {
336
367
  color: #177ddc;
368
+ }
369
+
370
+ .dark-theme .logo-icon-secondary {
371
+ color: #49aa19;
372
+ background: #141414;
337
373
  }