Skip to content

Commit

Permalink
fix: fix apply button (#5276)
Browse files Browse the repository at this point in the history
Signed-off-by: yuda <[email protected]>
  • Loading branch information
yuda110 authored Dec 20, 2024
1 parent 99b9226 commit d55800a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const state = reactive({
fieldManager = new WidgetFieldValueManager(
getWidgetConfig(widgetGenerateState.selectedWidgetName),
widgetGenerateGetters.selectedDataTable,
widgetGenerateState.widget?.options || {},
cloneDeep(widgetGenerateState.widget?.options) || {},
);
}
return fieldManager;
Expand All @@ -88,7 +88,7 @@ const state = reactive({
return WIDGET_WIDTH_RANGE_LIST[state.widgetSize]?.[0] || 0;
}),
isWidgetFieldChanged: computed<boolean>(() => {
const _isOptionsChanged = !isEqual(state.fieldManager.data, widgetGenerateState.widget?.options);
const _isOptionsChanged = !isEqual(cloneDeep(state.fieldManager.data), widgetGenerateState.widget?.options);
const _isTypeChanged = widgetGenerateState.selectedWidgetName !== widgetGenerateState.widget?.widget_type;
emit('watch-options-changed', _isOptionsChanged || _isTypeChanged);
return _isOptionsChanged || _isTypeChanged;
Expand Down Expand Up @@ -124,7 +124,7 @@ const updateWidget = async () => {
state: 'ACTIVE',
});
if (widget) {
state.fieldManager.updateOriginData(widget.options);
state.fieldManager.updateOriginData(cloneDeep(widget.options));
}
if (_isCreating) {
await dashboardStore.addWidgetToDashboard(dashboardDetailState.dashboardId || '', widgetGenerateState.widgetId);
Expand Down

0 comments on commit d55800a

Please sign in to comment.