From 88fa954fa648ac9c584faac669405db24b757166 Mon Sep 17 00:00:00 2001 From: xiayifan Date: Fri, 12 Jun 2020 15:05:45 +0800 Subject: [PATCH] scalar threshold feature v2 --- .../ui/src/views/train-manage/operator.vue | 9 + .../ui/src/views/train-manage/scalar.vue | 254 +++++++++++------- 2 files changed, 163 insertions(+), 100 deletions(-) diff --git a/mindinsight/ui/src/views/train-manage/operator.vue b/mindinsight/ui/src/views/train-manage/operator.vue index eeb532b..3dba870 100644 --- a/mindinsight/ui/src/views/train-manage/operator.vue +++ b/mindinsight/ui/src/views/train-manage/operator.vue @@ -313,10 +313,19 @@ export default { destroyed() { // Remove the listener of window size change window.removeEventListener('resize', this.resizeCallback); + this.$bus.$off('resize'); }, methods: { init() { this.getCoreTypeList(); + this.$bus.$on('resize', this.resizeEchart); + }, + resizeEchart() { + if (this.coreCharts.chartDom) { + setTimeout(() => { + this.coreCharts.chartDom.resize(); + }, 200); + } }, /** * Current device change diff --git a/mindinsight/ui/src/views/train-manage/scalar.vue b/mindinsight/ui/src/views/train-manage/scalar.vue index 1ed333b..061bc81 100644 --- a/mindinsight/ui/src/views/train-manage/scalar.vue +++ b/mindinsight/ui/src/views/train-manage/scalar.vue @@ -91,7 +91,7 @@ limitations under the License.
-
{{$t("scalar.currentThreshold")}}:{{sampleItem.pieceStr}}
+
{{$t("scalar.currentThreshold")}}:{{sampleItem.pieceStr || "-"}}