whistle.mock-plugins 1.1.3-dev.12 → 1.1.3-dev.14

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.12",
3
+ "version": "1.1.3-dev.14",
4
4
  "description": "Whistle 插件,用于快速创建 API 模拟数据",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -976,6 +976,27 @@ const InterfaceManagement = () => {
976
976
  重构后版本 V2
977
977
  </div>
978
978
 
979
+ {/* 警告信息置顶显示 */}
980
+ {!features.length && (
981
+ <Alert
982
+ message="未找到功能模块"
983
+ description="请先在模拟数据页面创建功能模块,然后再添加接口"
984
+ type="warning"
985
+ showIcon
986
+ style={{ marginBottom: 16 }}
987
+ />
988
+ )}
989
+
990
+ {selectedFeature?.active === false && (
991
+ <Alert
992
+ message="功能模块已禁用"
993
+ description="当前功能模块已被禁用,所有关联接口不会生效。您可以在模拟数据页面启用此功能模块。"
994
+ type="warning"
995
+ showIcon
996
+ style={{ marginBottom: 16 }}
997
+ />
998
+ )}
999
+
979
1000
  <Card className="interface-control-panel">
980
1001
  <div className="control-panel-header">
981
1002
  <div className="control-left">
@@ -1013,10 +1034,16 @@ const InterfaceManagement = () => {
1013
1034
  <Dropdown
1014
1035
  overlay={
1015
1036
  <Menu
1016
- selectedKeys={selectedGroup ? [selectedGroup] : []}
1017
- 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
+ }}
1018
1045
  >
1019
- <Menu.Item key={null}>全部分组</Menu.Item>
1046
+ <Menu.Item key="ALL_GROUPS">全部分组</Menu.Item>
1020
1047
  {groups.map(group => (
1021
1048
  <Menu.Item key={group}>
1022
1049
  {group} ({interfaces.filter(item => item.group === group).length})
@@ -1060,14 +1087,9 @@ const InterfaceManagement = () => {
1060
1087
  <div className="control-panel-stats">
1061
1088
  <div className="stats-left">
1062
1089
  <Space size="large">
1063
- <span className="stat-item">
1064
- <span className="stat-label">功能模块:</span>
1065
- <span className="stat-value">{selectedFeature?.name}</span>
1066
- </span>
1067
-
1068
1090
  {selectedGroup && (
1069
1091
  <span className="stat-item">
1070
- <span className="stat-label">分组:</span>
1092
+ <span className="stat-label">当前分组:</span>
1071
1093
  <Tag color="blue">{selectedGroup}</Tag>
1072
1094
  </span>
1073
1095
  )}
@@ -1145,96 +1167,70 @@ const InterfaceManagement = () => {
1145
1167
  </Popconfirm>
1146
1168
  </Space>
1147
1169
  )}
1170
+
1171
+ {/* 列设置按钮 */}
1172
+ <Popover
1173
+ title="自定义显示列"
1174
+ trigger="click"
1175
+ open={columnConfigVisible}
1176
+ onOpenChange={handleColumnConfigToggle}
1177
+ content={
1178
+ <div style={{ width: 280 }}>
1179
+ <div style={{ marginBottom: 12 }}>
1180
+ <Space>
1181
+ <Button size="small" onClick={handleSelectAllColumns}>
1182
+ 全选
1183
+ </Button>
1184
+ <Button size="small" onClick={handleResetColumns}>
1185
+ 重置
1186
+ </Button>
1187
+ </Space>
1188
+ </div>
1189
+ <Checkbox.Group
1190
+ value={tableConfig.visibleColumns || COLUMN_CONFIG.map(col => col.key)}
1191
+ onChange={handleColumnConfigChange}
1192
+ style={{ width: '100%' }}
1193
+ >
1194
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
1195
+ {COLUMN_CONFIG.map(col => (
1196
+ <Checkbox
1197
+ key={col.key}
1198
+ value={col.key}
1199
+ disabled={col.required}
1200
+ style={{
1201
+ width: '100%',
1202
+ color: col.required ? '#999' : undefined
1203
+ }}
1204
+ >
1205
+ {col.title}
1206
+ {col.required && (
1207
+ <span style={{ color: '#999', fontSize: '12px', marginLeft: 4 }}>
1208
+ (必须)
1209
+ </span>
1210
+ )}
1211
+ </Checkbox>
1212
+ ))}
1213
+ </div>
1214
+ </Checkbox.Group>
1215
+ </div>
1216
+ }
1217
+ >
1218
+ <Tooltip title="自定义表格显示列">
1219
+ <Button
1220
+ icon={<SettingOutlined />}
1221
+ type="text"
1222
+ size="small"
1223
+ className="inline-column-settings-btn"
1224
+ style={{ marginLeft: (selectedRowKeys.length > 0 || selectedGroup) ? 16 : 0 }}
1225
+ >
1226
+ 列设置
1227
+ </Button>
1228
+ </Tooltip>
1229
+ </Popover>
1148
1230
  </div>
1149
1231
  </div>
1150
1232
  </Card>
1151
1233
 
1152
- {!features.length && (
1153
- <Alert
1154
- message="未找到功能模块"
1155
- description="请先在模拟数据页面创建功能模块,然后再添加接口"
1156
- type="warning"
1157
- showIcon
1158
- style={{ marginBottom: 16 }}
1159
- />
1160
- )}
1161
-
1162
- {selectedFeature?.active === false && (
1163
- <Alert
1164
- message="功能模块已禁用"
1165
- description="当前功能模块已被禁用,所有关联接口不会生效。您可以在模拟数据页面启用此功能模块。"
1166
- type="warning"
1167
- showIcon
1168
- style={{ marginBottom: 16 }}
1169
- />
1170
- )}
1171
-
1172
- {/* 表格工具栏 */}
1173
- <div className="table-toolbar">
1174
- <div className="table-toolbar-left">
1175
- {/* 可以在这里添加其他表格相关的工具 */}
1176
- </div>
1177
- <div className="table-toolbar-right">
1178
- <Popover
1179
- title="自定义显示列"
1180
- trigger="click"
1181
- open={columnConfigVisible}
1182
- onOpenChange={handleColumnConfigToggle}
1183
- content={
1184
- <div style={{ width: 280 }}>
1185
- <div style={{ marginBottom: 12 }}>
1186
- <Space>
1187
- <Button size="small" onClick={handleSelectAllColumns}>
1188
- 全选
1189
- </Button>
1190
- <Button size="small" onClick={handleResetColumns}>
1191
- 重置
1192
- </Button>
1193
- </Space>
1194
- </div>
1195
- <Checkbox.Group
1196
- value={tableConfig.visibleColumns || COLUMN_CONFIG.map(col => col.key)}
1197
- onChange={handleColumnConfigChange}
1198
- style={{ width: '100%' }}
1199
- >
1200
- <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
1201
- {COLUMN_CONFIG.map(col => (
1202
- <Checkbox
1203
- key={col.key}
1204
- value={col.key}
1205
- disabled={col.required}
1206
- style={{
1207
- width: '100%',
1208
- color: col.required ? '#999' : undefined
1209
- }}
1210
- >
1211
- {col.title}
1212
- {col.required && (
1213
- <span style={{ color: '#999', fontSize: '12px', marginLeft: 4 }}>
1214
- (必须)
1215
- </span>
1216
- )}
1217
- </Checkbox>
1218
- ))}
1219
- </div>
1220
- </Checkbox.Group>
1221
- </div>
1222
- }
1223
- >
1224
- <Tooltip title="自定义表格显示列">
1225
- <Button
1226
- icon={<SettingOutlined />}
1227
- type="text"
1228
- size="small"
1229
- className="table-column-settings-btn"
1230
- >
1231
- 列设置
1232
- </Button>
1233
- </Tooltip>
1234
- </Popover>
1235
- </div>
1236
- </div>
1237
-
1238
1234
  <Card className="list-container-card" bordered={false} bodyStyle={{ padding: 0 }}>
1239
1235
  <div className="interface-list-container">
1240
1236
  <Table
@@ -273,11 +273,9 @@
273
273
  }
274
274
 
275
275
  .list-container-card {
276
- border-radius: 0 0 8px 8px;
276
+ border-radius: 12px;
277
277
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
278
278
  margin-bottom: 40px;
279
- border: 1px solid #f0f2f5;
280
- border-top: none;
281
279
  }
282
280
 
283
281
  .interface-list-container {
@@ -1121,54 +1119,29 @@
1121
1119
  font-style: italic;
1122
1120
  }
1123
1121
 
1124
- /* 表格工具栏样式 */
1125
- .table-toolbar {
1126
- display: flex;
1127
- justify-content: space-between;
1128
- align-items: center;
1129
- padding: 12px 16px;
1130
- background: #fafbfc;
1131
- border: 1px solid #f0f2f5;
1132
- border-bottom: none;
1133
- border-radius: 8px 8px 0 0;
1134
- margin-bottom: 0;
1135
- }
1136
-
1137
- .table-toolbar-left {
1138
- display: flex;
1139
- align-items: center;
1140
- gap: 12px;
1141
- }
1142
-
1143
- .table-toolbar-right {
1144
- display: flex;
1145
- align-items: center;
1146
- gap: 8px;
1147
- }
1148
-
1149
- .table-column-settings-btn {
1122
+ /* 内联列设置按钮样式 */
1123
+ .inline-column-settings-btn {
1150
1124
  display: flex;
1151
1125
  align-items: center;
1152
1126
  gap: 6px;
1153
- padding: 6px 12px;
1154
- border-radius: 6px;
1127
+ padding: 4px 8px;
1128
+ border-radius: 4px;
1155
1129
  border: 1px solid #d9d9d9;
1156
1130
  background: #ffffff;
1157
1131
  color: #666;
1158
- font-size: 13px;
1132
+ font-size: 12px;
1159
1133
  transition: all 0.2s ease;
1160
1134
  }
1161
1135
 
1162
- .table-column-settings-btn:hover {
1136
+ .inline-column-settings-btn:hover {
1163
1137
  border-color: #4096ff;
1164
- background: #f6ffed;
1138
+ background: #f0f9ff;
1165
1139
  color: #4096ff;
1166
- transform: translateY(-1px);
1167
- box-shadow: 0 2px 4px rgba(64, 150, 255, 0.15);
1168
1140
  }
1169
1141
 
1170
- .table-column-settings-btn:active {
1171
- transform: translateY(0);
1142
+ .inline-column-settings-btn:active {
1143
+ border-color: #1677ff;
1144
+ background: #e6f4ff;
1172
1145
  }
1173
1146
 
1174
1147
  /* 分页器样式 */