From 1ee2fe9060d8b033bd2cbd75e03ccd42ed4691cd Mon Sep 17 00:00:00 2001 From: zhl Date: Fri, 23 Apr 2021 13:56:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A2=98=E7=9B=AE=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/question.ts | 33 +++++- src/views/question/editor.vue | 182 ++++++++++++++++++++++++++++------ 2 files changed, 180 insertions(+), 35 deletions(-) diff --git a/src/api/question.ts b/src/api/question.ts index 2b43408..ebfc35f 100644 --- a/src/api/question.ts +++ b/src/api/question.ts @@ -7,13 +7,16 @@ export interface IQuestionData { a2?: string, a3?: string, a4?: string, - group?: string, + groups?: string[], tag?: string, - quality: number + subtag?: string, + quality: number, + withNext: boolean } export const defaultQuestionData: IQuestionData = { + withNext: false, quality: 3, a1: '', question: '' @@ -32,7 +35,12 @@ export const getQuestion = (id: string, params: any) => method: 'get', params }) - +export const nextQuestion = (id: string) => + request({ + url: `/nextpuzzle`, + method: 'post', + data: {id} + }) export const saveQuestion = (data: any) => request({ @@ -46,3 +54,22 @@ export const deleteQuestion = (id: string) => url: `/puzzle/${id}/delete`, method: 'post' }) + +export const getAllTags = () => + request({ + url: `/tags`, + method: 'get', + }) + +export const saveTag = (name: string) => + request({ + url: `/tag/save`, + method: 'post', + data: {name} + }) + +export const getAllCategory = () => + request({ + url: `/question/categorys`, + method: 'get', + }) diff --git a/src/views/question/editor.vue b/src/views/question/editor.vue index a4728be..0229494 100644 --- a/src/views/question/editor.vue +++ b/src/views/question/editor.vue @@ -4,25 +4,9 @@ ref="postForm" :model="postForm" :rules="rules" + label-width="120px" class="form-container" > - - - 取消 - - - 保存 - - -
@@ -46,7 +30,6 @@ + + + + + + + + + + + + + + + + + + + + + + + 保存 + + + 保存&下一题 + + + 删除 + + + 取消 + + + +