Merge branch 'dev' of https://git.mesalab.cn/cyber-narrator/cn-ui into dev
# Conflicts: # src/views/charts/Chart2.vue
This commit is contained in:
@@ -12,9 +12,11 @@
|
||||
:error-info="errorInfo"
|
||||
:chart-data="chartData"
|
||||
:chart-info="chartInfo"
|
||||
:table="table"
|
||||
@loadMore="loadMore"
|
||||
@refresh="refresh"
|
||||
@showFullscreen="showFullscreen"
|
||||
@tableChange="tableChange"
|
||||
></chart-header>
|
||||
<!-- chart -->
|
||||
<!-- 数据查询后传入chart组件,chart组件内不查询,只根据接传递的数据来渲染 -->
|
||||
@@ -29,6 +31,7 @@
|
||||
:is-error="isError"
|
||||
:loading="loading"
|
||||
:entity="entity"
|
||||
:table="table"
|
||||
:is-fullscreen="isFullscreen"
|
||||
@showLoading="showLoading"
|
||||
></chart>
|
||||
@@ -141,7 +144,10 @@ export default {
|
||||
table: {
|
||||
pageSize: chartTableDefaultPageSize,
|
||||
limit: chartTableTopOptions[0], // top-n
|
||||
orderBy: 'sessions'
|
||||
orderBy: 'sessions',
|
||||
tableColumns: [], // table字段
|
||||
tableData: [], // table的所有数据
|
||||
currentPageData: [] // table当前页的数据
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -186,6 +192,9 @@ export default {
|
||||
}
|
||||
if (response.code === 200) {
|
||||
this.chartData = response.data.result
|
||||
this.table.tableData = response.data.result
|
||||
this.table.tableColumns = this.getTableTitle(response.data.result)
|
||||
this.table.currentPageData = this.getTargetPageData(1, this.table.pageSize, this.table.tableData)
|
||||
this.resultType = response.data.resultType
|
||||
this.isError = false
|
||||
} else {
|
||||
@@ -230,6 +239,7 @@ export default {
|
||||
this.standaloneTimeRange.use = true
|
||||
this.standaloneTimeRange.startTime = myStartTime
|
||||
this.standaloneTimeRange.endTime = myEndTime
|
||||
this.emitter.emit('chart-pageNo')
|
||||
this.getChartData(null, {}, true)
|
||||
},
|
||||
showFullscreen (show) {
|
||||
@@ -284,6 +294,13 @@ export default {
|
||||
},
|
||||
showLoading (show) {
|
||||
this.loading = show
|
||||
},
|
||||
tableChange () {
|
||||
this.emitter.emit('chart-pageNo')
|
||||
this.getChartData()
|
||||
},
|
||||
getTargetPageData (pageNum, pageSize, tableData) {
|
||||
return this.$_.slice(tableData, (pageNum - 1) * pageSize, pageNum * pageSize)
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
||||
Reference in New Issue
Block a user