add footer
This commit is contained in:
parent
8e3f2cf6a3
commit
8876e015ae
21180
package-lock.json
generated
21180
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
17
src/views/main-footer.vue
Normal file
17
src/views/main-footer.vue
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<template>
|
||||||
|
<div class="footerbar">
|
||||||
|
© 中建材智能自动化研究院有限公司
|
||||||
|
<!-- © {{ 'copyright.company' | i18nFilter }} -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.footerbar{
|
||||||
|
width: 100%;
|
||||||
|
height: 20px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #C7C7C7;
|
||||||
|
margin: 5px 0;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,102 +1,121 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-loading.fullscreen.lock="loading" :element-loading-text="$t('loading')" :class="['aui-wrapper', { 'aui-sidebar--fold': $store.state.sidebarFold }]">
|
<div
|
||||||
|
v-loading.fullscreen.lock="loading"
|
||||||
|
:element-loading-text="$t('loading')"
|
||||||
|
:class="['aui-wrapper', { 'aui-sidebar--fold': $store.state.sidebarFold }]"
|
||||||
|
>
|
||||||
<template v-if="!loading">
|
<template v-if="!loading">
|
||||||
<main-navbar />
|
<main-navbar />
|
||||||
<main-sidebar />
|
<main-sidebar />
|
||||||
<div class="aui-content__wrapper">
|
<div class="aui-content__wrapper">
|
||||||
<main-content v-if="!$store.state.contentIsNeedRefresh" />
|
<main-content v-if="!$store.state.contentIsNeedRefresh" />
|
||||||
|
<main-footer />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MainNavbar from './main-navbar'
|
import MainNavbar from "./main-navbar";
|
||||||
import MainSidebar from './main-sidebar'
|
import MainSidebar from "./main-sidebar";
|
||||||
import MainContent from './main-content'
|
import MainContent from "./main-content";
|
||||||
import debounce from 'lodash/debounce'
|
import MainFooter from "./main-footer";
|
||||||
|
import debounce from "lodash/debounce";
|
||||||
export default {
|
export default {
|
||||||
provide () {
|
provide() {
|
||||||
return {
|
return {
|
||||||
// 刷新
|
// 刷新
|
||||||
refresh () {
|
refresh() {
|
||||||
this.$store.state.contentIsNeedRefresh = true
|
this.$store.state.contentIsNeedRefresh = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$store.state.contentIsNeedRefresh = false
|
this.$store.state.contentIsNeedRefresh = false;
|
||||||
})
|
});
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data () {
|
};
|
||||||
|
},
|
||||||
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true
|
loading: true,
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
MainNavbar,
|
MainNavbar,
|
||||||
MainSidebar,
|
MainSidebar,
|
||||||
MainContent
|
MainFooter,
|
||||||
|
MainContent,
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route: 'routeHandle'
|
$route: "routeHandle",
|
||||||
},
|
},
|
||||||
created () {
|
created() {
|
||||||
this.windowResizeHandle()
|
this.windowResizeHandle();
|
||||||
this.routeHandle(this.$route)
|
this.routeHandle(this.$route);
|
||||||
Promise.all([
|
Promise.all([this.getUserInfo(), this.getPermissions()]).then(() => {
|
||||||
this.getUserInfo(),
|
this.loading = false;
|
||||||
this.getPermissions()
|
});
|
||||||
]).then(() => {
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 窗口改变大小
|
// 窗口改变大小
|
||||||
windowResizeHandle () {
|
windowResizeHandle() {
|
||||||
this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false
|
this.$store.state.sidebarFold =
|
||||||
window.addEventListener('resize', debounce(() => {
|
document.documentElement["clientWidth"] <= 992 || false;
|
||||||
this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false
|
window.addEventListener(
|
||||||
}, 150))
|
"resize",
|
||||||
|
debounce(() => {
|
||||||
|
this.$store.state.sidebarFold =
|
||||||
|
document.documentElement["clientWidth"] <= 992 || false;
|
||||||
|
}, 150)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
// 路由, 监听
|
// 路由, 监听
|
||||||
routeHandle (route) {
|
routeHandle(route) {
|
||||||
if (!route.meta.isTab) {
|
if (!route.meta.isTab) {
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
var tab = this.$store.state.contentTabs.filter(item => item.name === route.name)[0]
|
var tab = this.$store.state.contentTabs.filter(
|
||||||
|
(item) => item.name === route.name
|
||||||
|
)[0];
|
||||||
if (!tab) {
|
if (!tab) {
|
||||||
tab = {
|
tab = {
|
||||||
...window.SITE_CONFIG['contentTabDefault'],
|
...window.SITE_CONFIG["contentTabDefault"],
|
||||||
...route.meta,
|
...route.meta,
|
||||||
'name': route.name,
|
name: route.name,
|
||||||
'params': { ...route.params },
|
params: { ...route.params },
|
||||||
'query': { ...route.query }
|
query: { ...route.query },
|
||||||
|
};
|
||||||
|
this.$store.state.contentTabs = this.$store.state.contentTabs.concat(
|
||||||
|
tab
|
||||||
|
);
|
||||||
}
|
}
|
||||||
this.$store.state.contentTabs = this.$store.state.contentTabs.concat(tab)
|
this.$store.state.sidebarMenuActiveName = tab.menuId;
|
||||||
}
|
this.$store.state.contentTabsActiveName = tab.name;
|
||||||
this.$store.state.sidebarMenuActiveName = tab.menuId
|
|
||||||
this.$store.state.contentTabsActiveName = tab.name
|
|
||||||
},
|
},
|
||||||
// 获取当前管理员信息
|
// 获取当前管理员信息
|
||||||
getUserInfo () {
|
getUserInfo() {
|
||||||
return this.$http.get('/sys/user/info').then(({ data: res }) => {
|
return this.$http
|
||||||
|
.get("/sys/user/info")
|
||||||
|
.then(({ data: res }) => {
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
return this.$message.error(res.msg)
|
return this.$message.error(res.msg);
|
||||||
}
|
}
|
||||||
this.$store.state.user.id = res.data.id
|
this.$store.state.user.id = res.data.id;
|
||||||
this.$store.state.user.name = res.data.username
|
this.$store.state.user.name = res.data.username;
|
||||||
this.$store.state.user.superAdmin = res.data.superAdmin
|
this.$store.state.user.superAdmin = res.data.superAdmin;
|
||||||
}).catch(() => {})
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
// 获取权限
|
// 获取权限
|
||||||
getPermissions () {
|
getPermissions() {
|
||||||
return this.$http.get('/sys/menu/permissions').then(({ data: res }) => {
|
return this.$http
|
||||||
|
.get("/sys/menu/permissions")
|
||||||
|
.then(({ data: res }) => {
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
return this.$message.error(res.msg)
|
return this.$message.error(res.msg);
|
||||||
}
|
}
|
||||||
window.SITE_CONFIG['permissions'] = res.data
|
window.SITE_CONFIG["permissions"] = res.data;
|
||||||
}).catch(() => {})
|
})
|
||||||
}
|
.catch(() => {});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user