@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { useBreakpoints } from "shared/composables/breakpoints"
|
||||
import { useFlowchartSubmission } from "../composables/useFlowchartSubmission"
|
||||
import { useFlowchart } from "../composables/useFlowchart"
|
||||
import FlowchartEvaluationDisplay from "./FlowchartEvaluationDisplay.vue"
|
||||
|
||||
const { isDesktop } = useBreakpoints()
|
||||
@@ -8,9 +8,9 @@ const { isDesktop } = useBreakpoints()
|
||||
// 通过inject获取FlowchartEditor组件的引用
|
||||
const flowchartEditorRef = inject<any>("flowchartEditorRef")
|
||||
|
||||
// 使用拆分后的逻辑
|
||||
// 使用合并后的逻辑
|
||||
const {
|
||||
evaluationResult,
|
||||
evaluation,
|
||||
loading,
|
||||
submissionCount,
|
||||
myFlowchartZippedStr,
|
||||
@@ -19,7 +19,7 @@ const {
|
||||
disconnect,
|
||||
checkCurrentSubmissionStatus,
|
||||
submitFlowchartData,
|
||||
} = useFlowchartSubmission()
|
||||
} = useFlowchart()
|
||||
|
||||
// 组件挂载时连接 WebSocket 并检查状态
|
||||
onMounted(() => {
|
||||
@@ -33,8 +33,8 @@ onUnmounted(() => {
|
||||
})
|
||||
|
||||
// 提交函数
|
||||
async function submit() {
|
||||
await submitFlowchartData(flowchartEditorRef)
|
||||
function submit() {
|
||||
submitFlowchartData(flowchartEditorRef)
|
||||
}
|
||||
|
||||
// 处理加载到编辑器
|
||||
@@ -64,10 +64,9 @@ function handleLoadToEditor(data: any) {
|
||||
|
||||
<!-- 评分结果显示组件 -->
|
||||
<FlowchartEvaluationDisplay
|
||||
:evaluation-result="evaluationResult"
|
||||
:evaluation="evaluation"
|
||||
:my-flowchart-zipped-str="myFlowchartZippedStr"
|
||||
:my-mermaid-code="myMermaidCode"
|
||||
@close="() => {}"
|
||||
@load-to-editor="handleLoadToEditor"
|
||||
/>
|
||||
</n-flex>
|
||||
|
||||
Reference in New Issue
Block a user