feat: 使用react-awesome-query-builder实现自动加分规则构建器

This commit is contained in:
NanGua-QWQ
2026-03-27 21:50:22 +08:00
parent a1d93e1d76
commit f70df2a1c8
10 changed files with 478 additions and 705 deletions
+3 -39
View File
@@ -1,7 +1,7 @@
import { useState, useEffect } from "react"
import { HolderOutlined } from "@ant-design/icons"
import { useTranslation } from "react-i18next"
import RuleComponent from "./autoScore/ruleComponent"
import DemoQueryBuilder from "./autoScore/aaa"
import {
Card,
Form,
@@ -426,44 +426,8 @@ export const AutoScoreManager: React.FC = () => {
</Form>
</Card>
<RuleComponent />
{/* <Card
style={{ marginBottom: '24px', backgroundColor: 'var(--ss-card-bg)' }}
title={t('autoScore.whenTriggered')}
>
<Space orientation="vertical" style={{ width: '100%' }}>
{triggerList.map((trigger, index) => renderTriggerItem(trigger, index))}
{' '}
<Button
type="dashed"
icon={<PlusOutlined />}
onClick={handleAddTrigger}
style={{ fontWeight: 'bolder', fontSize: 15 }}
>
{t('autoScore.addTrigger')}
</Button>
</Space>
</Card> */}
{/* <Card
style={{ marginBottom: '24px', backgroundColor: 'var(--ss-card-bg)' }}
title={t('autoScore.triggeredActions')}
>
<Space orientation="vertical" style={{ width: '100%' }}>
{actionList.map((action) => renderActionItem(action))}
<Button
type="dashed"
icon={<PlusOutlined />}
onClick={handleAddAction}
style={{ fontWeight: 'bolder', fontSize: 15 }}
>
{t('autoScore.addAction')}
</Button>
</Space>
</Card> */}
<DemoQueryBuilder />
<div style={{ marginBottom: "24px", display: "flex", gap: "12px" }}>
<Button type="primary" onClick={handleSubmit}>
{editingRuleId !== null ? t("autoScore.updateAutomation") : t("autoScore.addAutomation")}