- {categoryConfigs.map(config => (
-
-
-
-
{config.key}
- {config.description && (
-
{config.description}
- )}
-
- {hasChanges(config.id) && (
-
- )}
+
+ {Object.entries(categoryConfig).map(([category, config]) => {
+ const Icon = config.icon;
+ const isExpanded = expandedCategories.has(category);
+ const categoryConfigs = groupedConfigs[category] || [];
+
+ return (
+
+
+
+ {isExpanded && (
+
+ {categoryConfigs.length === 0 ? (
+
+
+
暂无{config.label}
+
可通过数据库添加相关配置项
-
-
- {Object.entries(config.value).map(([field, value]) => {
- const currentValue = getConfigValue(config, field);
-
- return (
-
- ))}
+ {hasChanges(configItem.id) && (
+
+
+
+
+ )}
+
+
+
+ {Object.entries(configItem.value).map(([field, value]) => {
+ const hasFieldChanged = editedValues[configItem.id]?.[field] !== undefined;
+
+ return (
+
+
+
+ {renderFieldInput(configItem, field, value)}
+
+
+ );
+ })}
+
+
+ ))
+ )}
+
+ )}
+
+ );
+ })}
);
diff --git a/tsconfig.json b/tsconfig.json
index 67e9c9d..f9faaf5 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -46,6 +46,10 @@
"exclude": [
"node_modules",
"tests",
- "e2e"
+ "e2e",
+ "**/*.test.ts",
+ "**/*.test.tsx",
+ "**/*.spec.ts",
+ "**/*.spec.tsx"
]
}
diff --git a/tsconfig.test.json b/tsconfig.test.json
new file mode 100644
index 0000000..395ca66
--- /dev/null
+++ b/tsconfig.test.json
@@ -0,0 +1,17 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "noUnusedLocals": false,
+ "noUnusedParameters": false,
+ "strict": false
+ },
+ "include": [
+ "**/*.test.ts",
+ "**/*.test.tsx",
+ "**/*.spec.ts",
+ "**/*.spec.tsx"
+ ],
+ "exclude": [
+ "node_modules"
+ ]
+}