feat: SQL 题接入测试点在线编辑器
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
import { getProblemTagList } from "shared/api"
|
import { getProblemTagList } from "shared/api"
|
||||||
import TextEditor from "shared/components/TextEditor.vue"
|
import TextEditor from "shared/components/TextEditor.vue"
|
||||||
import TestcaseGenerator from "./components/TestcaseGenerator.vue"
|
import TestcaseGenerator from "./components/TestcaseGenerator.vue"
|
||||||
|
import SQLTestcaseEditor from "./components/SQLTestcaseEditor.vue"
|
||||||
import AstRulesEditor from "./components/AstRulesEditor.vue"
|
import AstRulesEditor from "./components/AstRulesEditor.vue"
|
||||||
import {
|
import {
|
||||||
CODE_TEMPLATES,
|
CODE_TEMPLATES,
|
||||||
@@ -784,9 +785,9 @@ watch(
|
|||||||
<h2 class="title">测试用例区域</h2>
|
<h2 class="title">测试用例区域</h2>
|
||||||
|
|
||||||
<n-flex align="center" style="margin-bottom: 12px">
|
<n-flex align="center" style="margin-bottom: 12px">
|
||||||
<div v-if="!isSQLProblem">
|
<div>
|
||||||
<n-button type="success" @click="showGeneratorModal = true">
|
<n-button type="success" @click="showGeneratorModal = true">
|
||||||
(新)直接生成
|
{{ isSQLProblem ? "(新)在线编写" : "(新)直接生成" }}
|
||||||
</n-button>
|
</n-button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -844,12 +845,20 @@ watch(
|
|||||||
<n-modal
|
<n-modal
|
||||||
v-model:show="showGeneratorModal"
|
v-model:show="showGeneratorModal"
|
||||||
preset="card"
|
preset="card"
|
||||||
title="测试用例生成器"
|
:title="isSQLProblem ? 'SQL 测试点编辑器' : '测试用例生成器'"
|
||||||
style="width: 80vw; max-width: 900px"
|
style="width: 80vw; max-width: 900px"
|
||||||
:mask-closable="false"
|
:mask-closable="false"
|
||||||
display-directive="show"
|
display-directive="show"
|
||||||
>
|
>
|
||||||
|
<SQLTestcaseEditor
|
||||||
|
v-if="isSQLProblem"
|
||||||
|
:answers="problem.answers"
|
||||||
|
:mode="problem.sql_config?.mode ?? 'query'"
|
||||||
|
:problem-id="problem.id"
|
||||||
|
@uploaded="handleTestcasesGenerated"
|
||||||
|
/>
|
||||||
<TestcaseGenerator
|
<TestcaseGenerator
|
||||||
|
v-else
|
||||||
:answers="problem.answers"
|
:answers="problem.answers"
|
||||||
:samples="problem.samples"
|
:samples="problem.samples"
|
||||||
@uploaded="handleTestcasesGenerated"
|
@uploaded="handleTestcasesGenerated"
|
||||||
|
|||||||
Reference in New Issue
Block a user