Merge branch 'master' into deploy
This commit is contained in:
commit
10d9007f81
|
@ -4,15 +4,24 @@
|
||||||
<svg-icon class-name="size-icon" icon-class="size" />
|
<svg-icon class-name="size-icon" icon-class="size" />
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item :disabled="size==='medium'" command="medium">Medium</el-dropdown-item>
|
<el-dropdown-item v-for="item of sizeOptions" :key="item.value" :disabled="size===item.value" :command="item.value">{{
|
||||||
<el-dropdown-item :disabled="size==='small'" command="small">Small</el-dropdown-item>
|
item.label }}</el-dropdown-item>
|
||||||
<el-dropdown-item :disabled="size==='mini'" command="mini">Mini</el-dropdown-item>
|
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
sizeOptions: [
|
||||||
|
{ label: 'Default', value: 'default' },
|
||||||
|
{ label: 'Medium', value: 'medium' },
|
||||||
|
{ label: 'Small', value: 'small' },
|
||||||
|
{ label: 'Mini', value: 'mini' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
size() {
|
size() {
|
||||||
return this.$store.getters.size
|
return this.$store.getters.size
|
||||||
|
|
|
@ -56,23 +56,27 @@ export default {
|
||||||
this.width = this.width + 'px'
|
this.width = this.width + 'px'
|
||||||
this.isSticky = true
|
this.isSticky = true
|
||||||
},
|
},
|
||||||
reset() {
|
handleReset() {
|
||||||
if (!this.active) {
|
if (!this.active) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
this.position = ''
|
this.position = ''
|
||||||
this.width = 'auto'
|
this.width = 'auto'
|
||||||
this.active = false
|
this.active = false
|
||||||
this.isSticky = false
|
this.isSticky = false
|
||||||
},
|
},
|
||||||
handleScroll() {
|
handleScroll() {
|
||||||
this.width = this.$el.getBoundingClientRect().width
|
const width = this.$el.getBoundingClientRect().width
|
||||||
|
this.width = width || 'auto'
|
||||||
const offsetTop = this.$el.getBoundingClientRect().top
|
const offsetTop = this.$el.getBoundingClientRect().top
|
||||||
if (offsetTop < this.stickyTop) {
|
if (offsetTop < this.stickyTop) {
|
||||||
this.sticky()
|
this.sticky()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.reset()
|
this.handleReset()
|
||||||
},
|
},
|
||||||
handleReize() {
|
handleReize() {
|
||||||
if (this.isSticky) {
|
if (this.isSticky) {
|
||||||
|
|
|
@ -82,8 +82,7 @@ export default {
|
||||||
const reader = new FileReader()
|
const reader = new FileReader()
|
||||||
reader.onload = e => {
|
reader.onload = e => {
|
||||||
const data = e.target.result
|
const data = e.target.result
|
||||||
const fixedData = this.fixData(data)
|
const workbook = XLSX.read(data, { type: 'array' })
|
||||||
const workbook = XLSX.read(btoa(fixedData), { type: 'base64' })
|
|
||||||
const firstSheetName = workbook.SheetNames[0]
|
const firstSheetName = workbook.SheetNames[0]
|
||||||
const worksheet = workbook.Sheets[firstSheetName]
|
const worksheet = workbook.Sheets[firstSheetName]
|
||||||
const header = this.getHeaderRow(worksheet)
|
const header = this.getHeaderRow(worksheet)
|
||||||
|
@ -95,14 +94,6 @@ export default {
|
||||||
reader.readAsArrayBuffer(rawFile)
|
reader.readAsArrayBuffer(rawFile)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fixData(data) {
|
|
||||||
let o = ''
|
|
||||||
let l = 0
|
|
||||||
const w = 10240
|
|
||||||
for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)))
|
|
||||||
o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
|
|
||||||
return o
|
|
||||||
},
|
|
||||||
getHeaderRow(sheet) {
|
getHeaderRow(sheet) {
|
||||||
const headers = []
|
const headers = []
|
||||||
const range = XLSX.utils.decode_range(sheet['!ref'])
|
const range = XLSX.utils.decode_range(sheet['!ref'])
|
||||||
|
|
|
@ -10,8 +10,8 @@ import 'element-ui/lib/theme-chalk/index.css'
|
||||||
import '@/styles/index.scss' // global css
|
import '@/styles/index.scss' // global css
|
||||||
|
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import router from './router'
|
|
||||||
import store from './store'
|
import store from './store'
|
||||||
|
import router from './router'
|
||||||
|
|
||||||
import i18n from './lang' // Internationalization
|
import i18n from './lang' // Internationalization
|
||||||
import './icons' // icon
|
import './icons' // icon
|
||||||
|
|
|
@ -36,7 +36,7 @@ function filterAsyncRouter(routes, roles) {
|
||||||
|
|
||||||
const permission = {
|
const permission = {
|
||||||
state: {
|
state: {
|
||||||
routers: constantRouterMap,
|
routers: [],
|
||||||
addRouters: []
|
addRouters: []
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
|
|
|
@ -58,8 +58,26 @@
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// menu hover
|
||||||
|
.submenu-title-noDropdown,
|
||||||
|
.el-submenu__title {
|
||||||
|
&:hover {
|
||||||
|
background-color: $menuHover !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.is-active>.el-submenu__title {
|
.is-active>.el-submenu__title {
|
||||||
color: #f4f4f5 !important;
|
color: $subMenuActiveText !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
& .nest-menu .el-submenu>.el-submenu__title,
|
||||||
|
& .el-submenu .el-menu-item {
|
||||||
|
min-width: $sideBarWidth !important;
|
||||||
|
background-color: $subMenuBg !important;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: $subMenuHover !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,16 +126,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-container .nest-menu .el-submenu>.el-submenu__title,
|
|
||||||
.sidebar-container .el-submenu .el-menu-item {
|
|
||||||
min-width: $sideBarWidth !important;
|
|
||||||
background-color: $subMenuBg !important;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: $menuHover !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-menu--collapse .el-menu .el-submenu {
|
.el-menu--collapse .el-menu .el-submenu {
|
||||||
min-width: $sideBarWidth !important;
|
min-width: $sideBarWidth !important;
|
||||||
}
|
}
|
||||||
|
@ -135,6 +143,7 @@
|
||||||
|
|
||||||
&.hideSidebar {
|
&.hideSidebar {
|
||||||
.sidebar-container {
|
.sidebar-container {
|
||||||
|
pointer-events: none;
|
||||||
transition-duration: 0.3s;
|
transition-duration: 0.3s;
|
||||||
transform: translate3d(-$sideBarWidth, 0, 0);
|
transform: translate3d(-$sideBarWidth, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -150,10 +159,19 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// when menu collapsed
|
||||||
.el-menu--vertical {
|
.el-menu--vertical {
|
||||||
&>.el-menu {
|
&>.el-menu {
|
||||||
.svg-icon {
|
.svg-icon {
|
||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nest-menu .el-submenu>.el-submenu__title,
|
||||||
|
.el-menu-item {
|
||||||
|
&:hover {
|
||||||
|
// You can use $subMenuHover
|
||||||
|
background-color: $menuHover !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,26 @@ $yellow:#FEC171;
|
||||||
$panGreen: #30B08F;
|
$panGreen: #30B08F;
|
||||||
|
|
||||||
//sidebar
|
//sidebar
|
||||||
|
$menuText:#bfcbd9;
|
||||||
|
$menuActiveText:#409EFF;
|
||||||
|
$subMenuActiveText:#f4f4f5; //https://github.com/ElemeFE/element/issues/12951
|
||||||
|
|
||||||
$menuBg:#304156;
|
$menuBg:#304156;
|
||||||
|
$menuHover:#263445;
|
||||||
|
|
||||||
$subMenuBg:#1f2d3d;
|
$subMenuBg:#1f2d3d;
|
||||||
$menuHover:#001528;
|
$subMenuHover:#001528;
|
||||||
|
|
||||||
$sideBarWidth: 180px;
|
$sideBarWidth: 180px;
|
||||||
|
|
||||||
|
// the :export directive is the magic sauce for webpack
|
||||||
|
:export {
|
||||||
|
menuText: $menuText;
|
||||||
|
menuActiveText: $menuActiveText;
|
||||||
|
subMenuActiveText: $subMenuActiveText;
|
||||||
|
menuBg: $menuBg;
|
||||||
|
menuHover: $menuHover;
|
||||||
|
subMenuBg: $subMenuBg;
|
||||||
|
subMenuHover: $subMenuHover;
|
||||||
|
sideBarWidth: $sideBarWidth;
|
||||||
|
}
|
||||||
|
|
|
@ -11,7 +11,12 @@ export function parseTime(time, cFormat) {
|
||||||
if (typeof time === 'object') {
|
if (typeof time === 'object') {
|
||||||
date = time
|
date = time
|
||||||
} else {
|
} else {
|
||||||
if (('' + time).length === 10) time = parseInt(time) * 1000
|
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||||
|
time = parseInt(time)
|
||||||
|
}
|
||||||
|
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||||
|
time = time * 1000
|
||||||
|
}
|
||||||
date = new Date(time)
|
date = new Date(time)
|
||||||
}
|
}
|
||||||
const formatObj = {
|
const formatObj = {
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
:show-timeout="200"
|
:show-timeout="200"
|
||||||
:default-active="$route.path"
|
:default-active="$route.path"
|
||||||
:collapse="isCollapse"
|
:collapse="isCollapse"
|
||||||
|
:background-color="variables.menuBg"
|
||||||
|
:text-color="variables.menuText"
|
||||||
|
:active-text-color="variables.menuActiveText"
|
||||||
mode="vertical"
|
mode="vertical"
|
||||||
background-color="#304156"
|
|
||||||
text-color="#bfcbd9"
|
|
||||||
active-text-color="#409EFF"
|
|
||||||
>
|
>
|
||||||
<sidebar-item v-for="route in permission_routers" :key="route.path" :item="route" :base-path="route.path"/>
|
<sidebar-item v-for="route in permission_routers" :key="route.path" :item="route" :base-path="route.path"/>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
|
@ -17,6 +17,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import SidebarItem from './SidebarItem'
|
import SidebarItem from './SidebarItem'
|
||||||
|
import variables from '@/styles/variables.scss'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { SidebarItem },
|
components: { SidebarItem },
|
||||||
|
@ -25,6 +26,9 @@ export default {
|
||||||
'permission_routers',
|
'permission_routers',
|
||||||
'sidebar'
|
'sidebar'
|
||||||
]),
|
]),
|
||||||
|
variables() {
|
||||||
|
return variables
|
||||||
|
},
|
||||||
isCollapse() {
|
isCollapse() {
|
||||||
return !this.sidebar.opened
|
return !this.sidebar.opened
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue