added ESlint 语法检测
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<el-container class="layout-cont">
|
||||
<el-container :class="[isSider?'openside':'hideside',isMobile ? 'mobile': '']">
|
||||
<el-row :class="[isShadowBg?'shadowBg':'']" @click.native="changeShadow()"></el-row>
|
||||
<el-row :class="[isShadowBg?'shadowBg':'']" @click.native="changeShadow()" />
|
||||
<el-aside class="main-cont main-left">
|
||||
<div class="tilte">
|
||||
<img alt class="logoimg" src="~@/assets/nav_logo.png" />
|
||||
<h2 class="tit-text" v-if="isSider">Gin-Vue-Admin</h2>
|
||||
<img alt class="logoimg" src="~@/assets/nav_logo.png">
|
||||
<h2 v-if="isSider" class="tit-text">Gin-Vue-Admin</h2>
|
||||
</div>
|
||||
<Aside class="aside" />
|
||||
</el-aside>
|
||||
@@ -16,49 +16,49 @@
|
||||
:style="{width: `calc(100% - ${isMobile?'0px':isCollapse?'54px':'220px'})`}"
|
||||
class="topfix"
|
||||
>
|
||||
<el-row>
|
||||
<!-- :xs="8" :sm="6" :md="4" :lg="3" :xl="1" -->
|
||||
<el-header class="header-cont">
|
||||
<el-col :xs="2" :lg="1" :md="1" :sm="1" :xl="1">
|
||||
<div @click="totalCollapse" class="menu-total">
|
||||
<i class="el-icon-s-unfold" v-if="isCollapse"></i>
|
||||
<i class="el-icon-s-fold" v-else></i>
|
||||
<el-row>
|
||||
<!-- :xs="8" :sm="6" :md="4" :lg="3" :xl="1" -->
|
||||
<el-header class="header-cont">
|
||||
<el-col :xs="2" :lg="1" :md="1" :sm="1" :xl="1">
|
||||
<div class="menu-total" @click="totalCollapse">
|
||||
<i v-if="isCollapse" class="el-icon-s-unfold" />
|
||||
<i v-else class="el-icon-s-fold" />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="10" :lg="14" :md='14' :sm="9" :xl="14">
|
||||
<el-breadcrumb class="breadcrumb" separator-class="el-icon-arrow-right">
|
||||
<el-breadcrumb-item
|
||||
:key="item.path"
|
||||
v-for="item in matched.slice(1,matched.length)"
|
||||
>{{item.meta.title}}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</el-col>
|
||||
<el-col :xs="12" :lg="9" :md="9" :sm="14" :xl="9">
|
||||
<div class="fl-right right-box">
|
||||
<Search />
|
||||
<Screenfull class="screenfull" :style="{cursor:'pointer'}"></Screenfull>
|
||||
<el-dropdown>
|
||||
<span class="header-avatar">
|
||||
<CustomPic/>
|
||||
<span style="margin-left: 5px">{{userInfo.nickName}}</span>
|
||||
<i class="el-icon-arrow-down"></i>
|
||||
</span>
|
||||
<el-dropdown-menu class="dropdown-group" slot="dropdown">
|
||||
<el-dropdown-item>
|
||||
<span>
|
||||
更多信息
|
||||
<el-badge is-dot />
|
||||
<el-col :xs="10" :lg="14" :md="14" :sm="9" :xl="14">
|
||||
<el-breadcrumb class="breadcrumb" separator-class="el-icon-arrow-right">
|
||||
<el-breadcrumb-item
|
||||
v-for="item in matched.slice(1,matched.length)"
|
||||
:key="item.path"
|
||||
>{{ item.meta.title }}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</el-col>
|
||||
<el-col :xs="12" :lg="9" :md="9" :sm="14" :xl="9">
|
||||
<div class="fl-right right-box">
|
||||
<Search />
|
||||
<Screenfull class="screenfull" :style="{cursor:'pointer'}" />
|
||||
<el-dropdown>
|
||||
<span class="header-avatar">
|
||||
<CustomPic />
|
||||
<span style="margin-left: 5px">{{ userInfo.nickName }}</span>
|
||||
<i class="el-icon-arrow-down" />
|
||||
</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="toPerson" icon="el-icon-s-custom">个人信息</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="LoginOut" icon="el-icon-table-lamp">登 出</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-dropdown-menu slot="dropdown" class="dropdown-group">
|
||||
<el-dropdown-item>
|
||||
<span>
|
||||
更多信息
|
||||
<el-badge is-dot />
|
||||
</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-s-custom" @click.native="toPerson">个人信息</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-table-lamp" @click.native="LoginOut">登 出</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
</el-header>
|
||||
</el-row>
|
||||
</el-header>
|
||||
</el-row>
|
||||
<!-- 当前面包屑用路由自动生成可根据需求修改 -->
|
||||
<!--
|
||||
:to="{ path: item.path }" 暂时注释不用-->
|
||||
@@ -67,16 +67,16 @@
|
||||
</transition>
|
||||
<transition mode="out-in" name="el-fade-in-linear">
|
||||
<keep-alive>
|
||||
<router-view v-loading="loadingFlag" element-loading-text="正在加载中" class="admin-box" v-if="$route.meta.keepAlive && reloadFlag"></router-view>
|
||||
<router-view v-if="$route.meta.keepAlive && reloadFlag" v-loading="loadingFlag" element-loading-text="正在加载中" class="admin-box" />
|
||||
</keep-alive>
|
||||
</transition>
|
||||
<transition mode="out-in" name="el-fade-in-linear">
|
||||
<router-view v-loading="loadingFlag" element-loading-text="正在加载中" class="admin-box" v-if="!$route.meta.keepAlive && reloadFlag"></router-view>
|
||||
<router-view v-if="!$route.meta.keepAlive && reloadFlag" v-loading="loadingFlag" element-loading-text="正在加载中" class="admin-box" />
|
||||
</transition>
|
||||
<BottomInfo />
|
||||
<BottomInfo />
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
||||
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
@@ -90,18 +90,6 @@ import { mapGetters, mapActions } from 'vuex'
|
||||
import CustomPic from '@/components/customPic'
|
||||
export default {
|
||||
name: 'Layout',
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
isCollapse: false,
|
||||
isSider: true,
|
||||
isMobile: false,
|
||||
isShadowBg: false,
|
||||
loadingFlag:false,
|
||||
reloadFlag:true,
|
||||
value: ''
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Aside,
|
||||
HistoryComponent,
|
||||
@@ -110,28 +98,17 @@ export default {
|
||||
BottomInfo,
|
||||
CustomPic
|
||||
},
|
||||
methods: {
|
||||
...mapActions('user', ['LoginOut']),
|
||||
reload(){
|
||||
this.reloadFlag = false
|
||||
this.$nextTick(()=>{
|
||||
this.reloadFlag = true
|
||||
})
|
||||
},
|
||||
totalCollapse() {
|
||||
this.isCollapse = !this.isCollapse
|
||||
this.isSider = !this.isCollapse
|
||||
this.isShadowBg = !this.isCollapse
|
||||
this.$bus.emit('collapse', this.isCollapse)
|
||||
},
|
||||
toPerson() {
|
||||
this.$router.push({ name: 'person' })
|
||||
},
|
||||
changeShadow() {
|
||||
this.isShadowBg = !this.isShadowBg
|
||||
this.isSider = !!this.isCollapse
|
||||
this.totalCollapse()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
isCollapse: false,
|
||||
isSider: true,
|
||||
isMobile: false,
|
||||
isShadowBg: false,
|
||||
loadingFlag: false,
|
||||
reloadFlag: true,
|
||||
value: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('user', ['userInfo']),
|
||||
@@ -143,7 +120,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let screenWidth = document.body.clientWidth
|
||||
const screenWidth = document.body.clientWidth
|
||||
if (screenWidth < 1000) {
|
||||
this.isMobile = true
|
||||
this.isSider = false
|
||||
@@ -159,16 +136,16 @@ export default {
|
||||
}
|
||||
this.$bus.emit('collapse', this.isCollapse)
|
||||
this.$bus.emit('mobile', this.isMobile)
|
||||
this.$bus.on("reload",this.reload)
|
||||
this.$bus.on("showLoading",()=>{
|
||||
this.$bus.on('reload', this.reload)
|
||||
this.$bus.on('showLoading', () => {
|
||||
this.loadingFlag = true
|
||||
})
|
||||
this.$bus.on("closeLoading",()=>{
|
||||
this.$bus.on('closeLoading', () => {
|
||||
this.loadingFlag = false
|
||||
})
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
let screenWidth = document.body.clientWidth
|
||||
const screenWidth = document.body.clientWidth
|
||||
if (screenWidth < 1000) {
|
||||
this.isMobile = true
|
||||
this.isSider = false
|
||||
@@ -186,9 +163,33 @@ export default {
|
||||
this.$bus.emit('mobile', this.isMobile)
|
||||
})()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions('user', ['LoginOut']),
|
||||
reload() {
|
||||
this.reloadFlag = false
|
||||
this.$nextTick(() => {
|
||||
this.reloadFlag = true
|
||||
})
|
||||
},
|
||||
totalCollapse() {
|
||||
this.isCollapse = !this.isCollapse
|
||||
this.isSider = !this.isCollapse
|
||||
this.isShadowBg = !this.isCollapse
|
||||
this.$bus.emit('collapse', this.isCollapse)
|
||||
},
|
||||
toPerson() {
|
||||
this.$router.push({ name: 'person' })
|
||||
},
|
||||
changeShadow() {
|
||||
this.isShadowBg = !this.isShadowBg
|
||||
this.isSider = !!this.isCollapse
|
||||
this.totalCollapse()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '@/style/mobile.scss';
|
||||
|
||||
@@ -330,7 +331,6 @@ export default {
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// .screenfull {
|
||||
// display: inline-block;
|
||||
// }
|
||||
|
Reference in New Issue
Block a user