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"
>
-