修改: 调整布局,解决全局动画导致的界面抖动问题;
| | |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | <style lang="less" scoped> |
| | | #id{ |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="exception"> |
| | | <div class="exception-page" :style="{minHeight: layoutMinHeight - 64 + 'px'}"> |
| | | <div class="img"> |
| | | <img :src="config[type].img" /> |
| | | <!--<div class="ele" :style="{backgroundImage: `url(${config[type].img})`}"/>--> |
| | | </div> |
| | | <div class="content"> |
| | | <h1>{{config[type].title}}</h1> |
| | |
| | | return { |
| | | config: Config |
| | | } |
| | | } |
| | | }, |
| | | inject: ['layoutMinHeight'] |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .exception{ |
| | | min-height: 500px; |
| | | height: 80%; |
| | | .exception-page{ |
| | | border-radius: 4px; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | text-align: center; |
| | | margin-top: 150px; |
| | | background-color: white; |
| | | .img{ |
| | | display: inline-block; |
| | | padding-right: 52px; |
| | |
| | | } |
| | | .content{ |
| | | display: inline-block; |
| | | flex: auto; |
| | | h1{ |
| | | color: #434e59; |
| | | font-size: 72px; |
| | |
| | | </img-checkbox-group> |
| | | </setting-item> |
| | | <setting-item title="主题色"> |
| | | <color-checkbox-group @change="onColorChange" :defaultValues="[0]" :multiple="false"> |
| | | <color-checkbox-group @change="onColorChange" :defaultValues="[5]" :multiple="false"> |
| | | <color-checkbox v-for="(color, index) in colors" :key="index" :color="color" :value="index" /> |
| | | </color-checkbox-group> |
| | | </setting-item> |
| | |
| | | colors: ['#f5222d', '#fa541c', '#faad14', '#13c2c2', '#52c41a', '#1d92ff', '#2f54eb', '#722ed1'], |
| | | } |
| | | }, |
| | | watch: { |
| | | animate(){ |
| | | this.direction = 0 |
| | | } |
| | | }, |
| | | computed: { |
| | | animateCfg() { |
| | | return this.animates[this.animate] |
| | |
| | | direction = animate.directions[0] |
| | | } else { |
| | | direction = animate.directions.find(item => item == this.direction) |
| | | direction = (direction == undefined || direction === 'default') ? '' : direction |
| | | } |
| | | window.console.log(direction) |
| | | direction = (direction == undefined || direction === 'default') ? '' : direction |
| | | if (direction != '') { |
| | | direction = isLeave && this.reverse ? this.reversePosition(direction, animate.directions) : direction |
| | | direction = direction[0].toUpperCase() + direction.substring(1) |
| | |
| | | <template> |
| | | <a-layout> |
| | | <a-layout class="global-layout"> |
| | | <drawer v-if="isMobile" :openDrawer="collapsed" @change="onDrawerChange"> |
| | | <sider-menu :theme="theme" :menuData="menuData" :collapsed="false" :collapsible="false" @menuSelect="onMenuSelect"/> |
| | | </drawer> |
| | |
| | | </div> |
| | | <setting /> |
| | | </drawer> |
| | | <a-layout> |
| | | <a-layout class="global-layout-main"> |
| | | <global-header :menuData="menuData" :collapsed="collapsed" @toggleCollapse="toggleCollapse"/> |
| | | <a-layout-content :style="{minHeight: minHeight, padding: '24px 24px 0', position: 'relative'}"> |
| | | <a-layout-content class="global-layout-content" :style="{minHeight: minHeight, padding: '24px 24px 0', position: 'relative'}"> |
| | | <slot></slot> |
| | | </a-layout-content> |
| | | <a-layout-footer style="padding: 0px"> |
| | |
| | | import SiderMenu from '../components/menu/SiderMenu' |
| | | import Setting from '../components/setting/Setting' |
| | | |
| | | const minHeight = window.innerHeight - 64 - 24 - 122 |
| | | const minHeight = window.innerHeight - 64 - 122 |
| | | |
| | | let menuData = [] |
| | | |
| | |
| | | collapsed: false, |
| | | menuData: menuData, |
| | | showSetting: false |
| | | } |
| | | }, |
| | | provide() { |
| | | return{ |
| | | layoutMinHeight: minHeight, |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .setting{ |
| | | background-color: #1890ff; |
| | | color: #fff; |
| | | border-radius: 5px 0 0 5px; |
| | | line-height: 40px; |
| | | font-size: 22px; |
| | | width: 40px; |
| | | height: 40px; |
| | | box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15); |
| | | .global-layout{ |
| | | height: 100vh; |
| | | .global-layout-main{ |
| | | height: 100vh; |
| | | overflow-y: scroll; |
| | | scrollbar-color: @primary-color @primary-2; |
| | | scrollbar-width: thin; |
| | | &::-webkit-scrollbar{ |
| | | width: 3px; |
| | | height: 1px; |
| | | } |
| | | &::-webkit-scrollbar-thumb { |
| | | border-radius: 3px; |
| | | background: @primary; |
| | | } |
| | | &::-webkit-scrollbar-track { |
| | | -webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0); |
| | | border-radius: 3px; |
| | | background: @primary-3; |
| | | } |
| | | } |
| | | .global-layout-content{ |
| | | } |
| | | .setting{ |
| | | background-color: #1890ff; |
| | | color: #fff; |
| | | border-radius: 5px 0 0 5px; |
| | | line-height: 40px; |
| | | font-size: 22px; |
| | | width: 40px; |
| | | height: 40px; |
| | | box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15); |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <global-layout> |
| | | <contextmenu :itemList="menuItemList" :visible.sync="menuVisible" @select="onMenuSelect" /> |
| | | <a-tabs |
| | | @contextmenu.native="e => onContextmenu(e)" |
| | | v-if="multiPage" |
| | | :active-key="activePage" |
| | | style="margin-top: -8px; margin-bottom: 8px" |
| | | :hide-add="true" |
| | | type="editable-card" |
| | | @change="changePage" |
| | | @edit="editPage"> |
| | | <a-tab-pane :key="page.fullPath" v-for="page in pageList"> |
| | | <span slot="tab" :pagekey="page.fullPath">{{page.name}}</span> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <page-toggle-transition :animate="animate.name" :direction="animate.direction"> |
| | | <keep-alive v-if="multiPage"> |
| | | <router-view /> |
| | | </keep-alive> |
| | | <router-view v-else /> |
| | | </page-toggle-transition> |
| | | <contextmenu :itemList="menuItemList" :visible.sync="menuVisible" @select="onMenuSelect" /> |
| | | <a-tabs |
| | | @contextmenu.native="e => onContextmenu(e)" |
| | | v-if="multiPage" |
| | | :active-key="activePage" |
| | | style="margin-top: -8px; margin-bottom: 8px" |
| | | :hide-add="true" |
| | | type="editable-card" |
| | | @change="changePage" |
| | | @edit="editPage"> |
| | | <a-tab-pane :key="page.fullPath" v-for="page in pageList"> |
| | | <span slot="tab" :pagekey="page.fullPath">{{page.name}}</span> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <page-toggle-transition :animate="animate.name" :direction="animate.direction"> |
| | | <keep-alive v-if="multiPage"> |
| | | <router-view /> |
| | | </keep-alive> |
| | | <router-view v-else /> |
| | | </page-toggle-transition> |
| | | </global-layout> |
| | | </template> |
| | | |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | <style scoped lang="less"> |
| | | .menu-view{ |
| | | .menu-view-content{ |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div style="margin: -24px -24px 0px"> |
| | | <div class="page-layout"> |
| | | <page-header :breadcrumb="breadcrumb" :title="title" :logo="logo" :avatar="avatar"> |
| | | <slot name="action" slot="action"></slot> |
| | | <slot slot="content" name="headerContent"></slot> |
| | |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .page-header{ |
| | | margin: -24px -24px 0; |
| | | } |
| | | .link{ |
| | | margin-top: 16px; |
| | | line-height: 24px; |
| | |
| | | } |
| | | .page-content{ |
| | | position: relative; |
| | | padding: 24px 24px 0; |
| | | &.side{ |
| | | padding: 24px 24px 0; |
| | | } |
| | | &.head{ |
| | | padding: 24px 0 0; |
| | | margin: 0 auto; |
| | | max-width: 1400px; |
| | | } |
| | | } |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | <style scoped lang="less"> |
| | | .exception-page{ |
| | | margin: -24px 0 0; |
| | | } |
| | | </style> |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | <style scoped lang="less"> |
| | | .exception-page{ |
| | | margin: -24px 0 0; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <exception-page type="500" /> |
| | | <exception-page type="500" /> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | <style scoped lang="less"> |
| | | .exception-page{ |
| | | margin: -24px 0 0; |
| | | } |
| | | </style> |
| | |
| | | multiPage: true, |
| | | animates: animates, |
| | | animate: { |
| | | name: 'back', |
| | | name: 'bounce', |
| | | direction: 'left' |
| | | } |
| | | }, |
| | |
| | | @import "../theme"; |
| | | @import '~ant-design-vue/lib/style/color/colors.less'; |
| | | @primary: #1890ff; |
| | | @primary-color: @primary; |
| | | @processing-color: @primary; |
| | | @link-color: @primary; |
| | | |
| | | @primary-1: color(~`colorPalette('@{primary}', 1) `); |
| | | @primary-2: color(~`colorPalette('@{primary}', 2) `); |
| | | @primary-3: color(~`colorPalette('@{primary}', 3) `); |
| | | @primary-4: color(~`colorPalette('@{primary}', 4) `); |
| | | @primary-5: color(~`colorPalette('@{primary}', 5) `); |
| | | @primary-6: color(~`colorPalette('@{primary}', 6) `); |
| | | @primary-7: color(~`colorPalette('@{primary}', 7) `); |
| | | @primary-8: color(~`colorPalette('@{primary}', 8) `); |
| | | @primary-9: color(~`colorPalette('@{primary}', 9) `); |
| | | @primary-10: color(~`colorPalette('@{primary}', 10) `); |
| | |
| | | @primary: #1890ff; |
| | | @import "./default/index"; |
| | |
| | | // let path = require('path') |
| | | let path = require('path') |
| | | const ThemeColorReplacer = require('webpack-theme-color-replacer') |
| | | const getThemeColors = require('./src/utils/themeUtil').getThemeColors |
| | | const themeColor = require('./src/config').themeColor |
| | | |
| | | module.exports = { |
| | | // transpileDependencies: ['webpack-theme-color-replacer'], |
| | | pluginOptions: { |
| | | 'style-resources-loader': { |
| | | preProcessor: 'less', |
| | | // patterns: [path.resolve(__dirname, "./src/theme/theme.less")] |
| | | patterns: [] |
| | | patterns: [path.resolve(__dirname, "./src/theme/theme.less")], |
| | | } |
| | | }, |
| | | configureWebpack: config => { |