From 04539d605dc9b92773f658c3b35901c0c817e61e Mon Sep 17 00:00:00 2001 From: tnt group Date: Tue, 27 Sep 2022 20:14:00 +0800 Subject: [PATCH 1/8] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=9B=BE?= =?UTF-8?q?=E5=B1=82=E6=A8=A1=E5=BC=8F=E6=8E=A7=E5=88=B6=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 1 + src/plugins/icon.ts | 13 ++++++-- src/styles/common/style.scss | 23 +++++++++----- src/views/chart/ContentBox/index.vue | 15 +++------ src/views/chart/ContentLayers/index.vue | 41 ++++++++++++++++++++++--- 5 files changed, 67 insertions(+), 26 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index d01f44ae..25f7f0d1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,6 +22,7 @@ module.exports = { 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'no-unused-vars': 'off', + 'vue/no-unused-vars': 'off', 'vue/multi-word-component-names': 'off', 'vue/valid-template-root': 'off', 'vue/no-mutating-props': 'off' diff --git a/src/plugins/icon.ts b/src/plugins/icon.ts index 90bf057c..bcc2496a 100644 --- a/src/plugins/icon.ts +++ b/src/plugins/icon.ts @@ -57,7 +57,10 @@ import { ChevronDownOutline as ChevronDownOutlineIcon, Pulse as PulseIcon, Folder as FolderIcon, - FolderOpen as FolderOpenIcon + FolderOpen as FolderOpenIcon, + Image as ImageIcon, + Images as ImagesIcon, + List as ListIcon } from '@vicons/ionicons5' import { @@ -211,7 +214,13 @@ const ionicons5 = { // 文件夹 FolderIcon, // 文件夹打开 - FolderOpenIcon + FolderOpenIcon, + // 图片 + ImageIcon, + // 多个图片 + ImagesIcon, + // 列表 + ListIcon } const carbon = { diff --git a/src/styles/common/style.scss b/src/styles/common/style.scss index 9fde7bf4..13dee27b 100644 --- a/src/styles/common/style.scss +++ b/src/styles/common/style.scss @@ -1,7 +1,7 @@ -@import './var.scss'; -@import './format.scss'; -@import './animation.scss'; -@import './mixins/mixins.scss'; +@import "./var.scss"; +@import "./format.scss"; +@import "./animation.scss"; +@import "./mixins/mixins.scss"; // 过度 .go-transition { @@ -49,14 +49,14 @@ // 毛玻璃 .go-background-filter { backdrop-filter: $--filter-blur-base; - @include fetch-bg-color('filter-color'); + @include fetch-bg-color("filter-color"); box-shadow: $--border-shadow; } // 毛玻璃 .go-background-filter-shallow { backdrop-filter: $--filter-blur-base; - @include fetch-bg-color('filter-color-shallow'); + @include fetch-bg-color("filter-color-shallow"); box-shadow: $--border-shadow; } @@ -68,7 +68,7 @@ // 背景斑点需配合 @mixin background-image 使用 .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; } @@ -117,4 +117,11 @@ .go-#{$typekey} { #{$type}: 0 !important; } -} \ No newline at end of file +} + +.go-d-inline-block { + display: inline-block; +} +.go-d-block { + display: block; +} diff --git a/src/views/chart/ContentBox/index.vue b/src/views/chart/ContentBox/index.vue index 8c10edcf..826bbb85 100644 --- a/src/views/chart/ContentBox/index.vue +++ b/src/views/chart/ContentBox/index.vue @@ -10,14 +10,9 @@ - + - + @@ -151,7 +146,7 @@ $topOrBottomHeight: 40px; border-bottom: 1px solid; @include fetch-border-color('background-color1'); } - + .content { height: calc(100vh - #{$--header-height}); overflow: hidden; @@ -165,9 +160,7 @@ $topOrBottomHeight: 40px; height: calc(100vh - #{$--header-height} - #{$topOrBottomHeight}); } .content-height-show-both { - height: calc( - 100vh - #{$--header-height} - #{$topOrBottomHeight} - #{$topOrBottomHeight} - ); + height: calc(100vh - #{$--header-height} - #{$topOrBottomHeight} - #{$topOrBottomHeight}); } } diff --git a/src/views/chart/ContentLayers/index.vue b/src/views/chart/ContentLayers/index.vue index 1c34c7b3..1211316f 100644 --- a/src/views/chart/ContentLayers/index.vue +++ b/src/views/chart/ContentLayers/index.vue @@ -8,14 +8,41 @@ @mousedown="boxMousedownHandle($event)" > + + + 暂无图层~ + - + {{ componentGroupData.chartConfig.title }} + +
@@ -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, required: true + }, + layerMode: { + type: Object as PropType, + 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 diff --git a/src/views/chart/ContentLayers/components/LayersListItem/index.vue b/src/views/chart/ContentLayers/components/LayersListItem/index.vue index 5ef4cdb2..e113e9bc 100644 --- a/src/views/chart/ContentLayers/components/LayersListItem/index.vue +++ b/src/views/chart/ContentLayers/components/LayersListItem/index.vue @@ -1,5 +1,5 @@