From 6dc59a5e2a24b8c9f6d9c7cbd49f54a66fc5fa53 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Fri, 17 May 2019 10:33:05 +0800 Subject: [PATCH] Refactor SheetList. --- src/api/theme.js | 12 ++++++- src/components/Tools/HeaderComment.vue | 44 ++------------------------ src/views/dashboard/Dashboard.vue | 4 +-- src/views/sheet/SheetList.vue | 26 ++++++++++----- 4 files changed, 33 insertions(+), 53 deletions(-) diff --git a/src/api/theme.js b/src/api/theme.js index db5c04472..cfd294a5d 100644 --- a/src/api/theme.js +++ b/src/api/theme.js @@ -124,4 +124,14 @@ themeApi.reload = () => { }) } -export default themeApi +themeApi.exists = template => { + return service({ + url: `${baseUrl}/activation/template/exists`, + method: 'get', + params: { + template: template + } + }) +} + +export default themeApi \ No newline at end of file diff --git a/src/components/Tools/HeaderComment.vue b/src/components/Tools/HeaderComment.vue index 25183cbd2..07d2a58a6 100644 --- a/src/components/Tools/HeaderComment.vue +++ b/src/components/Tools/HeaderComment.vue @@ -70,35 +70,6 @@ - - - - - - - - - - - @@ -109,7 +80,7 @@ > @@ -131,8 +102,7 @@ export default { loadding: false, visible: false, postComments: [], - sheetComments: [], - journalComments: [] + sheetComments: [] } }, created() { @@ -150,12 +120,6 @@ export default { comment.content = marked(comment.content, { sanitize: true }) return comment }) - }, - converttedJournalComments() { - return this.journalComments.map(comment => { - comment.content = marked(comment.content, { sanitize: true }) - return comment - }) } }, methods: { @@ -177,10 +141,6 @@ export default { this.sheetComments = response.data.data this.loadding = false }) - commentApi.latestComment('journals', 5, 'AUDITING').then(response => { - this.journalComments = response.data.data - this.loadding = false - }) } } } diff --git a/src/views/dashboard/Dashboard.vue b/src/views/dashboard/Dashboard.vue index 001cc5f2b..f575db1a3 100644 --- a/src/views/dashboard/Dashboard.vue +++ b/src/views/dashboard/Dashboard.vue @@ -144,12 +144,12 @@ > - - + --> diff --git a/src/views/sheet/SheetList.vue b/src/views/sheet/SheetList.vue index f868d58d4..68bd477e4 100644 --- a/src/views/sheet/SheetList.vue +++ b/src/views/sheet/SheetList.vue @@ -15,7 +15,7 @@ v-if="isMobile()" > @@ -58,7 +58,10 @@ 管理 - 查看 + 查看 @@ -150,6 +153,10 @@ const internalColumns = [ title: '访问路径', dataIndex: 'url' }, + { + title: '状态', + dataIndex: 'status' + }, { title: '操作', dataIndex: 'action', @@ -187,21 +194,24 @@ const customColumns = [ scopedSlots: { customRender: 'action' } } ] -const internalPages = [ +const internalSheets = [ { id: '1', name: '友情链接', - url: '/links' + url: '/links', + status: '可用' }, { id: '2', name: '图库页面', - url: '/photos' + url: '/photos', + status: '可用' }, { id: '3', name: '日志页面', - url: '/journals' + url: '/journals', + status: '实验性' } ] export default { @@ -211,7 +221,7 @@ export default { sheetStatus: sheetApi.sheetStatus, internalColumns, customColumns, - internalPages, + internalSheets, sheets: [], options: [], keys: ['blog_url']