|
|
@@ -1,117 +1,157 @@
|
|
|
<template>
|
|
|
<div class="panel">
|
|
|
<div class="flex-align-stretch">
|
|
|
- <asideTemp @getModules="getModules"></asideTemp>
|
|
|
- <div style="flex:100" class="body__panel">
|
|
|
- <headeTemp></headeTemp>
|
|
|
+ <asideTemp ref="AsideTemp" @getModules="getModules"></asideTemp>
|
|
|
+ <div style="flex: 100" class="body__panel">
|
|
|
+ <headeTemp @onRender="onRender"></headeTemp>
|
|
|
<div>
|
|
|
-<!-- <menuTemp class="sticky normal-margin" :style="marginTrue ? 'margin-bottom:70px !important' : 'margin-bottom:16px'" ref="menu" style="background: red"></menuTemp>-->
|
|
|
- <menuTemp class="sticky normal-margin" ref="menu" @switch="debouned"></menuTemp>
|
|
|
- <div class="radius" ref="divContent" :style="{'marginTop':divTop,'height':divHeight}">
|
|
|
+ <!-- <menuTemp class="sticky normal-margin" :style="marginTrue ? 'margin-bottom:70px !important' : 'margin-bottom:16px'" ref="menu" style="background: red"></menuTemp>-->
|
|
|
+ <menuTemp
|
|
|
+ class="sticky normal-margin"
|
|
|
+ ref="menu"
|
|
|
+ @switch="debouned"
|
|
|
+ ></menuTemp>
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-if="dateNow"
|
|
|
+ class="radius"
|
|
|
+ ref="divContent"
|
|
|
+ :style="{ marginTop: divTop, height: divHeight }"
|
|
|
+ >
|
|
|
<keep-alive :include="pageCache">
|
|
|
<router-view></router-view>
|
|
|
</keep-alive>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-else
|
|
|
+ class="radius"
|
|
|
+ ref="divContent"
|
|
|
+ :style="{ marginTop: divTop, height: divHeight }"
|
|
|
+ >
|
|
|
+ <keep-alive :include="pageCache">
|
|
|
+ </keep-alive>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <navTemp @getModules="getModules"></navTemp>
|
|
|
+ <navTemp @getModules="getModules"></navTemp>
|
|
|
</div>
|
|
|
<socketMessage></socketMessage>
|
|
|
<el-dialog
|
|
|
- :title="$t('提示')"
|
|
|
- style="margin-top: calc(28vh)"
|
|
|
- :visible.sync="dialogVisible"
|
|
|
- width="500px"
|
|
|
- :before-close="handleClose"
|
|
|
- >
|
|
|
- <span>{{$t('当前密码为初始密码,请前往修改密码')}}</span>
|
|
|
+ :title="$t('提示')"
|
|
|
+ style="margin-top: calc(28vh)"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="500px"
|
|
|
+ :before-close="handleClose"
|
|
|
+ >
|
|
|
+ <span>{{ $t("当前密码为初始密码,请前往修改密码") }}</span>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button size="small" @click="onClose">{{$t('取 消')}}</el-button>
|
|
|
- <el-button size="small" type="primary" @click="goPassword">{{$t('确 定')}}</el-button>
|
|
|
- </span>
|
|
|
+ <el-button size="small" @click="onClose">{{ $t("取 消") }}</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="goPassword">{{
|
|
|
+ $t("确 定")
|
|
|
+ }}</el-button>
|
|
|
+ </span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import headeTemp from './modules/header.vue'
|
|
|
-import asideTemp from './modules/aside.vue'
|
|
|
-import menuTemp from './modules/menu.vue'
|
|
|
-import navTemp from './modules/navRight.vue'
|
|
|
-import socketMessage from '@/components/socketMessage/index.vue'
|
|
|
+import headeTemp from "./modules/header.vue";
|
|
|
+import asideTemp from "./modules/aside.vue";
|
|
|
+import menuTemp from "./modules/menu.vue";
|
|
|
+import navTemp from "./modules/navRight.vue";
|
|
|
+import socketMessage from "@/components/socketMessage/index.vue";
|
|
|
|
|
|
-import {mapGetters} from 'vuex'
|
|
|
+import { mapGetters } from "vuex";
|
|
|
|
|
|
export default {
|
|
|
- components:{
|
|
|
+ components: {
|
|
|
headeTemp,
|
|
|
asideTemp,
|
|
|
menuTemp,
|
|
|
navTemp,
|
|
|
socketMessage,
|
|
|
-
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters({
|
|
|
- pageCache: 'pageCache'
|
|
|
- })
|
|
|
+ pageCache: "pageCache",
|
|
|
+ }),
|
|
|
},
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
- timer:null,
|
|
|
- marginTrue:false,
|
|
|
- divHeight:'',
|
|
|
- divTop:'',
|
|
|
- dialogVisible:false
|
|
|
- }
|
|
|
+ timer: null,
|
|
|
+ marginTrue: false,
|
|
|
+ divHeight: "",
|
|
|
+ divTop: "",
|
|
|
+ dialogVisible: false,
|
|
|
+ show: true,
|
|
|
+ dateNow: Date.now(),
|
|
|
+ };
|
|
|
},
|
|
|
- methods:{
|
|
|
- getModules (mod,type) {
|
|
|
+ methods: {
|
|
|
+ onRender() {
|
|
|
+ this.$refs.menu.rander();
|
|
|
+ this.$refs.AsideTemp.dateNow = Date.now();
|
|
|
+ this.$refs.AsideTemp.systemList = JSON.parse(
|
|
|
+ sessionStorage.getItem("module_info")
|
|
|
+ );
|
|
|
+ //部分路由切换后依旧不刷新,强制重新渲染
|
|
|
+ if(["salesfunnel"].includes(this.$route.name)) this.dateNow = false
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.debouned();
|
|
|
+ this.dateNow = Date.now();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getModules(mod, type) {
|
|
|
// this.$refs['menu'].setModules(mod,type)
|
|
|
},
|
|
|
- debouned () {
|
|
|
+ debouned() {
|
|
|
if (this.timer) {
|
|
|
- clearTimeout(this.timer)
|
|
|
+ clearTimeout(this.timer);
|
|
|
}
|
|
|
this.timer = setTimeout(() => {
|
|
|
- let size = this.$refs.menu.$refs.menuList.$el.clientHeight / 40 -1
|
|
|
- if (this.$refs.menu.$refs.menuList.$el.clientHeight === 80){
|
|
|
- this.divTop =(this.$refs.menu.$refs.menuList.$el.clientHeight - (25 * size)) + 'px'
|
|
|
- }else {
|
|
|
- this.divTop = 0 + 'px'
|
|
|
+ let size = this.$refs.menu.$refs.menuList.$el.clientHeight / 40 - 1;
|
|
|
+ if (this.$refs.menu.$refs.menuList.$el.clientHeight === 80) {
|
|
|
+ this.divTop =
|
|
|
+ this.$refs.menu.$refs.menuList.$el.clientHeight - 25 * size + "px";
|
|
|
+ } else {
|
|
|
+ this.divTop = 0 + "px";
|
|
|
}
|
|
|
|
|
|
- /* this.divHeight = (this.$refs.divContent.clientHeight - this.$refs.menu.$refs.menuList.$el.clientHeight + 10) + 'px'*/
|
|
|
- /* if (this.$refs.menu.$el.clientWidth < 1206 && Array.from(this.$refs.menu.$el.getElementsByTagName('li')).filter(item => item.className.indexOf('el-submenu') != -1).length > 8) {
|
|
|
+ /* this.divHeight = (this.$refs.divContent.clientHeight - this.$refs.menu.$refs.menuList.$el.clientHeight + 10) + 'px'*/
|
|
|
+ /* if (this.$refs.menu.$el.clientWidth < 1206 && Array.from(this.$refs.menu.$el.getElementsByTagName('li')).filter(item => item.className.indexOf('el-submenu') != -1).length > 8) {
|
|
|
this.marginTrue = true
|
|
|
} else {
|
|
|
this.marginTrue = false
|
|
|
}*/
|
|
|
- },200)
|
|
|
+ }, 200);
|
|
|
},
|
|
|
- goPassword(){
|
|
|
- this.dialogVisible = false
|
|
|
- this.$router.push('/user_center')
|
|
|
- sessionStorage.setItem('password','1')
|
|
|
- sessionStorage.setItem('isPassword','1')
|
|
|
+ goPassword() {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.$router.push("/user_center");
|
|
|
+ sessionStorage.setItem("password", "1");
|
|
|
+ sessionStorage.setItem("isPassword", "1");
|
|
|
},
|
|
|
- handleClose(){
|
|
|
- this.dialogVisible = false
|
|
|
- sessionStorage.setItem('password','1')
|
|
|
- sessionStorage.setItem('isPassword','0')
|
|
|
+ handleClose() {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ sessionStorage.setItem("password", "1");
|
|
|
+ sessionStorage.setItem("isPassword", "0");
|
|
|
+ },
|
|
|
+ onClose() {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ sessionStorage.setItem("password", "1");
|
|
|
+ sessionStorage.setItem("isPassword", "0");
|
|
|
},
|
|
|
- onClose(){
|
|
|
- this.dialogVisible = false
|
|
|
- sessionStorage.setItem('password','1')
|
|
|
- sessionStorage.setItem('isPassword','0')
|
|
|
- }
|
|
|
},
|
|
|
mounted() {
|
|
|
- if (JSON.parse(sessionStorage.getItem('active_password')) == '1' && JSON.parse(sessionStorage.getItem('password')) != '1'){
|
|
|
- this.dialogVisible = true
|
|
|
+ if (
|
|
|
+ JSON.parse(sessionStorage.getItem("active_password")) == "1" &&
|
|
|
+ JSON.parse(sessionStorage.getItem("password")) != "1"
|
|
|
+ ) {
|
|
|
+ this.dialogVisible = true;
|
|
|
}
|
|
|
/*this.debouned()*/
|
|
|
- /* console.log('长度')
|
|
|
+ /* console.log('长度')
|
|
|
console.log(this.$refs.menu.$refs.menuList.$el.clientHeight,'高度')
|
|
|
console.log(this.$refs.menu.$refs.menuList.$el.clientHeight % 60)
|
|
|
if (this.$refs.menu.$refs.menuList.$el.clientHeight === 120){
|
|
|
@@ -121,45 +161,42 @@ export default {
|
|
|
}*/
|
|
|
},
|
|
|
created() {
|
|
|
- window.addEventListener('resize',this.debouned)
|
|
|
+ window.addEventListener("resize", this.debouned);
|
|
|
this.$nextTick(() => {
|
|
|
- this.debouned()
|
|
|
- })
|
|
|
+ this.debouned();
|
|
|
+ });
|
|
|
},
|
|
|
-}
|
|
|
-
|
|
|
+};
|
|
|
</script>
|
|
|
<style>
|
|
|
-.panel{
|
|
|
+.panel {
|
|
|
background: url("../../assets/wallhaven-0pq8gm.jpeg") no-repeat;
|
|
|
background-size: cover;
|
|
|
}
|
|
|
-.el-menu{
|
|
|
- border-right:0
|
|
|
+.el-menu {
|
|
|
+ border-right: 0;
|
|
|
}
|
|
|
</style>
|
|
|
<style scoped>
|
|
|
-.body__panel{
|
|
|
+.body__panel {
|
|
|
height: 100vh;
|
|
|
/* padding-right: 16px; */
|
|
|
padding-right: 60px;
|
|
|
margin-right: 10px;
|
|
|
overflow-y: scroll;
|
|
|
}
|
|
|
-.body__panel::-webkit-scrollbar{
|
|
|
- display:none !important;
|
|
|
-
|
|
|
+.body__panel::-webkit-scrollbar {
|
|
|
+ display: none !important;
|
|
|
}
|
|
|
.sticky {
|
|
|
position: sticky;
|
|
|
}
|
|
|
-.radius{
|
|
|
+.radius {
|
|
|
/* margin: 16px 0; */
|
|
|
- border-radius:10px;
|
|
|
+ border-radius: 10px;
|
|
|
overflow: hidden;
|
|
|
box-shadow: 0 2px 5px rgb(0 0 0 / 10%);
|
|
|
- transform: translate3d(0,-2px,0);
|
|
|
+ transform: translate3d(0, -2px, 0);
|
|
|
background: #fff;
|
|
|
}
|
|
|
-
|
|
|
</style>
|