feat: 添加图层模式控制选项

This commit is contained in:
tnt group 2022-09-27 20:14:00 +08:00
parent 617b940d64
commit 0a1023f795
5 changed files with 67 additions and 26 deletions

View File

@ -22,6 +22,7 @@ module.exports = {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-unused-vars': 'off', 'no-unused-vars': 'off',
'vue/no-unused-vars': 'off',
'vue/multi-word-component-names': 'off', 'vue/multi-word-component-names': 'off',
'vue/valid-template-root': 'off', 'vue/valid-template-root': 'off',
'vue/no-mutating-props': 'off' 'vue/no-mutating-props': 'off'

View File

@ -57,7 +57,10 @@ import {
ChevronDownOutline as ChevronDownOutlineIcon, ChevronDownOutline as ChevronDownOutlineIcon,
Pulse as PulseIcon, Pulse as PulseIcon,
Folder as FolderIcon, Folder as FolderIcon,
FolderOpen as FolderOpenIcon FolderOpen as FolderOpenIcon,
Image as ImageIcon,
Images as ImagesIcon,
List as ListIcon
} from '@vicons/ionicons5' } from '@vicons/ionicons5'
import { import {
@ -211,7 +214,13 @@ const ionicons5 = {
// 文件夹 // 文件夹
FolderIcon, FolderIcon,
// 文件夹打开 // 文件夹打开
FolderOpenIcon FolderOpenIcon,
// 图片
ImageIcon,
// 多个图片
ImagesIcon,
// 列表
ListIcon
} }
const carbon = { const carbon = {

View File

@ -1,7 +1,7 @@
@import './var.scss'; @import "./var.scss";
@import './format.scss'; @import "./format.scss";
@import './animation.scss'; @import "./animation.scss";
@import './mixins/mixins.scss'; @import "./mixins/mixins.scss";
// 过度 // 过度
.go-transition { .go-transition {
@ -49,14 +49,14 @@
// 毛玻璃 // 毛玻璃
.go-background-filter { .go-background-filter {
backdrop-filter: $--filter-blur-base; backdrop-filter: $--filter-blur-base;
@include fetch-bg-color('filter-color'); @include fetch-bg-color("filter-color");
box-shadow: $--border-shadow; box-shadow: $--border-shadow;
} }
// 毛玻璃 // 毛玻璃
.go-background-filter-shallow { .go-background-filter-shallow {
backdrop-filter: $--filter-blur-base; backdrop-filter: $--filter-blur-base;
@include fetch-bg-color('filter-color-shallow'); @include fetch-bg-color("filter-color-shallow");
box-shadow: $--border-shadow; box-shadow: $--border-shadow;
} }
@ -68,7 +68,7 @@
// 背景斑点需配合 @mixin background-image 使用 // 背景斑点需配合 @mixin background-image 使用
.go-point-bg { .go-point-bg {
@include fetch-theme-custom('background-color', 'background-color1'); @include fetch-theme-custom("background-color", "background-color1");
background-size: 15px 15px, 15px 15px; background-size: 15px 15px, 15px 15px;
} }
@ -117,4 +117,11 @@
.go-#{$typekey} { .go-#{$typekey} {
#{$type}: 0 !important; #{$type}: 0 !important;
} }
} }
.go-d-inline-block {
display: inline-block;
}
.go-d-block {
display: block;
}

View File

@ -10,14 +10,9 @@
<slot name="icon"></slot> <slot name="icon"></slot>
</div> </div>
</n-space> </n-space>
<n-space> <n-space align="center" style="gap: 4px">
<slot name="top-right"></slot> <slot name="top-right"></slot>
<n-icon <n-icon v-show="backIcon" size="20" class="go-cursor-pointer go-d-block" @click="backHandle">
v-show="backIcon"
size="20"
class="go-cursor-pointer"
@click="backHandle"
>
<chevron-back-outline-icon></chevron-back-outline-icon> <chevron-back-outline-icon></chevron-back-outline-icon>
</n-icon> </n-icon>
</n-space> </n-space>
@ -151,7 +146,7 @@ $topOrBottomHeight: 40px;
border-bottom: 1px solid; border-bottom: 1px solid;
@include fetch-border-color('background-color1'); @include fetch-border-color('background-color1');
} }
.content { .content {
height: calc(100vh - #{$--header-height}); height: calc(100vh - #{$--header-height});
overflow: hidden; overflow: hidden;
@ -165,9 +160,7 @@ $topOrBottomHeight: 40px;
height: calc(100vh - #{$--header-height} - #{$topOrBottomHeight}); height: calc(100vh - #{$--header-height} - #{$topOrBottomHeight});
} }
.content-height-show-both { .content-height-show-both {
height: calc( height: calc(100vh - #{$--header-height} - #{$topOrBottomHeight} - #{$topOrBottomHeight});
100vh - #{$--header-height} - #{$topOrBottomHeight} - #{$topOrBottomHeight}
);
} }
} }
</style> </style>

View File

@ -8,14 +8,41 @@
@mousedown="boxMousedownHandle($event)" @mousedown="boxMousedownHandle($event)"
> >
<template #icon> <template #icon>
<n-icon size="16" :depth="2"> <n-icon size="16" :depth="2" :component="LayersIcon" />
<component :is="LayersIcon"></component>
</n-icon>
</template> </template>
<template #top-right>
<n-radio-group v-model:value="layerMode" name="radiobuttongroup1" size="small" class="go-flex-center">
<n-radio-button value="thumbnail">
<n-icon size="16" class="go-d-block" title="缩略图" :depth="2" :component="ImageIcon" />
</n-radio-button>
<n-radio-button value="text">
<n-icon size="16" class="go-d-block" title="文字列表" :depth="2" :component="ListIcon" />
</n-radio-button>
</n-radio-group>
<!-- <n-icon
size="16"
class="go-cursor-pointer go-d-block"
title="缩略图"
:depth="2"
:component="ImageIcon"
:class="{ 'go-layer-mode-active': layerMode === 'thumbnail' }"
/>
<n-icon
size="16"
class="go-cursor-pointer go-d-block"
title="文字列表"
:depth="2"
:component="ListIcon"
:class="{ 'go-layer-mode-active': layerMode === 'text' }"
/> -->
</template>
<!-- 图层内容 --> <!-- 图层内容 -->
<n-space v-if="reverseList.length === 0" justify="center"> <n-space v-if="reverseList.length === 0" justify="center">
<n-text class="not-layer-text">暂无图层~</n-text> <n-text class="not-layer-text">暂无图层~</n-text>
</n-space> </n-space>
<!-- https://github.com/SortableJS/vue.draggable.next --> <!-- https://github.com/SortableJS/vue.draggable.next -->
<draggable item-key="id" v-model="layerList" ghostClass="ghost" @change="onMoveCallback"> <draggable item-key="id" v-model="layerList" ghostClass="ghost" @change="onMoveCallback">
<template #item="{ element }"> <template #item="{ element }">
@ -55,12 +82,13 @@ import { LayersGroupListItem } from './components/LayersGroupListItem/index'
import { icon } from '@/plugins' import { icon } from '@/plugins'
const { LayersIcon } = icon.ionicons5 const { LayersIcon, ImageIcon, ListIcon } = icon.ionicons5
const chartLayoutStore = useChartLayoutStore() const chartLayoutStore = useChartLayoutStore()
const chartEditStore = useChartEditStore() const chartEditStore = useChartEditStore()
const { handleContextMenu, onClickOutSide } = useContextMenu() const { handleContextMenu, onClickOutSide } = useContextMenu()
const layerList = ref<any>([]) const layerList = ref<any>([])
const layerMode = ref<'thumbnail' | 'text'>('thumbnail')
// //
const reverseList = computed(() => { const reverseList = computed(() => {
@ -159,7 +187,7 @@ const mouseleaveHandle = (item: CreateComponentType) => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$wight: 170px; $wight: 180px;
@include go(content-layers) { @include go(content-layers) {
width: $wight; width: $wight;
flex-shrink: 0; flex-shrink: 0;
@ -177,5 +205,8 @@ $wight: 170px;
.ghost { .ghost {
opacity: 0; opacity: 0;
} }
.go-layer-mode-active {
color: #51d6a9;
}
} }
</style> </style>