diff --git a/nezha-fronted/src/assets/css/common/loading.scss b/nezha-fronted/src/assets/css/common/loading.scss index 91ba5125a..effc792d5 100644 --- a/nezha-fronted/src/assets/css/common/loading.scss +++ b/nezha-fronted/src/assets/css/common/loading.scss @@ -1,5 +1,25 @@ // https://github.com/loadingio/css-spinner/tree/master/dist 从当前链接现在在 在tools.js 的myLoading 进行判断处理 // 高度 宽度 等细节 记得处理 +.my-loading-parent--relative { + height: 100%; + width: 100%; + position: relative !important; +} +.my-loading-box { + height: 100%; + width: 100%; + position: relative !important; +} +.my-loading{ + position: absolute; + width: 48px; + height: 48px; + top: 50%; + left: 50%; + margin-top: 0; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); +} loading-hide{ display: none; diff --git a/nezha-fronted/src/components/common/globalSearch/globalSearch.vue b/nezha-fronted/src/components/common/globalSearch/globalSearch.vue index 0e3315b05..b0804dd41 100644 --- a/nezha-fronted/src/components/common/globalSearch/globalSearch.vue +++ b/nezha-fronted/src/components/common/globalSearch/globalSearch.vue @@ -340,7 +340,7 @@ export default { route += 'asset' } else { tableId = type + 'Table' - route += 'monitor/' + type + route += type } let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + tableId) if (!(pageSize && pageSize !== 'undefined')) { diff --git a/nezha-fronted/src/components/common/js/tools.js b/nezha-fronted/src/components/common/js/tools.js index ed29b4643..fd0a4d07a 100644 --- a/nezha-fronted/src/components/common/js/tools.js +++ b/nezha-fronted/src/components/common/js/tools.js @@ -146,7 +146,13 @@ function myLoadingFunction (el, binding, vnode) { // div内部加入内容 // div.innerHTML = '加载中...' // el 元素设置相对定位 div设置绝对定位 - el.setAttribute('class', 'el-loading-parent--relative') + console.log(el.className) + const elClassname = el.className.split(' ') + if (elClassname.indexOf('my-loading-parent--relative') === -1) { + className.push('my-loading-parent--relative') + el.className = className.join(' ') + } + // el.setAttribute('class', 'el-loading-parent--relative') // 设置绝对定位 div.setAttribute('class', className) } else {