fix: Related sessions模块精简代码

This commit is contained in:
刘洪洪
2022-11-18 16:39:10 +08:00
parent 0f5bd8a7a7
commit 8d461ef200

View File

@@ -108,17 +108,17 @@ export default {
divRed.style.width = this.sessionData.serverSessions divRed.style.width = this.sessionData.serverSessions
} else { } else {
this.isNoData = true this.isNoData = true
this.changeErrorOrNodata() this.changeByErrorOrNodata()
} }
} else { } else {
this.showError = true this.showError = true
this.errorMsg = res.message this.errorMsg = res.message
this.changeErrorOrNodata() this.changeByErrorOrNodata()
} }
}).catch(error => { }).catch(error => {
this.showError = true this.showError = true
this.errorMsg = error.message this.errorMsg = error.message
this.changeErrorOrNodata() this.changeByErrorOrNodata()
}).finally(() => { }).finally(() => {
this.toggleLoading(false) this.toggleLoading(false)
}) })
@@ -126,7 +126,7 @@ export default {
/** /**
* 当无数据或者报错时改变界面样式,出现灰条 * 当无数据或者报错时改变界面样式,出现灰条
*/ */
changeErrorOrNodata () { changeByErrorOrNodata () {
const divGray = document.getElementById('gray') const divGray = document.getElementById('gray')
divGray.style.borderRadius = 4 + 'px' divGray.style.borderRadius = 4 + 'px'
divGray.style.width = '100%' divGray.style.width = '100%'