You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

154 lines
3.8 KiB

<template>
<div class="avue-contail" :class="{ 'avue--collapse': isCollapse }">
<div class="avue-layout" :class="{ 'avue-layout--horizontal': isHorizontal }">
<div class="avue-sidebar" v-show="validSidebar">
<!-- 左侧导航栏 -->
<logo />
<sidebar />
</div>
<div class="avue-main">
<!-- 顶部导航栏 -->
<top ref="top" />
<!-- 顶部标签卡 -->
<tags />
<search class="avue-view" v-show="isSearch"></search>
<!-- 主体视图层 -->
<div id="avue-view" v-show="!isSearch" v-if="isRefresh">
<router-view #="{ Component }">
<keep-alive>
<component :is="Component" />
</keep-alive>
</router-view>
</div>
</div>
</div>
<!-- <wechat></wechat> -->
</div>
</template>
<script>
import index from '@/mixins/index';
import wechat from './wechat.vue';
//import { validatenull } from 'utils/validate';
import { mapGetters } from 'vuex';
import tags from './tags.vue';
import search from './search.vue';
import logo from './logo.vue';
import top from './top/index.vue';
import sidebar from './sidebar/index.vue';
import { getMyCurrentWarehouse } from '@/api/work/work';
export default {
mixins: [index],
components: {
top,
logo,
tags,
search,
sidebar,
wechat,
},
name: 'index',
provide() {
return {
index: this,
};
},
computed: {
...mapGetters([
'isHorizontal',
'isRefresh',
'isLock',
'isCollapse',
'isSearch',
'menu',
'setting',
'userInfo',
]),
validSidebar() {
return !(
(this.$route.meta || {}).menu === false || (this.$route.query || {}).menu === 'false'
);
},
},
data() {
return {
TabName: null,
};
},
created() {
getMyCurrentWarehouse().then(res => {
if (res.data.data == null) {
console.log('当前没有数据');
localStorage.setItem('WarehouseName', void 0);
return;
}
localStorage.setItem('WarehouseName', res.data.data.name);
});
},
mounted() {
if (this.userInfo.tenant_id == '000000') {
let obj = JSON.parse(JSON.stringify(this.setting));
obj.debug = true;
this.$store.commit('SERTING', obj);
} else {
let obj = JSON.parse(JSON.stringify(this.setting));
obj.debug = false;
this.$store.commit('SERTING', obj);
}
// 加入需要不刷新的页面
// $store.getters.tagsKeep.push("")
// console.log(obj)
},
props: [],
methods: {
//打开菜单
openMenu(item = {}) {
this.$store.dispatch('GetMenu', item.id).then(data => {
if (data.length !== 0) {
this.$router.$avueRouter.formatRoutes(data, true);
}
//当点击顶部菜单后默认打开第一个菜单
/*if (!this.validatenull(item)) {
let itemActive = {},
childItemActive = 0;
if (item.path) {
itemActive = item;
} else {
if (this.menu[childItemActive].length === 0) {
itemActive = this.menu[childItemActive];
} else {
itemActive = this.menu[childItemActive].children[childItemActive];
}
}
this.$store.commit('SET_MENU_ID', item);
this.$router.push({
path: this.$router.$avueRouter.getPath({
name: (itemActive.label || itemActive.name),
src: itemActive.path
}, itemActive.meta)
});
}*/
});
},
},
};
</script>
<style lang="scss">
.el-card__body {
padding: 10px !important;
}
// .font-day{
// }
.el-popup-parent--hidden font:first-of-type {
z-index: 99999999999;
position: fixed;
top: 3%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
height: 5%;
background-color: #fff;
}
</style>