diff --git a/src/api/question/label/index.ts b/src/api/question/label/index.ts new file mode 100644 index 0000000..4e4f893 --- /dev/null +++ b/src/api/question/label/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { LabelVO, LabelForm, LabelQuery } from '@/api/question/label/types'; + +/** + * 查询题目标签列表 + * @param query + * @returns {*} + */ + +export const listLabel = (query?: LabelQuery): AxiosPromise => { + return request({ + url: '/question/label/list', + method: 'get', + params: query + }); +}; + +/** + * 查询题目标签详细 + * @param id + */ +export const getLabel = (id: string | number): AxiosPromise => { + return request({ + url: '/question/label/' + id, + method: 'get' + }); +}; + +/** + * 新增题目标签 + * @param data + */ +export const addLabel = (data: LabelForm) => { + return request({ + url: '/question/label', + method: 'post', + data: data + }); +}; + +/** + * 修改题目标签 + * @param data + */ +export const updateLabel = (data: LabelForm) => { + return request({ + url: '/question/label', + method: 'put', + data: data + }); +}; + +/** + * 删除题目标签 + * @param id + */ +export const delLabel = (id: string | number | Array) => { + return request({ + url: '/question/label/' + id, + method: 'delete' + }); +}; diff --git a/src/api/question/label/types.ts b/src/api/question/label/types.ts new file mode 100644 index 0000000..fa4fa77 --- /dev/null +++ b/src/api/question/label/types.ts @@ -0,0 +1,56 @@ +export interface LabelVO { + /** + * + */ + id: string | number; + + /** + * 标签名称 + */ + label: string; + + /** + * 标签状态 1:启用 0:禁用 + */ + status: number; + +} + +export interface LabelForm extends BaseEntity { + /** + * + */ + id?: string | number; + + /** + * 标签名称 + */ + label?: string; + + /** + * 标签状态 1:启用 0:禁用 + */ + status?: number; + +} + +export interface LabelQuery extends PageQuery { + + /** + * 标签名称 + */ + label?: string; + + /** + * 标签状态 1:启用 0:禁用 + */ + status?: number; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/views/question/label/index.vue b/src/views/question/label/index.vue new file mode 100644 index 0000000..e2d3835 --- /dev/null +++ b/src/views/question/label/index.vue @@ -0,0 +1,224 @@ + + + diff --git a/src/views/question/title/index.vue b/src/views/question/title/index.vue index a5c1a92..725cee4 100644 --- a/src/views/question/title/index.vue +++ b/src/views/question/title/index.vue @@ -7,7 +7,14 @@ - + + + 搜索 @@ -40,7 +47,11 @@ - + + +