renew text editor

This commit is contained in:
2024-06-11 19:32:43 +08:00
parent 854aad1f43
commit 30a3609838
4 changed files with 56 additions and 24 deletions

View File

@@ -422,11 +422,12 @@ watch([fromExistingTags, newTags], (tags) => {
/> />
</n-form-item> </n-form-item>
</n-form> </n-form>
<n-form v-if="needTemplate">
<n-form-item label="编写代码模板">
<n-tabs <n-tabs
type="line" type="segment"
default-value="C" default-value="C"
class="template box" class="template box"
v-if="needTemplate"
v-model:value="currentActiveTemplate" v-model:value="currentActiveTemplate"
> >
<n-tab-pane <n-tab-pane
@@ -442,6 +443,9 @@ watch([fromExistingTags, newTags], (tags) => {
/> />
</n-tab-pane> </n-tab-pane>
</n-tabs> </n-tabs>
</n-form-item>
</n-form>
<n-alert <n-alert
class="box" class="box"
v-if="problem.test_case_score.length" v-if="problem.test_case_score.length"

View File

@@ -65,7 +65,7 @@ onBeforeUnmount(() => {
> >
<n-gi :span="isDesktop ? 1 : 2" v-show="onlyDetail"> <n-gi :span="isDesktop ? 1 : 2" v-show="onlyDetail">
<n-scrollbar v-if="isDesktop" style="max-height: calc(100vh - 92px)"> <n-scrollbar v-if="isDesktop" style="max-height: calc(100vh - 92px)">
<n-tabs default-value="content" type="line"> <n-tabs default-value="content" type="segment">
<n-tab-pane name="content" tab="题目描述"> <n-tab-pane name="content" tab="题目描述">
<ProblemContent /> <ProblemContent />
</n-tab-pane> </n-tab-pane>
@@ -77,7 +77,7 @@ onBeforeUnmount(() => {
</n-tab-pane> </n-tab-pane>
</n-tabs> </n-tabs>
</n-scrollbar> </n-scrollbar>
<n-tabs v-else default-value="content" type="line"> <n-tabs v-else default-value="content" type="segment">
<n-tab-pane name="content" tab="题目描述"> <n-tab-pane name="content" tab="题目描述">
<ProblemContent /> <ProblemContent />
</n-tab-pane> </n-tab-pane>

View File

@@ -24,7 +24,35 @@ watch(rawHtml, () => emit("update:value", rawHtml.value))
const editorRef = shallowRef<IDomEditor>() const editorRef = shallowRef<IDomEditor>()
const toolbarConfig: Partial<IToolbarConfig> = { const toolbarConfig: Partial<IToolbarConfig> = {
excludeKeys: ["todo", "insertVideo", "fullScreen"], toolbarKeys: [
"blockquote",
"headerSelect",
"fontSize",
"lineHeight",
"|",
"bold",
"underline",
"italic",
"through",
"color",
"bgColor",
"|",
"bulletedList",
"numberedList",
"justifyLeft",
"justifyCenter",
"justifyRight",
"|",
"uploadImage",
"emotion",
"insertLink",
"insertTable",
"divider",
"|",
"clearStyle",
"undo",
"redo",
],
} }
const editorConfig: Partial<IEditorConfig> = { const editorConfig: Partial<IEditorConfig> = {

View File

@@ -6,7 +6,7 @@ import AutoImport from "unplugin-auto-import/vite"
import Components from "unplugin-vue-components/vite" import Components from "unplugin-vue-components/vite"
import { NaiveUiResolver } from "unplugin-vue-components/resolvers" import { NaiveUiResolver } from "unplugin-vue-components/resolvers"
const dev = false const dev = process.env.NODE_ENV === "development"
const url = dev ? "http://localhost:8080" : "https://oj.xuyue.cc" const url = dev ? "http://localhost:8080" : "https://oj.xuyue.cc"
const proxyConfig = { const proxyConfig = {
target: url, target: url,