diff --git a/package.json b/package.json index f8ca9f385..8ab4fdcd2 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "test:unit": "vue-cli-service test:unit" }, "dependencies": { + "animate.css": "^3.7.0", "ant-design-vue": "~1.3.7", "axios": "^0.18.0", "enquire.js": "^2.1.6", 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/api/menu.js b/src/api/menu.js new file mode 100644 index 000000000..344c3ec1a --- /dev/null +++ b/src/api/menu.js @@ -0,0 +1,29 @@ +import service from '@/utils/service' + +const baseUrl = '/admin/api/menus' + +const menuApi = {} + +menuApi.listAll = () => { + return service({ + url: baseUrl, + method: 'get' + }) +} + +menuApi.create = menu => { + return service({ + url: baseUrl, + data: menu, + method: 'post' + }) +} + +menuApi.delete = menuId => { + return service({ + url: `${baseUrl}/${menuId}`, + method: 'delete' + }) +} + +export default menuApi diff --git a/src/api/theme.js b/src/api/theme.js index 6a28884da..4ac3d8248 100644 --- a/src/api/theme.js +++ b/src/api/theme.js @@ -4,6 +4,13 @@ const baseUrl = '/admin/api/themes' const themeApi = {} +themeApi.listAll = () => { + return service({ + url: `${baseUrl}`, + method: 'get' + }) +} + themeApi.listFiles = () => { return service({ url: `${baseUrl}/files`, @@ -11,4 +18,31 @@ themeApi.listFiles = () => { }) } +themeApi.customTpls = () => { + return service({ + url: `${baseUrl}/files/custom`, + method: 'get' + }) +} + +themeApi.active = theme => { + return service({ + url: `${baseUrl}/active?theme=${theme}`, + method: 'get' + }) +} + +themeApi.delete = key => { + return service({ + url: `${baseUrl}/${key}`, + method: 'delete' + }) +} + +themeApi.listOptions = theme => { + return service({ + url: `${baseUrl}/configurations?name=${theme}` + }) +} + export default themeApi diff --git a/src/components/layouts/UserLayout.vue b/src/components/layouts/UserLayout.vue deleted file mode 100644 index 7fbf6b4c4..000000000 --- a/src/components/layouts/UserLayout.vue +++ /dev/null @@ -1,150 +0,0 @@ - - - - - diff --git a/src/components/layouts/index.js b/src/components/layouts/index.js index 434e8371d..45268119c 100644 --- a/src/components/layouts/index.js +++ b/src/components/layouts/index.js @@ -1,7 +1,6 @@ -import UserLayout from '@/components/layouts/UserLayout' import BlankLayout from '@/components/layouts/BlankLayout' import BasicLayout from '@/components/layouts/BasicLayout' import RouteView from '@/components/layouts/RouteView' import PageView from '@/components/layouts/PageView' -export { UserLayout, BasicLayout, BlankLayout, RouteView, PageView } +export { BasicLayout, BlankLayout, RouteView, PageView } diff --git a/src/components/setting/SettingDrawer.vue b/src/components/setting/SettingDrawer.vue index 338b249eb..7a5cbe797 100644 --- a/src/components/setting/SettingDrawer.vue +++ b/src/components/setting/SettingDrawer.vue @@ -3,12 +3,13 @@
@@ -147,13 +148,6 @@
-
- - - - - -
@@ -289,10 +283,6 @@ export default { font-size: 14px; } } - .iconClose { - font-size: 24px; - cursor: pointer; - } } .setting-drawer-index-handle { diff --git a/src/config/router.config.js b/src/config/router.config.js index d4c90dbb7..6933ebb33 100644 --- a/src/config/router.config.js +++ b/src/config/router.config.js @@ -1,5 +1,5 @@ // eslint-disable-next-line -import { UserLayout, BasicLayout, RouteView, BlankLayout, PageView } from '@/components/layouts' +import { BasicLayout, RouteView, BlankLayout, PageView } from '@/components/layouts' export const asyncRouterMap = [ @@ -24,7 +24,7 @@ export const asyncRouterMap = [ path: '/posts', name: 'Posts', redirect: '/posts/list', - component: RouteView, + component: PageView, meta: { title: '文章', icon: 'form' }, children: [ { @@ -58,7 +58,7 @@ export const asyncRouterMap = [ { path: '/pages', name: 'Pages', - component: RouteView, + component: PageView, redirect: '/pages/list', meta: { title: '页面', icon: 'read' }, children: [ @@ -97,7 +97,7 @@ export const asyncRouterMap = [ { path: '/interface', name: 'Interface', - component: RouteView, + component: PageView, redirect: '/interface/themes', meta: { title: '外观', icon: 'skin' }, children: [ @@ -126,7 +126,7 @@ export const asyncRouterMap = [ { path: '/user', name: 'User', - component: RouteView, + component: PageView, redirect: '/user/profile', meta: { title: '用户', icon: 'user' }, children: [ @@ -143,7 +143,7 @@ export const asyncRouterMap = [ { path: '/system', name: 'System', - component: RouteView, + component: PageView, redirect: '/system/options', meta: { title: '系统', icon: 'setting' }, children: [ @@ -191,10 +191,12 @@ export const constantRouterMap = [ } ] }, - + { + path: '/login', + component: () => import('@/views/user/Login') + }, { path: '/404', component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404') } - ] diff --git a/src/main.js b/src/main.js index a4bae7738..e0fe3d58e 100644 --- a/src/main.js +++ b/src/main.js @@ -9,10 +9,12 @@ import './core/use' import bootstrap from './core/bootstrap' // import '@/permission' // permission control import '@/utils/filter' // global filter +import animated from 'animate.css' Vue.config.productionTip = false Vue.use(router) +Vue.use(animated) new Vue({ router, diff --git a/src/views/attachment/AttachmentList.vue b/src/views/attachment/AttachmentList.vue index 7de6782c9..d059669b1 100644 --- a/src/views/attachment/AttachmentList.vue +++ b/src/views/attachment/AttachmentList.vue @@ -1,20 +1,118 @@ - diff --git a/src/views/comment/CommentList.vue b/src/views/comment/CommentList.vue index 332fdade3..ddd3baae1 100644 --- a/src/views/comment/CommentList.vue +++ b/src/views/comment/CommentList.vue @@ -11,7 +11,7 @@ - + 已发布 待审核 回收站 @@ -41,18 +41,11 @@
- - {{ text }} - Name - - {{ tag }} - + - Invite 一 {{ record.name }} + 编辑 - Delete - - More actions + 删除
@@ -61,51 +54,57 @@ diff --git a/src/views/interface/MenuList.vue b/src/views/interface/MenuList.vue index e9cd32cd8..6699d1dc2 100644 --- a/src/views/interface/MenuList.vue +++ b/src/views/interface/MenuList.vue @@ -1,41 +1,69 @@ - diff --git a/src/views/interface/ThemeList.vue b/src/views/interface/ThemeList.vue index f7fa30a81..f760a3ec3 100644 --- a/src/views/interface/ThemeList.vue +++ b/src/views/interface/ThemeList.vue @@ -1,73 +1,183 @@ diff --git a/src/views/interface/components/ThemeFile.vue b/src/views/interface/components/ThemeFile.vue index d0f8cb629..20a38f506 100644 --- a/src/views/interface/components/ThemeFile.vue +++ b/src/views/interface/components/ThemeFile.vue @@ -43,10 +43,15 @@ export default { }) ) } - return h('p', 'No files') + return h('p', '没有文件') } } - diff --git a/src/views/page/PageEdit.vue b/src/views/page/PageEdit.vue index 7b0d387b3..3b0300868 100644 --- a/src/views/page/PageEdit.vue +++ b/src/views/page/PageEdit.vue @@ -1,10 +1,166 @@ +import { mavonEditor } from 'mavon-editor' +import { mixin, mixinDevice } from '@/utils/mixin.js' +import 'mavon-editor/dist/css/index.css' +import tagApi from '@/api/theme' +export default { + name: 'Editor', + components: { + mavonEditor + }, + mixins: [mixin, mixinDevice], + data() { + return { + wrapperCol: { + xl: { span: 24 }, + sm: { span: 24 }, + xs: { span: 24 } + }, + value: 'Hello World', + visible: false, + drawerWidth: '460', + postUrl: 'hello-world', + customTpls: [] + } + }, + mounted() { + if (this.isMobile()) { + this.drawerWidth = '100%' + } else { + this.drawerWidth = '460' + } + }, + created() { + this.loadCustomTpls() + }, + methods: { + loadCustomTpls() { + tagApi.customTpls().then(response => { + this.customTpls = response.data.data + }) + }, + showDrawer() { + this.visible = true + }, + onClose() { + this.visible = false + } + } +} + diff --git a/src/views/post/CategoryList.vue b/src/views/post/CategoryList.vue index bdf0ce948..6e3d2a32e 100644 --- a/src/views/post/CategoryList.vue +++ b/src/views/post/CategoryList.vue @@ -1,7 +1,13 @@