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 @@ + + + + + + +