From 914153a07c7a1eab689e8f8daee2a9c50dd942d0 Mon Sep 17 00:00:00 2001 From: zhouyanli <593579392@qq.com> Date: Wed, 4 Nov 2026 09:20:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=B8=AE=E5=8A=A9=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E7=AE=A1=E7=90=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增/编辑/详情/列表/删除接口及类型定义 - 操作列增加上架/下架,图标按钮改为文字按钮 --- src/api/helpArticle/index.ts | 77 +++++++++++++++++++++++++++ src/api/helpArticle/types.ts | 100 +++++++++++++++++++++++++++++++++++ src/views/biz/help/index.vue | 83 ++++++++++++++++++++++++----- 3 files changed, 248 insertions(+), 12 deletions(-) create mode 100644 src/api/helpArticle/index.ts create mode 100644 src/api/helpArticle/types.ts 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 @@