@@ -55,14 +68,14 @@ const paletteStyle = computed(() => {
const isDarkTheme = designStore.getDarkTheme
return isDarkTheme
? {
- bgColor: '#18181c',
- longfgColor: '#4d4d4d',
- shortfgColor: '#4d4d4d',
- fontColor: '#4d4d4d',
- shadowColor: '#18181c',
- borderColor: '#18181c',
- cornerActiveColor: '#18181c'
- }
+ bgColor: '#18181c',
+ longfgColor: '#4d4d4d',
+ shortfgColor: '#4d4d4d',
+ fontColor: '#4d4d4d',
+ shadowColor: '#18181c',
+ borderColor: '#18181c',
+ cornerActiveColor: '#18181c'
+ }
: {}
})
@@ -182,7 +195,7 @@ watch(
chartEditStore.setScale(newValue)
setTimeout(() => {
canvasPosCenter()
- }, 500);
+ }, 500)
}
}
)
From 0b8ab9adfa8b2868278fccd9b81ca72ad962665a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?=
<1262327911@qq.com>
Date: Sun, 18 Dec 2022 00:00:41 +0800
Subject: [PATCH 12/16] =?UTF-8?q?style:=20=E4=BF=AE=E6=94=B9=E9=94=99?=
=?UTF-8?q?=E8=AF=AF=E5=8D=95=E8=AF=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ContentEdit/components/EditRule/index.vue | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/views/chart/ContentEdit/components/EditRule/index.vue b/src/views/chart/ContentEdit/components/EditRule/index.vue
index 6e0d678f..a98737ba 100644
--- a/src/views/chart/ContentEdit/components/EditRule/index.vue
+++ b/src/views/chart/ContentEdit/components/EditRule/index.vue
@@ -40,8 +40,8 @@ const chartEditStore = useChartEditStore()
const designStore = useDesignStore()
const thick = 20
-let prevMoveXVallue = [0, 0]
-let prevMoveYVallue = [0, 0]
+let prevMoveXValue = [0, 0]
+let prevMoveYValue = [0, 0]
const $app = ref()
const sketchRuleReDraw = ref(true)
@@ -127,11 +127,11 @@ const dragCanvas = (e: any) => {
const nx = e.pageX - startX
const ny = e.pageY - startY
- const [prevMoveX1, prevMoveX2] = prevMoveXVallue
- const [prevMoveY1, prevMoveY2] = prevMoveYVallue
+ const [prevMoveX1, prevMoveX2] = prevMoveXValue
+ const [prevMoveY1, prevMoveY2] = prevMoveYValue
- prevMoveXVallue = [prevMoveX2, nx]
- prevMoveYVallue = [prevMoveY2, ny]
+ prevMoveXValue = [prevMoveX2, nx]
+ prevMoveYValue = [prevMoveY2, ny]
$app.value.scrollLeft -=
prevMoveX2 > prevMoveX1 ? Math.abs(prevMoveX2 - prevMoveX1) : -Math.abs(prevMoveX2 - prevMoveX1)
@@ -142,8 +142,8 @@ const dragCanvas = (e: any) => {
const listenMouseup = listen(window, 'mouseup', () => {
listenMousemove()
listenMouseup()
- prevMoveXVallue = [0, 0]
- prevMoveYVallue = [0, 0]
+ prevMoveXValue = [0, 0]
+ prevMoveYValue = [0, 0]
isPressSpace.value = false
})
}
From 1f9790e5f5825976435df9ad78488282bc2a0c5c Mon Sep 17 00:00:00 2001
From: jeo young <1414294708@qq.com>
Date: Sun, 18 Dec 2022 10:24:49 +0800
Subject: [PATCH 13/16] =?UTF-8?q?fix:=20=E7=94=BB=E5=B8=83=E4=B8=8D?=
=?UTF-8?q?=E8=83=BD=E6=BB=9A=E5=8A=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/chart/ContentEdit/components/EditRule/index.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/views/chart/ContentEdit/components/EditRule/index.vue b/src/views/chart/ContentEdit/components/EditRule/index.vue
index a98737ba..13078ec4 100644
--- a/src/views/chart/ContentEdit/components/EditRule/index.vue
+++ b/src/views/chart/ContentEdit/components/EditRule/index.vue
@@ -85,8 +85,8 @@ const themeColor = computed(() => {
})
const handleWheel = (e: any) => {
- e.preventDefault()
if (e.ctrlKey || e.metaKey) {
+ e.preventDefault()
let resScale = scale.value
// 放大(200%)
if (e.wheelDelta >= 0 && scale.value < 2) {
From 5b1458b22f4d1702560bdf4e817e401ddedaba3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?=
<1262327911@qq.com>
Date: Tue, 20 Dec 2022 15:09:12 +0800
Subject: [PATCH 14/16] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20deep=20?=
=?UTF-8?q?=E6=8A=A5=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/styles/common/mixins/mixins.scss | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/styles/common/mixins/mixins.scss b/src/styles/common/mixins/mixins.scss
index 39374ff1..ec6f2ccd 100644
--- a/src/styles/common/mixins/mixins.scss
+++ b/src/styles/common/mixins/mixins.scss
@@ -17,7 +17,7 @@
}
@mixin deep() {
- :deep {
+ :deep() {
@content;
}
}
From 65127ced7fdc4849920077262d1804e4addcb00f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?=
<1262327911@qq.com>
Date: Tue, 20 Dec 2022 15:16:25 +0800
Subject: [PATCH 15/16] =?UTF-8?q?perf:=20=E6=96=B0=E5=A2=9E=E5=BF=AB?=
=?UTF-8?q?=E6=8D=B7=E9=94=AE=E8=AF=B4=E6=98=8E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/enums/editPageEnum.ts | 3 +-
.../EditShortcutKey/ShortcutKeyModal.vue | 28 +++++++------------
2 files changed, 12 insertions(+), 19 deletions(-)
diff --git a/src/enums/editPageEnum.ts b/src/enums/editPageEnum.ts
index 4b26802d..07d51e70 100644
--- a/src/enums/editPageEnum.ts
+++ b/src/enums/editPageEnum.ts
@@ -79,5 +79,6 @@ export enum MacKeyboard {
ALT = '⌥',
CTRL_SOURCE_KEY = '⌘',
SHIFT_SOURCE_KEY = '⇧',
- ALT_SOURCE_KEY = '⌥'
+ ALT_SOURCE_KEY = '⌥',
+ SPACE = 'Space'
}
diff --git a/src/views/chart/ContentEdit/components/EditShortcutKey/ShortcutKeyModal.vue b/src/views/chart/ContentEdit/components/EditShortcutKey/ShortcutKeyModal.vue
index 24af3ca7..17dd3ecc 100644
--- a/src/views/chart/ContentEdit/components/EditShortcutKey/ShortcutKeyModal.vue
+++ b/src/views/chart/ContentEdit/components/EditShortcutKey/ShortcutKeyModal.vue
@@ -19,7 +19,8 @@
{{ item.label }} |
{{ item.win }} |
-
+ | {{ item.mac }} |
+
{{ item.mac.substr(0, 1) }}
+ {{ item.mac.substr(3) }}
|
@@ -44,25 +45,16 @@ defineProps({
// 快捷键
const shortcutKeyOptions = [
{
- label: '向上移动',
- win: `${WinKeyboard.CTRL.toUpperCase()} + ↑ `,
+ label: '拖拽画布',
+ win: `${WinKeyboard.SPACE.toUpperCase()} + 🖱️ `,
+ mac: `${MacKeyboard.SPACE.toUpperCase()} + 🖱️ `,
+ macSource: true
+ },
+ {
+ label: '向 上/右/下/左 移动',
+ win: `${WinKeyboard.CTRL.toUpperCase()} + ↑ 或 → 或 ↓ 或 ←`,
mac: `${MacKeyboard.CTRL.toUpperCase()} + ↑ `
},
- {
- label: '向右移动',
- win: `${WinKeyboard.CTRL.toUpperCase()} + → `,
- mac: `${MacKeyboard.CTRL.toUpperCase()} + → `
- },
- {
- label: '向下移动',
- win: `${WinKeyboard.CTRL.toUpperCase()} + ↓ `,
- mac: `${MacKeyboard.CTRL.toUpperCase()} + ↓ `
- },
- {
- label: '向左移动',
- win: `${WinKeyboard.CTRL.toUpperCase()} + ← `,
- mac: `${MacKeyboard.CTRL.toUpperCase()} + ← `
- },
{
label: '锁定',
win: `${WinKeyboard.CTRL.toUpperCase()} + L `,
From 1fb57ad1ffbee782ffa6c619a5e1e3b0e170ec94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?=
<1262327911@qq.com>
Date: Tue, 20 Dec 2022 16:54:04 +0800
Subject: [PATCH 16/16] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E8=BD=BD=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../chartLayoutStore/chartLayoutStore.d.ts | 7 ++--
.../chartLayoutStore/chartLayoutStore.ts | 10 ++++++
src/views/chart/ContentLoad/index.ts | 3 ++
src/views/chart/ContentLoad/index.vue | 33 +++++++++++++++++++
src/views/chart/hooks/useSync.hook.ts | 14 +++++++-
src/views/chart/index.vue | 3 ++
6 files changed, 67 insertions(+), 3 deletions(-)
create mode 100644 src/views/chart/ContentLoad/index.ts
create mode 100644 src/views/chart/ContentLoad/index.vue
diff --git a/src/store/modules/chartLayoutStore/chartLayoutStore.d.ts b/src/store/modules/chartLayoutStore/chartLayoutStore.d.ts
index b1155ea5..abcef916 100644
--- a/src/store/modules/chartLayoutStore/chartLayoutStore.d.ts
+++ b/src/store/modules/chartLayoutStore/chartLayoutStore.d.ts
@@ -1,5 +1,5 @@
export enum ChartModeEnum {
- SINGLE= 'single',
+ SINGLE = 'single',
DOUBLE = 'double'
}
@@ -13,7 +13,8 @@ export enum ChartLayoutStoreEnum {
CHARTS = 'charts',
DETAILS = 'details',
Chart_TYPE = 'chartType',
- LAYER_TYPE = 'layerType'
+ LAYER_TYPE = 'layerType',
+ PERCENTAGE = 'percentage'
}
export interface ChartLayoutType {
@@ -27,4 +28,6 @@ export interface ChartLayoutType {
[ChartLayoutStoreEnum.Chart_TYPE]: ChartModeEnum
// 层级展示方式
[ChartLayoutStoreEnum.LAYER_TYPE]: LayerModeEnum
+ // 当前正在加载的数量
+ [ChartLayoutStoreEnum.PERCENTAGE]: number
}
diff --git a/src/store/modules/chartLayoutStore/chartLayoutStore.ts b/src/store/modules/chartLayoutStore/chartLayoutStore.ts
index c50bd520..5aa5704e 100644
--- a/src/store/modules/chartLayoutStore/chartLayoutStore.ts
+++ b/src/store/modules/chartLayoutStore/chartLayoutStore.ts
@@ -24,6 +24,8 @@ export const useChartLayoutStore = defineStore({
chartType: ChartModeEnum.SINGLE,
// 图层类型(默认图片)
layerType: LayerModeEnum.THUMBNAIL,
+ // 当前加载数量
+ percentage: 0,
// 防止值不存在
...storageChartLayout
}),
@@ -42,6 +44,9 @@ export const useChartLayoutStore = defineStore({
},
getLayerType(): LayerModeEnum {
return this.layerType
+ },
+ getPercentage(): number {
+ return this.percentage
}
},
actions: {
@@ -54,6 +59,11 @@ export const useChartLayoutStore = defineStore({
setTimeout(() => {
chartEditStore.computedScale()
}, 500)
+ },
+ setItemUnHandle(key: T, value: K): void {
+ this.$patch(state => {
+ state[key] = value
+ })
}
}
})
diff --git a/src/views/chart/ContentLoad/index.ts b/src/views/chart/ContentLoad/index.ts
new file mode 100644
index 00000000..7e41ed39
--- /dev/null
+++ b/src/views/chart/ContentLoad/index.ts
@@ -0,0 +1,3 @@
+import ContentLoad from './index.vue'
+
+export { ContentLoad }
diff --git a/src/views/chart/ContentLoad/index.vue b/src/views/chart/ContentLoad/index.vue
new file mode 100644
index 00000000..6b7905a5
--- /dev/null
+++ b/src/views/chart/ContentLoad/index.vue
@@ -0,0 +1,33 @@
+
+
+
+ 拼命加载中...
+
+
+
+
+
+
diff --git a/src/views/chart/hooks/useSync.hook.ts b/src/views/chart/hooks/useSync.hook.ts
index 3d551f00..ac006245 100644
--- a/src/views/chart/hooks/useSync.hook.ts
+++ b/src/views/chart/hooks/useSync.hook.ts
@@ -2,6 +2,8 @@ import { getUUID } from '@/utils'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { ChartEditStoreEnum, ChartEditStorage } from '@/store/modules/chartEditStore/chartEditStore.d'
import { useChartHistoryStore } from '@/store/modules/chartHistoryStore/chartHistoryStore'
+import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayoutStore'
+import { ChartLayoutStoreEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'
import { fetchChartComponent, fetchConfigComponent, createComponent } from '@/packages/index'
import { BaseEvent, EventLife, CreateComponentType, CreateComponentGroupType } from '@/packages/index.d'
import { PublicGroupConfigClass } from '@/packages/public/publicConfig'
@@ -85,7 +87,7 @@ const componentMerge = (newObject: any, sources: any, notComponent = false) => {
export const useSync = () => {
const chartEditStore = useChartEditStore()
const chartHistoryStore = useChartHistoryStore()
-
+ const chartLayoutStore = useChartLayoutStore()
/**
* * 组件动态注册
* @param projectData 项目数据
@@ -151,7 +153,14 @@ export const useSync = () => {
for (const key in projectData) {
// 组件
if (key === ChartEditStoreEnum.COMPONENT_LIST) {
+ let loadIndex = 0
+ const listLength = projectData[key].length;
+ console.log(listLength)
for (const comItem of projectData[key]) {
+ // 设置加载数量
+ let percentage = parseInt((parseFloat(`${++loadIndex / listLength}`) * 100).toString())
+ chartLayoutStore.setItemUnHandle(ChartLayoutStoreEnum.PERCENTAGE, percentage)
+ // 判断类型
if (comItem.isGroup) {
// 创建分组
let groupClass = new PublicGroupConfigClass()
@@ -182,6 +191,9 @@ export const useSync = () => {
componentMerge(chartEditStore[key], projectData[key], true)
}
}
+
+ // 清除数量
+ chartLayoutStore.setItemUnHandle(ChartLayoutStoreEnum.PERCENTAGE, 0)
}
return {
diff --git a/src/views/chart/index.vue b/src/views/chart/index.vue
index 46cbfe3e..89c60d95 100644
--- a/src/views/chart/index.vue
+++ b/src/views/chart/index.vue
@@ -32,6 +32,8 @@
:on-clickoutside="onClickOutSide"
@select="handleMenuSelect"
>
+
+