From 51c3c16fd56d836239da728ca53504acd431bd30 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Tue, 20 Oct 2026 17:01:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=A2=98=E7=9B=AE):=20=E5=8F=82=E8=80=83?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=9B=BE=E7=82=B9=E4=B8=80=E4=B8=8B=E8=83=BD?= =?UTF-8?q?=E6=94=BE=E5=A4=A7=E7=9C=8B=EF=BC=8C=E6=89=8B=E6=9C=BA=E4=B8=8A?= =?UTF-8?q?=E5=AE=BD=E5=9B=BE=E6=A8=AA=E7=9D=80=E6=BB=9A=E3=80=81=E6=8C=89?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=85=88=E5=85=B3=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- .../oj/problem/components/ProblemContent.vue | 32 +++++++++++++++++-- .../FlowchartEditor/FlowchartView.vue | 21 ++++++++++-- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/apps/web/src/oj/problem/components/ProblemContent.vue b/apps/web/src/oj/problem/components/ProblemContent.vue index 09c6365..413b0bd 100644 --- a/apps/web/src/oj/problem/components/ProblemContent.vue +++ b/apps/web/src/oj/problem/components/ProblemContent.vue @@ -13,6 +13,8 @@ import { isFlowchartPass, useFlowchartStore } from "oj/store/flowchart" import { useMyFlowchartStore } from "shared/store/myFlowchart" import { useUserStore } from "shared/store/user" import { useProblemPageContext } from "../composables/problemPageContext" +import { useBackClose } from "shared/composables/backClose" +import { useBreakpoints } from "shared/composables/breakpoints" const ProblemFlowchart = defineAsyncComponent(() => import("./ProblemFlowchart.vue")) const FlowchartView = defineAsyncComponent( @@ -62,6 +64,10 @@ const referenceDoc = computed(() => { const doc = parseFlowDoc(problem.value?.flowchartData) return doc?.steps.length ? doc : null }) +/** 点开放大看。手机上弹框是整屏的,按返回先关它 */ +const referenceZoom = ref(false) +const { isMobile } = useBreakpoints() +useBackClose(referenceZoom, isMobile) const myFlowchartStore = useMyFlowchartStore() const flowchartStore = useFlowchartStore() const userStore = useUserStore() @@ -358,11 +364,32 @@ const astRequirements = computed(() => Object.entries(problem.value?.astRequirem 折成一条要点开 —— 摊开放前面的话,长图(1056 有一千来像素高)会把例子挤出第一屏 -->
-

参考流程图

-
+
+

参考流程图

+ + 放大看 + +
+
+ + + +
@@ -492,6 +519,7 @@ const astRequirements = computed(() => Object.entries(problem.value?.astRequirem /* 参考流程图:和例子的格子同一种浅灰底 */ .reference-flowchart { + cursor: zoom-in; border-radius: 6px; background-color: rgba(128, 128, 128, 0.05); padding: 16px 12px; diff --git a/apps/web/src/shared/components/FlowchartEditor/FlowchartView.vue b/apps/web/src/shared/components/FlowchartEditor/FlowchartView.vue index 5f398fc..e6cfd18 100644 --- a/apps/web/src/shared/components/FlowchartEditor/FlowchartView.vue +++ b/apps/web/src/shared/components/FlowchartEditor/FlowchartView.vue @@ -10,8 +10,10 @@ import { nodeLabel, shapePoints, useFlowPaint } from "./paint" * 整张缩进左栏后字只剩十来像素。 * * 宽度超过容器时整张按比例缩到正好放下(viewBox),不超过就按原大小居中。 + * zoomed(点开放大的弹框里):放大到 1.5 倍、放不下就缩回容器宽,但不小于原大小 —— + * 手机上宽图横着滚,不再缩成看不清的一团。 */ -const { doc } = defineProps<{ doc: FlowDoc }>() +const { doc, zoomed = false } = defineProps<{ doc: FlowDoc; zoomed?: boolean }>() const theme = useThemeVars() const { paint, lineColor } = useFlowPaint() @@ -42,10 +44,14 @@ const markerId = `flow-view-arrow-${useId()}`