feat: Enhance AutoScore functionality with interval triggers and JSON tree support

- Added support for trigger trees in AutoScoreRule interface.
- Implemented functions to convert query trees to JSON and vice versa.
- Updated IntervalValue to use days, hours, and minutes instead of a single amount and unit.
- Refactored IntervalValueWidget to allow separate input for days, hours, and minutes.
- Added validation to ensure at least one interval trigger is present.
- Enhanced user interface with informative alerts and tooltips for better user experience.
- Updated localization files to include new strings for interval triggers and UI elements.
This commit is contained in:
NanGua-QWQ
2026-04-10 21:09:04 +08:00
parent 3caea0afe5
commit eef6b703f7
13 changed files with 931 additions and 294 deletions
+5
View File
@@ -772,6 +772,7 @@
"addTrigger": "Add Rule",
"addAction": "Add Action",
"whenTriggered": "When the following rules trigger",
"triggerScheduleHint": "Note: whether a rule runs is still scheduled by the interval trigger. Tags, SQL, and AND / OR / NOT only decide which students are matched for that run.",
"triggeredActions": "Actions triggered when rules are met",
"addAutomation": "Add Automation",
"updateAutomation": "Update Automation",
@@ -785,6 +786,7 @@
"fetchFailed": "Failed to get automation",
"unsupportedLogic": "Saving currently supports AND-only conditions. OR / NOT logic is not wired to backend persistence yet",
"triggerRequired": "Please add at least one trigger",
"intervalTriggerRequired": "Please add at least one interval trigger, otherwise the rule will never run automatically",
"actionRequired": "Please add at least one action",
"createSuccess": "Automation created successfully",
"updateSuccess": "Automation updated successfully",
@@ -841,6 +843,9 @@
"intervalUnitMonth": "month(s) later",
"intervalUnitDay": "day(s) later",
"intervalUnitMinute": "minute(s) later",
"intervalPartDay": "Days",
"intervalPartHour": "Hours",
"intervalPartMinute": "Minutes",
"minutesPlaceholder": "Enter minutes",
"minutes": "minutes",
"tagsPlaceholder": "Enter tag name",
+6 -1
View File
@@ -772,6 +772,7 @@
"addTrigger": "添加规则",
"addAction": "添加行动",
"whenTriggered": "当以下规则触发时",
"triggerScheduleHint": "提示:规则是否执行仍由“间隔时间”触发器决定,标签、SQL、AND / OR / NOT 仅用于筛选本次命中的学生。",
"triggeredActions": "满足规则时触发的行动",
"addAutomation": "添加自动化",
"updateAutomation": "更新自动化",
@@ -785,6 +786,7 @@
"fetchFailed": "获取自动化失败",
"unsupportedLogic": "当前版本保存规则时仅支持 AND 条件,OR / NOT 逻辑暂未接入后端存储",
"triggerRequired": "请至少添加一个触发器",
"intervalTriggerRequired": "请至少添加一个“间隔时间”触发器,否则规则不会自动执行",
"actionRequired": "请至少添加一个行动",
"createSuccess": "自动化创建成功",
"updateSuccess": "自动化更新成功",
@@ -838,7 +840,10 @@
"intervalAmountPlaceholder": "请输入间隔时间",
"intervalUnitMonth": "个月",
"intervalUnitDay": "天",
"intervalUnitMinute": "分 钟",
"intervalUnitMinute": "分钟",
"intervalPartDay": "天",
"intervalPartHour": "小时",
"intervalPartMinute": "分钟",
"minutesPlaceholder": "请输入分钟数",
"minutes": "分钟",
"tagsPlaceholder": "请输入标签名称",