From f18746d8ffee923d3f6de04439a89665ada4d3d7 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <773861846@qq.com> Date: Sun, 29 May 2022 20:46:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E4=BD=9C=E5=AE=B6?= =?UTF-8?q?=E7=AB=A0=E8=8A=82=E5=88=97=E8=A1=A8=E5=92=8C=E7=AB=A0=E8=8A=82?= =?UTF-8?q?=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/author.js | 12 +- src/router/index.js | 10 + src/views/Book.vue | 2 +- src/views/BookClass.vue | 4 +- src/views/BookContent.vue | 2 +- src/views/author/BookAdd.vue | 3 +- src/views/author/BookList.vue | 17 +- src/views/author/ChapterAdd.vue | 747 ++++++++++++++++++++++++++++++ src/views/author/ChapterList.vue | 753 +++++++++++++++++++++++++++++++ 9 files changed, 1533 insertions(+), 17 deletions(-) create mode 100644 src/views/author/ChapterAdd.vue create mode 100644 src/views/author/ChapterList.vue diff --git a/src/api/author.js b/src/api/author.js index 27060f8..35d0a80 100644 --- a/src/api/author.js +++ b/src/api/author.js @@ -8,10 +8,18 @@ export function register(params) { return request.post('/author/register', params); } -export function listBooks() { - return request.get('/author/books'); +export function listBooks(params) { + return request.get('/author/books', { params }); } export function publishBook(params) { return request.post('/author/book', params); +} + +export function listChapters(bookId, params) { + return request.get(`/author/book/chapters/${bookId}`, { params }); +} + +export function publishChapter(bookId,params) { + return request.post(`/author/book/chapter/${bookId}`, params); } \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 8b645bf..a087649 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -82,6 +82,16 @@ const router = createRouter({ path: '/author/book_add', name: 'authorBookAdd', component: () => import('@/views/author/BookAdd') + }, + { + path: '/author/chapter_list', + name: 'authorChapterList', + component: () => import('@/views/author/ChapterList') + }, + { + path: '/author/chapter_add', + name: 'authorChapterAdd', + component: () => import('@/views/author/ChapterAdd') } ] }) diff --git a/src/views/Book.vue b/src/views/Book.vue index 97f797d..b5389da 100644 --- a/src/views/Book.vue +++ b/src/views/Book.vue @@ -36,7 +36,7 @@
-

+

收起 diff --git a/src/views/BookClass.vue b/src/views/BookClass.vue index 5f90e82..3b839c9 100644 --- a/src/views/BookClass.vue +++ b/src/views/BookClass.vue @@ -360,10 +360,10 @@ export default { computed: { wordCountFormat(wordCount) { return (wordCount) => { - if (wordCount.length > 5) { + if (wordCount.length >= 5) { return parseInt(wordCount / 10000) + "万"; } - if (wordCount.length > 4) { + if (wordCount.length >= 4) { return parseInt(wordCount / 1000) + "千"; } return wordCount; diff --git a/src/views/BookContent.vue b/src/views/BookContent.vue index 8169c33..e739655 100644 --- a/src/views/BookContent.vue +++ b/src/views/BookContent.vue @@ -113,7 +113,7 @@
diff --git a/src/views/author/BookAdd.vue b/src/views/author/BookAdd.vue index 1b22c81..fd28522 100644 --- a/src/views/author/BookAdd.vue +++ b/src/views/author/BookAdd.vue @@ -4,7 +4,8 @@
diff --git a/src/views/author/BookList.vue b/src/views/author/BookList.vue index eef5ba1..fd4424a 100644 --- a/src/views/author/BookList.vue +++ b/src/views/author/BookList.vue @@ -4,7 +4,8 @@
@@ -60,14 +61,10 @@ 0 {{ item.updateTime }} 更新 - 0 + {{ wordCountFormat(item.wordCount) }} - 章节管理 - + 章节管理 + @@ -168,10 +165,10 @@ export default { computed: { wordCountFormat(wordCount) { return (wordCount) => { - if (wordCount.length > 5) { + if (wordCount.length >= 5) { return parseInt(wordCount / 10000) + "万"; } - if (wordCount.length > 4) { + if (wordCount.length >= 4) { return parseInt(wordCount / 1000) + "千"; } return wordCount; diff --git a/src/views/author/ChapterAdd.vue b/src/views/author/ChapterAdd.vue new file mode 100644 index 0000000..641f052 --- /dev/null +++ b/src/views/author/ChapterAdd.vue @@ -0,0 +1,747 @@ + + + + + + + diff --git a/src/views/author/ChapterList.vue b/src/views/author/ChapterList.vue new file mode 100644 index 0000000..722bfd6 --- /dev/null +++ b/src/views/author/ChapterList.vue @@ -0,0 +1,753 @@ + + + + + + +