update
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
2026-01-04 22:22:46 +08:00
parent 774e463ad4
commit c3f818e738
2 changed files with 22 additions and 8 deletions

View File

@@ -405,6 +405,10 @@ function clear() {
location.reload()
}
function generateMermaid() {
message.info("还在开发中,敬请期待!")
}
onMounted(() => {
getTagList()
getProblemDetail()
@@ -625,7 +629,17 @@ watch(
<h2 class="title">流程图区域</h2>
<!-- 流程图相关设置 -->
<n-form inline label-placement="left">
<n-form inline label-placement="left" :show-feedback="false">
<n-form-item label="根据上面的答案智能生成 Mermaid 代码">
<n-button
type="primary"
size="small"
:disabled="!problem.answers.filter((a) => a.code).length"
@click="generateMermaid"
>
AI 生成
</n-button>
</n-form-item>
<n-form-item label="允许提交流程图">
<n-switch v-model:value="problem.allow_flowchart" />
</n-form-item>
@@ -635,7 +649,7 @@ watch(
</n-form>
<n-form>
<n-form-item label="流程图">
<n-form-item>
<MermaidEditor
v-model="problem.mermaid_code"
@render-success="onMermaidRenderSuccess"

View File

@@ -105,12 +105,12 @@ onBeforeUnmount(() => {
<n-flex align="center">
<span>Mermaid 代码</span>
<n-flex align="center">
<n-button text @click="copyCode" size="small" type="primary"
>复制</n-button
>
<n-button text @click="clearCode" type="error" size="small"
>清空</n-button
>
<n-button text @click="copyCode" size="small" type="primary">
复制
</n-button>
<n-button text @click="clearCode" type="error" size="small">
清空
</n-button>
</n-flex>
</n-flex>
<n-input