feat(数据大屏): 分组选择后支持安卓Ctrl取消其中一个已选中的组件 #13698

This commit is contained in:
wangjiahao 2025-02-17 16:36:14 +08:00 committed by 王嘉豪
parent 9e368d1868
commit d5ff719de7
2 changed files with 37 additions and 2 deletions

View File

@ -47,6 +47,7 @@ import PopArea from '@/custom-component/pop-area/Component.vue'
import DatasetParamsComponent from '@/components/visualization/DatasetParamsComponent.vue' import DatasetParamsComponent from '@/components/visualization/DatasetParamsComponent.vue'
import DeGrid from '@/components/data-visualization/DeGrid.vue' import DeGrid from '@/components/data-visualization/DeGrid.vue'
import DeGridScreen from '@/components/data-visualization/DeGridScreen.vue' import DeGridScreen from '@/components/data-visualization/DeGridScreen.vue'
import GroupAreaShadow from '@/custom-component/group-area/ComponentShadow.vue'
const snapshotStore = snapshotStoreWithOut() const snapshotStore = snapshotStoreWithOut()
const dvMainStore = dvMainStoreWithOut() const dvMainStore = dvMainStoreWithOut()
@ -55,7 +56,7 @@ const contextmenuStore = contextmenuStoreWithOut()
const { curComponent, dvInfo, editMode, tabMoveOutComponentId, canvasState } = const { curComponent, dvInfo, editMode, tabMoveOutComponentId, canvasState } =
storeToRefs(dvMainStore) storeToRefs(dvMainStore)
const { editorMap, areaData } = storeToRefs(composeStore) const { editorMap, areaData, isCtrlOrCmdDown } = storeToRefs(composeStore)
const emits = defineEmits(['scrollCanvasToTop']) const emits = defineEmits(['scrollCanvasToTop'])
const props = defineProps({ const props = defineProps({
themes: { themes: {
@ -1471,6 +1472,19 @@ const dataVBatchOptAdaptor = () => {
}) })
} }
const itemShow = item => {
return (
item.isShow &&
(item.component !== 'GroupArea' || (item.component === 'GroupArea' && !isCtrlOrCmdDown.value))
)
}
const groupAreaShadowShow = computed(
() =>
componentData.value.length > 0 &&
componentData.value[componentData.value.length - 1].component === 'GroupArea' &&
isCtrlOrCmdDown.value
)
// //
const groupAreaClickChange = async () => { const groupAreaClickChange = async () => {
let groupAreaCom let groupAreaCom
@ -1574,6 +1588,7 @@ defineExpose({
:style="editStyle" :style="editStyle"
@contextmenu="handleContextMenu" @contextmenu="handleContextMenu"
> >
---{{ componentData[componentData.length - 1].component }}
<slot name="canvasDragTips" /> <slot name="canvasDragTips" />
<drag-info v-if="dragInfoShow"></drag-info> <drag-info v-if="dragInfoShow"></drag-info>
<canvas-opt-bar <canvas-opt-bar
@ -1611,11 +1626,15 @@ defineExpose({
<!--切换canvas 拖拽阴影部分--> <!--切换canvas 拖拽阴影部分-->
<point-shadow v-if="pointShadowShow" :canvas-id="canvasId" /> <point-shadow v-if="pointShadowShow" :canvas-id="canvasId" />
<GroupAreaShadow
v-if="groupAreaShadowShow"
:style="getShapeItemShowStyle(componentData[componentData.length - 1])"
></GroupAreaShadow>
<!--页面组件列表展示--> <!--页面组件列表展示-->
<Shape <Shape
v-for="(item, index) in componentData" v-for="(item, index) in componentData"
v-show="item.isShow" v-show="itemShow(item)"
:canvas-id="canvasId" :canvas-id="canvasId"
:scale="curScale" :scale="curScale"
:key="item.id" :key="item.id"

View File

@ -0,0 +1,16 @@
<template>
<div class="areaShadow"></div>
</template>
<script setup lang="ts"></script>
<style lang="less" scoped>
.areaShadow {
position: absolute;
z-index: 1;
width: 100%;
height: 100%;
border: 2px solid var(--ed-color-primary) !important;
pointer-events: none;
}
</style>