|
@@ -127,32 +127,6 @@ export default defineComponent({
|
|
|
return animationTypes[animation.type]
|
|
return animationTypes[animation.type]
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- const updateElementAnimation = (type: string) => {
|
|
|
|
|
- const animations = (currentSlideAnimations.value as PPTAnimation[]).map(item => {
|
|
|
|
|
- if (item.elId === handleElement.value.id) return { ...item, type }
|
|
|
|
|
- return item
|
|
|
|
|
- })
|
|
|
|
|
- store.commit(MutationTypes.UPDATE_SLIDE, { animations })
|
|
|
|
|
- animationPoolVisible.value = false
|
|
|
|
|
- addHistorySnapshot()
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const addAnimation = (type: string) => {
|
|
|
|
|
- if (handleElementAnimation.value) {
|
|
|
|
|
- updateElementAnimation(type)
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- const animations: PPTAnimation[] = currentSlideAnimations.value ? JSON.parse(JSON.stringify(currentSlideAnimations.value)) : []
|
|
|
|
|
- animations.push({
|
|
|
|
|
- elId: handleElement.value.id,
|
|
|
|
|
- type,
|
|
|
|
|
- duration: 1000,
|
|
|
|
|
- })
|
|
|
|
|
- store.commit(MutationTypes.UPDATE_SLIDE, { animations })
|
|
|
|
|
- animationPoolVisible.value = false
|
|
|
|
|
- addHistorySnapshot()
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
const deleteAnimation = (elId: string) => {
|
|
const deleteAnimation = (elId: string) => {
|
|
|
const animations = (currentSlideAnimations.value as PPTAnimation[]).filter(item => item.elId !== elId)
|
|
const animations = (currentSlideAnimations.value as PPTAnimation[]).filter(item => item.elId !== elId)
|
|
|
store.commit(MutationTypes.UPDATE_SLIDE, { animations })
|
|
store.commit(MutationTypes.UPDATE_SLIDE, { animations })
|
|
@@ -186,6 +160,36 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ const updateElementAnimation = (type: string) => {
|
|
|
|
|
+ const animations = (currentSlideAnimations.value as PPTAnimation[]).map(item => {
|
|
|
|
|
+ if (item.elId === handleElement.value.id) return { ...item, type }
|
|
|
|
|
+ return item
|
|
|
|
|
+ })
|
|
|
|
|
+ store.commit(MutationTypes.UPDATE_SLIDE, { animations })
|
|
|
|
|
+ animationPoolVisible.value = false
|
|
|
|
|
+ addHistorySnapshot()
|
|
|
|
|
+
|
|
|
|
|
+ runAnimation(handleElement.value.id, type)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const addAnimation = (type: string) => {
|
|
|
|
|
+ if (handleElementAnimation.value) {
|
|
|
|
|
+ updateElementAnimation(type)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const animations: PPTAnimation[] = currentSlideAnimations.value ? JSON.parse(JSON.stringify(currentSlideAnimations.value)) : []
|
|
|
|
|
+ animations.push({
|
|
|
|
|
+ elId: handleElement.value.id,
|
|
|
|
|
+ type,
|
|
|
|
|
+ duration: 1000,
|
|
|
|
|
+ })
|
|
|
|
|
+ store.commit(MutationTypes.UPDATE_SLIDE, { animations })
|
|
|
|
|
+ animationPoolVisible.value = false
|
|
|
|
|
+ addHistorySnapshot()
|
|
|
|
|
+
|
|
|
|
|
+ runAnimation(handleElement.value.id, type)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return {
|
|
return {
|
|
|
handleElement,
|
|
handleElement,
|
|
|
animationPoolVisible,
|
|
animationPoolVisible,
|
|
@@ -238,9 +242,11 @@ export default defineComponent({
|
|
|
height: 40px;
|
|
height: 40px;
|
|
|
line-height: 40px;
|
|
line-height: 40px;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
- background-color: $lightGray;
|
|
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
}
|
|
}
|
|
|
|
|
+.animation-box {
|
|
|
|
|
+ background-color: $lightGray;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
.sequence-item {
|
|
.sequence-item {
|
|
|
height: 36px;
|
|
height: 36px;
|