From 5e761d68b43b347e285dbc01bb78aa07c8673d28 Mon Sep 17 00:00:00 2001 From: peterlu14 Date: Fri, 15 Dec 2023 11:59:53 +0800 Subject: [PATCH] feat: refine UI behavior and enhance test compatibility - Clear input value after confirming in the SaveConfigModal component - Add a check for undefined grid source before removing series in chart actions Signed-off-by: peterlu14 --- src/components/task/content/configuration/SaveConfigModal.vue | 1 + src/store/modules/task/content/actions/chartAct.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/task/content/configuration/SaveConfigModal.vue b/src/components/task/content/configuration/SaveConfigModal.vue index e70c4a1b..e98768d9 100644 --- a/src/components/task/content/configuration/SaveConfigModal.vue +++ b/src/components/task/content/configuration/SaveConfigModal.vue @@ -36,6 +36,7 @@ export default { methods: { confirm: function () { this.$emit('confirm', [this.inputValue, this.lock]) + this.inputValue = '' }, undo: function () { this.inputValue = '' diff --git a/src/store/modules/task/content/actions/chartAct.js b/src/store/modules/task/content/actions/chartAct.js index 457735d9..4d144e4a 100644 --- a/src/store/modules/task/content/actions/chartAct.js +++ b/src/store/modules/task/content/actions/chartAct.js @@ -862,6 +862,7 @@ const chartActs = { const { chartID, gridIndex, gridSourceIndex } = payload const gridSource = state.chartData[chartID].gridSource[gridIndex][gridSourceIndex] + if (gridSource === undefined) return // remove series const seriesIndex = state.chartData[chartID].series.findIndex((val) => { return val.name === gridSource.name