mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
chore: 完成锁定及隐藏,列表方式功能占位
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div class="go-content-layers-group-list-item">
|
||||
<div
|
||||
class="root-item-content"
|
||||
:class="{ hover: hover, select: select }"
|
||||
:class="{ hover: hover, select: select, 'list-mini': layerMode === 'text' }"
|
||||
@click="clickHandle($event)"
|
||||
@mousedown="groupMousedownHandle($event)"
|
||||
@mouseenter="mouseenterHandle(componentGroupData)"
|
||||
@@ -18,11 +18,13 @@
|
||||
<folder-icon></folder-icon>
|
||||
</template>
|
||||
</n-icon>
|
||||
<n-ellipsis>
|
||||
<n-ellipsis style="margin-right: auto">
|
||||
<n-text class="go-ml-2 list-text" :depth="2">
|
||||
{{ componentGroupData.chartConfig.title }}
|
||||
</n-text>
|
||||
</n-ellipsis>
|
||||
<n-icon size="12" class="list-status-icon" :component="LockClosedOutlineIcon" />
|
||||
<n-icon size="12" class="list-status-icon" :component="EyeOffOutlineIcon" />
|
||||
</div>
|
||||
<div :class="{ 'select-modal': select }"></div>
|
||||
</div>
|
||||
@@ -31,6 +33,7 @@
|
||||
v-for="element in componentGroupData.groupList"
|
||||
:key="element.id"
|
||||
:componentData="element"
|
||||
:layer-mode="layerMode"
|
||||
@mousedown="mousedownHandle($event, element, componentGroupData.id)"
|
||||
@mouseenter="mouseenterHandle(element)"
|
||||
@mouseleave="mouseleaveHandle(element)"
|
||||
@@ -50,13 +53,21 @@ import { useContextMenu, divider } from '@/views/chart/hooks/useContextMenu.hook
|
||||
import { MenuOptionsItemType } from '@/views/chart/hooks/useContextMenu.hook.d'
|
||||
import { CreateComponentType, CreateComponentGroupType } from '@/packages/index.d'
|
||||
import { LayersListItem } from '../LayersListItem'
|
||||
import throttle from 'lodash/throttle'
|
||||
import { icon } from '@/plugins'
|
||||
import { LayerModeEnum } from '../../enums'
|
||||
|
||||
const { LockClosedOutlineIcon, EyeOffOutlineIcon } = icon.ionicons5
|
||||
|
||||
const props = defineProps({
|
||||
componentGroupData: {
|
||||
type: Object as PropType<CreateComponentGroupType>,
|
||||
required: true
|
||||
},
|
||||
layerMode: {
|
||||
type: Object as PropType<LayerModeEnum>,
|
||||
default(): LayerModeEnum {
|
||||
return 'thumbnail'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -148,7 +159,11 @@ const groupMousedownHandle = (e: MouseEvent) => {
|
||||
}
|
||||
|
||||
// 公共点击事件
|
||||
const mousedownHandle = (e: MouseEvent, componentInstance: CreateComponentType | CreateComponentGroupType, id?: string) => {
|
||||
const mousedownHandle = (
|
||||
e: MouseEvent,
|
||||
componentInstance: CreateComponentType | CreateComponentGroupType,
|
||||
id?: string
|
||||
) => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
@@ -169,6 +184,7 @@ const mouseleaveHandle = (componentInstance: CreateComponentType | CreateCompone
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$centerHeight: 52px;
|
||||
$centerMiniHeight: 28px;
|
||||
$textSize: 10px;
|
||||
|
||||
@include go(content-layers-group-list-item) {
|
||||
@@ -178,6 +194,11 @@ $textSize: 10px;
|
||||
margin-bottom: 5px;
|
||||
@extend .go-transition-quick;
|
||||
|
||||
:deep(.go-content-layers-list-item) {
|
||||
margin-right: 0 !important;
|
||||
width: 95% !important;
|
||||
}
|
||||
|
||||
.root-item-content {
|
||||
height: $centerHeight;
|
||||
cursor: pointer;
|
||||
@@ -196,6 +217,17 @@ $textSize: 10px;
|
||||
border: 1px solid v-bind('themeColor') !important;
|
||||
}
|
||||
}
|
||||
|
||||
// mini样式
|
||||
&.list-mini {
|
||||
height: $centerMiniHeight;
|
||||
.item-content {
|
||||
height: calc(#{$centerMiniHeight} - 10px) !important;
|
||||
}
|
||||
.select-modal {
|
||||
height: calc(#{$centerMiniHeight} + 2px) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.select-modal,
|
||||
.item-content {
|
||||
@@ -220,5 +252,9 @@ $textSize: 10px;
|
||||
padding-left: 6px;
|
||||
font-size: $textSize;
|
||||
}
|
||||
|
||||
.list-status-icon {
|
||||
margin-left: 3px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="go-content-layers-list-item" :class="{ hover: hover, select: select }">
|
||||
<div class="go-content-layers-list-item" :class="{ hover: hover, select: select, 'list-mini': layerMode === 'text' }">
|
||||
<div class="go-flex-center item-content">
|
||||
<n-image
|
||||
class="list-img"
|
||||
@@ -8,21 +8,27 @@
|
||||
:src="image"
|
||||
:fallback-src="requireErrorImg()"
|
||||
></n-image>
|
||||
<n-ellipsis>
|
||||
<n-ellipsis style="margin-right: auto">
|
||||
<n-text class="list-text" :depth="2">
|
||||
{{ props.componentData.chartConfig.title }}
|
||||
</n-text>
|
||||
</n-ellipsis>
|
||||
<n-icon size="12" class="list-status-icon" :component="LockClosedOutlineIcon" />
|
||||
<n-icon size="12" class="list-status-icon" :component="EyeOffOutlineIcon" />
|
||||
</div>
|
||||
<div :class="{ 'select-modal': select }"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { toRefs, computed } from 'vue'
|
||||
import { toRefs, computed, PropType } from 'vue'
|
||||
import { requireErrorImg } from '@/utils'
|
||||
import { useDesignStore } from '@/store/modules/designStore/designStore'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
import { LayerModeEnum } from '../../enums'
|
||||
|
||||
import { icon } from '@/plugins'
|
||||
const { LockClosedOutlineIcon, EyeOffOutlineIcon } = icon.ionicons5
|
||||
|
||||
// 全局颜色
|
||||
const designStore = useDesignStore()
|
||||
@@ -37,6 +43,12 @@ const props = defineProps({
|
||||
componentData: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
layerMode: {
|
||||
type: Object as PropType<LayerModeEnum>,
|
||||
default(): LayerModeEnum {
|
||||
return 'thumbnail'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -56,6 +68,7 @@ const hover = computed(() => {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$centerHeight: 52px;
|
||||
$centerMiniHeight: 28px;
|
||||
$textSize: 10px;
|
||||
|
||||
@include go(content-layers-list-item) {
|
||||
@@ -72,15 +85,7 @@ $textSize: 10px;
|
||||
&:hover {
|
||||
@include fetch-bg-color('background-color4');
|
||||
}
|
||||
/* 选中 */
|
||||
&.select {
|
||||
border: 1px solid v-bind('themeColor');
|
||||
/* 需要设置最高级,覆盖 hover 的颜色 */
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
.list-img {
|
||||
border: 1px solid v-bind('themeColor') !important;
|
||||
}
|
||||
}
|
||||
|
||||
.select-modal,
|
||||
.item-content {
|
||||
position: absolute;
|
||||
@@ -94,24 +99,46 @@ $textSize: 10px;
|
||||
width: calc(100% - 10px);
|
||||
height: calc(100% - 10px);
|
||||
}
|
||||
|
||||
.select-modal {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0.3;
|
||||
background-color: v-bind('themeColor');
|
||||
}
|
||||
|
||||
.list-img {
|
||||
flex-shrink: 0;
|
||||
height: $centerHeight;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
border: 1px solid;
|
||||
border: none !important;
|
||||
padding: 2px;
|
||||
@include hover-border-color('hover-border-color');
|
||||
}
|
||||
|
||||
.list-text {
|
||||
padding-left: 6px;
|
||||
font-size: $textSize;
|
||||
}
|
||||
|
||||
.list-status-icon {
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
/* 选中样式 */
|
||||
&.select {
|
||||
border: 1px solid v-bind('themeColor');
|
||||
/* 需要设置最高级,覆盖 hover 的颜色 */
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
// .list-img {
|
||||
// border: 1px solid v-bind('themeColor') !important;
|
||||
// }
|
||||
}
|
||||
|
||||
// mini样式
|
||||
&.list-mini {
|
||||
height: $centerMiniHeight;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user