diff options
| author | zhangyu <[email protected]> | 2023-06-15 11:43:36 +0800 |
|---|---|---|
| committer | zhangyu <[email protected]> | 2023-06-15 11:43:36 +0800 |
| commit | ed052e4f077f63ae97ae12968c3cbaf14c88a98f (patch) | |
| tree | 2831e7985fdc3fa0d2fa2f2ce2e52a6bae274e84 | |
| parent | 1007414e61b1b0af1bb52cafed6a809860127454 (diff) | |
NEZ-2688 fix:Explore使用快照后单位有误
| -rw-r--r-- | nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue index 7d90dc7fd..e09068a2a 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue @@ -3,7 +3,7 @@ <div style="display: flex;justify-content: space-between;align-items: center;margin-bottom: 10px;"> <span>{{dataJson.type == 1 ? 'Metric expression' : 'Log expression'}}</span> <span> - <chart-unit v-model="chartUnit" class="margin-r-10"></chart-unit> + <chart-unit v-model="chartUnitType" class="margin-r-10"></chart-unit> </span> </div> <div v-for="(item, index) in dataJson.data" :key = 'index' style="display: flex;margin-bottom: 10px"> @@ -22,7 +22,7 @@ <template v-if="showMetrics"> <el-collapse-item name="1" :title="$t('explore.graph')" class="el-collapse-item__height"> <div class="chart-room"> - <chart ref="exploreChart" :unit="chartUnit" :timeRange="filterTime"></chart> + <chart ref="exploreChart" :unit="chartUnitType" :timeRange="filterTime"></chart> </div> </el-collapse-item> <el-collapse-item class="el-collapse-item__height" name="2" title="Table"> @@ -94,7 +94,7 @@ <template v-else> <el-collapse-item v-if="showTab.indexOf('1') > -1" name="1" :title="$t('explore.graph')" class="el-collapse-item__height"> <div class="chart-room"> - <chart ref="logChart" :unit="chartUnit" v-my-loading="chartLoading" :timeRange="filterTime"></chart> + <chart ref="logChart" :unit="chartUnitType" v-my-loading="chartLoading" :timeRange="filterTime"></chart> </div> </el-collapse-item> <el-collapse-item v-if="showTab.indexOf('2') > -1" name="2" title="Logs"> @@ -136,7 +136,7 @@ export default { pageSize: 20, total: 0 }, - chartUnit: 1, + chartUnitType: 1, filterTime: [], tools: { loading: false, // 是否显示table加载动画 @@ -162,7 +162,8 @@ export default { } else { this.showMetrics = false } - this.chartUnit = this.dataJson.unit || 1 + this.chartUnitType = this.dataJson.unit || 1 + this.$refs.chartUnit.unit = this.dataJson.unit || 1 this.expressionChange() window.addEventListener('resize', this.logsCollapseChange) }, @@ -230,7 +231,7 @@ export default { values: ['', val] } } - this.$set(metrics, 'value#' + index, chartDataFormat.getUnit(this.chartUnit || 2).compute(result.values[0][1], null, 2)) + this.$set(metrics, 'value#' + index, chartDataFormat.getUnit(this.chartUnitType || 2).compute(result.values[0][1], null, 2)) this.$set(metrics, 'time', bus.timeFormate(bus.computeTimezone(result.values[0][0] * 1000))) for (const key in metrics) { @@ -558,7 +559,7 @@ export default { } }, watch: { - chartUnit: { + chartUnitType: { handler (n, o) { this.expressionChange() } |
