feat: loading和部分nodata处理;地图功能

This commit is contained in:
chenjinsong
2022-08-21 22:11:53 +08:00
parent c4cf810011
commit ab19220e0d
17 changed files with 257 additions and 162 deletions

View File

@@ -37,7 +37,6 @@
</svg>
<div class="table-no-data__title">{{ $t('npm.thereNoEvents') }}</div>
</div>
<!-- <div v-else>&nbsp;</div>-->
</template>
</el-table>
</div>
@@ -47,13 +46,11 @@
import { get } from '@/utils/http'
import { api } from '@/utils/api'
import { getSecond } from '@/utils/date-util'
import chartMixin from '@/views/charts2/chart-mixin'
export default {
name: 'NpmRecentEvents',
props: {
chart: Object,
timeFilter: Object
},
mixins: [chartMixin],
data () {
return {
tableData: [],
@@ -62,7 +59,7 @@ export default {
{ label: 'network.entity', prop: 'eventKey' },
{ label: 'detections.eventType', prop: 'eventType' }
],
isNoData: true
isNoData: false
}
},
methods: {
@@ -72,10 +69,18 @@ export default {
endTime: getSecond(this.timeFilter.endTime),
limit: 8
}
this.toggleLoading(true)
get(api.npm.events.recentEvents, params).then(res => {
if (res.code === 200) {
if (!res.data.result || res.data.result.length === 0) {
this.isNoData = true
}
this.tableData = res.data.result
} else {
this.isNoData = true
}
}).finally(() => {
this.toggleLoading(false)
})
}
},