From 10e9e91c96ad57446e25502104a53d6c7e1cc987 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Fri, 5 Apr 2019 13:05:12 +0800 Subject: [PATCH] ui build --- src/api/category.js | 14 +++++++ src/views/comment/CommentList.vue | 4 +- src/views/interface/ThemeEdit.vue | 9 ++++- src/views/post/PostEdit.vue | 64 ++++++++++++++++++++----------- src/views/post/PostList.vue | 30 ++++++++++----- src/views/user/Profile.vue | 42 ++++++++++++-------- 6 files changed, 111 insertions(+), 52 deletions(-) create mode 100644 src/api/category.js diff --git a/src/api/category.js b/src/api/category.js new file mode 100644 index 000000000..aac5441d1 --- /dev/null +++ b/src/api/category.js @@ -0,0 +1,14 @@ +import service from '@/utils/service' + +const baseUrl = '/admin/api/categories' + +const categoryApi = {} + +categoryApi.listAll = () => { + return service({ + url: `${baseUrl}`, + method: 'get' + }) +} + +export default categoryApi diff --git a/src/views/comment/CommentList.vue b/src/views/comment/CommentList.vue index 332fdade3..f6e5da798 100644 --- a/src/views/comment/CommentList.vue +++ b/src/views/comment/CommentList.vue @@ -11,7 +11,7 @@ - + 已发布 待审核 回收站 @@ -41,7 +41,7 @@
- + {{ text }} Name diff --git a/src/views/interface/ThemeEdit.vue b/src/views/interface/ThemeEdit.vue index 98b48ce33..906fd3f22 100644 --- a/src/views/interface/ThemeEdit.vue +++ b/src/views/interface/ThemeEdit.vue @@ -3,7 +3,14 @@ - + + + + + + 保存 + + diff --git a/src/views/post/PostEdit.vue b/src/views/post/PostEdit.vue index d601249f2..ad4486e96 100644 --- a/src/views/post/PostEdit.vue +++ b/src/views/post/PostEdit.vue @@ -15,29 +15,23 @@
- +
- +

基本设置

- - + + - + @@ -48,7 +42,7 @@
- +

分类目录

@@ -58,7 +52,7 @@
- +

标签

@@ -66,27 +60,25 @@ - {{ tag.name }} + {{ + tag.name + }}
- +

缩略图

- +
- +
保存草稿 @@ -103,6 +95,26 @@ import { mavonEditor } from 'mavon-editor' import { mixin, mixinDevice } from '@/utils/mixin.js' import 'mavon-editor/dist/css/index.css' import tagApi from '@/api/tag' +const toolbars = { + bold: true, // 粗体 + italic: true, // 斜体 + header: true, // 标题 + underline: true, // 下划线 + strikethrough: true, // 中划线 + quote: true, // 引用 + ol: true, // 有序列表 + ul: true, // 无序列表 + link: true, // 链接 + imagelink: true, // 图片链接 + code: true, // code + table: true, // 表格 + readmodel: true, // 沉浸式阅读 + undo: true, // 上一步 + redo: true, // 下一步 + navigation: true, // 导航目录 + subfield: true, // 单双栏模式 + preview: true // 预览 +} const treeData = [ { title: '学习记录', @@ -144,7 +156,8 @@ export default { drawerWidth: '460', postUrl: 'hello-world', tags: [], - treeData + treeData, + markdownOption: toolbars } }, mounted() { @@ -206,7 +219,12 @@ export default { padding-bottom: 0; } -.post-thum .img{ +.post-thum .img { width: 100%; } + +.mavonEditor { + width: 100%; + height: 560px; +} diff --git a/src/views/post/PostList.vue b/src/views/post/PostList.vue index c80c243e6..1284e155a 100644 --- a/src/views/post/PostList.vue +++ b/src/views/post/PostList.vue @@ -11,7 +11,7 @@ - + 已发布 草稿箱 回收站 @@ -20,10 +20,8 @@ - - xx - xx - xx + + {{ category.name }} @@ -39,7 +37,9 @@
- 新建 + + 写文章 + 回收站 @@ -51,7 +51,7 @@
- + {{ text }} Name @@ -71,6 +71,7 @@ diff --git a/src/views/user/Profile.vue b/src/views/user/Profile.vue index ba61e8188..9833819ae 100644 --- a/src/views/user/Profile.vue +++ b/src/views/user/Profile.vue @@ -1,8 +1,8 @@