diff --git a/package.json b/package.json index 47dd5c2..dd71d63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jmal-cloud-view", - "version": "2.0.3", + "version": "2.0.4", "description": "jmal cloud", "author": "Jmal ", "license": "MIT", diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 4adac71..fd87ebd 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -4,16 +4,17 @@
- -
- 网站管理 -
-
- -
- 网站 -
-
+ +
+ + {{route.children[0].name}} +
+
{{showName}}
@@ -22,16 +23,16 @@
- + - 基本设置 + + {{route.children[0].name}} - - - - 网站管理 - - + 退出登录 @@ -49,6 +50,10 @@ import { mapGetters } from 'vuex' import Breadcrumb from '@/components/Breadcrumb' import Hamburger from '@/components/Hamburger' import Icon from '@/components/Icon/Icon.vue' +import AppLink from './Sidebar/Link' +import store from "@/store" +import {isExternal} from "@/utils/validate"; +import path from "path"; export default { data() { @@ -62,14 +67,31 @@ export default { components: { Icon, Breadcrumb, - Hamburger + Hamburger, + AppLink }, computed: { ...mapGetters([ 'sidebar', 'avatar', 'showName' - ]) + ]), + routes() { + let routes = {} + let topRouters = [] + let rightTopRoutes = [] + this.$router.options.routes.forEach(route => { + if(route.menuType === 3){ + topRouters.push(route) + } + if(route.menuType === 4){ + rightTopRoutes.push(route) + } + }) + routes.topRouters = topRouters + routes.rightTopRoutes = rightTopRoutes + return routes + }, }, mounted() { this.isShow = this.$pc; @@ -83,6 +105,15 @@ export default { async logout() { await this.$store.dispatch('user/logout') this.$router.push(`/login?redirect=${this.$route.fullPath}`) + }, + resolvePath(routePath) { + if (isExternal(routePath)) { + return routePath + } + if (isExternal(this.basePath)) { + return this.basePath + } + return path.resolve(this.basePath, routePath) } } } diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index ca1804f..d8c73aa 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -32,15 +32,15 @@ export default { ]), routes() { let routes = [] - if(this.$route.path.startsWith("/setting")){ + if(this.$route.meta.menuType === 0){ this.$router.options.routes.forEach(route => { - if(route.path.startsWith("/setting")){ + if(route.menuType === 0){ routes.push(route) } }) } else { this.$router.options.routes.forEach(route => { - if(!route.path.startsWith("/setting")){ + if(route.menuType === 2){ routes.push(route) } }) diff --git a/src/permission.js b/src/permission.js index b923acf..8f0e6a0 100644 --- a/src/permission.js +++ b/src/permission.js @@ -84,7 +84,7 @@ function setMenuList(next, to){ function findPath(menuList, to, parentPath){ for( let i = 0; i < menuList.length; i++) { const menu = menuList[i] - if(menu.menuType > 0){ + if(menu.menuType === 1){ continue } if(menu.children && menu.children.length > 0){ diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 57d41b3..672e2fa 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -134,12 +134,14 @@ const actions = { } function getMenuTree(menuList) { - menuList = menuList.filter(menu => menu.menuType === 0) + menuList = menuList.filter(menu => menu.menuType !== 1) return menuList.map(menu => { let router = {} if(menu.children && menu.children.length){ - router.meta = {title: menu.name, icon: menu.icon} + router.meta = {title: menu.name, icon: menu.icon, menuType: menu.menuType} + router.hidden = menu.hide router.children = findChildren(menu.children) + router.menuType = menu.menuType } if(menu.component && menu.component.length > 0) { router.children = [ @@ -147,25 +149,29 @@ function getMenuTree(menuList) { path: '', name: menu.name, component: loadView(menu.component), - meta: {title: menu.name, icon: menu.icon} + meta: {title: menu.name, icon: menu.icon, menuType: menu.menuType}, + hidden: menu.hide } ] } router.path = menu.path router.component = Layout + router.menuType = menu.menuType return router }) } function findChildren(childrenMenu){ let children = [] - childrenMenu = childrenMenu.filter(menu => menu.menuType === 0) + childrenMenu = childrenMenu.filter(menu => menu.menuType !== 1) childrenMenu.forEach(menu => { let router = { path: menu.path, name: menu.name, component: !menu.component || menu.component.length === 0 ? ParentView : loadView(menu.component), - meta: {title: menu.name, icon: menu.icon} + meta: {title: menu.name, icon: menu.icon, menuType: menu.menuType}, + hidden: menu.hide, + menuType: menu.menuType } if(menu.children && menu.children.length){ if(!menu.component || menu.component.length === 0){ diff --git a/src/styles/setting.scss b/src/styles/setting.scss index e26324e..d15ccff 100644 --- a/src/styles/setting.scss +++ b/src/styles/setting.scss @@ -71,7 +71,7 @@ a:hover { float: right; margin-top: -32px; } -/deep/ .el-collapse-item__content { +/deep/ .el-collapse-item__content, /deep/.el-tab-pane { background-color: #fafafa; padding: 0 30px 20px; } @@ -171,6 +171,9 @@ a:hover { .text-align-right { text-align: right; } +.input-none-width { + width: unset; +} @media screen and (max-width: 768px) { .query-item { margin-bottom: 10px; diff --git a/src/views/markdown/index.vue b/src/views/markdown/index.vue index f3a9c9a..ec1d271 100644 --- a/src/views/markdown/index.vue +++ b/src/views/markdown/index.vue @@ -172,7 +172,6 @@ activeNames: ['1'], file: {}, editStatus: false, - html:'', // 及时转的html filename: '', clientHeight: document.documentElement.clientHeight - 150, updating: false, @@ -355,11 +354,6 @@ upload: this.markdownImageUplaod() }) }, - // 所有操作都会被解析重新渲染 - change(value, render){ - // render 为 markdown 解析后的结果[html] - this.html = render; - }, markdownImageUplaod(){ return { accept: 'image/*,.mp3, .wav, .rar', diff --git a/src/views/setting/articles/articleManager.vue b/src/views/setting/articles/articleManager.vue index 0ae6772..2b4b763 100644 --- a/src/views/setting/articles/articleManager.vue +++ b/src/views/setting/articles/articleManager.vue @@ -249,7 +249,7 @@ export default { }, methods: { setMaxHeight(){ - this.tableMaxHeight = document.documentElement.clientHeight - 285 + this.tableMaxHeight = document.documentElement.clientHeight - 265 }, //行拖拽 rowDrop() { diff --git a/src/views/setting/articles/blogManager.vue b/src/views/setting/articles/blogManager.vue index 875074f..140ca80 100644 --- a/src/views/setting/articles/blogManager.vue +++ b/src/views/setting/articles/blogManager.vue @@ -9,8 +9,9 @@
- - + + +
站点背景大图:
@@ -21,8 +22,8 @@
首页大图内描述:
显示在博客首页大图内的描述。 -
- + +
导航栏顶部 - 网站 Logo / 站点名称:
配置网站的 Logo,该选项仅作用于顶部导航条 @@ -47,10 +48,8 @@ - -
- - + +
页面显示与否:
归档 @@ -68,14 +67,14 @@
标签界面背景大图:
在这里填入图片的URL地址, 以在分类页面显示一个背景大图。 -
- + +
版权信息:
备案许可号:
-
-
+ + @@ -93,7 +92,7 @@ export default { }, data() { return { - activeNames: ['1'], + activeName: '1', example: 'github', form: { backgroundSite: '', @@ -114,8 +113,14 @@ export default { computed: {}, mounted() { this.getSetting() + if(this.$route.query.tab){ + this.activeName = this.$route.query.tab + } }, methods: { + handleClick(tab, event) { + this.$router.push({query: {tab: tab.name}}) + }, preview(){ this.operatingButtons = [] if(this.form.operatingButtons) { @@ -213,5 +218,15 @@ export default { color: #fff; } } - +/deep/ .el-tabs__header { + margin: 0; + @media screen and (min-width: 768px) { + .el-tabs__nav { + padding: 0 20px; + } + .el-tabs__active-bar { + left: 20px; + } + } +} diff --git a/src/views/setting/articles/tagManager.vue b/src/views/setting/articles/tagManager.vue index c005f14..0dd5376 100644 --- a/src/views/setting/articles/tagManager.vue +++ b/src/views/setting/articles/tagManager.vue @@ -257,9 +257,9 @@ export default { /deep/ .el-checkbox.is-bordered { background-color: #f4f4f5; border-color: #e9e9eb; - color: #909399; + color: #646568; font-weight: 400; - padding: 5px 5px 5px 10px; + padding: 6px 5px 5px 10px; } /deep/ .el-checkbox.is-bordered.is-checked { background-color: #ecf5ff; diff --git a/src/views/setting/cloudManager.vue b/src/views/setting/cloudManager.vue index 9cf5228..5d8d55f 100644 --- a/src/views/setting/cloudManager.vue +++ b/src/views/setting/cloudManager.vue @@ -9,10 +9,6 @@
-
网盘同步: - -
- 一般用于初始化操作, 将文件数据同步到数据库
启用webp: 什么是webp? +
网盘同步: + +
+ 一般用于初始化操作, 将文件数据同步到数据库
diff --git a/src/views/setting/sys/cusomerInfo.vue b/src/views/setting/sys/cusomerInfo.vue index 7287321..042857e 100644 --- a/src/views/setting/sys/cusomerInfo.vue +++ b/src/views/setting/sys/cusomerInfo.vue @@ -29,7 +29,7 @@ 确 定 - +
@@ -44,13 +44,13 @@ 修改密码 - + - + @@ -262,6 +262,8 @@ } } } + data.delete("createTime") + data.delete("updateTime") return data }, // 保存头像 diff --git a/src/views/setting/sys/menuManager.vue b/src/views/setting/sys/menuManager.vue index c522e12..ffd2197 100644 --- a/src/views/setting/sys/menuManager.vue +++ b/src/views/setting/sys/menuManager.vue @@ -47,13 +47,20 @@ + + 显示 + 隐藏 + 菜单 按钮 - - 显示 - 影藏 + + + 设置 + 顶部 + 右上 + @@ -131,7 +138,7 @@ export default { dialogTitle: '', updateLoading: false, valid: true, - isExpand: true, + isExpand: false, form: { name: '', parentId: '', @@ -173,16 +180,23 @@ export default { } } }, - {prop: 'menuType', label: '类型', width: 75, tag: true, + {prop: 'menuType', label: '类型', width: 100, tag: true, formatData: (menuType)=> { - if(menuType === 0){ - return ['菜单'] - }else{ - return ['按钮'] + switch (menuType) { + case 0: + return ['首页菜单'] + case 1: + return ['按钮'] + case 2: + return ['设置菜单'] + case 3: + return ['顶部菜单'] + case 4: + return ['右上角菜单'] } } }, - {prop: 'createTime', label: '创建时间'}, + // {prop: 'createTime', label: '创建时间'}, {label: '操作', minWidth: this.$pc ? 0 : 130, active: [ {name: '修改', icon: 'el-icon-edit', handle: (row) => this.handleEdit(row.id)}, {name: '删除', icon: 'el-icon-delete', color: '#ff4d4f', handle: (row) => this.handleDelete([row.id])}, diff --git a/src/views/setting/sys/roleManager.vue b/src/views/setting/sys/roleManager.vue index af8ac4d..93b8a26 100644 --- a/src/views/setting/sys/roleManager.vue +++ b/src/views/setting/sys/roleManager.vue @@ -51,12 +51,12 @@ - - + + - +
查询 添加 @@ -68,7 +68,7 @@