From 5421f82801c6f485cd3fb611e084ead528e30fc9 Mon Sep 17 00:00:00 2001 From: pipipi-pikachu Date: Mon, 8 Mar 2021 22:35:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=BC=A9=E7=95=A5?= =?UTF-8?q?=E5=9B=BE=E5=A4=9A=E9=80=89=EF=BC=88=E5=BE=85=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=93=8D=E4=BD=9C=E5=8A=9F=E8=83=BD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/constants.ts | 1 + src/store/mutations.ts | 4 ++ src/store/state.ts | 2 + src/views/Editor/Thumbnails/index.vue | 71 +++++++++++++++++++++++++-- 4 files changed, 74 insertions(+), 4 deletions(-) diff --git a/src/store/constants.ts b/src/store/constants.ts index 16e610df..cde289ca 100644 --- a/src/store/constants.ts +++ b/src/store/constants.ts @@ -21,6 +21,7 @@ export const enum MutationTypes { UPDATE_SLIDE = 'updateSlide', DELETE_SLIDE = 'deleteSlide', UPDATE_SLIDE_INDEX = 'updateSlideIndex', + UPDATE_SELECTED_SLIDES_INDEX = 'updateSelectedSlidesIndex', ADD_ELEMENT = 'addElement', UPDATE_ELEMENT = 'updateElement', REMOVE_ELEMENT_PROPS = 'removeElementProps', diff --git a/src/store/mutations.ts b/src/store/mutations.ts index 96376fb3..c451854a 100644 --- a/src/store/mutations.ts +++ b/src/store/mutations.ts @@ -106,6 +106,10 @@ export const mutations: MutationTree = { state.slideIndex = index }, + [MutationTypes.UPDATE_SELECTED_SLIDES_INDEX](state, selectedSlidesIndex: number[]) { + state.selectedSlidesIndex = selectedSlidesIndex + }, + [MutationTypes.ADD_ELEMENT](state, element: PPTElement | PPTElement[]) { const elements = Array.isArray(element) ? element : [element] const currentSlideEls = state.slides[state.slideIndex].elements diff --git a/src/store/state.ts b/src/store/state.ts index c7d18155..9aba0eef 100644 --- a/src/store/state.ts +++ b/src/store/state.ts @@ -19,6 +19,7 @@ export interface State { theme: SlideTheme; slides: Slide[]; slideIndex: number; + selectedSlidesIndex: number[]; snapshotCursor: number; snapshotLength: number; ctrlKeyState: boolean; @@ -47,6 +48,7 @@ export const state: State = { }, slides: slides, slideIndex: 0, + selectedSlidesIndex: [], snapshotCursor: -1, snapshotLength: 0, ctrlKeyState: false, diff --git a/src/views/Editor/Thumbnails/index.vue b/src/views/Editor/Thumbnails/index.vue index 608015ca..b3fc246f 100644 --- a/src/views/Editor/Thumbnails/index.vue +++ b/src/views/Editor/Thumbnails/index.vue @@ -18,8 +18,11 @@