fix: 修复detection顶部柱状图数据没有按时间排序的问题,修复app图逻辑问题

This commit is contained in:
chenjinsong
2023-02-10 14:20:07 +08:00
parent 6f8631f947
commit 6ed9c4f5fe
2 changed files with 5 additions and 2 deletions

View File

@@ -247,7 +247,7 @@ export default {
handleData (prevRequest, request, _t) {
this.toggleLoading(true)
Promise.all([prevRequest, request]).then(res => {
this.isNoData = (res[0].data.result.length && res[1].data.result.length) === 0
this.isNoData = res[0].data.result.length === 0 && res[1].data.result.length === 0
if (this.isNoData) {
this.appData = this.appData.map(t => {
return {

View File

@@ -294,7 +294,7 @@ export default {
const chartDom = document.getElementById(`eventSeverityTrendBar${this.pageType}`)
const eventSeverityTrendOption = this.$_.cloneDeep(multipleBarOption)
const xData = []
let xData = []
dataMap.forEach(function (value) {
// eventSeverityTrendOption.series[Number(getSeriesIndex(key))].data = value.map(v => Number(v[1]))
value.forEach(item => {
@@ -303,6 +303,9 @@ export default {
}
})
})
xData = xData.sort((a, b) => {
return new Date(a) - new Date(b)
})
eventSeverityTrendOption.series.forEach(serie => {
const seriesData = []
xData.forEach(item => {