diff --git a/nezha-fronted/src/components/chart/chartMixin.js b/nezha-fronted/src/components/chart/chartMixin.js index 53323d747..59396f88d 100644 --- a/nezha-fronted/src/components/chart/chartMixin.js +++ b/nezha-fronted/src/components/chart/chartMixin.js @@ -85,7 +85,7 @@ export default { let expressionIndex = expressionIndexs let legend = '' // up let alias = '' - if (expressionIndex >= chartInfo.elements.length) { + if (chartInfo.elements && (expressionIndex >= chartInfo.elements.length)) { expressionIndex -= chartInfo.elements.length legend += 'Previous ' alias += 'Previous ' diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index 3a56581e4..29414988c 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -399,7 +399,6 @@ export default { unitChange (val) { this.$emit('update:chartInfo', 'unit', val) this.chartInfo.unit = val - console.log(this.chartInfo.unit) this.$nextTick(() => { this.$refs.chart && this.$refs.chart.$refs['chart' + this.chartInfo.id].initChart() }) diff --git a/nezha-fronted/src/components/common/pickTime.vue b/nezha-fronted/src/components/common/pickTime.vue index 3e93b0d27..b28585ae0 100644 --- a/nezha-fronted/src/components/common/pickTime.vue +++ b/nezha-fronted/src/components/common/pickTime.vue @@ -163,7 +163,6 @@ export default { }, watch: { unit: { - immediate: true, handler (n, o) { this.$emit('unitChange', n) } diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index e7b19de11..235f025d6 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -194,7 +194,7 @@ export default { this.$put('visual/panel/chart', params).then(response => { if (response.code === 200) { this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') }) - this.$emit('on-create-success') + this.$emit('on-create-success', { id: this.panelId, name: this.panelName }) this.esc(true) } else { this.$message.error(response.msg) @@ -204,7 +204,7 @@ export default { this.$post('visual/panel/chart', params).then(response => { if (response.code === 200) { this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') }) - this.$emit('on-create-success') + this.$emit('on-create-success', { id: this.panelId, name: this.panelName }) this.esc(true) } else { this.$message.error(response.msg) diff --git a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue index 55c907575..8995146ad 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue @@ -529,7 +529,7 @@ export default { }, watch: { selectList (n) { - if (n.length === 1 && !this.chartConfig.param.datasource[0].systemSelect) { + if (!this.chartConfig.param.datasource[0].systemSelect) { this.chartConfig.param.datasource[0].systemSelect = this.selectList[0].name this.systemSelectChange(0) } @@ -547,11 +547,11 @@ export default { if (res.code === 200) { this.systemData = JSON.parse(res.data.paramValue) if (this.systemData.length) { - if (!this.chartConfig.param.system) { + if (!this.chartConfig.param.datasource[0].type) { this.chartConfig.param.datasource[0].type = this.systemData[0].name this.groupList = this.systemData[0].group this.selectList = this.systemData[0].select - } else { + } else { const system = this.systemData.find(item => item.name === this.chartConfig.param.datasource[0].type) this.chartConfig.param.system = system.name this.groupList = system.group diff --git a/nezha-fronted/src/components/common/table/special/endpointQueryTab.vue b/nezha-fronted/src/components/common/table/special/endpointQueryTab.vue index e6ba1edc6..d1e85618d 100644 --- a/nezha-fronted/src/components/common/table/special/endpointQueryTab.vue +++ b/nezha-fronted/src/components/common/table/special/endpointQueryTab.vue @@ -413,7 +413,7 @@ export default { }) }) }, - createSuccess (type, response, param, panel) { + createSuccess (panel) { this.$confirm(this.$t('dashboard.metric.goPanelTip'), this.$t('tip.saveSuccess'), { confirmButtonText: this.$t('tip.yes'), cancelButtonText: this.$t('tip.no'),