diff --git a/src/oj/submission/components/FlowchartLink.vue b/src/oj/submission/components/FlowchartLink.vue index 24793ae..2c70731 100644 --- a/src/oj/submission/components/FlowchartLink.vue +++ b/src/oj/submission/components/FlowchartLink.vue @@ -2,7 +2,9 @@ {{ flowchart.id.slice(0, 12) }} - {{ flowchart.id.slice(0, 12) }} + + {{ flowchart.id.slice(0, 12) }} + + + diff --git a/src/oj/submission/components/FlowchartScoreDetail.vue b/src/oj/submission/components/FlowchartScoreDetail.vue new file mode 100644 index 0000000..929ea6b --- /dev/null +++ b/src/oj/submission/components/FlowchartScoreDetail.vue @@ -0,0 +1,148 @@ + + + + + + + + {{ renderError }} + + + + + + + + + + + {{ submission.ai_feedback }} + + + + + {{ submission.ai_suggestions }} + + + + + + + + {{ key }} + + {{ detail.score || 0 }}分 / {{ detail.max }}分 + + + + + {{ detail.comment }} + + + + + + + + + + + + diff --git a/src/oj/submission/detail.vue b/src/oj/submission/detail.vue index f2ba561..69cf604 100644 --- a/src/oj/submission/detail.vue +++ b/src/oj/submission/detail.vue @@ -30,12 +30,15 @@ const message = useMessage() const { isMobile, isDesktop } = useBreakpoints() const submission = ref() +const loading = ref(false) async function init() { submission.value = props.submission if (submission.value) return + loading.value = true const res = await getSubmission(props.submissionID) submission.value = res.data + loading.value = false } const columns: DataTableColumn[] = [ @@ -144,6 +147,8 @@ onMounted(init) :data="submission.info.data" /> + + diff --git a/src/oj/submission/list.vue b/src/oj/submission/list.vue index 558ebd2..7006dc8 100644 --- a/src/oj/submission/list.vue +++ b/src/oj/submission/list.vue @@ -26,6 +26,7 @@ import SubmissionLink from "./components/SubmissionLink.vue" import SubmissionDetail from "./detail.vue" import Grade from "./components/Grade.vue" import FlowchartLink from "./components/FlowchartLink.vue" +import FlowchartScoreDetail from "./components/FlowchartScoreDetail.vue" interface SubmissionQuery { username: string @@ -61,6 +62,11 @@ const [statisticPanel, toggleStatisticPanel] = useToggle(false) const [flowchartStatisticPanel, toggleFlowchartStatisticPanel] = useToggle(false) const [codePanel, toggleCodePanel] = useToggle(false) +const [scoreDetailPanel, toggleScoreDetailPanel] = useToggle(false) +const selectedFlowchartId = ref("") +const selectedFlowchart = computed(() => { + return flowcharts.value.find((f) => f.id === selectedFlowchartId.value) +}) const resultOptions: SelectOption[] = [ { label: "全部", value: "" }, @@ -150,6 +156,28 @@ function showCodePanel(id: string, problem: string) { problemDisplayID.value = problem } +function showScoreDetail(id: string) { + selectedFlowchartId.value = id + toggleScoreDetailPanel(true) +} + +function getGradeType(grade?: string) { + if (!grade) return "default" + if (grade === "S") return "primary" + if (grade === "A") return "info" + if (grade === "B") return "warning" + return "error" +} + +function flowchartRowProps(row: FlowchartSubmissionListItem) { + return { + style: "cursor: pointer", + onClick() { + showScoreDetail(row.id) + }, + } +} + // 监听用户名和题号变化(防抖) watchDebounced(() => [query.username, query.problem], listSubmissions, { debounce: 500, @@ -260,7 +288,11 @@ const flowchartColumns: DataTableColumn[] = [ { title: renderTableTitle("提交编号", "fluent-emoji-flat:input-numbers"), key: "id", - render: (row) => h(FlowchartLink, { flowchart: row }), + render: (row) => + h(FlowchartLink, { + flowchart: row, + onShowDetail: (id: string) => showScoreDetail(id), + }), }, { title: renderTableTitle("题目", "streamline-emojis:blossom"), @@ -397,6 +429,7 @@ const flowchartColumns: DataTableColumn[] = [ :bordered="false" :columns="flowchartColumns" :data="flowcharts" + :row-props="flowchartRowProps" /> [] = [ hideList /> + + + + 流程图评分详情 + + {{ selectedFlowchart.ai_score }}分 {{ selectedFlowchart.ai_grade }}级 + + + + +