@@ -101,10 +101,6 @@ async function submit() {
|
||||
if (contestID) {
|
||||
data.contest_id = parseInt(contestID)
|
||||
}
|
||||
if (problemSetId) {
|
||||
data.problemset_id = parseInt(problemSetId)
|
||||
}
|
||||
|
||||
// 2. 提交代码到后端
|
||||
const res = await submitCode(data)
|
||||
console.log(`[Submit] 代码已提交: ID=${res.data.submission_id}`)
|
||||
@@ -123,11 +119,14 @@ watch(
|
||||
// 1. 刷新题目状态
|
||||
problem.value!.my_status = 0
|
||||
|
||||
// 2. 更新题单进度
|
||||
// 2. 创建ProblemSetSubmission记录,更新题单进度
|
||||
if (problemSetId) {
|
||||
console.log(problemSetId, "problemSetId")
|
||||
try {
|
||||
await updateProblemSetProgress(Number(problemSetId), problem.value!.id)
|
||||
await updateProblemSetProgress(
|
||||
Number(problemSetId),
|
||||
problem.value!.id,
|
||||
submission.value!.id,
|
||||
)
|
||||
} catch (error) {
|
||||
console.error("更新题单进度失败:", error)
|
||||
}
|
||||
|
||||
@@ -33,12 +33,12 @@ const ProblemFlowchart = defineAsyncComponent(
|
||||
interface Props {
|
||||
problemID: string
|
||||
contestID?: string
|
||||
problemSetID?: string
|
||||
problemSetId?: string
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
contestID: "",
|
||||
problemSetID: "",
|
||||
problemSetId: "",
|
||||
})
|
||||
|
||||
const errMsg = ref("无数据")
|
||||
|
||||
Reference in New Issue
Block a user