diff --git a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue index 3ab5cb0d2d..79d055f66f 100644 --- a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue +++ b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue @@ -2,6 +2,7 @@ import { ref, reactive, nextTick, computed, shallowRef, toRefs, watch } from 'vue' import { storeToRefs } from 'pinia' import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' +import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' import { useI18n } from '@/hooks/web/useI18n' import { fieldType } from '@/utils/attr' import { ElMessage } from 'element-plus-secondary' @@ -55,6 +56,7 @@ const activeConditionForRename = reactive({ visible: false }) const datasetMap = {} +const snapshotStore = snapshotStoreWithOut() const dfsComponentData = () => { const isMain = componentData.value.some(ele => ele.id === queryElement.value.id) @@ -308,6 +310,7 @@ const confirmClick = () => { ) }) queryElement.value.propValue = cloneDeep(conditions.value) + snapshotStore.recordSnapshotCache() } const cancelValueSource = () => { diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts index 64d9b1d125..9ffce990ae 100644 --- a/core/core-frontend/src/utils/canvasUtils.ts +++ b/core/core-frontend/src/utils/canvasUtils.ts @@ -1,4 +1,4 @@ -import { deepCopy } from '@/utils/utils' +import { cloneDeep } from 'lodash-es' import componentList, { COMMON_COMPONENT_BACKGROUND_DARK, COMMON_COMPONENT_BACKGROUND_LIGHT @@ -17,12 +17,12 @@ const { curBatchOptComponents, dvInfo, canvasStyleData, componentData, canvasVie const snapshotStore = snapshotStoreWithOut() export function chartTransStr2Object(targetIn, copy) { - const target = copy === 'Y' ? deepCopy(targetIn) : targetIn + const target = copy === 'Y' ? cloneDeep(targetIn) : targetIn return target } export function chartTransObject2Str(targetIn, copy) { - const target = copy === 'Y' ? deepCopy(targetIn) : targetIn + const target = copy === 'Y' ? cloneDeep(targetIn) : targetIn return target } @@ -37,7 +37,7 @@ export function findNewComponent(componentName, innerType) { let newComponent componentList.forEach(comp => { if (comp.component === componentName) { - newComponent = deepCopy(comp) + newComponent = cloneDeep(comp) newComponent.innerType = innerType if (newComponent.innerType === 'richText') { newComponent.propValue = { @@ -45,9 +45,9 @@ export function findNewComponent(componentName, innerType) { } } if (dvMainStore.curOriginThemes === 'light') { - newComponent['commonBackground'] = deepCopy(COMMON_COMPONENT_BACKGROUND_LIGHT) + newComponent['commonBackground'] = cloneDeep(COMMON_COMPONENT_BACKGROUND_LIGHT) } else { - newComponent['commonBackground'] = deepCopy(COMMON_COMPONENT_BACKGROUND_DARK) + newComponent['commonBackground'] = cloneDeep(COMMON_COMPONENT_BACKGROUND_DARK) } } }) @@ -130,7 +130,7 @@ export function checkIsBatchOptView(viewId) { } export function canvasSave(callBack) { - const componentDataToSave = deepCopy(componentData.value) + const componentDataToSave = cloneDeep(componentData.value) componentDataToSave.forEach(item => { if (item.component === 'UserView') { item.linkageFilters = [] @@ -152,6 +152,7 @@ export function canvasSave(callBack) { canvasViewInfo: canvasViewInfo.value, ...dvInfo.value } + const method = dvInfo.value.id ? updateCanvas : saveCanvas method(canvasInfo).then(res => { if (res && res.data) {