Merge pull request #2749 from dataease/pr@dev@fix_filter_component_copy

fix(仪表板-过滤组件): 复制视图后过滤组件对原视图和目标视图作用效果不一致
This commit is contained in:
fit2cloud-chenyw 2022-08-01 13:39:08 +08:00 committed by GitHub
commit 62517b7fdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,6 +100,10 @@ export default {
const newView = deepCopy(data)
newView.id = uuid.v1()
newView.propValue.viewId = res.data
if (newView.filters && newView.filters.length) {
newView.filters = []
}
store.commit('addComponent', { component: newView })
})
} else if (data.type === 'de-tabs') {
@ -111,6 +115,9 @@ export default {
const newViewId = uuid.v1()
sourceAndTargetIds[item.content.propValue.viewId] = newViewId
item.content.propValue.viewId = newViewId
if (item.content.filters && item.content.filters.length) {
item.content.filters = []
}
}
})
chartBatchCopy({ 'sourceAndTargetIds': sourceAndTargetIds }, state.panel.panelInfo.id).then((rsp) => {