diff --git a/nezha-fronted/src/assets/css/common/index.scss b/nezha-fronted/src/assets/css/common/index.scss index 5f683d057..65dee4c1b 100644 --- a/nezha-fronted/src/assets/css/common/index.scss +++ b/nezha-fronted/src/assets/css/common/index.scss @@ -3,3 +3,4 @@ @import './tableCommon.scss'; @import './rightBoxCommon.scss'; @import './tooltip.scss'; +@import './loading.scss'; diff --git a/nezha-fronted/src/assets/css/common/loading.scss b/nezha-fronted/src/assets/css/common/loading.scss new file mode 100644 index 000000000..63658822c --- /dev/null +++ b/nezha-fronted/src/assets/css/common/loading.scss @@ -0,0 +1,78 @@ +// https://github.com/loadingio/css-spinner/tree/master/dist 从当前链接现在在 在tools.js 的myLoading 进行判断处理 +// 高度 宽度 等细节 记得处理 +// 1 +.lds-dual-ring, +.lds-dual-ring:after { + box-sizing: border-box; +} +.lds-dual-ring { + display: inline-block; + width: 80px; + height: 80px; +} +.lds-dual-ring:after { + content: " "; + display: block; + width: 64px; + height: 64px; + margin: 8px; + border-radius: 50%; + border: 6.4px solid currentColor; + border-color: currentColor transparent currentColor transparent; + animation: lds-dual-ring 1.2s linear infinite; +} +@keyframes lds-dual-ring { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} +// 2 +.ldsFacebook, +.ldsFacebook div { + box-sizing: border-box; +} +.ldsFacebook { + display: inline-block; + position: relative; + width: 40px; + height: 32px; +} +.ldsFacebook div { + display: inline-block; + position: absolute; + left: 8px; + width: 8px; + background: $--background-color-empty; + animation: ldsFacebook 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite; +} +.ldsFacebook div:nth-child(1) { + left: 8px; + background: $--background-color-empty; + filter: invert(50%); + animation-delay: -0.24s; +} +.ldsFacebook div:nth-child(2) { + left: 20px; + background: $--background-color-empty; + filter: invert(50%); + animation-delay: -0.12s; +} +.ldsFacebook div:nth-child(3) { + left: 32px; + background: $--background-color-empty; + filter: invert(50%); + animation-delay: 0s; +} +@keyframes ldsFacebook { + 0% { + top: 8px; + height: 32px; + } + 50%, 100% { + top: 12px; + height: 16px; + } +} diff --git a/nezha-fronted/src/assets/css/components/common/alert/alertDaysInfo.scss b/nezha-fronted/src/assets/css/components/common/alert/alertDaysInfo.scss new file mode 100644 index 000000000..79d33fd06 --- /dev/null +++ b/nezha-fronted/src/assets/css/components/common/alert/alertDaysInfo.scss @@ -0,0 +1,13 @@ +.alert-days-info{ + display: flex; + height: 100%; + width: 100%; + > div{ + width: 14px; + height: 24px; + margin-right: 5px; + border-radius: 2px; + background-color:$--color-success; + cursor: pointer; + } +} diff --git a/nezha-fronted/src/assets/css/components/index.scss b/nezha-fronted/src/assets/css/components/index.scss index 14d2fbab5..c09beccae 100644 --- a/nezha-fronted/src/assets/css/components/index.scss +++ b/nezha-fronted/src/assets/css/components/index.scss @@ -5,6 +5,7 @@ @import './common/alert/alertLabel.scss'; @import './common/alert/alertRuleInfo.scss'; @import './common/alert/selectAlertSilence.scss'; +@import './common/alert/alertDaysInfo.scss'; @import './common/bottomBox/bottomBox.scss'; @import './common/bottomBox/panelTabNew.scss'; @import './common/bottomBox/terminalLogCMDTab.scss'; diff --git a/nezha-fronted/src/components/common/alert/alertDaysInfo.vue b/nezha-fronted/src/components/common/alert/alertDaysInfo.vue new file mode 100644 index 000000000..f2237bdb8 --- /dev/null +++ b/nezha-fronted/src/components/common/alert/alertDaysInfo.vue @@ -0,0 +1,75 @@ + + + + + diff --git a/nezha-fronted/src/components/common/js/tools.js b/nezha-fronted/src/components/common/js/tools.js index 3c29f5d01..8cf1614f7 100644 --- a/nezha-fronted/src/components/common/js/tools.js +++ b/nezha-fronted/src/components/common/js/tools.js @@ -98,6 +98,61 @@ function isEqual (o1, o2) { } return isEqualForInner(o1, o2) } +export const myLoading = { + bind: myLoadingFunction, + update: myLoadingFunction, + unbind: function (el, binding) { + const className = binding.arg || 'el-loading-mask' + const ds = el.getElementsByClassName(className)[0] + if (ds) { + el.removeChild(ds) + } + } +} +function myLoadingFunction (el, binding, vnode) { + const className = binding.arg || 'el-loading-mask' + const ds = el.getElementsByClassName(className)[0] + if (binding.value) { + if (ds) { + return + } + // 若果是true创建一个div + const div = document.createElement('div') + div.style.textAlign = 'center' + if (binding.modifiers.scaleMin) { + div.style.transform = 'scale(0.5)' + } + if (binding.modifiers.scaleMax) { + div.style.transform = 'scale(2)' + } + if (className === 'ldsFacebook') { + const newDiv1 = document.createElement('div') + const newDiv2 = document.createElement('div') + const newDiv3 = document.createElement('div') + div.appendChild(newDiv1) + div.appendChild(newDiv2) + div.appendChild(newDiv3) + } + if (className === 'el-loading-mask') { + const newDiv1 = document.createElement('div') + newDiv1.setAttribute('class', 'el-loading-spinner') + div.appendChild(newDiv1) + } + // 插入到被绑定的元素内部 + el.appendChild(div) + // div内部加入内容 + // div.innerHTML = '加载中...' + // el 元素设置相对定位 div设置绝对定位 + el.setAttribute('class', 'elrelative') + // 设置绝对定位 + div.setAttribute('class', className) + } else { + // 去掉div 去掉样式 去掉定位 + if (ds) { + el.removeChild(ds) + } + } +} export const cancelWithChange = { bind: function (el, binding) { if (!binding.value || !binding.value.obj) return diff --git a/nezha-fronted/src/components/common/table/asset/assetTable.vue b/nezha-fronted/src/components/common/table/asset/assetTable.vue index 59714a659..34e491f52 100644 --- a/nezha-fronted/src/components/common/table/asset/assetTable.vue +++ b/nezha-fronted/src/components/common/table/asset/assetTable.vue @@ -43,7 +43,13 @@ {{scope.row.endpointNum ? scope.row.endpointNum : 0}}