forked from github/dataease
Merge pull request #5292 from dataease/pr@dev@fix_panel-filter
fix(仪表板): 修复仪表板复用组件,位置属性与目标仪表板设置不一致问题
This commit is contained in:
commit
cb9e54d9d3
@ -150,13 +150,13 @@ export default {
|
||||
}
|
||||
})
|
||||
chartBatchCopy({ 'sourceAndTargetIds': sourceAndTargetIds }, state.panel.panelInfo.id).then((rsp) => {
|
||||
needAdaptor && adaptCurThemeCommonStyle(newCop)
|
||||
needAdaptor && adaptCurThemeCommonStyle(newCop,'copy')
|
||||
store.commit('addComponent', { component: newCop })
|
||||
})
|
||||
} else {
|
||||
const newCop = deepCopy(data)
|
||||
newCop.id = uuid.v1()
|
||||
needAdaptor && adaptCurThemeCommonStyle(newCop)
|
||||
needAdaptor && adaptCurThemeCommonStyle(newCop,'copy')
|
||||
store.commit('addComponent', { component: newCop })
|
||||
}
|
||||
if (state.isCut) {
|
||||
|
@ -375,7 +375,7 @@ export function adaptCurTheme(customStyle, customAttr, chartType) {
|
||||
}
|
||||
}
|
||||
|
||||
export function adaptCurThemeCommonStyle(component) {
|
||||
export function adaptCurThemeCommonStyle(component,adaptFrom = 'them') {
|
||||
const commonStyle = store.state.canvasStyleData.chartInfo.chartCommonStyle
|
||||
for (const key in commonStyle) {
|
||||
Vue.set(component.commonBackground, key, commonStyle[key])
|
||||
@ -383,8 +383,10 @@ export function adaptCurThemeCommonStyle(component) {
|
||||
if (isFilterComponent(component.component)) {
|
||||
const filterStyle = store.state.canvasStyleData.chartInfo.filterStyle
|
||||
for (const styleKey in filterStyle) {
|
||||
// 位置属性不修改
|
||||
if (styleKey !== 'horizontal' && styleKey !== 'vertical') {
|
||||
if(adaptFrom === 'copy'){
|
||||
Vue.set(component.style, styleKey, filterStyle[styleKey])
|
||||
}else if (adaptFrom === 'them' && styleKey !== 'horizontal' && styleKey !== 'vertical') {
|
||||
// 主题变化位置属性不修改
|
||||
Vue.set(component.style, styleKey, filterStyle[styleKey])
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user