forked from github/dataease
Merge pull request #11166 from dataease/pr@dev-v2@fix_group
Pr@dev v2@fix group
This commit is contained in:
commit
26dcce3860
@ -33,7 +33,13 @@ const transformIndex = index => {
|
||||
return componentData.value.length - 1 - index
|
||||
}
|
||||
const areaDataPush = component => {
|
||||
if (component && !component.isLock && component.isShow && component.canvasId === 'canvas-main') {
|
||||
if (
|
||||
component &&
|
||||
!component.isLock &&
|
||||
component.isShow &&
|
||||
component.canvasId === 'canvas-main' &&
|
||||
component.category !== 'hidden'
|
||||
) {
|
||||
areaData.value.components.push(component)
|
||||
}
|
||||
}
|
||||
@ -63,7 +69,11 @@ const shiftDataPush = curClickIndex => {
|
||||
const shiftAreaComponents = componentData.value
|
||||
.slice(indexBegin, indexEnd + 1)
|
||||
.filter(
|
||||
component => !areaDataIdArray.includes(component.id) && !component.isLock && component.isShow
|
||||
component =>
|
||||
!areaDataIdArray.includes(component.id) &&
|
||||
!component.isLock &&
|
||||
component.isShow &&
|
||||
component.category !== 'hidden'
|
||||
)
|
||||
areaData.value.components.push(...shiftAreaComponents)
|
||||
dvMainStore.setCurComponent({ component: null, index: null })
|
||||
|
@ -1382,7 +1382,6 @@ const groupAreaClickChange = async () => {
|
||||
if (areaData.value.components.length > 1) {
|
||||
// 重新计算边界
|
||||
composeStore.calcComposeArea()
|
||||
const hist2 = dvMainStore.componentData.filter(ele => ele.component === 'GroupArea')
|
||||
if (groupAreaHis.length === 0) {
|
||||
// 如果不存在 新建视括组件
|
||||
groupAreaCom = findNewComponent('GroupArea', 'GroupArea')
|
||||
|
@ -260,9 +260,11 @@ function handleCommand(command) {
|
||||
|
||||
const reloadLinkage = () => {
|
||||
// 刷新联动信息
|
||||
getPanelAllLinkageInfo(dvInfo.value.id).then(rsp => {
|
||||
dvMainStore.setNowPanelTrackInfo(rsp.data)
|
||||
})
|
||||
if (dvInfo.value.id) {
|
||||
getPanelAllLinkageInfo(dvInfo.value.id).then(rsp => {
|
||||
dvMainStore.setNowPanelTrackInfo(rsp.data)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const componentMoveIn = component => {
|
||||
|
@ -142,7 +142,7 @@ export const composeStore = defineStore('compose', {
|
||||
|
||||
const components = []
|
||||
areaData.components.forEach(component => {
|
||||
if (component.component != 'Group') {
|
||||
if (!['Group', 'GroupArea'].includes(component.component)) {
|
||||
components.push(component)
|
||||
} else {
|
||||
// 如果要组合的组件中,已经存在组合数据,则需要提前拆分
|
||||
|
@ -1272,6 +1272,15 @@ export const dvMainStore = defineStore('dataVisualization', {
|
||||
mobileLayout: false
|
||||
}
|
||||
this.canvasStyleData = { ...deepCopy(DEFAULT_CANVAS_STYLE_DATA_DARK), backgroundColor: null }
|
||||
},
|
||||
removeGroupArea() {
|
||||
// 清理临时组件
|
||||
const groupAreaHis = this.componentData.filter(ele => ele.component === 'GroupArea')
|
||||
if (groupAreaHis && groupAreaHis.length > 0) {
|
||||
groupAreaHis.forEach(ele => {
|
||||
this.deleteComponentById(ele.id)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -154,6 +154,7 @@ export const snapshotStore = defineStore('snapshot', {
|
||||
recordSnapshot() {
|
||||
this.styleChangeTimes = ++this.styleChangeTimes
|
||||
if (dataPrepareState.value) {
|
||||
dvMainStore.removeGroupArea()
|
||||
// 添加新的快照
|
||||
const newSnapshot = {
|
||||
componentData: deepCopy(componentData.value),
|
||||
|
@ -329,6 +329,7 @@ export function checkIsBatchOptView(viewId) {
|
||||
}
|
||||
|
||||
export async function canvasSave(callBack) {
|
||||
dvMainStore.removeGroupArea()
|
||||
const componentDataToSave = cloneDeep(componentData.value)
|
||||
componentDataToSave.forEach(item => {
|
||||
if (item.component === 'UserView') {
|
||||
|
Loading…
Reference in New Issue
Block a user