diff --git a/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue b/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue index a445159ac6..636197873e 100644 --- a/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue +++ b/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue @@ -3,9 +3,9 @@ import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' import { layerStoreWithOut } from '@/store/modules/data-visualization/layer' import { storeToRefs } from 'pinia' -import { ElIcon, ElRow } from 'element-plus-secondary' +import { ElIcon, ElRow, ElSwitch } from 'element-plus-secondary' import Icon from '../icon-custom/src/Icon.vue' -import { nextTick, ref } from 'vue' +import { computed, nextTick, ref } from 'vue' import draggable from 'vuedraggable' import { lockStoreWithOut } from '@/store/modules/data-visualization/lock' import ContextMenuAsideDetails from '@/components/data-visualization/canvas/ContextMenuAsideDetails.vue' @@ -22,7 +22,8 @@ const composeStore = composeStoreWithOut() const { areaData, isCtrlOrCmdDown, isShiftDown, laterIndex } = storeToRefs(composeStore) -const { componentData, curComponent, canvasViewInfo } = storeToRefs(dvMainStore) +const { componentData, canvasStyleData, curComponent, canvasViewInfo, canvasState } = + storeToRefs(dvMainStore) const getComponent = index => { return componentData.value[componentData.value.length - 1 - index] } @@ -34,6 +35,13 @@ const areaDataPush = component => { areaData.value.components.push(component) } } + +const hiddenAreaActive = computed( + () => canvasState.value.curPointArea === 'hidden' && !curComponent.value +) +const baseAreaActive = computed( + () => canvasState.value.curPointArea === 'base' && !curComponent.value +) // shift 选择算法逻辑 // 1.记录上次点击的laterIndex(初始状态laterIndex=0); // 2.获取当前index curClickIndex; @@ -59,6 +67,16 @@ const shiftDataPush = curClickIndex => { dvMainStore.setCurComponent({ component: null, index: null }) } +const hiddenAreaOnClick = (e, element) => { + let indexResult + componentData.value.forEach((component, index) => { + if (element.id === component.id) { + indexResult = index + } + }) + dvMainStore.setCurComponent({ component: element, index: indexResult }) +} + const onClick = (e, index) => { // 初始化点击是 laterIndex=0 if (!curComponent.value) { @@ -149,6 +167,14 @@ const showComponent = () => { }) } +const popComponentData = computed(() => + componentData.value.filter(ele => ele.category && ele.category === 'hidden') +) + +const baseComponentData = computed(() => + componentData.value.filter(ele => ele.category !== 'hidden' && ele.component !== 'GroupArea') +) + const dragOnEnd = ({ oldIndex, newIndex }) => { const source = componentData.value[newIndex] const comLength = componentData.value.length @@ -204,12 +230,94 @@ const handleContextMenu = e => { document.body.removeChild(customContextMenu) }) } + +const areaClick = area => { + dvMainStore.setCurComponent({ component: null, index: null }) + dvMainStore.canvasStateChange({ key: 'curPointArea', value: area }) +}