mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
feat: 添加基础的备注功能
This commit is contained in:
parent
98d30be554
commit
9319d24f5a
@ -205,6 +205,7 @@ export interface SlideBackground {
|
|||||||
export interface Slide {
|
export interface Slide {
|
||||||
id: string;
|
id: string;
|
||||||
elements: PPTElement[];
|
elements: PPTElement[];
|
||||||
|
remark?: string;
|
||||||
background?: SlideBackground;
|
background?: SlideBackground;
|
||||||
animations?: PPTAnimation[];
|
animations?: PPTAnimation[];
|
||||||
turningMode?: 'no' | 'fade' | 'slideX' | 'slideY';
|
turningMode?: 'no' | 'fade' | 'slideX' | 'slideY';
|
||||||
|
59
src/views/Editor/Remark/index.vue
Normal file
59
src/views/Editor/Remark/index.vue
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<div class="remark">
|
||||||
|
<textarea
|
||||||
|
:value="remark"
|
||||||
|
placeholder="点击输入演讲者备注"
|
||||||
|
@input="$event => handleInput($event)"
|
||||||
|
></textarea>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { computed, defineComponent } from 'vue'
|
||||||
|
import { MutationTypes, useStore } from '@/store'
|
||||||
|
import { Slide } from '@/types/slides'
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'remark',
|
||||||
|
setup() {
|
||||||
|
const store = useStore()
|
||||||
|
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||||
|
const remark = computed(() => currentSlide.value?.remark || '')
|
||||||
|
|
||||||
|
const handleInput = (e: InputEvent) => {
|
||||||
|
const value = (e.target as HTMLTextAreaElement).value
|
||||||
|
store.commit(MutationTypes.UPDATE_SLIDE, { remark: value })
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
remark,
|
||||||
|
handleInput,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.remark {
|
||||||
|
position: relative;
|
||||||
|
border-top: 1px solid $borderColor;
|
||||||
|
background-color: $lightGray;
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
resize: none;
|
||||||
|
border: 0;
|
||||||
|
outline: 0;
|
||||||
|
padding: 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -6,6 +6,7 @@
|
|||||||
<div class="layout-content-center">
|
<div class="layout-content-center">
|
||||||
<CanvasTool class="center-top" />
|
<CanvasTool class="center-top" />
|
||||||
<Canvas class="center-body" />
|
<Canvas class="center-body" />
|
||||||
|
<Remark class="center-bottom" />
|
||||||
</div>
|
</div>
|
||||||
<Toolbar class="layout-content-right" />
|
<Toolbar class="layout-content-right" />
|
||||||
</div>
|
</div>
|
||||||
@ -23,6 +24,7 @@ import Canvas from './Canvas/index.vue'
|
|||||||
import CanvasTool from './CanvasTool/index.vue'
|
import CanvasTool from './CanvasTool/index.vue'
|
||||||
import Thumbnails from './Thumbnails/index.vue'
|
import Thumbnails from './Thumbnails/index.vue'
|
||||||
import Toolbar from './Toolbar/index.vue'
|
import Toolbar from './Toolbar/index.vue'
|
||||||
|
import Remark from './Remark/index.vue'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'editor',
|
name: 'editor',
|
||||||
@ -32,6 +34,7 @@ export default defineComponent({
|
|||||||
CanvasTool,
|
CanvasTool,
|
||||||
Thumbnails,
|
Thumbnails,
|
||||||
Toolbar,
|
Toolbar,
|
||||||
|
Remark,
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
useGlobalHotkey()
|
useGlobalHotkey()
|
||||||
@ -63,7 +66,10 @@ export default defineComponent({
|
|||||||
height: 40px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
.center-body {
|
.center-body {
|
||||||
height: calc(100% - 40px);
|
height: calc(100% - 40px - 40px);
|
||||||
|
}
|
||||||
|
.center-bottom {
|
||||||
|
height: 40px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.layout-content-right {
|
.layout-content-right {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user