From c3aaf28f7316cce12eec007a9f85a96cbcddeec2 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 07 五月 2025 10:34:20 +0800
Subject: [PATCH] 最新版本541200007
---
admin/src/router/index.js | 64 +++++++++++++++++++++++++++++---
1 files changed, 58 insertions(+), 6 deletions(-)
diff --git a/admin/src/router/index.js b/admin/src/router/index.js
index 0078cd0..3d06d31 100644
--- a/admin/src/router/index.js
+++ b/admin/src/router/index.js
@@ -60,16 +60,16 @@
return
}
// 濡傛灉璁块棶鐨勬槸鐧诲綍椤甸潰锛屽垯鐩存帴璺宠浆鑷抽椤�
- if (to.name === 'login') {
- next({ name: 'index' })
- return
- }
+ // if (to.name === 'login') {
+ // next({ name: 'index' })
+ // return
+ // }
next()
return
}
if (to.name === 'login') {
- next()
- return
+ next()
+ return
}
getUserInfo()
.then(userInfo => {
@@ -98,4 +98,56 @@
})
})
+router.afterEach((to, from, failure) => {
+ setTimeout(function () {
+ computeTableHeightIndex()
+ window.addEventListener('resize', function(){
+ computeTableHeightIndex()}
+ )
+ }, 1000)
+
+})
+function computeTableHeightIndex () {
+ const height = window.innerHeight
+ // console.log('beforeEach========================锛�' + height)
+ const height13 = getEleHeghtByClassName('common-header', 0)
+ const height4 = getEleHeghtByClassName('table-pagination', 0,-20)
+ const height5 = document.getElementsByTagName('thead') && document.getElementsByTagName('thead')[0] ? document.getElementsByTagName('thead')[0].clientHeight : 0
+ if (document.getElementsByClassName('main_app') && document.getElementsByClassName('main_app')[0]) {
+ // console.log('main_app========================')
+ // alert(height)
+ const height3 = getEleHeghtByClassName('main-header', 0)
+ const height2 = getEleHeghtByClassName('toolbar', 0)
+ const height6 = getEleHeghtByClassName('doumee-filter', 0, 16)
+ const height7 = getEleHeghtByClassName('pt16', 0, 0)
+ const height9 = getEleHeghtByClassName('static_wrap', 0)
+ const height10 = getEleHeghtByClassName('query_btns', 0)
+ const height11 = getEleHeghtByClassName('el-tabs-ele', 0)
+ const height12 = getEleHeghtByClassName('platgroup_tabs', 0,20)
+ router.app.$store.commit('setTableHeightNew', height -10 - height2 - height3 - height4 - height5 - height6 - height7 - height9 - height10 - height11 - height12 - height13)
+ console.log('gableHeightNew', router.app.$store.state.tableHeightNew)
+ } else {
+ // console.log('tableLayout========================')
+ const height1 = getEleHeghtByClassName('table-search-form', 40, 16)
+ const height3 = getEleHeghtByClassName('main-header', 0)
+ // const height4 = getEleHeghtByClassName('table-pagination', 0,-20)
+ const height2 = getEleHeghtByClassName('toolbar', 0)
+ console.log('defualtlength', document.getElementsByClassName('table-search-form').length)
+ router.app.$store.commit('setTableHeightNew', height - height4 - height3 - height2 - height1 - height5 - height13)
+ console.log('gableHeightNew', router.app.$store.state.tableHeightNew)
+ }
+}
+
+function getEleHeghtByClassName (name, dv, margin) {
+ if ((document.getElementsByClassName(name) && document.getElementsByClassName(name)[0])) {
+ let t = 0
+ document.getElementsByClassName(name).forEach(e => {
+ // console.log(name + '========================' + t + ':' + e.clientHeight)
+ t++
+ })
+ return document.getElementsByClassName(name)[document.getElementsByClassName(name).length - 1].clientHeight + (margin || 0)
+ }
+ return dv || 0
+}
+
export default router
--
Gitblit v1.9.3