feat(plugin): P2-4 数据导入导出 — 后端 export/import API + 前端 UI + TS 修复

- data_service: export 方法查询匹配行(上限10000),import 方法逐行校验+插入
- data_handler: export_plugin_data / import_plugin_data 处理函数
- module: 注册 GET /export + POST /import 路由
- pluginData.ts: exportPluginData / importPluginData API 函数
- PluginCRUDPage: 根据 entity importable/exportable 标志显示导出/导入按钮
- PluginMarket: 修复 TS 错误 (unused imports, type narrowing)
- PluginSettingsForm: 修复 TS 错误 (Rule type, Divider orientation)
This commit is contained in:
iven
2026-04-19 13:28:12 +08:00
parent e429448c42
commit 120f3fe867
8 changed files with 464 additions and 6 deletions

View File

@@ -10,7 +10,6 @@ import {
Typography,
Modal,
Rate,
List,
message,
Empty,
Tooltip,
@@ -21,7 +20,7 @@ import {
AppstoreOutlined,
StarOutlined,
} from '@ant-design/icons';
import { listPlugins, installPlugin } from '../api/plugins';
import { listPlugins } from '../api/plugins';
const { Title, Text, Paragraph } = Typography;
@@ -108,7 +107,7 @@ export default function PluginMarket() {
return matchSearch && matchCategory;
});
const categories = Array.from(new Set(plugins.map((p) => p.category).filter(Boolean)));
const categories = Array.from(new Set(plugins.map((p) => p.category).filter((c): c is string => Boolean(c))));
const showDetail = (plugin: MarketPlugin) => {
setSelectedPlugin(plugin);