基础组件完善

This commit is contained in:
2025-04-09 01:34:14 +08:00
parent e421bcd44b
commit ebdf97aebf
11 changed files with 2673 additions and 1692 deletions
+30 -1
View File
@@ -2,6 +2,13 @@ import React, { useState, useEffect, useContext, useCallback, useRef } from 'rea
import { SimpleCodeEditor } from './SimpleCodeEditor';
import { RuleContext } from '~/contexts/RuleContext';
import { processFieldNames, areArraysDifferent, getArrayDifference, debounce } from '~/utils';
import type {
Rule as ModelRule,
RuleType as ModelRuleType,
LogicType,
SuggestionMessageType,
PostActionType
} from '~/models/evaluation_points';
interface RuleType {
id: string;
@@ -38,9 +45,31 @@ interface ReviewSettingsProps {
score?: number;
scoreDisplay?: string;
};
// 添加选项数据参数
ruleTypeOptions?: Array<{ value: string; label: string }>;
logicTypeOptions?: Array<{ value: string; label: string }>;
logicOperatorOptions?: Array<{ value: string; label: string }>;
compareMethodOptions?: Array<{ value: string; label: string }>;
formatTypeOptions?: Array<{ value: string; label: string }>;
comparisonOperatorOptions?: Array<{ value: string; label: string }>;
matchTypeOptions?: Array<{ value: string; label: string }>;
suggestionMessageTypeOptions?: Array<{ value: string; label: string }>;
postActionOptions?: Array<{ value: string; label: string }>;
}
export function ReviewSettings({ onChange, initialData }: ReviewSettingsProps) {
export function ReviewSettings({
onChange,
initialData,
ruleTypeOptions = [],
logicTypeOptions = [],
logicOperatorOptions = [],
compareMethodOptions = [],
formatTypeOptions = [],
comparisonOperatorOptions = [],
matchTypeOptions = [],
suggestionMessageTypeOptions = [],
postActionOptions = []
}: ReviewSettingsProps) {
const [rules, setRules] = useState<RuleType[]>([
{ id: '1', type: '', config: {} }
]);