diff --git a/src/admin/problem/components/AstRulesEditor.vue b/src/admin/problem/components/AstRulesEditor.vue new file mode 100644 index 0000000..01816e8 --- /dev/null +++ b/src/admin/problem/components/AstRulesEditor.vue @@ -0,0 +1,241 @@ + + + diff --git a/src/admin/problem/detail.vue b/src/admin/problem/detail.vue index cb2499e..670da84 100644 --- a/src/admin/problem/detail.vue +++ b/src/admin/problem/detail.vue @@ -2,6 +2,7 @@ import { getProblemTagList } from "shared/api" import TextEditor from "shared/components/TextEditor.vue" import TestcaseGenerator from "./components/TestcaseGenerator.vue" +import AstRulesEditor from "./components/AstRulesEditor.vue" import { CODE_TEMPLATES, LANGUAGE_SHOW_VALUE, @@ -87,6 +88,7 @@ const problem = useLocalStorage(STORAGE_KEY.ADMIN_PROBLEM, { flowchart_data: {}, flowchart_hint: "", show_flowchart: false, + ast_rules: null as { [key: string]: any[] } | null, }) // 从服务器来的tag列表 @@ -176,6 +178,7 @@ async function getProblemDetail() { problem.value.mermaid_code = data.mermaid_code ?? "" problem.value.flowchart_hint = data.flowchart_hint ?? "" problem.value.flowchart_data = data.flowchart_data + problem.value.ast_rules = data.ast_rules ?? null if (data.answers && data.answers.length) { problem.value.answers = data.answers } else { @@ -643,6 +646,11 @@ watch( + +

测试用例区域