mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-21 11:49:02 +08:00
FIX
This commit is contained in:
@@ -418,13 +418,13 @@ export class AutoScoreService extends Service {
|
||||
// 当前触发器有匹配的学生
|
||||
if (currentRelation === 'AND') {
|
||||
// AND关系下,取交集
|
||||
currentGroup = currentGroup.filter(student =>
|
||||
result.matchedStudents!.some(matched => matched.id === student.id)
|
||||
currentGroup = currentGroup.filter((student) =>
|
||||
result.matchedStudents!.some((matched) => matched.id === student.id)
|
||||
)
|
||||
} else {
|
||||
// OR关系下,取并集
|
||||
const newStudents = result.matchedStudents.filter(matched =>
|
||||
!currentGroup.some(student => student.id === matched.id)
|
||||
const newStudents = result.matchedStudents.filter(
|
||||
(matched) => !currentGroup.some((student) => student.id === matched.id)
|
||||
)
|
||||
currentGroup = [...currentGroup, ...newStudents]
|
||||
}
|
||||
@@ -439,8 +439,8 @@ export class AutoScoreService extends Service {
|
||||
if (currentRelation === 'AND') {
|
||||
// AND组结束,如果当前组不为空,则合并到结果
|
||||
if (currentGroup.length > 0) {
|
||||
resultStudents = resultStudents.filter(student =>
|
||||
currentGroup.some(groupStudent => groupStudent.id === student.id)
|
||||
resultStudents = resultStudents.filter((student) =>
|
||||
currentGroup.some((groupStudent) => groupStudent.id === student.id)
|
||||
)
|
||||
} else {
|
||||
// AND组为空,整个规则不匹配
|
||||
@@ -448,8 +448,9 @@ export class AutoScoreService extends Service {
|
||||
}
|
||||
} else {
|
||||
// OR组结束,合并当前组到结果
|
||||
const newStudents = currentGroup.filter(groupStudent =>
|
||||
!resultStudents.some(resultStudent => resultStudent.id === groupStudent.id)
|
||||
const newStudents = currentGroup.filter(
|
||||
(groupStudent) =>
|
||||
!resultStudents.some((resultStudent) => resultStudent.id === groupStudent.id)
|
||||
)
|
||||
resultStudents = [...resultStudents, ...newStudents]
|
||||
}
|
||||
@@ -465,8 +466,8 @@ export class AutoScoreService extends Service {
|
||||
if (currentRelation === 'AND') {
|
||||
// AND组结束,如果当前组不为空,则合并到结果
|
||||
if (currentGroup.length > 0) {
|
||||
resultStudents = resultStudents.filter(student =>
|
||||
currentGroup.some(groupStudent => groupStudent.id === student.id)
|
||||
resultStudents = resultStudents.filter((student) =>
|
||||
currentGroup.some((groupStudent) => groupStudent.id === student.id)
|
||||
)
|
||||
} else {
|
||||
// AND组为空,整个规则不匹配
|
||||
@@ -474,8 +475,9 @@ export class AutoScoreService extends Service {
|
||||
}
|
||||
} else {
|
||||
// OR组结束,合并当前组到结果
|
||||
const newStudents = currentGroup.filter(groupStudent =>
|
||||
!resultStudents.some(resultStudent => resultStudent.id === groupStudent.id)
|
||||
const newStudents = currentGroup.filter(
|
||||
(groupStudent) =>
|
||||
!resultStudents.some((resultStudent) => resultStudent.id === groupStudent.id)
|
||||
)
|
||||
resultStudents = [...resultStudents, ...newStudents]
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@ export const AutoScoreManager: React.FC = () => {
|
||||
/>
|
||||
</Card>
|
||||
|
||||
<Card style={{ marginBottom: '24px', backgroundColor: 'var(--ss-card-bg)' }}>
|
||||
<Card style={{ marginBottom: '24px' }}>
|
||||
<Code
|
||||
code={(() => {
|
||||
if (editingRuleId !== null) {
|
||||
|
||||
@@ -3,8 +3,6 @@ import { useEffect } from 'react'
|
||||
import Prism from 'prismjs'
|
||||
import { useTheme } from '../contexts/ThemeContext'
|
||||
|
||||
// 预先导入所有主题
|
||||
import 'prismjs/themes/prism-coy.min.css'
|
||||
import 'prismjs/themes/prism-okaidia.min.css'
|
||||
|
||||
const Code = ({ code, language }) => {
|
||||
|
||||
@@ -43,7 +43,7 @@ const actionDefinitions: ActionDefinition[] = [
|
||||
description: sendNotificationDescription,
|
||||
component: SendNotificationAction,
|
||||
hasReason: sendNotificationHasReason
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
actionDefinitions.forEach((def) => actionRegistry.register(def))
|
||||
|
||||
@@ -14,8 +14,4 @@ export { default as TriggerItemComponent } from './TriggerItem'
|
||||
export { default as ActionItemComponent } from './ActionItem'
|
||||
|
||||
export { IntervalTimeTrigger, StudentTagTrigger, RandomTimeTrigger } from './triggers'
|
||||
export {
|
||||
AddScoreAction,
|
||||
AddTagAction,
|
||||
SendNotificationAction,
|
||||
} from './actions'
|
||||
export { AddScoreAction, AddTagAction, SendNotificationAction } from './actions'
|
||||
|
||||
@@ -36,8 +36,8 @@ const IntervalTimeTrigger: React.FC<TriggerComponentProps> = ({ value, onChange
|
||||
numValue === undefined || isNaN(numValue)
|
||||
? undefined
|
||||
: unit === 'minutes'
|
||||
? numValue
|
||||
: Math.max(1, Math.round(numValue / 1440))
|
||||
? numValue
|
||||
: Math.max(1, Math.round(numValue / 1440))
|
||||
|
||||
return (
|
||||
<Space>
|
||||
|
||||
Reference in New Issue
Block a user