修复一些已知问题

更新layout
master
toesbieya 6 years ago
parent c35952434a
commit e9aabafe42
  1. 12
      vue/full/package-lock.json
  2. 4
      vue/full/package.json
  3. 236
      vue/full/src/layout/component/SettingDrawer/index.vue
  4. 17
      vue/full/src/layout/component/SettingDrawer/mixin/tagsViewPersistent.js
  5. 46
      vue/full/src/layout/component/SettingDrawer/mixin/tagsViewShortcut.js
  6. 16
      vue/full/src/layout/index.vue
  7. 14
      vue/full/src/main.js
  8. 13
      vue/full/src/router/define.js
  9. 22
      vue/full/src/router/guardian/avoidReuse.js
  10. 22
      vue/full/src/router/guardian/iframe.js
  11. 6
      vue/full/src/router/guardian/index.js
  12. 3
      vue/full/src/router/guardian/nprogress.js
  13. 20
      vue/full/src/router/guardian/setTitle.js
  14. 6
      vue/full/src/router/module/admin/child/purchase.js
  15. 6
      vue/full/src/router/module/admin/child/sell.js
  16. 6
      vue/full/src/router/module/example/child/test.js
  17. 3
      vue/full/src/util/auth.js
  18. 7
      vue/full/src/util/browser.js
  19. 2
      vue/full/src/util/route.js
  20. 12
      vue/full/src/view/_app/redirect.vue
  21. 2
      vue/full/src/view/admin/system/category/component/List.vue
  22. 2
      vue/full/src/view/admin/system/department/indexPage.vue
  23. 3
      vue/full/src/view/admin/system/menu/indexPage.vue
  24. 6
      vue/full/src/view/admin/userCenter/component/Avatar.vue

