|
|
@@ -43,7 +43,6 @@
|
|
|
/>
|
|
|
</n-card>
|
|
|
</n-modal>
|
|
|
-
|
|
|
<n-modal v-model:show="showForm">
|
|
|
<n-card
|
|
|
style="width: 600px"
|
|
|
@@ -54,6 +53,9 @@
|
|
|
aria-modal="true"
|
|
|
>
|
|
|
<NForm ref="form" :model="model" :rules="rules">
|
|
|
+ <NFormItem label="专业" path="major">
|
|
|
+ <NInput v-model:value="model.major" />
|
|
|
+ </NFormItem>
|
|
|
<NFormItem label="标题" path="title">
|
|
|
<NInput v-model:value="model.title" />
|
|
|
</NFormItem>
|
|
|
@@ -80,8 +82,8 @@
|
|
|
</n-modal>
|
|
|
|
|
|
<n-drawer v-model:show="showEditor" width="100%" height="100%" placement="bottom" @afterEnter="onEditorShow">
|
|
|
- <n-drawer-content title="编辑" body-content-style="padding:0">
|
|
|
- <div class="px-4 py-8">
|
|
|
+ <n-drawer-content body-content-style="padding:0">
|
|
|
+ <div class="h-full">
|
|
|
<div id="editor"></div>
|
|
|
</div>
|
|
|
</n-drawer-content>
|
|
|
@@ -413,11 +415,13 @@ const resultColumns: DataTableColumn[] = [
|
|
|
const showForm = ref(false)
|
|
|
const form: Ref<FormInst | null> = ref(null)
|
|
|
const model = ref({
|
|
|
+ major: '',
|
|
|
title: '',
|
|
|
description: '',
|
|
|
remark: ''
|
|
|
})
|
|
|
const rules = {
|
|
|
+ major: [{ required: true, message: '请输入专业' }],
|
|
|
title: [{ required: true, message: '请输入标题' }],
|
|
|
description: [{ required: true, message: '请输入描述' }]
|
|
|
}
|
|
|
@@ -425,6 +429,7 @@ const loading = ref(false)
|
|
|
function onCreate() {
|
|
|
orderId.value = null
|
|
|
model.value = {
|
|
|
+ major: '',
|
|
|
title: '',
|
|
|
description: '',
|
|
|
remark: ''
|
|
|
@@ -453,6 +458,7 @@ async function submit() {
|
|
|
}
|
|
|
function editRow(row: any) {
|
|
|
model.value = {
|
|
|
+ major: row.major,
|
|
|
title: row.title,
|
|
|
description: row.description,
|
|
|
remark: row.remark
|
|
|
@@ -483,9 +489,6 @@ function highlightBlock(str: string, lang?: string) {
|
|
|
}
|
|
|
|
|
|
const showEditor = ref(false)
|
|
|
-setTimeout(() => {
|
|
|
- showEditor.value = true
|
|
|
-}, 500)
|
|
|
function onEditorShow() {
|
|
|
console.log('show')
|
|
|
const vditor = new Vditor('editor', {
|