From 3aaed5fd063b0d3fd1e908f3fc87473a2a4bbc62 Mon Sep 17 00:00:00 2001 From: zhl Date: Fri, 23 Apr 2021 15:52:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A2=98=E5=BA=93=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/question.ts | 3 +- src/views/question/editor.vue | 14 ++++--- src/views/question/list.vue | 79 +++++++++++++++++++++++++++++++++-- 3 files changed, 85 insertions(+), 11 deletions(-) diff --git a/src/api/question.ts b/src/api/question.ts index ebfc35f..3b4ae0c 100644 --- a/src/api/question.ts +++ b/src/api/question.ts @@ -9,7 +9,8 @@ export interface IQuestionData { a4?: string, groups?: string[], tag?: string, - subtag?: string, + sub_tag?: string, + category?: string, quality: number, withNext: boolean } diff --git a/src/views/question/editor.vue b/src/views/question/editor.vue index 0229494..efe8ca2 100644 --- a/src/views/question/editor.vue +++ b/src/views/question/editor.vue @@ -13,12 +13,12 @@ 题目 @@ -31,11 +31,12 @@ @@ -221,7 +222,8 @@ export default class extends Vue { private postForm = Object.assign({}, defaultQuestionData) private loading = false private rules = { - title: [{ validator: this.validateRequire }], + question: [{ validator: this.validateRequire }], + a1: [{ validator: this.validateRequire }], } private typeOptions: any[] = [] private typeSelect: string[] = [] @@ -256,7 +258,7 @@ export default class extends Vue { try { const { data } = await getQuestion(id, { /* Your params here */ }) this.postForm = data - this.typeSelect = [this.postForm.tag || '', this.postForm.subtag || ''] + this.typeSelect = [this.postForm.tag || '', this.postForm.sub_tag || ''] // Just for test const title = this.lang === 'zh' ? '编辑题目' : 'Edit Question' // Set tagsview title @@ -282,7 +284,7 @@ export default class extends Vue { private typechange(val: string[]) { this.postForm.tag = this.typeSelect[0] - this.postForm.subtag = this.typeSelect[1] + this.postForm.sub_tag = this.typeSelect[1] } private async tagChange(tags: string[]) { diff --git a/src/views/question/list.vue b/src/views/question/list.vue index 6251783..23b330a 100644 --- a/src/views/question/list.vue +++ b/src/views/question/list.vue @@ -5,7 +5,16 @@ - + + + + 查询 重置 @@ -36,6 +45,13 @@ {{ row.createtime | parseTime }} + + + + + + + +