From 5b9298aaad3d0228511765644ac7829f064788a8 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Tue, 25 Apr 2023 19:20:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BD=9C=E5=AE=B6=E5=90=8E=E5=8F=B0-?= =?UTF-8?q?=E5=B0=8F=E8=AF=B4=E7=AB=A0=E8=8A=82=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/author.js | 8 + src/router/index.js | 5 + src/views/author/ChapterList.vue | 62 ++- src/views/author/ChapterUpdate.vue | 767 +++++++++++++++++++++++++++++ 4 files changed, 820 insertions(+), 22 deletions(-) create mode 100644 src/views/author/ChapterUpdate.vue diff --git a/src/api/author.js b/src/api/author.js index c4d7683..0a248ae 100644 --- a/src/api/author.js +++ b/src/api/author.js @@ -26,4 +26,12 @@ export function publishChapter(bookId,params) { export function deleteChapter(id) { return request.delete(`/author/book/chapter/${id}`); +} + +export function getChapter(id) { + return request.get(`/author/book/chapter/${id}`); +} + +export function updateChapter(id,params) { + return request.put(`/author/book/chapter/${id}`,params); } \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index f813c35..6cfbd46 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -97,6 +97,11 @@ const router = createRouter({ path: '/author/chapter_add', name: 'authorChapterAdd', component: () => import('@/views/author/ChapterAdd') + }, + { + path: '/author/chapter_update', + name: 'authorChapterUpdate', + component: () => import('@/views/author/ChapterUpdate') } ] }) diff --git a/src/views/author/ChapterList.vue b/src/views/author/ChapterList.vue index 4e7913c..e997132 100644 --- a/src/views/author/ChapterList.vue +++ b/src/views/author/ChapterList.vue @@ -14,53 +14,71 @@
- 章节发布 + 章节发布

章节列表

- 新建章节 + 新建章节
- + - + - + - - - + + + -
章节名 更新时间 是否收费操作操作
- {{item.chapterName}} + {{ item.chapterName }} {{item.chapterUpdateTime}}
更新
{{item.isVip == 1 ? '收费' : '免费'}}{{ item.chapterUpdateTime }}
更新
+ {{ item.isVip == 1 ? "收费" : "免费" }} + - - 修改 + +
+
删除
{ - const { data } = await listChapters(state.bookId,state.searchCondition); + const { data } = await listChapters(state.bookId, state.searchCondition); state.chapters = data.list; state.searchCondition.pageNum = data.pageNum; state.searchCondition.pageSize = data.pageSize; @@ -160,7 +178,7 @@ export default { ...toRefs(state), handleCurrentChange, load, - deleteBookChapter + deleteBookChapter, }; }, }; diff --git a/src/views/author/ChapterUpdate.vue b/src/views/author/ChapterUpdate.vue new file mode 100644 index 0000000..c80aa0f --- /dev/null +++ b/src/views/author/ChapterUpdate.vue @@ -0,0 +1,767 @@ + + + + + + +