@ -4535,9 +4535,9 @@
"dev": true
},
"el-admin-layout": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/el-admin-layout/-/el-admin-layout-0.0.2.tgz",
"integrity": "sha512-F+5n9HzlbGyD3EbQi4Uk7RdMlZbSLmPAsw5aoK5pYmEtLJktZCOC70bGMNRESc38bGpADa7Cv1+8bwCruG1/uw=="
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/el-admin-layout/-/el-admin-layout-0.3.0.tgz",
"integrity": "sha512-mqETeYK9XxTTI7VHD5NIIjORRxzsdE4HPfae8PmaTZVhJH+BlzmFf8OpOmXvei4Z3C35/2BiYCxmbMw9XeiGjQ=="
},
"electron-to-chromium": {
"version": "1.3.633",
@ -7685,9 +7685,9 @@
"dev": true
},
"pako": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/pako/-/pako-2.0.2.tgz",
"integrity": "sha512-9e8DRI3+dRLomCmMBAH30B2ejh+blwXr7VmMEx/pVFZlSDA7oyI8uKMhKXr8IrZpoxBF2YlxUvhqRXzTT1i0NA=="
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
},
"param-case": {
"version": "3.0.4",

@ -10,12 +10,12 @@
"dependencies": {
"axios": "^0.21.1",
"decimal.js": "^10.2.1",
"el-admin-layout": "0.0.2",
"el-admin-layout": "^0.3.0",
"element-ui": "^2.14.1",
"file-saver": "^2.0.5",
"js-md5": "^0.7.3",
"nprogress": "^0.2.0",
"pako": "^2.0.2",
"pako": "^1.0.11",
"socket.io-client": "2.3.1",
"vue": "^2.6.12",
"vue-count-to": "^1.0.13",

@ -1,6 +1,6 @@
<template>
<el-drawer
:visible="appGetters.showSettingDrawer"
:visible="visible"
:with-header="false"
append-to-body
size="288px"
@ -9,51 +9,37 @@
<div class="drawer-container">
<el-divider>导航模式</el-divider>
<div class="drawer-item">
<checkbox-group :value="appGetters.navMode" @input="changeNavMode">
<checkbox-group v-model="setting.app.navMode">
<img-checkbox
v-for="{label, value, img} in navModes"
:key="value"
:label="label"
:value="value"
v-model="value"
:img="img"
/>
</checkbox-group>
</div>
<el-divider>页面设置</el-divider>
<el-divider>导航栏设置</el-divider>
<div class="drawer-item">
<span>分层结构</span>
<span>主题风格</span>
<el-select
:value="pageGetters.position"
v-model="setting.navbar.theme"
size="mini"
style="width: 80px"
@input="changePagePosition"
>
<el-option value="top-bottom" label="上下"/>
<el-option value="left-right" label="左右"/>
<el-option value="light" label="亮色"/>
<el-option value="dark" label="暗色"/>
</el-select>
</div>
<div class="drawer-item">
<span>显示logo</span>
<el-switch :value="pageGetters.showLogo" @input="changePageShowLogo"/>
</div>
<div class="drawer-item">
<span>显示页头</span>
<el-switch :value="pageGetters.showPageHeader" @input="changePageShowHeader"/>
</div>
<div class="drawer-item">
<span>显示返回顶部按钮</span>
<el-switch :value="pageGetters.showBackToTop" @input="changePageBackToTop"/>
</div>
<el-divider>侧边栏设置</el-divider>
<div class="drawer-item">
<span>主题风格</span>
<el-select
:value="asideGetters.theme"
v-model="setting.aside.theme"
size="mini"
style="width: 80px"
@input="changeAsideTheme"
>
<el-option value="light" label="亮色"/>
<el-option value="dark" label="暗色"/>
@ -62,10 +48,9 @@
<div class="drawer-item">
<span>汉堡包位置</span>
<el-select
:value="asideGetters.hamburgerPosition"
v-model="setting.aside.hamburgerPosition"
size="mini"
style="width: 90px"
@input="changeAsideHamburgerPosition"
>
<el-option value="aside" label="侧边栏"/>
<el-option value="head" label="导航栏"/>
@ -73,83 +58,98 @@
</div>
<div class="drawer-item">
<span>手风琴效果</span>
<el-switch :value="asideGetters.uniqueOpen" @input="changeAsideUniqueOpen"/>
<el-switch v-model="setting.aside.uniqueOpen"/>
</div>
<div class="drawer-item">
<span>折叠</span>
<el-switch :value="asideGetters.collapse" @input="changeAsideCollapse"/>
<el-switch v-model="setting.aside.collapse"/>
</div>
<div class="drawer-item">
<span>折叠时显示上级</span>
<el-switch :value="asideGetters.showParentOnCollapse" @input="changeAsideCollapseParent"/>
<el-switch v-model="setting.aside.showParentOnCollapse"/>
</div>
<div class="drawer-item">
<span>自动隐藏</span>
<el-switch :value="asideGetters.autoHide" @input="changeAsideAutoHide"/>
<el-switch v-model="setting.aside.autoHide"/>
</div>
<div class="drawer-item">
<span>显示搜索框</span>
<el-switch :value="asideGetters.search" @input="changeAsideSearch"/>
<el-switch v-model="setting.aside.search"/>
</div>
<el-divider>导航栏设置</el-divider>
<el-divider>页面设置</el-divider>
<div class="drawer-item">
<span>主题风格</span>
<span>分层结构</span>
<el-select
:value="navbarGetters.theme"
v-model="setting.page.position"
size="mini"
style="width: 80px"
@input="changeNavbarTheme"
>
<el-option value="light" label="亮色"/>
<el-option value="dark" label="暗色"/>
<el-option value="top-bottom" label="上下"/>
<el-option value="left-right" label="左右"/>
</el-select>
</div>
<div class="drawer-item">
<span>显示logo</span>
<el-switch v-model="setting.page.showLogo"/>
</div>
<div class="drawer-item">
<span>显示页头</span>
<el-switch v-model="setting.page.showHeader"/>
</div>
<div class="drawer-item">
<span>显示页脚</span>
<el-switch v-model="setting.page.showFooter"/>
</div>
<div class="drawer-item">
<span>显示返回顶部按钮</span>
<el-switch v-model="setting.page.showBackToTop"/>
</div>
<el-divider>多页签设置</el-divider>
<div class="drawer-item">
<span>启用</span>
<el-switch :value="tagsViewGetters.enabled" @input="changeTagsViewEnabled"/>
<el-switch v-model="setting.tagsView.enabled"/>
</div>
<div class="drawer-item">
<span>启用缓存</span>
<el-switch v-model="setting.tagsView.enableCache"/>
</div>
<div class="drawer-item">
<span>启用快捷键切换</span>
<el-switch :value="tagsViewGetters.shortcut" @input="changeTagsViewShortcut"/>
<el-switch v-model="setting.tagsView.shortcut"/>
</div>
<div class="drawer-item">
<span>持久化</span>
<el-switch :value="tagsViewGetters.persistent" @input="changeTagsViewPersistent"/>
<el-switch v-model="setting.tagsView.persistent"/>
</div>
</div>
</el-drawer>
</template>
<script>
import tagsViewPersistentMixin from "./mixin/tagsViewPersistent"
import tagsViewShortcutMixin from "./mixin/tagsViewShortcut"
import CheckboxGroup from "./component/checkbox/Group"
import ColorCheckbox from "./component/checkbox/ColorCheckbox"
import ImgCheckbox from "./component/checkbox/ImgCheckbox"
import {
appGetters,
appMutations,
asideGetters,
asideMutations,
navbarGetters,
navbarMutations,
pageGetters,
pageMutations,
tagsViewGetters,
tagsViewMutations
} from "el-admin-layout"
import {appMutations, asideMutations, navbarMutations, pageMutations, tagsViewMutations} from "el-admin-layout"
import {mergeObj} from "@/util"
import {getLocalPersonalSettings, setLocalPersonalSettings} from "@/util/storage"
export default {
name: "SettingDrawer",
mixins: [tagsViewPersistentMixin, tagsViewShortcutMixin],
components: {CheckboxGroup, ColorCheckbox, ImgCheckbox},
data() {
return {
appGetters, asideGetters, navbarGetters, pageGetters, tagsViewGetters,
//vue
getRoot: () => undefined,
visible: false,
navModes: [
{
@ -181,11 +181,12 @@ export default {
page: {
position: 'left-right',
showLogo: true,
showPageHeader: true,
showHeader: true,
showFooter: true,
showBackToTop: true
},
aside: {
theme: 'light',
theme: 'dark',
hamburgerPosition: 'aside',
uniqueOpen: true,
collapse: false,
@ -194,10 +195,11 @@ export default {
search: true
},
navbar: {
theme: 'light'
theme: 'dark'
},
tagsView: {
enabled: true,
enableCache: true,
shortcut: true,
persistent: true
}
@ -207,7 +209,22 @@ export default {
methods: {
close() {
appMutations.showSettingDrawer(false)
this.visible = false
},
getMutationsByType(type) {
switch (type) {
case 'app':
return appMutations
case 'aside':
return asideMutations
case 'navbar':
return navbarMutations
case 'page':
return pageMutations
case 'tagsView':
return tagsViewMutations
}
},
//layoutstore
@ -218,97 +235,42 @@ export default {
Object.entries(page).forEach(([k, v]) => pageMutations[k](v))
Object.entries(aside).forEach(([k, v]) => asideMutations[k](v))
Object.entries(navbar).forEach(([k, v]) => navbarMutations[k](v))
Object.entries(tagsView).forEach(([k, v]) => tagsViewMutations[k](v))
},
//layoutstore
syncSettingDrawer() {
const {app, page, aside, navbar, tagsView} = this.setting
Object.keys(app).forEach(k => app[k] = appGetters[k])
Object.keys(page).forEach(k => page[k] = pageGetters[k])
Object.keys(aside).forEach(k => aside[k] = asideGetters[k])
Object.keys(navbar).forEach(k => navbar[k] = navbarGetters[k])
Object.keys(tagsView).forEach(k => tagsView[k] = tagsViewGetters[k])
},
//
saveSetting() {
this.syncSettingDrawer()
setLocalPersonalSettings(this.setting)
},
changeNavMode(v) {
appMutations.navMode(v)
},
changePagePosition(v) {
pageMutations.position(v)
},
changePageShowLogo(v) {
pageMutations.showLogo(v)
},
changePageShowHeader(v) {
pageMutations.showPageHeader(v)
},
changePageBackToTop(v) {
pageMutations.showBackToTop(v)
},
changeAsideTheme(v) {
asideMutations.theme(v)
},
changeAsideHamburgerPosition(v) {
asideMutations.hamburgerPosition(v)
},
changeAsideUniqueOpen(v) {
asideMutations.uniqueOpen(v)
},
changeAsideCollapse(v) {
asideMutations.collapse(v)
},
changeAsideCollapseParent(v) {
asideMutations.showParentOnCollapse(v)
},
changeAsideAutoHide(v) {
asideMutations.autoHide(v)
},
changeAsideSearch(v) {
asideMutations.search(v)
},
changeNavbarTheme(v) {
navbarMutations.theme(v)
},
changeTagsViewEnabled(v) {
tagsViewMutations.enabled(v)
},
changeTagsViewShortcut(v) {
tagsViewMutations.shortcut(v)
},
changeTagsViewPersistent(v) {
tagsViewMutations.persistent(v)
tagsViewMutations.enabled(tagsView.enabled)
tagsViewMutations.enableCache(tagsView.enableCache)
}
},
created() {
//change
for (const [key, value] of Object.entries(this)) {
if (typeof value !== 'function' || !key.startsWith('change')) {
continue
}
this[key] = (...arg) => {
value.apply(this, arg)
this.saveSetting()
}
}
//
mergeObj(this.setting, getLocalPersonalSettings())
//
setLocalPersonalSettings(this.setting)
this.syncLayoutStore()
//
const noop = () => undefined
Object.entries(this.setting).forEach(([type, v]) => {
const mutations = this.getMutationsByType(type)
Object.keys(v).forEach(key => {
const mutation = (() => {
const fun = mutations[key]
//tagsView
return fun ? newVal => fun(newVal) : noop
})()
this.$watch(
`setting.${type}.${key}`,
v => {
mutation(v)
setLocalPersonalSettings(this.setting)
}
)
})
})
}
}
</script>

@ -10,11 +10,11 @@ import {getTagsView, setTagsView} from "@/util/storage"
export default {
computed: {
shouldPersistent: () => tagsViewGetters.persistent
visitedViews: () => tagsViewGetters.visitedViews
},
watch: {
shouldPersistent: {
'setting.tagsView.persistent': {
immediate: true,
handler(v) {
//尝试清除之前的watch
@ -27,7 +27,7 @@ export default {
if (!v) return setTagsView()
//启用时先存储一次(仅在mounted后,否则此时页签数据不完整)
this._isMounted && this.persistentTagsView(tagsViewGetters.visitedViews)
this._isMounted && this.persistentTagsView(this.visitedViews)
this.watchVisitedViewsCallback = this.$watch('visitedViews', this.persistentTagsView)
}
@ -35,13 +35,18 @@ export default {
},
beforeCreate() {
this.persistentTagsView = debounce(setTagsView)
this.persistentTagsView = debounce(views => {
setTagsView(views.map(v => ({fullPath: v.fullPath, meta: v.meta})))
})
},
mounted() {
if (!this.shouldPersistent) return
if (!this.setting.tagsView.persistent) return
const tags = getTagsView()
Array.isArray(tags) && tags.forEach(tagsViewMutations.addTagOnly)
Array.isArray(tags) && tags.forEach(({fullPath, meta}) => {
const {route} = this.getRoot().$router.resolve(fullPath)
route && tagsViewMutations.addTagOnly({...route, meta: {...route.meta, ...meta}})
})
}
}

@ -7,14 +7,8 @@
import {tagsViewGetters} from "el-admin-layout"
export default {
computed: {
shouldBindKeydownEvent() {
return tagsViewGetters.shortcut
}
},
watch: {
shouldBindKeydownEvent: {
'setting.tagsView.shortcut': {
immediate: true,
handler(v) {
//尝试移除之前可能添加的事件
@ -26,38 +20,26 @@ export default {
},
methods: {
//上一个页签
gotoViewFront() {
const views = tagsViewGetters.visitedViews
gotoViewByDirection(direction) {
const root = this.getRoot()
if (!root) return
const views = tagsViewGetters.visitedViews
if (views.length <= 1) return
let index = views.findIndex(view => view.path === this.$route.path)
let index = views.findIndex(view => view.path === root.$route.path)
if (index < 0) return
if (index === 0) {
index = views.length
//上一个页签
if (direction === 'front') {
index = index === 0 ? views.length - 1 : index - 1
}
return this.$router.push({path: views[index - 1].path})
},
//下一个页签
gotoViewBehind() {
const views = tagsViewGetters.visitedViews
if (views.length <= 1) return
let index = views.findIndex(view => view.path === this.$route.path)
if (index < 0) return
if (index + 1 > views.length - 1) {
index = -1
else if (direction === 'behind') {
index = index > views.length - 2 ? 0 : index + 1
}
return this.$router.push({path: views[index + 1].path})
return root.$router.push({path: views[index].path})
},
//快捷键监听
@ -67,11 +49,11 @@ export default {
//ctrl + →
case 'ArrowRight':
e.preventDefault()
return this.gotoViewBehind()
return this.gotoViewByDirection('behind')
//ctrl + ←
case 'ArrowLeft':
e.preventDefault()
return this.gotoViewFront()
return this.gotoViewByDirection('front')
}
}
}

@ -5,13 +5,11 @@
<script type="text/jsx">
import Vue from 'vue'
import config from "@/config"
import ElAdminLayout, {setIconRenderer, appMutations} from 'el-admin-layout'
import ElAdminLayout, {Const, appMutations} from 'el-admin-layout'
import Footer from './component/Footer'
import NotifyBell from './component/NotifyBell'
import SettingDrawer from './component/SettingDrawer'
import offlineMixin from './mixin/offline'
import tagsViewPersistent from './mixin/tagsViewPersistent'
import tagsViewShortcut from './mixin/tagsViewShortcut'
import {elConfirm} from "@/util/message"
//
@ -19,12 +17,12 @@ appMutations.title(config.title)
appMutations.logo(config.logo)
//
setIconRenderer((h, data) => <v-icon {...data}/>)
Const.iconRenderer = (h, icon) => <v-icon icon={icon}/>
export default {
name: "Layout",
mixins: [offlineMixin, tagsViewPersistent, tagsViewShortcut],
mixins: [offlineMixin],
components: {ElAdminLayout, NotifyBell, SettingDrawer},
@ -54,10 +52,8 @@ export default {
navbarProps() {
const userInfo = this.$store.state.user
return {
user: {
avatar: userInfo.avatar,
name: userInfo.name
},
username: userInfo.name,
userDropdownItems: [
{
icon: 'el-icon-user',
@ -107,7 +103,7 @@ export default {
},
openSettingDrawer() {
appMutations.showSettingDrawer(true)
this.$_settingDrawerInstance.visible = true
},
renderNavbarActions(defaultActions) {
@ -129,7 +125,7 @@ export default {
//layout
beforeCreate() {
const Drawer = Vue.extend(SettingDrawer)
const instance = new Drawer().$mount()
const instance = new Drawer({data: {getRoot: () => this}}).$mount()
document.body.appendChild(instance.$el)
this.$_settingDrawerInstance = instance
},

@ -1,14 +1,14 @@
import Vue from 'vue'
import Element from 'element-ui'
import ElementPersonal from '@ele'
import '@/asset/style/index.scss'
import App from '@/App'
import store from '@/store'
import router from '@/router'
import '@/asset/icon'
import '@/directive'
import './asset/style/index.scss'
import './asset/icon'
import './directive'
import App from './App'
import store from './store'
import router from './router'
import filters from './filter'
import globalMethod from '@/globalMethod'
import globalMethod from './globalMethod'
Vue.use(Element)
Vue.use(ElementPersonal)

@ -1,5 +1,5 @@
import {injectDefaultRoute} from 'el-admin-layout'
import Layout from "@/layout"
import Redirect from "@/view/_app/redirect"
import Login from "@/view/_app/login/index"
import Page403 from "@/view/_app/403"
import Page404 from "@/view/_app/404"
@ -13,16 +13,7 @@ export function getDynamicRoutes() {
//系统自有路由
export default [
{
path: '/redirect',
component: Layout,
children: [
{
path: '*',
component: Redirect
}
]
},
...injectDefaultRoute(Layout),
{
path: '/login',
alias: '/register',

@ -1,22 +0,0 @@
import {isEmpty} from "@/util"
const beforeEach = (to, from, next) => {
//若是共用组件的路由页面之间的跳转,借助redirect避免组件复用
const a = to.meta.commonModule, b = from.meta.commonModule
const isComponentReuse = !isEmpty(a) && a === b
if (isComponentReuse) {
//这里vue-router会报redirect错误,已在下方忽略
return next(`/redirect${to.fullPath}`)
}
next()
}
export default function (router) {
router.beforeEach(beforeEach)
}
window.addEventListener('unhandledrejection', event => {
if (event.reason.stack && event.reason.stack.startsWith('Error: Redirected when going from')) {
event.preventDefault()
}
})

@ -1,22 +0,0 @@
import {pageMutations} from "el-admin-layout"
const beforeEach = (to, from, next) => {
//从iframe页面离开时,判断是否需要删除iframe
if (from.meta.iframe) {
//如果设置了无缓存或是进行了刷新,那么移除iframe
const del = from.meta.noCache || to.path === `/redirect${from.path}`
pageMutations.closeIframe({src: from.meta.iframe, del})
}
//跳转至iframe页面时,打开iframe
if (to.meta.iframe) {
pageMutations.openIframe({src: to.meta.iframe})
}
next()
}
export default function (router) {
router.beforeEach(beforeEach)
}

@ -1,13 +1,7 @@
import nprogress from './nprogress'
import avoidReuse from './avoidReuse'
import setTitle from './setTitle'
import accessControl from './accessControl'
import iframe from './iframe'
export default function (router) {
nprogress(router)
avoidReuse(router)
accessControl(router)
setTitle(router)
iframe(router)
}

@ -1,10 +1,11 @@
import NProgress from 'nprogress'
import {Const} from 'el-admin-layout'
NProgress.configure({showSpinner: false})
const beforeEach = (to, from, next) => {
//使用redirect进行跳转时不显示进度条
!to.path.startsWith('/redirect') && NProgress.start()
!to.path.startsWith(Const.redirectPath) && NProgress.start()
next()
}

@ -1,20 +0,0 @@
import {title} from "@/config"
const beforeEach = (to, from, next) => {
const {path, meta} = to
if (!path.startsWith('/redirect')) {
if (typeof meta.dynamicTitle === 'function') {
meta.title = meta.dynamicTitle(to, from)
}
const pageTitle = meta.title
document.title = pageTitle ? `${pageTitle} - ${title}` : title
}
next()
}
export default function (router) {
router.beforeEach(beforeEach)
}

@ -29,8 +29,7 @@ const router = {
}
},
activeMenu: '/purchase/order',
usePathKey: true,
commonModule: '@/view/admin/purchase/order/detail'
usePathKey: true
}
},
{
@ -58,8 +57,7 @@ const router = {
}
},
activeMenu: '/purchase/inbound',
usePathKey: true,
commonModule: '@/view/admin/purchase/inbound/detail'
usePathKey: true
}
}
]

@ -29,8 +29,7 @@ const router = {
}
},
activeMenu: '/sell/order',
usePathKey: true,
commonModule: '@/view/admin/sell/order/detail'
usePathKey: true
}
},
{
@ -58,8 +57,7 @@ const router = {
}
},
activeMenu: '/sell/outbound',
usePathKey: true,
commonModule: '@/view/admin/sell/outbound/detail'
usePathKey: true
}
}
]

@ -16,8 +16,7 @@ export default {
component: 'example/test/cache/detail',
meta: {
title: '详情页1',
usePathKey: true,
commonModule: '@/view/example/test/cache/detailPage'
usePathKey: true
}
},
{
@ -25,8 +24,7 @@ export default {
component: 'example/test/cache/detail',
meta: {
title: '详情页2',
usePathKey: true,
commonModule: '@/view/example/test/cache/detailPage'
usePathKey: true
}
}
]

@ -1,3 +1,4 @@
import {Const} from 'el-admin-layout'
import store from '@/store'
import {uppercaseFirst} from "@/filter"
import {isEmpty} from "@/util"
@ -12,7 +13,7 @@ import {isEmpty} from "@/util"
export function needAuth(route) {
const {path, meta} = route
if (!meta || path.startsWith('/redirect')) return false
if (!meta || path.startsWith(Const.redirectPath)) return false
if (isEmpty(meta.title) && isEmpty(meta.dynamicTitle)) return false

@ -1,4 +1,9 @@
export {isMobile} from "el-admin-layout/src/util"
import {Const} from "el-admin-layout"
export function isMobile() {
const rect = document.body.getBoundingClientRect()
return rect.width <= Const.maxMobileWidth
}
/**
* 获取元素的内宽扣除左右padding后

@ -2,7 +2,7 @@
* 路由控制工具类
*/
import router from "@/router"
import {refreshPage as refreshLayoutPage, closeCurrentPage as closeLayoutCurrentPage} from "el-admin-layout/src/util"
import {refreshPage as refreshLayoutPage, closeCurrentPage as closeLayoutCurrentPage} from "el-admin-layout/src/helper"
/**
* 路由刷新

@ -1,12 +0,0 @@
<script>
import {replaceAll} from "@/util"
export default {
mounted() {
const {fullPath} = this.$route
this.$router.replace(`${replaceAll(fullPath, '/redirect', '')}`)
},
render: h => h()
}
</script>

@ -14,7 +14,7 @@
</template>
<script>
import {ContextMenu} from "el-admin-layout"
import ContextMenu from "el-admin-layout/src/component/TagsView/ContextMenu"
import CategoryTree from '@/component/biz/CategoryTree'
import {add, del, getAll} from "@/api/system/category"
import {isEmpty, waitUntilSuccess} from '@/util'

@ -48,7 +48,7 @@
* 详情见iview-admin
* https://admin.iviewui.com/component/org_tree_page
*/
import {ContextMenu} from "el-admin-layout"
import ContextMenu from "el-admin-layout/src/component/TagsView/ContextMenu"
import EditDialog from "./component/EditDialog"
import OrgTreeView from "./component/OrgTreeView"
import ZoomControl from './component/ZoomControl'

@ -202,8 +202,7 @@ export default {
noAuth: false,
iframe: null,
usePathKey: false,
useFullPathKey: false,
commonModule: null
useFullPathKey: false
},
metaStr: null,
admin: false,

@ -1,5 +1,5 @@
<template>
<abstract-dialog :loading="loading" title="上传头像" :value="value" width="50%" @close="clear">
<abstract-dialog :loading="loading" title="上传头像" :value="value" width="50%" @close="close">
<div class="avatar-cropper cropper-bg">
<div v-show="!img" class="avatar-cropper-bg cropper-bg" title="选择图片" @click="handleBgClick"/>
@ -54,6 +54,10 @@ export default {
!this.img && this.chooseImage()
},
close() {
this.closeDialog()
this.clear()
},
clear() {
this.loading = false
this.cropper && this.cropper.destroy()

Loading…
Cancel
Save