diff --git a/src/oj/problem/components/SubmitFlowchart.vue b/src/oj/problem/components/SubmitFlowchart.vue index dfa8e7b..a305a20 100644 --- a/src/oj/problem/components/SubmitFlowchart.vue +++ b/src/oj/problem/components/SubmitFlowchart.vue @@ -12,6 +12,8 @@ import { useFlowchartWebSocket, type FlowchartEvaluationUpdate, } from "shared/composables/websocket" +import { Icon } from "@iconify/vue" +import { usePinnedFlowchartStore } from "shared/store/pinnedFlowchart" // API 和状态管理 import { @@ -51,6 +53,7 @@ const message = useMessage() const problemStore = useProblemStore() const { problem } = toRefs(problemStore) const { isDesktop } = useBreakpoints() +const pinnedStore = usePinnedFlowchartStore() const { convertToMermaid } = useMermaidConverter() const { renderError, renderFlowchart } = useMermaid() @@ -220,6 +223,11 @@ function closeModal() { showDetailModal.value = false } +function pinFlowchart() { + pinnedStore.pin(myMermaidCode.value) + closeModal() +} + function loadToEditor() { if (myFlowchartZippedStr.value) { const str = atou(myFlowchartZippedStr.value) @@ -291,11 +299,26 @@ onUnmounted(() => {