fix Network & APP Performance 下钻 请求参数动态获取
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
:npm-network-cycle-data="npmNetworkCycleData"
|
||||
:npm-network-name="npmNetworkName"
|
||||
:time-filter="timeFilter"
|
||||
:chartData="chartData"
|
||||
></single-value>
|
||||
</div>
|
||||
</template>
|
||||
@@ -14,6 +15,7 @@ import { get } from '@/utils/http'
|
||||
import { getSecond } from '@/utils/date-util'
|
||||
import { api } from '@/utils/api'
|
||||
import chartMixin from '@/views/charts2/chart-mixin'
|
||||
import _ from 'lodash'
|
||||
export default {
|
||||
name: 'NpmNetworkQuantity',
|
||||
components: { SingleValue },
|
||||
@@ -27,16 +29,29 @@ export default {
|
||||
{ name: 'networkAppPerformance.packetLoss' },
|
||||
{ name: 'overall.packetRetrans' }
|
||||
],
|
||||
npmNetworkCycleData: []
|
||||
npmNetworkCycleData: [],
|
||||
side: '',
|
||||
chartData: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
npmNetworkCycleQuery () {
|
||||
const condition = this.$store.getters.getQueryCondition.split(/["|'](.*?)["|']/)
|
||||
const type = this.$store.getters.getDimensionType
|
||||
const params = {
|
||||
startTime: getSecond(this.timeFilter.startTime),
|
||||
endTime: getSecond(this.timeFilter.endTime),
|
||||
cycle: 0
|
||||
}
|
||||
if (this.chartData.id === 23) {
|
||||
this.side = 'client'
|
||||
} else {
|
||||
this.side = 'server'
|
||||
}
|
||||
if (condition && type) {
|
||||
params.q = `${type}='${condition[1]}' and side='${this.side}'`
|
||||
params.type = type
|
||||
}
|
||||
const tcp = get(api.npm.overview.tcpSessionDelay, params)
|
||||
const http = get(api.npm.overview.httpResponseDelay, params)
|
||||
const ssl = get(api.npm.overview.sslConDelay, params)
|
||||
@@ -56,6 +71,9 @@ export default {
|
||||
|
||||
},
|
||||
mounted () {
|
||||
if (this.chart) {
|
||||
this.chartData = _.cloneDeep(this.chart)
|
||||
}
|
||||
this.npmNetworkCycleQuery()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user