+
import("./SubmitFlowchart.vue"))
+
/**
* 手机上屏幕底部固定的「运行例子 / 提交」(设计文档 5.6)。原来这两个按钮在「代码」页签
* 顶上,和语言、更多挤成两行;看着题面想交一次,还得先切回代码页签。
@@ -41,7 +43,8 @@ const canRunSamples = computed(
运行例子
-
+
+
diff --git a/apps/web/src/oj/problem/components/ProblemEditor.vue b/apps/web/src/oj/problem/components/ProblemEditor.vue
index 29c2ea8..1616096 100644
--- a/apps/web/src/oj/problem/components/ProblemEditor.vue
+++ b/apps/web/src/oj/problem/components/ProblemEditor.vue
@@ -191,13 +191,12 @@ watch(
)
// 流程图编辑器交给 store:结果页签(在左栏,不在编辑器底下)要拿当前画布比一比、
-// 把旧版本载回去。子组件 SubmitFlowchart 还是从 inject 拿
+// 把旧版本载回去;「交给 AI 点评」在手机上挂在屏幕底部那条,也从 store 拿
const flowchartStore = useFlowchartStore()
watch(flowchartEditorRef, (editor) => flowchartStore.attachEditor(editor ?? null), {
immediate: true,
})
onBeforeUnmount(() => flowchartStore.attachEditor(null))
-provide("flowchartEditorRef", flowchartEditorRef)
diff --git a/apps/web/src/oj/problem/components/ResultPane.vue b/apps/web/src/oj/problem/components/ResultPane.vue
index 6a060f7..5510d8f 100644
--- a/apps/web/src/oj/problem/components/ResultPane.vue
+++ b/apps/web/src/oj/problem/components/ResultPane.vue
@@ -5,8 +5,6 @@ import { useProblemStore } from "oj/store/problem"
import { useSubmissionStore } from "oj/store/submission"
import { useCodeStore } from "oj/store/code"
import { useTeacherCollab } from "../composables/teacherCollab"
-import { useProblemPageContext } from "../composables/problemPageContext"
-import { useBreakpoints } from "shared/composables/breakpoints"
import { useThemeVars } from "naive-ui"
import { parseTime } from "utils/functions"
import ResultHeader from "./ResultHeader.vue"
@@ -33,8 +31,6 @@ const { submission, syntaxErrorInfo, resultSegment, formattedBeforeSubmit } =
storeToRefs(submissionStore)
const { problem } = storeToRefs(useProblemStore())
const codeStore = useCodeStore()
-const ctx = useProblemPageContext()
-const { isDesktop } = useBreakpoints()
/** 协作中的老师自己还没交过:先摆学生最近一次交的 */
const teacherCollab = useTeacherCollab()
@@ -42,24 +38,7 @@ const teacherCollab = useTeacherCollab()
const theme = useThemeVars()
const { samplesRunAt } = submissionStore.trial
-/**
- * 手机上流程图题只能看点评、不能画(设计文档 5.6)。画不了,语言也就落不到 Flowchart 上,
- * 下面的 drawing 永远是假 —— 原来学生在电脑上画过、AI 评过的,手机上一条都看不到。
- * 这时多给一段「流程图点评」,只读。
- */
-const flowchartReadable = computed(
- () => !isDesktop.value && !!problem.value?.allowFlowchart && ctx.value.entry !== "contest",
-)
-/** 在看「流程图点评」那一段。只在这一页记着:点运行例子、提交时照常切回对应的分段 */
-const viewingFlowchart = ref(false)
-watch(
- () => [submissionStore.resultSeq, problem.value?.id, flowchartReadable.value],
- () => {
- viewingFlowchart.value = false
- },
-)
-
-type Segment = "submit" | "samples" | "custom" | "flowchart"
+type Segment = "submit" | "samples" | "custom"
const codeSegments = computed<{ value: Segment; label: string; time: string }[]>(() => [
{
value: "submit",
@@ -84,25 +63,16 @@ const drawing = computed(() => codeStore.code.language === "Flowchart")
// 试跑走判题机,SQL 题不走那里;流程图也没得跑。这两种只留「提交结果」
const canTrial = computed(() => !problem.value || !isSqlProblem(problem.value))
-const segments = computed(() => {
- const list = canTrial.value ? codeSegments.value : codeSegments.value.slice(0, 1)
- return flowchartReadable.value
- ? [...list, { value: "flowchart" as const, label: "流程图点评", time: "" }]
- : list
-})
-/** 只有一段(SQL 题、又不是手机上的流程图题)就不摆分段了 */
+const segments = computed(() =>
+ canTrial.value ? codeSegments.value : codeSegments.value.slice(0, 1),
+)
+/** 只有一段(SQL 题)就不摆分段了 */
const showSegments = computed(() => segments.value.length > 1)
function isActive(segment: Segment) {
- if (viewingFlowchart.value) return segment === "flowchart"
return resultSegment.value === segment
}
function pick(segment: Segment) {
- if (segment === "flowchart") {
- viewingFlowchart.value = true
- return
- }
- viewingFlowchart.value = false
resultSegment.value = segment
}
@@ -124,14 +94,13 @@ function pick(segment: Segment) {
>
{{ segment.label }} · {{ segment.time }}
- 自己编数据试试,这里不判对错