From 6f1720acd5b00b7a14f9c4f1e8be4572a367533b Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Mon, 13 Oct 2025 15:18:14 +0800 Subject: [PATCH] update --- src/oj/flowchart/index.vue | 7 ++ src/oj/problem/components/Form.vue | 24 +++-- src/oj/problem/components/ProblemEditor.vue | 7 +- src/oj/problem/components/SubmitFlowchart.vue | 2 +- .../composables/useFlowchartSubmission.ts | 10 +- .../problem/composables/useFlowchartSubmit.ts | 26 +++--- .../composables/useMermaidConverter.ts | 3 +- src/routes.ts | 4 + .../components/FlowchartEditor/CustomNode.vue | 66 ++++++------- .../FlowchartEditor/NodeActions.vue | 8 +- .../FlowchartEditor/NodeHandles.vue | 8 +- .../components/FlowchartEditor/Toolbar.vue | 93 ++++++++++--------- .../components/FlowchartEditor/index.vue | 89 +++++++++++------- .../components/FlowchartEditor/useCache.ts | 30 +++--- .../components/FlowchartEditor/useDnD.ts | 30 +++--- .../components/FlowchartEditor/useHistory.ts | 14 +-- src/shared/composables/websocket.ts | 11 ++- 17 files changed, 248 insertions(+), 184 deletions(-) create mode 100644 src/oj/flowchart/index.vue diff --git a/src/oj/flowchart/index.vue b/src/oj/flowchart/index.vue new file mode 100644 index 0000000..cd8329d --- /dev/null +++ b/src/oj/flowchart/index.vue @@ -0,0 +1,7 @@ + + + diff --git a/src/oj/problem/components/Form.vue b/src/oj/problem/components/Form.vue index 4c135f2..f654977 100644 --- a/src/oj/problem/components/Form.vue +++ b/src/oj/problem/components/Form.vue @@ -72,19 +72,17 @@ const menu = computed(() => [ { label: "重置代码", key: "reset" }, ]) -const languageOptions: DropdownOption[] = languages.value.map( - (it) => ({ - label: () => - h(NFlex, { align: "center" }, () => [ - h(Icon, { - icon: ICON_SET[it], - width: 16, - }), - LANGUAGE_SHOW_VALUE[it], - ]), - value: it, - }), -) +const languageOptions: DropdownOption[] = languages.value.map((it) => ({ + label: () => + h(NFlex, { align: "center" }, () => [ + h(Icon, { + icon: ICON_SET[it], + width: 16, + }), + LANGUAGE_SHOW_VALUE[it], + ]), + value: it, +})) const copy = async () => { const success = await copyToClipboard(codeStore.code.value) diff --git a/src/oj/problem/components/ProblemEditor.vue b/src/oj/problem/components/ProblemEditor.vue index 58ccc47..e69c03d 100644 --- a/src/oj/problem/components/ProblemEditor.vue +++ b/src/oj/problem/components/ProblemEditor.vue @@ -81,7 +81,7 @@ const handleSyncStatusChange = (status: { } // 提供FlowchartEditor的ref给子组件 -provide('flowchartEditorRef', flowchartEditorRef) +provide("flowchartEditorRef", flowchartEditorRef)