diff --git a/src/api/helpArticle/index.ts b/src/api/helpArticle/index.ts new file mode 100644 index 0000000..77c3c56 --- /dev/null +++ b/src/api/helpArticle/index.ts @@ -0,0 +1,77 @@ +import type { HelpArticleForm, HelpArticleQuery, HelpArticleVO } from '@/api/helpArticle/types'; +import type { PageResult } from '@/api/types'; +import type { AxiosPromise } from '@/utils/api-types'; +import request from '@/utils/request'; + +/** + * 查询帮助文章列表 + * @param query + * @returns {*} + */ +export const listHelpArticle = (query?: HelpArticleQuery): AxiosPromise> => { + return request({ + url: '/helpManage/helpArticle/list', + method: 'get', + params: query + }); +}; + +/** + * 查询帮助文章详细 + * @param articleId + */ +export const getHelpArticle = (articleId: string | number): AxiosPromise => { + return request({ + url: '/helpManage/helpArticle/' + articleId, + method: 'get' + }); +}; + +/** + * 新增帮助文章 + * @param data + */ +export const addHelpArticle = (data: HelpArticleForm) => { + return request({ + url: '/helpManage/helpArticle', + method: 'post', + data: data + }); +}; + +/** + * 修改帮助文章 + * @param data + */ +export const updateHelpArticle = (data: HelpArticleForm) => { + return request({ + url: '/helpManage/helpArticle', + method: 'put', + data: data + }); +}; + + + +/** + * 修改帮助文章状态(上下架) + * @param articleId 帮助文章ID + * @param status 状态(0草稿 1已上架 2已下架) + */ +export const changeHelpArticleStatus = (articleId: string | number, status: string) => { + return request({ + url: '/helpManage/helpArticle/status/' + articleId + '/' + status, + method: 'put' + }); +}; + +/** + * 删除帮助文章 + * @param articleId + */ +export const delHelpArticle = (articleId: string | number | Array) => { + return request({ + url: '/helpManage/helpArticle/' + articleId, + method: 'delete' + }); +}; diff --git a/src/api/helpArticle/types.ts b/src/api/helpArticle/types.ts new file mode 100644 index 0000000..9a591ee --- /dev/null +++ b/src/api/helpArticle/types.ts @@ -0,0 +1,100 @@ +export interface HelpArticleVO { + /** + * 帮助文章ID + */ + articleId: string | number; + /** + * 帮助分类ID + */ + categoryId: string | number; + /** + * 适用端(0租客 1房东) + */ + audience: string; + /** + * 文章标题 + */ + title: string; + /** + * 文章内容 + */ + content: string; + /** + * 状态(0草稿 1已上架 2已下架) + */ + status: string; + /** + * 上架时间 + */ + publishedAt: string; + /** + * 更新时间 + */ + updateTime?: string; +} + +export interface HelpArticleForm extends BaseEntity { + /** + * 帮助文章ID + */ + articleId?: string | number; + /** + * 帮助分类ID + */ + categoryId?: number; + /** + * 适用端(0租客 1房东) + */ + audience?: string; + /** + * 文章标题 + */ + title?: string; + /** + * 文章内容 + */ + content?: string; + /** + * 状态(0草稿 1已上架 2已下架) + */ + status?: string; + /** + * 上架时间 + */ + publishedAt?: string; + /** + * 创建部门 + */ + createDept?: number; + /** + * 创建后台账号ID + */ + createBy?: number; + /** + * 创建时间 + */ + createTime?: string; + /** + * 更新后台账号ID + */ + updateBy?: number; + /** + * 更新时间 + */ + updateTime?: string; +} + +export interface HelpArticleQuery extends PageQuery { + /** + * 适用端(0租客 1房东),必传 + */ + audience: string; + /** + * 文章标题 + */ + title?: string; + /** + * 状态 + */ + status?: string; +} diff --git a/src/views/biz/help/index.vue b/src/views/biz/help/index.vue index 8e7bfea..f83efc9 100644 --- a/src/views/biz/help/index.vue +++ b/src/views/biz/help/index.vue @@ -74,14 +74,20 @@ - + @@ -114,6 +120,7 @@