mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
refactor: 更新 defineProps 语法
This commit is contained in:
parent
99a7f700f4
commit
74c3248045
@ -5,11 +5,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
defineProps({
|
withDefaults(defineProps<{
|
||||||
checked: {
|
checked?: boolean
|
||||||
type: Boolean,
|
}>(), {
|
||||||
default: false,
|
checked: false,
|
||||||
},
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -17,17 +17,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onUnmounted, PropType, ref } from 'vue'
|
import { computed, onUnmounted, ref } from 'vue'
|
||||||
|
|
||||||
import Checkboard from './Checkboard.vue'
|
import Checkboard from './Checkboard.vue'
|
||||||
import { ColorFormats } from 'tinycolor2'
|
import { ColorFormats } from 'tinycolor2'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
value: {
|
value: ColorFormats.RGBA
|
||||||
type: Object as PropType<ColorFormats.RGBA>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: 'colorChange', payload: ColorFormats.RGBA): void
|
(event: 'colorChange', payload: ColorFormats.RGBA): void
|
||||||
|
@ -5,19 +5,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
size: {
|
size?: number
|
||||||
type: Number,
|
white?: string
|
||||||
default: 8,
|
grey?: string
|
||||||
},
|
}>(), {
|
||||||
white: {
|
size: 8,
|
||||||
type: String,
|
white: '#fff',
|
||||||
default: '#fff',
|
grey: '#e6e6e6',
|
||||||
},
|
|
||||||
grey: {
|
|
||||||
type: String,
|
|
||||||
default: '#e6e6e6',
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
interface CheckboardCache {
|
interface CheckboardCache {
|
||||||
|
@ -9,15 +9,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import tinycolor, { ColorFormats } from 'tinycolor2'
|
import tinycolor, { ColorFormats } from 'tinycolor2'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
value: {
|
value: ColorFormats.RGBA
|
||||||
type: Object as PropType<ColorFormats.RGBA>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: 'colorChange', payload: ColorFormats.RGBA): void
|
(event: 'colorChange', payload: ColorFormats.RGBA): void
|
||||||
|
@ -16,19 +16,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onUnmounted, PropType, ref, watch } from 'vue'
|
import { computed, onUnmounted, ref, watch } from 'vue'
|
||||||
import tinycolor, { ColorFormats } from 'tinycolor2'
|
import tinycolor, { ColorFormats } from 'tinycolor2'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
value: {
|
value: ColorFormats.RGBA
|
||||||
type: Object as PropType<ColorFormats.RGBA>,
|
hue: number
|
||||||
required: true,
|
}>()
|
||||||
},
|
|
||||||
hue: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: 'colorChange', payload: ColorFormats.HSLA): void
|
(event: 'colorChange', payload: ColorFormats.HSLA): void
|
||||||
|
@ -19,20 +19,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onUnmounted, PropType, ref } from 'vue'
|
import { computed, onUnmounted, ref } from 'vue'
|
||||||
import tinycolor, { ColorFormats } from 'tinycolor2'
|
import tinycolor, { ColorFormats } from 'tinycolor2'
|
||||||
import { throttle, clamp } from 'lodash'
|
import { throttle, clamp } from 'lodash'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
value: {
|
value: ColorFormats.RGBA
|
||||||
type: Object as PropType<ColorFormats.RGBA>,
|
hue: number
|
||||||
required: true,
|
}>()
|
||||||
},
|
|
||||||
hue: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: 'colorChange', payload: ColorFormats.HSVA): void
|
(event: 'colorChange', payload: ColorFormats.HSVA): void
|
||||||
|
@ -89,11 +89,10 @@ import EditableInput from './EditableInput.vue'
|
|||||||
|
|
||||||
import { message } from 'ant-design-vue'
|
import { message } from 'ant-design-vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
modelValue: {
|
modelValue?: string
|
||||||
type: String,
|
}>(), {
|
||||||
default: '#e86b99',
|
modelValue: '#e86b99',
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
@ -31,19 +31,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from 'vue'
|
|
||||||
import { ContextmenuItem } from './types'
|
import { ContextmenuItem } from './types'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
menus: {
|
menus: ContextmenuItem[]
|
||||||
type: Array as PropType<ContextmenuItem[]>,
|
handleClickMenuItem: (item: ContextmenuItem) => void
|
||||||
required: true,
|
}>()
|
||||||
},
|
|
||||||
handleClickMenuItem: {
|
|
||||||
type: Function,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -21,29 +21,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { ContextmenuItem, Axis } from './types'
|
import { ContextmenuItem, Axis } from './types'
|
||||||
|
|
||||||
import MenuContent from './MenuContent.vue'
|
import MenuContent from './MenuContent.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
axis: {
|
axis: Axis
|
||||||
type: Object as PropType<Axis>,
|
el: HTMLElement
|
||||||
required: true,
|
menus: ContextmenuItem[]
|
||||||
},
|
removeContextmenu: () => void
|
||||||
el: {
|
}>()
|
||||||
type: Object as PropType<HTMLElement>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
menus: {
|
|
||||||
type: Array as PropType<ContextmenuItem[]>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
removeContextmenu: {
|
|
||||||
type: Function,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const style = computed(() => {
|
const style = computed(() => {
|
||||||
const MENU_WIDTH = 170
|
const MENU_WIDTH = 170
|
||||||
|
@ -14,12 +14,10 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
withDefaults(defineProps<{
|
||||||
defineProps({
|
accept?: string
|
||||||
accept: {
|
}>(), {
|
||||||
type: String,
|
accept: 'image/*',
|
||||||
default: 'image/*',
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
@ -8,15 +8,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
defineProps({
|
withDefaults(defineProps<{
|
||||||
loading: {
|
loading?: boolean
|
||||||
type: Boolean,
|
tip?: string
|
||||||
default: false,
|
}>(), {
|
||||||
},
|
loading: false,
|
||||||
tip: {
|
tip: '',
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -23,20 +23,11 @@
|
|||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
import { hfmath } from './hfmath'
|
import { hfmath } from './hfmath'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
latex: {
|
latex: string
|
||||||
type: String,
|
width: number
|
||||||
required: true,
|
height: number
|
||||||
},
|
}>()
|
||||||
width: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
height: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const box = ref({ x: 0, y: 0, w: 0, h: 0 })
|
const box = ref({ x: 0, y: 0, w: 0, h: 0 })
|
||||||
const pathd = ref('')
|
const pathd = ref('')
|
||||||
|
@ -6,12 +6,9 @@
|
|||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { hfmath } from './hfmath'
|
import { hfmath } from './hfmath'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
latex: {
|
latex: string
|
||||||
type: String,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const svg = computed(() => {
|
const svg = computed(() => {
|
||||||
const eq = new hfmath(props.latex)
|
const eq = new hfmath(props.latex)
|
||||||
|
@ -97,11 +97,10 @@ interface LatexResult {
|
|||||||
h: number
|
h: number
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
value: {
|
value?: string
|
||||||
type: String,
|
}>(), {
|
||||||
default: '',
|
value: '',
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
@ -28,31 +28,18 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
width: {
|
width: number
|
||||||
type: Number,
|
height: number
|
||||||
required: true,
|
left?: number
|
||||||
},
|
top?: number
|
||||||
height: {
|
title?: string
|
||||||
type: Number,
|
moveable?: boolean
|
||||||
required: true,
|
}>(), {
|
||||||
},
|
left: 10,
|
||||||
left: {
|
top: 10,
|
||||||
type: Number,
|
title: '',
|
||||||
default: 10,
|
moveable: true,
|
||||||
},
|
|
||||||
top: {
|
|
||||||
type: Number,
|
|
||||||
default: 10,
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
moveable: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
@ -55,33 +55,22 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onMounted, onUnmounted, PropType, ref, watch } from 'vue'
|
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
color: {
|
color?: string
|
||||||
type: String,
|
model?: 'pen' | 'eraser' | 'mark'
|
||||||
default: '#ffcc00',
|
blackboard?: boolean
|
||||||
},
|
penSize?: number
|
||||||
model: {
|
markSize?: number
|
||||||
type: String as PropType<'pen' | 'eraser' | 'mark'>,
|
rubberSize?: number
|
||||||
default: 'pen',
|
}>(), {
|
||||||
},
|
color: '#ffcc00',
|
||||||
blackboard: {
|
model: 'pen',
|
||||||
type: Boolean,
|
blackboard: false,
|
||||||
default: false,
|
penSize: 6,
|
||||||
},
|
markSize: 24,
|
||||||
penSize: {
|
rubberSize: 80,
|
||||||
type: Number,
|
|
||||||
default: 6,
|
|
||||||
},
|
|
||||||
markSize: {
|
|
||||||
type: Number,
|
|
||||||
default: 24,
|
|
||||||
},
|
|
||||||
rubberSize: {
|
|
||||||
type: Number,
|
|
||||||
default: 80,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
@ -5,27 +5,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { AlignmentLineAxis } from '@/types/edit'
|
import { AlignmentLineAxis } from '@/types/edit'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
type: {
|
type: 'vertical' | 'horizontal'
|
||||||
type: String as PropType<'vertical' | 'horizontal'>,
|
axis: AlignmentLineAxis
|
||||||
required: true,
|
length: number
|
||||||
},
|
canvasScale: number
|
||||||
axis: {
|
}>()
|
||||||
type: Object as PropType<AlignmentLineAxis>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
length: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
canvasScale: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
// 吸附对齐线的位置
|
// 吸附对齐线的位置
|
||||||
const left = computed(() => props.axis.x * props.canvasScale + 'px')
|
const left = computed(() => props.axis.x * props.canvasScale + 'px')
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { ElementTypes, PPTElement } from '@/types/slides'
|
import { ElementTypes, PPTElement } from '@/types/slides'
|
||||||
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
||||||
|
|
||||||
@ -41,28 +41,13 @@ import LatexElement from '@/views/components/element/LatexElement/index.vue'
|
|||||||
import VideoElement from '@/views/components/element/VideoElement/index.vue'
|
import VideoElement from '@/views/components/element/VideoElement/index.vue'
|
||||||
import AudioElement from '@/views/components/element/AudioElement/index.vue'
|
import AudioElement from '@/views/components/element/AudioElement/index.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTElement
|
||||||
type: Object as PropType<PPTElement>,
|
elementIndex: number
|
||||||
required: true,
|
isMultiSelect: boolean
|
||||||
},
|
selectElement: (e: MouseEvent | TouchEvent, element: PPTElement, canMove?: boolean) => void
|
||||||
elementIndex: {
|
openLinkDialog: () => void
|
||||||
type: Number,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
isMultiSelect: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
selectElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTElement, canMove?: boolean) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
openLinkDialog: {
|
|
||||||
type: Function as PropType<() => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const currentElementComponent = computed<unknown>(() => {
|
const currentElementComponent = computed<unknown>(() => {
|
||||||
const elementTypeMap = {
|
const elementTypeMap = {
|
||||||
|
@ -10,31 +10,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
defineProps({
|
defineProps<{
|
||||||
top: {
|
top: number
|
||||||
type: Number,
|
left: number
|
||||||
required: true,
|
width: number
|
||||||
},
|
height: number
|
||||||
left: {
|
quadrant: 1 | 2 | 3 | 4
|
||||||
type: Number,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
width: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
height: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
quadrant: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
validator(value: number) {
|
|
||||||
return [1, 2, 3, 4].includes(value)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -3,18 +3,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from 'vue'
|
|
||||||
import { OperateBorderLines } from '@/types/edit'
|
import { OperateBorderLines } from '@/types/edit'
|
||||||
|
|
||||||
defineProps({
|
withDefaults(defineProps<{
|
||||||
type: {
|
type: OperateBorderLines
|
||||||
type: String as PropType<OperateBorderLines>,
|
isWide?: boolean
|
||||||
required: true,
|
}>(), {
|
||||||
},
|
isWide: false
|
||||||
isWide: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore } from '@/store'
|
import { useMainStore } from '@/store'
|
||||||
import { PPTShapeElement, PPTVideoElement, PPTLatexElement, PPTAudioElement } from '@/types/slides'
|
import { PPTShapeElement, PPTVideoElement, PPTLatexElement, PPTAudioElement } from '@/types/slides'
|
||||||
@ -47,24 +47,12 @@ import BorderLine from './BorderLine.vue'
|
|||||||
|
|
||||||
type PPTElement = PPTShapeElement | PPTVideoElement | PPTLatexElement | PPTAudioElement
|
type PPTElement = PPTShapeElement | PPTVideoElement | PPTLatexElement | PPTAudioElement
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTElement
|
||||||
type: Object as PropType<PPTElement>,
|
handlerVisible: boolean
|
||||||
required: true,
|
rotateElement: (element: PPTElement) => void
|
||||||
},
|
scaleElement: (e: MouseEvent, element: PPTElement, command: OperateResizeHandlers) => void
|
||||||
handlerVisible: {
|
}>()
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
rotateElement: {
|
|
||||||
type: Function as PropType<(element: PPTElement) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
scaleElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent, element: PPTElement, command: OperateResizeHandlers) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { canvasScale } = storeToRefs(useMainStore())
|
const { canvasScale } = storeToRefs(useMainStore())
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore } from '@/store'
|
import { useMainStore } from '@/store'
|
||||||
import { PPTImageElement } from '@/types/slides'
|
import { PPTImageElement } from '@/types/slides'
|
||||||
@ -44,24 +44,12 @@ import RotateHandler from './RotateHandler.vue'
|
|||||||
import ResizeHandler from './ResizeHandler.vue'
|
import ResizeHandler from './ResizeHandler.vue'
|
||||||
import BorderLine from './BorderLine.vue'
|
import BorderLine from './BorderLine.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTImageElement
|
||||||
type: Object as PropType<PPTImageElement>,
|
handlerVisible: boolean
|
||||||
required: true,
|
rotateElement: (element: PPTImageElement) => void
|
||||||
},
|
scaleElement: (e: MouseEvent, element: PPTImageElement, command: OperateResizeHandlers) => void
|
||||||
handlerVisible: {
|
}>()
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
rotateElement: {
|
|
||||||
type: Function as PropType<(element: PPTImageElement) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
scaleElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent, element: PPTImageElement, command: OperateResizeHandlers) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { canvasScale, clipingImageElementId } = storeToRefs(useMainStore())
|
const { canvasScale, clipingImageElementId } = storeToRefs(useMainStore())
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore } from '@/store'
|
import { useMainStore } from '@/store'
|
||||||
import { PPTLineElement } from '@/types/slides'
|
import { PPTLineElement } from '@/types/slides'
|
||||||
@ -48,20 +48,11 @@ import { OperateLineHandlers } from '@/types/edit'
|
|||||||
|
|
||||||
import ResizeHandler from './ResizeHandler.vue'
|
import ResizeHandler from './ResizeHandler.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTLineElement
|
||||||
type: Object as PropType<PPTLineElement>,
|
handlerVisible: boolean
|
||||||
required: true,
|
dragLineElement: (e: MouseEvent, element: PPTLineElement, command: OperateLineHandlers) => void
|
||||||
},
|
}>()
|
||||||
handlerVisible: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
dragLineElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent, element: PPTLineElement, command: OperateLineHandlers) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { canvasScale } = storeToRefs(useMainStore())
|
const { canvasScale } = storeToRefs(useMainStore())
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore, useSlidesStore } from '@/store'
|
import { useMainStore, useSlidesStore } from '@/store'
|
||||||
import { PPTElement, PPTElementLink } from '@/types/slides'
|
import { PPTElement, PPTElementLink } from '@/types/slides'
|
||||||
@ -19,20 +19,11 @@ import useLink from '@/hooks/useLink'
|
|||||||
|
|
||||||
import { Divider } from 'ant-design-vue'
|
import { Divider } from 'ant-design-vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTElement
|
||||||
type: Object as PropType<PPTElement>,
|
link: PPTElementLink
|
||||||
required: true,
|
openLinkDialog: () => void
|
||||||
},
|
}>()
|
||||||
link: {
|
|
||||||
type: Object as PropType<PPTElementLink>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
openLinkDialog: {
|
|
||||||
type: Function as PropType<() => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const mainStore = useMainStore()
|
const mainStore = useMainStore()
|
||||||
const slidesStore = useSlidesStore()
|
const slidesStore = useSlidesStore()
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, ref, PropType, watchEffect } from 'vue'
|
import { computed, ref, watchEffect } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore } from '@/store'
|
import { useMainStore } from '@/store'
|
||||||
import { PPTElement } from '@/types/slides'
|
import { PPTElement } from '@/types/slides'
|
||||||
@ -32,16 +32,10 @@ import useCommonOperate from '../hooks/useCommonOperate'
|
|||||||
import ResizeHandler from './ResizeHandler.vue'
|
import ResizeHandler from './ResizeHandler.vue'
|
||||||
import BorderLine from './BorderLine.vue'
|
import BorderLine from './BorderLine.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementList: {
|
elementList: PPTElement[]
|
||||||
type: Array as PropType<PPTElement[]>,
|
scaleMultiElement: (e: MouseEvent, range: MultiSelectRange, command: OperateResizeHandlers) => void
|
||||||
required: true,
|
}>()
|
||||||
},
|
|
||||||
scaleMultiElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent, range: MultiSelectRange, command: OperateResizeHandlers) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { activeElementIdList, canvasScale } = storeToRefs(useMainStore())
|
const { activeElementIdList, canvasScale } = storeToRefs(useMainStore())
|
||||||
|
|
||||||
|
@ -3,18 +3,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { OperateResizeHandlers } from '@/types/edit'
|
import { OperateResizeHandlers } from '@/types/edit'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
type: {
|
type: OperateResizeHandlers
|
||||||
type: String as PropType<OperateResizeHandlers>,
|
rotate?: number
|
||||||
default: '',
|
}>(), {
|
||||||
},
|
rotate: 0,
|
||||||
rotate: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const rotateClassName = computed(() => {
|
const rotateClassName = computed(() => {
|
||||||
|
@ -39,7 +39,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore } from '@/store'
|
import { useMainStore } from '@/store'
|
||||||
import { PPTShapeElement } from '@/types/slides'
|
import { PPTShapeElement } from '@/types/slides'
|
||||||
@ -51,28 +51,13 @@ import RotateHandler from './RotateHandler.vue'
|
|||||||
import ResizeHandler from './ResizeHandler.vue'
|
import ResizeHandler from './ResizeHandler.vue'
|
||||||
import BorderLine from './BorderLine.vue'
|
import BorderLine from './BorderLine.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTShapeElement
|
||||||
type: Object as PropType<PPTShapeElement>,
|
handlerVisible: boolean
|
||||||
required: true,
|
rotateElement: (element: PPTShapeElement) => void
|
||||||
},
|
scaleElement: (e: MouseEvent, element: PPTShapeElement, command: OperateResizeHandlers) => void
|
||||||
handlerVisible: {
|
moveShapeKeypoint: (e: MouseEvent, element: PPTShapeElement) => void
|
||||||
type: Boolean,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
rotateElement: {
|
|
||||||
type: Function as PropType<(element: PPTShapeElement) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
scaleElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent, element: PPTShapeElement, command: OperateResizeHandlers) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
moveShapeKeypoint: {
|
|
||||||
type: Function as PropType<(e: MouseEvent, element: PPTShapeElement) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { canvasScale } = storeToRefs(useMainStore())
|
const { canvasScale } = storeToRefs(useMainStore())
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore } from '@/store'
|
import { useMainStore } from '@/store'
|
||||||
import { PPTTableElement } from '@/types/slides'
|
import { PPTTableElement } from '@/types/slides'
|
||||||
@ -44,24 +44,12 @@ import RotateHandler from './RotateHandler.vue'
|
|||||||
import ResizeHandler from './ResizeHandler.vue'
|
import ResizeHandler from './ResizeHandler.vue'
|
||||||
import BorderLine from './BorderLine.vue'
|
import BorderLine from './BorderLine.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTTableElement
|
||||||
type: Object as PropType<PPTTableElement>,
|
handlerVisible: boolean
|
||||||
required: true,
|
rotateElement: (element: PPTTableElement) => void
|
||||||
},
|
scaleElement: (e: MouseEvent, element: PPTTableElement, command: OperateResizeHandlers) => void
|
||||||
handlerVisible: {
|
}>()
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
rotateElement: {
|
|
||||||
type: Function as PropType<(element: PPTTableElement) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
scaleElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent, element: PPTTableElement, command: OperateResizeHandlers) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { canvasScale } = storeToRefs(useMainStore())
|
const { canvasScale } = storeToRefs(useMainStore())
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore } from '@/store'
|
import { useMainStore } from '@/store'
|
||||||
import { PPTTextElement } from '@/types/slides'
|
import { PPTTextElement } from '@/types/slides'
|
||||||
@ -44,24 +44,12 @@ import RotateHandler from './RotateHandler.vue'
|
|||||||
import ResizeHandler from './ResizeHandler.vue'
|
import ResizeHandler from './ResizeHandler.vue'
|
||||||
import BorderLine from './BorderLine.vue'
|
import BorderLine from './BorderLine.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTTextElement
|
||||||
type: Object as PropType<PPTTextElement>,
|
handlerVisible: boolean
|
||||||
required: true,
|
rotateElement: (element: PPTTextElement) => void
|
||||||
},
|
scaleElement: (e: MouseEvent, element: PPTTextElement, command: OperateResizeHandlers) => void
|
||||||
handlerVisible: {
|
}>()
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
rotateElement: {
|
|
||||||
type: Function as PropType<(element: PPTTextElement) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
scaleElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent, element: PPTTextElement, command: OperateResizeHandlers) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { canvasScale } = storeToRefs(useMainStore())
|
const { canvasScale } = storeToRefs(useMainStore())
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType, computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore, useSlidesStore } from '@/store'
|
import { useMainStore, useSlidesStore } from '@/store'
|
||||||
import { ElementTypes, PPTElement, PPTLineElement, PPTVideoElement, PPTAudioElement, PPTShapeElement } from '@/types/slides'
|
import { ElementTypes, PPTElement, PPTLineElement, PPTVideoElement, PPTAudioElement, PPTShapeElement } from '@/types/slides'
|
||||||
@ -52,48 +52,18 @@ import TableElementOperate from './TableElementOperate.vue'
|
|||||||
import CommonElementOperate from './CommonElementOperate.vue'
|
import CommonElementOperate from './CommonElementOperate.vue'
|
||||||
import LinkHandler from './LinkHandler.vue'
|
import LinkHandler from './LinkHandler.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTElement
|
||||||
type: Object as PropType<PPTElement>,
|
isSelected: boolean
|
||||||
required: true,
|
isActive: boolean
|
||||||
},
|
isActiveGroupElement: boolean
|
||||||
isSelected: {
|
isMultiSelect: boolean
|
||||||
type: Boolean,
|
rotateElement: (element: Exclude<PPTElement, PPTLineElement | PPTVideoElement | PPTAudioElement>) => void
|
||||||
required: true,
|
scaleElement: (e: MouseEvent, element: Exclude<PPTElement, PPTLineElement>, command: OperateResizeHandlers) => void
|
||||||
},
|
dragLineElement: (e: MouseEvent, element: PPTLineElement, command: OperateLineHandlers) => void
|
||||||
isActive: {
|
moveShapeKeypoint: (e: MouseEvent, element: PPTShapeElement) => void
|
||||||
type: Boolean,
|
openLinkDialog: () => void
|
||||||
required: true,
|
}>()
|
||||||
},
|
|
||||||
isActiveGroupElement: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
isMultiSelect: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
rotateElement: {
|
|
||||||
type: Function as PropType<(element: Exclude<PPTElement, PPTLineElement | PPTVideoElement | PPTAudioElement>) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
scaleElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent, element: Exclude<PPTElement, PPTLineElement>, command: OperateResizeHandlers) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
dragLineElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent, element: PPTLineElement, command: OperateLineHandlers) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
moveShapeKeypoint: {
|
|
||||||
type: Function as PropType<(e: MouseEvent, element: PPTShapeElement) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
openLinkDialog: {
|
|
||||||
type: Function as PropType<() => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { canvasScale, toolbarState } = storeToRefs(useMainStore())
|
const { canvasScale, toolbarState } = storeToRefs(useMainStore())
|
||||||
const { formatedAnimations } = storeToRefs(useSlidesStore())
|
const { formatedAnimations } = storeToRefs(useSlidesStore())
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore } from '@/store'
|
import { useMainStore } from '@/store'
|
||||||
|
|
||||||
@ -48,12 +48,9 @@ interface ViewportStyles {
|
|||||||
height: number
|
height: number
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
viewportStyles: {
|
viewportStyles: ViewportStyles
|
||||||
type: Object as PropType<ViewportStyles>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { canvasScale } = storeToRefs(useMainStore())
|
const { canvasScale } = storeToRefs(useMainStore())
|
||||||
|
|
||||||
|
@ -27,15 +27,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from 'vue'
|
|
||||||
import { ShapePoolItem } from '@/configs/shapes'
|
import { ShapePoolItem } from '@/configs/shapes'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
shape: {
|
shape: ShapePoolItem
|
||||||
type: Object as PropType<ShapePoolItem>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -17,12 +17,9 @@ import { computed } from 'vue'
|
|||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSlidesStore } from '@/store'
|
import { useSlidesStore } from '@/store'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
height: {
|
height: number
|
||||||
type: Number,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: 'update:height', payload: number): void
|
(event: 'update:height', payload: number): void
|
||||||
|
@ -55,19 +55,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onMounted, onUnmounted, PropType, ref } from 'vue'
|
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
||||||
import { ChartData } from '@/types/slides'
|
import { ChartData } from '@/types/slides'
|
||||||
import { KEYS } from '@/configs/hotkey'
|
import { KEYS } from '@/configs/hotkey'
|
||||||
import { pasteCustomClipboardString, pasteExcelClipboardString } from '@/utils/clipboard'
|
import { pasteCustomClipboardString, pasteExcelClipboardString } from '@/utils/clipboard'
|
||||||
|
|
||||||
import { Button } from 'ant-design-vue'
|
import { Button } from 'ant-design-vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
data: {
|
data: ChartData
|
||||||
type: Object as PropType<ChartData>,
|
}>()
|
||||||
required: true,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: 'save', payload: ChartData): void
|
(event: 'save', payload: ChartData): void
|
||||||
|
@ -10,12 +10,9 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Button } from 'ant-design-vue'
|
import { Button } from 'ant-design-vue'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
color: {
|
color: string
|
||||||
type: String,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -62,11 +62,10 @@ import {
|
|||||||
} from 'ant-design-vue'
|
} from 'ant-design-vue'
|
||||||
const SelectOption = Select.Option
|
const SelectOption = Select.Option
|
||||||
|
|
||||||
defineProps({
|
withDefaults(defineProps<{
|
||||||
fixed: {
|
fixed?: boolean
|
||||||
type: Boolean,
|
}>(), {
|
||||||
default: false,
|
fixed: false,
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const slidesStore = useSlidesStore()
|
const slidesStore = useSlidesStore()
|
||||||
|
@ -10,12 +10,9 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Button } from 'ant-design-vue'
|
import { Button } from 'ant-design-vue'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
color: {
|
color: string
|
||||||
type: String,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -9,18 +9,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from 'vue'
|
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSnapshotStore } from '@/store'
|
import { useSnapshotStore } from '@/store'
|
||||||
import { Mode } from '@/types/mobile'
|
import { Mode } from '@/types/mobile'
|
||||||
import useHistorySnapshot from '@/hooks/useHistorySnapshot'
|
import useHistorySnapshot from '@/hooks/useHistorySnapshot'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
changeMode: {
|
changeMode: (mode: Mode) => void
|
||||||
type: Function as PropType<(mode: Mode) => void>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { canUndo, canRedo } = storeToRefs(useSnapshotStore())
|
const { canUndo, canRedo } = storeToRefs(useSnapshotStore())
|
||||||
const { redo, undo } = useHistorySnapshot()
|
const { redo, undo } = useHistorySnapshot()
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { ElementTypes, PPTElement } from '@/types/slides'
|
import { ElementTypes, PPTElement } from '@/types/slides'
|
||||||
|
|
||||||
import ImageElement from '@/views/components/element/ImageElement/index.vue'
|
import ImageElement from '@/views/components/element/ImageElement/index.vue'
|
||||||
@ -28,20 +28,11 @@ import LatexElement from '@/views/components/element/LatexElement/index.vue'
|
|||||||
import VideoElement from '@/views/components/element/VideoElement/index.vue'
|
import VideoElement from '@/views/components/element/VideoElement/index.vue'
|
||||||
import AudioElement from '@/views/components/element/AudioElement/index.vue'
|
import AudioElement from '@/views/components/element/AudioElement/index.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTElement
|
||||||
type: Object as PropType<PPTElement>,
|
elementIndex: number
|
||||||
required: true,
|
selectElement: (e: TouchEvent, element: PPTElement, canMove?: boolean) => void
|
||||||
},
|
}>()
|
||||||
elementIndex: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
selectElement: {
|
|
||||||
type: Function as PropType<(e: TouchEvent, element: PPTElement, canMove?: boolean) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const currentElementComponent = computed<unknown>(() => {
|
const currentElementComponent = computed<unknown>(() => {
|
||||||
const elementTypeMap = {
|
const elementTypeMap = {
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType, computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { PPTElement, PPTLineElement } from '@/types/slides'
|
import { PPTElement, PPTLineElement } from '@/types/slides'
|
||||||
import useCommonOperate from '@/views/Editor/Canvas/hooks/useCommonOperate'
|
import useCommonOperate from '@/views/Editor/Canvas/hooks/useCommonOperate'
|
||||||
import { OperateResizeHandlers } from '@/types/edit'
|
import { OperateResizeHandlers } from '@/types/edit'
|
||||||
@ -38,24 +38,12 @@ import { OperateResizeHandlers } from '@/types/edit'
|
|||||||
import BorderLine from '@/views/Editor/Canvas/Operate/BorderLine.vue'
|
import BorderLine from '@/views/Editor/Canvas/Operate/BorderLine.vue'
|
||||||
import ResizeHandler from '@/views/Editor/Canvas/Operate/ResizeHandler.vue'
|
import ResizeHandler from '@/views/Editor/Canvas/Operate/ResizeHandler.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: Exclude<PPTElement, PPTLineElement>
|
||||||
type: Object as PropType<Exclude<PPTElement, PPTLineElement>>,
|
isSelected: boolean
|
||||||
required: true,
|
canvasScale: number
|
||||||
},
|
scaleElement: (e: MouseEvent, element: Exclude<PPTElement, PPTLineElement>, command: OperateResizeHandlers) => void
|
||||||
isSelected: {
|
}>()
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
canvasScale: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
scaleElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent, element: Exclude<PPTElement, PPTLineElement>, command: OperateResizeHandlers) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const rotate = computed(() => 'rotate' in props.elementInfo ? props.elementInfo.rotate : 0)
|
const rotate = computed(() => 'rotate' in props.elementInfo ? props.elementInfo.rotate : 0)
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onMounted, PropType, ref, watchEffect } from 'vue'
|
import { computed, onMounted, ref, watchEffect } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore, useSlidesStore } from '@/store'
|
import { useMainStore, useSlidesStore } from '@/store'
|
||||||
import { PPTElement } from '@/types/slides'
|
import { PPTElement } from '@/types/slides'
|
||||||
@ -58,12 +58,9 @@ import SlideToolbar from './SlideToolbar.vue'
|
|||||||
import ElementToolbar from './ElementToolbar.vue'
|
import ElementToolbar from './ElementToolbar.vue'
|
||||||
import Header from './Header.vue'
|
import Header from './Header.vue'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
changeMode: {
|
changeMode: (mode: Mode) => void
|
||||||
type: Function as PropType<(mode: Mode) => void>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const slidesStore = useSlidesStore()
|
const slidesStore = useSlidesStore()
|
||||||
const mainStore = useMainStore()
|
const mainStore = useMainStore()
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onMounted, PropType, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSlidesStore } from '@/store'
|
import { useSlidesStore } from '@/store'
|
||||||
import { Mode } from '@/types/mobile'
|
import { Mode } from '@/types/mobile'
|
||||||
@ -60,12 +60,9 @@ import { Mode } from '@/types/mobile'
|
|||||||
import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
|
import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
|
||||||
import MobileThumbnails from './MobileThumbnails.vue'
|
import MobileThumbnails from './MobileThumbnails.vue'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
changeMode: {
|
changeMode: (mode: Mode) => void
|
||||||
type: Function as PropType<(mode: Mode) => void>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const slidesStore = useSlidesStore()
|
const slidesStore = useSlidesStore()
|
||||||
const { slides, slideIndex, currentSlide, viewportRatio } = storeToRefs(slidesStore)
|
const { slides, slideIndex, currentSlide, viewportRatio } = storeToRefs(slidesStore)
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType, onMounted, ref } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSlidesStore } from '@/store'
|
import { useSlidesStore } from '@/store'
|
||||||
import useLoadSlides from '@/hooks/useLoadSlides'
|
import useLoadSlides from '@/hooks/useLoadSlides'
|
||||||
@ -27,12 +27,9 @@ import { Mode } from '@/types/mobile'
|
|||||||
import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
|
import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
|
||||||
import { Divider } from 'ant-design-vue'
|
import { Divider } from 'ant-design-vue'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
changeMode: {
|
changeMode: (mode: Mode) => void
|
||||||
type: Function as PropType<(mode: Mode) => void>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { slides } = storeToRefs(useSlidesStore())
|
const { slides } = storeToRefs(useSlidesStore())
|
||||||
const { slidesLoadLimit } = useLoadSlides()
|
const { slidesLoadLimit } = useLoadSlides()
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType, ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSlidesStore } from '@/store'
|
import { useSlidesStore } from '@/store'
|
||||||
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
||||||
@ -83,12 +83,9 @@ import WritingBoardTool from './WritingBoardTool.vue'
|
|||||||
import CountdownTimer from './CountdownTimer.vue'
|
import CountdownTimer from './CountdownTimer.vue'
|
||||||
import { Tooltip } from 'ant-design-vue'
|
import { Tooltip } from 'ant-design-vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
changeViewMode: {
|
changeViewMode: (mode: 'base' | 'presenter') => void
|
||||||
type: Function as PropType<(mode: 'base' | 'presenter') => void>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { slides, slideIndex } = storeToRefs(useSlidesStore())
|
const { slides, slideIndex } = storeToRefs(useSlidesStore())
|
||||||
|
|
||||||
|
@ -47,15 +47,12 @@ import { fillDigit } from '@/utils/common'
|
|||||||
|
|
||||||
import MoveablePanel from '@/components/MoveablePanel.vue'
|
import MoveablePanel from '@/components/MoveablePanel.vue'
|
||||||
|
|
||||||
defineProps({
|
withDefaults(defineProps<{
|
||||||
left: {
|
left?: number
|
||||||
type: Number,
|
top?: number
|
||||||
default: 5,
|
}>(), {
|
||||||
},
|
left: 5,
|
||||||
top: {
|
top: 5,
|
||||||
type: Number,
|
|
||||||
default: 5,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, nextTick, ref, watch, PropType } from 'vue'
|
import { computed, nextTick, ref, watch } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSlidesStore } from '@/store'
|
import { useSlidesStore } from '@/store'
|
||||||
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
||||||
@ -95,12 +95,9 @@ import WritingBoardTool from './WritingBoardTool.vue'
|
|||||||
import CountdownTimer from './CountdownTimer.vue'
|
import CountdownTimer from './CountdownTimer.vue'
|
||||||
import { Divider } from 'ant-design-vue'
|
import { Divider } from 'ant-design-vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
changeViewMode: {
|
changeViewMode: (mode: 'base' | 'presenter') => void
|
||||||
type: Function as PropType<(mode: 'base' | 'presenter') => void>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { slides, slideIndex, viewportRatio, currentSlide } = storeToRefs(useSlidesStore())
|
const { slides, slideIndex, viewportRatio, currentSlide } = storeToRefs(useSlidesStore())
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSlidesStore } from '@/store'
|
import { useSlidesStore } from '@/store'
|
||||||
import { ElementTypes, PPTElement } from '@/types/slides'
|
import { ElementTypes, PPTElement } from '@/types/slides'
|
||||||
@ -35,28 +35,13 @@ import BaseLatexElement from '@/views/components/element/LatexElement/BaseLatexE
|
|||||||
import ScreenVideoElement from '@/views/components/element/VideoElement/ScreenVideoElement.vue'
|
import ScreenVideoElement from '@/views/components/element/VideoElement/ScreenVideoElement.vue'
|
||||||
import ScreenAudioElement from '@/views/components/element/AudioElement/ScreenAudioElement.vue'
|
import ScreenAudioElement from '@/views/components/element/AudioElement/ScreenAudioElement.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTElement
|
||||||
type: Object as PropType<PPTElement>,
|
elementIndex: number
|
||||||
required: true,
|
animationIndex: number
|
||||||
},
|
turnSlideToId: (id: string) => void
|
||||||
elementIndex: {
|
manualExitFullscreen: () => void
|
||||||
type: Number,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
animationIndex: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
turnSlideToId: {
|
|
||||||
type: Function as PropType<(id: string) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
manualExitFullscreen: {
|
|
||||||
type: Function as PropType<() => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const currentElementComponent = computed<unknown>(() => {
|
const currentElementComponent = computed<unknown>(() => {
|
||||||
const elementTypeMap = {
|
const elementTypeMap = {
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType, provide } from 'vue'
|
import { computed, provide } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSlidesStore } from '@/store'
|
import { useSlidesStore } from '@/store'
|
||||||
import { Slide } from '@/types/slides'
|
import { Slide } from '@/types/slides'
|
||||||
@ -31,28 +31,13 @@ import useSlideBackgroundStyle from '@/hooks/useSlideBackgroundStyle'
|
|||||||
|
|
||||||
import ScreenElement from './ScreenElement.vue'
|
import ScreenElement from './ScreenElement.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
slide: {
|
slide: Slide
|
||||||
type: Object as PropType<Slide>,
|
scale: number
|
||||||
required: true,
|
animationIndex: number
|
||||||
},
|
turnSlideToId: (id: string) => void
|
||||||
scale: {
|
manualExitFullscreen: () => void
|
||||||
type: Number,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
animationIndex: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
turnSlideToId: {
|
|
||||||
type: Function as PropType<(id: string) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
manualExitFullscreen: {
|
|
||||||
type: Function as PropType<() => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { viewportRatio } = storeToRefs(useSlidesStore())
|
const { viewportRatio } = storeToRefs(useSlidesStore())
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType, provide } from 'vue'
|
import { computed, provide } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSlidesStore } from '@/store'
|
import { useSlidesStore } from '@/store'
|
||||||
import { injectKeySlideScale } from '@/types/injectKey'
|
import { injectKeySlideScale } from '@/types/injectKey'
|
||||||
@ -43,28 +43,13 @@ import { VIEWPORT_SIZE } from '@/configs/canvas'
|
|||||||
|
|
||||||
import ScreenSlide from './ScreenSlide.vue'
|
import ScreenSlide from './ScreenSlide.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
slideWidth: {
|
slideWidth: number
|
||||||
type: Number,
|
slideHeight: number
|
||||||
required: true,
|
animationIndex: number
|
||||||
},
|
turnSlideToId: (id: string) => void
|
||||||
slideHeight: {
|
manualExitFullscreen: () => void
|
||||||
type: Number,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
animationIndex: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
turnSlideToId: {
|
|
||||||
type: Function as PropType<(id: string) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
manualExitFullscreen: {
|
|
||||||
type: Function as PropType<() => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { slides, slideIndex, currentSlide } = storeToRefs(useSlidesStore())
|
const { slides, slideIndex, currentSlide } = storeToRefs(useSlidesStore())
|
||||||
|
|
||||||
|
@ -18,19 +18,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from 'vue'
|
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSlidesStore } from '@/store'
|
import { useSlidesStore } from '@/store'
|
||||||
import useLoadSlides from '@/hooks/useLoadSlides'
|
import useLoadSlides from '@/hooks/useLoadSlides'
|
||||||
|
|
||||||
import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
|
import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
turnSlideToIndex: {
|
turnSlideToIndex: (index: number) => void
|
||||||
type: Function as PropType<(index: number) => void>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: 'close'): void
|
(event: 'close'): void
|
||||||
|
@ -104,23 +104,14 @@ const writingBoardColors = ['#000000', '#ffffff', '#1e497b', '#4e81bb', '#e2534d
|
|||||||
|
|
||||||
type WritingBoardModel = 'pen' | 'mark' | 'eraser'
|
type WritingBoardModel = 'pen' | 'mark' | 'eraser'
|
||||||
|
|
||||||
defineProps({
|
withDefaults(defineProps<{
|
||||||
slideWidth: {
|
slideWidth: number
|
||||||
type: Number,
|
slideHeight: number
|
||||||
required: true,
|
left?: number
|
||||||
},
|
top?: number
|
||||||
slideHeight: {
|
}>(), {
|
||||||
type: Number,
|
left: -5,
|
||||||
required: true,
|
top: -5,
|
||||||
},
|
|
||||||
left: {
|
|
||||||
type: Number,
|
|
||||||
default: -5,
|
|
||||||
},
|
|
||||||
top: {
|
|
||||||
type: Number,
|
|
||||||
default: -5,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { ElementTypes, PPTElement } from '@/types/slides'
|
import { ElementTypes, PPTElement } from '@/types/slides'
|
||||||
|
|
||||||
import BaseImageElement from '@/views/components/element/ImageElement/BaseImageElement.vue'
|
import BaseImageElement from '@/views/components/element/ImageElement/BaseImageElement.vue'
|
||||||
@ -28,16 +28,10 @@ import BaseLatexElement from '@/views/components/element/LatexElement/BaseLatexE
|
|||||||
import BaseVideoElement from '@/views/components/element/VideoElement/BaseVideoElement.vue'
|
import BaseVideoElement from '@/views/components/element/VideoElement/BaseVideoElement.vue'
|
||||||
import BaseAudioElement from '@/views/components/element/AudioElement/BaseAudioElement.vue'
|
import BaseAudioElement from '@/views/components/element/AudioElement/BaseAudioElement.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTElement
|
||||||
type: Object as PropType<PPTElement>,
|
elementIndex: number
|
||||||
required: true,
|
}>()
|
||||||
},
|
|
||||||
elementIndex: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const currentElementComponent = computed<unknown>(() => {
|
const currentElementComponent = computed<unknown>(() => {
|
||||||
const elementTypeMap = {
|
const elementTypeMap = {
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType, provide } from 'vue'
|
import { computed, provide } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSlidesStore } from '@/store'
|
import { useSlidesStore } from '@/store'
|
||||||
import { Slide } from '@/types/slides'
|
import { Slide } from '@/types/slides'
|
||||||
@ -37,19 +37,12 @@ import useSlideBackgroundStyle from '@/hooks/useSlideBackgroundStyle'
|
|||||||
|
|
||||||
import ThumbnailElement from './ThumbnailElement.vue'
|
import ThumbnailElement from './ThumbnailElement.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
slide: {
|
slide: Slide
|
||||||
type: Object as PropType<Slide>,
|
size: number
|
||||||
required: true,
|
visible?: boolean
|
||||||
},
|
}>(), {
|
||||||
size: {
|
visible: true,
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
visible: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const { viewportRatio } = storeToRefs(useSlidesStore())
|
const { viewportRatio } = storeToRefs(useSlidesStore())
|
||||||
|
@ -76,23 +76,14 @@
|
|||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
import { message } from 'ant-design-vue'
|
import { message } from 'ant-design-vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
src: {
|
src: string
|
||||||
type: String,
|
loop: boolean
|
||||||
required: true,
|
autoplay?: boolean
|
||||||
},
|
scale?: number
|
||||||
loop: {
|
}>(), {
|
||||||
type: Boolean,
|
autoplay: false,
|
||||||
required: true,
|
scale: 1,
|
||||||
},
|
|
||||||
autoplay: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
scale: {
|
|
||||||
type: Number,
|
|
||||||
default: 1,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const secondToTime = (second = 0) => {
|
const secondToTime = (second = 0) => {
|
||||||
|
@ -25,15 +25,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { PPTAudioElement } from '@/types/slides'
|
import { PPTAudioElement } from '@/types/slides'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTAudioElement
|
||||||
type: Object as PropType<PPTAudioElement>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const audioIconSize = computed(() => {
|
const audioIconSize = computed(() => {
|
||||||
return Math.min(props.elementInfo.width, props.elementInfo.height) + 'px'
|
return Math.min(props.elementInfo.width, props.elementInfo.height) + 'px'
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, inject, PropType, ref } from 'vue'
|
import { computed, inject, ref } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSlidesStore } from '@/store'
|
import { useSlidesStore } from '@/store'
|
||||||
import { PPTAudioElement } from '@/types/slides'
|
import { PPTAudioElement } from '@/types/slides'
|
||||||
@ -45,12 +45,9 @@ import { VIEWPORT_SIZE } from '@/configs/canvas'
|
|||||||
|
|
||||||
import AudioPlayer from './AudioPlayer.vue'
|
import AudioPlayer from './AudioPlayer.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTAudioElement
|
||||||
type: Object as PropType<PPTAudioElement>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { viewportRatio, currentSlide } = storeToRefs(useSlidesStore())
|
const { viewportRatio, currentSlide } = storeToRefs(useSlidesStore())
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore, useSlidesStore } from '@/store'
|
import { useMainStore, useSlidesStore } from '@/store'
|
||||||
import { PPTAudioElement } from '@/types/slides'
|
import { PPTAudioElement } from '@/types/slides'
|
||||||
@ -49,19 +49,11 @@ import { VIEWPORT_SIZE } from '@/configs/canvas'
|
|||||||
|
|
||||||
import AudioPlayer from './AudioPlayer.vue'
|
import AudioPlayer from './AudioPlayer.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTAudioElement
|
||||||
type: Object as PropType<PPTAudioElement>,
|
selectElement: (e: MouseEvent | TouchEvent, element: PPTAudioElement, canMove?: boolean) => void
|
||||||
required: true,
|
contextmenus: () => ContextmenuItem[] | null
|
||||||
},
|
}>()
|
||||||
selectElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTAudioElement, canMove?: boolean) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
contextmenus: {
|
|
||||||
type: Function as PropType<() => ContextmenuItem[] | null>,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { canvasScale, handleElementId } = storeToRefs(useMainStore())
|
const { canvasScale, handleElementId } = storeToRefs(useMainStore())
|
||||||
const { viewportRatio } = storeToRefs(useSlidesStore())
|
const { viewportRatio } = storeToRefs(useSlidesStore())
|
||||||
|
@ -40,19 +40,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, inject, PropType, ref } from 'vue'
|
import { computed, inject, ref } from 'vue'
|
||||||
import { PPTChartElement } from '@/types/slides'
|
import { PPTChartElement } from '@/types/slides'
|
||||||
import { injectKeySlideScale } from '@/types/injectKey'
|
import { injectKeySlideScale } from '@/types/injectKey'
|
||||||
|
|
||||||
import ElementOutline from '@/views/components/element/ElementOutline.vue'
|
import ElementOutline from '@/views/components/element/ElementOutline.vue'
|
||||||
import Chart from './Chart.vue'
|
import Chart from './Chart.vue'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTChartElement
|
||||||
type: Object as PropType<PPTChartElement>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const slideScale = inject(injectKeySlideScale) || ref(1)
|
const slideScale = inject(injectKeySlideScale) || ref(1)
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, inject, onMounted, PropType, ref, watch } from 'vue'
|
import { computed, inject, onMounted, ref, watch } from 'vue'
|
||||||
import tinycolor from 'tinycolor2'
|
import tinycolor from 'tinycolor2'
|
||||||
import { BarChart, LineChart, PieChart } from 'chartist'
|
import { BarChart, LineChart, PieChart } from 'chartist'
|
||||||
import { ChartData, ChartOptions, ChartType } from '@/types/slides'
|
import { ChartData, ChartOptions, ChartType } from '@/types/slides'
|
||||||
@ -35,41 +35,17 @@ import { injectKeySlideScale } from '@/types/injectKey'
|
|||||||
|
|
||||||
import 'chartist/dist/index.css'
|
import 'chartist/dist/index.css'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
width: {
|
width: number
|
||||||
type: Number,
|
height: number
|
||||||
required: true,
|
type: ChartType
|
||||||
},
|
data: ChartData
|
||||||
height: {
|
themeColor: string[]
|
||||||
type: Number,
|
legends: string[]
|
||||||
required: true,
|
options?: ChartOptions
|
||||||
},
|
gridColor?: string
|
||||||
type: {
|
legend?: '' | 'top' | 'bottom'
|
||||||
type: String as PropType<ChartType>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
data: {
|
|
||||||
type: Object as PropType<ChartData>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
type: Object as PropType<ChartOptions>,
|
|
||||||
},
|
|
||||||
themeColor: {
|
|
||||||
type: Array as PropType<string[]>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
legends: {
|
|
||||||
type: Array as PropType<string[]>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
gridColor: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
type: String as PropType<'' | 'top' | 'bottom'>,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const chartRef = ref<HTMLElement>()
|
const chartRef = ref<HTMLElement>()
|
||||||
const slideScale = inject(injectKeySlideScale) || ref(1)
|
const slideScale = inject(injectKeySlideScale) || ref(1)
|
||||||
|
@ -3,15 +3,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from 'vue'
|
|
||||||
import { PPTChartElement } from '@/types/slides'
|
import { PPTChartElement } from '@/types/slides'
|
||||||
|
|
||||||
import BaseChartElement from './BaseChartElement.vue'
|
import BaseChartElement from './BaseChartElement.vue'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTChartElement
|
||||||
type: Object as PropType<PPTChartElement>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -44,7 +44,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from 'vue'
|
|
||||||
import { PPTChartElement } from '@/types/slides'
|
import { PPTChartElement } from '@/types/slides'
|
||||||
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
||||||
import emitter, { EmitterEvents } from '@/utils/emitter'
|
import emitter, { EmitterEvents } from '@/utils/emitter'
|
||||||
@ -52,19 +51,11 @@ import emitter, { EmitterEvents } from '@/utils/emitter'
|
|||||||
import ElementOutline from '@/views/components/element/ElementOutline.vue'
|
import ElementOutline from '@/views/components/element/ElementOutline.vue'
|
||||||
import Chart from './Chart.vue'
|
import Chart from './Chart.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTChartElement
|
||||||
type: Object as PropType<PPTChartElement>,
|
selectElement: (e: MouseEvent | TouchEvent, element: PPTChartElement, canMove?: boolean) => void
|
||||||
required: true,
|
contextmenus: () => ContextmenuItem[] | null
|
||||||
},
|
}>()
|
||||||
selectElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTChartElement, canMove?: boolean) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
contextmenus: {
|
|
||||||
type: Function as PropType<() => ContextmenuItem[] | null>,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const handleSelectElement = (e: MouseEvent | TouchEvent) => {
|
const handleSelectElement = (e: MouseEvent | TouchEvent) => {
|
||||||
if (props.elementInfo.lock) return
|
if (props.elementInfo.lock) return
|
||||||
|
@ -20,24 +20,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType, toRef } from 'vue'
|
import { toRef } from 'vue'
|
||||||
import { PPTElementOutline } from '@/types/slides'
|
import { PPTElementOutline } from '@/types/slides'
|
||||||
|
|
||||||
import useElementOutline from '@/views/components/element/hooks/useElementOutline'
|
import useElementOutline from '@/views/components/element/hooks/useElementOutline'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
width: {
|
width: number
|
||||||
type: Number,
|
height: number
|
||||||
required: true,
|
outline?: PPTElementOutline
|
||||||
},
|
}>()
|
||||||
height: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
outline: {
|
|
||||||
type: Object as PropType<PPTElementOutline>
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
outlineWidth,
|
outlineWidth,
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { PPTImageElement } from '@/types/slides'
|
import { PPTImageElement } from '@/types/slides'
|
||||||
import useElementShadow from '@/views/components/element/hooks/useElementShadow'
|
import useElementShadow from '@/views/components/element/hooks/useElementShadow'
|
||||||
import useElementFlip from '@/views/components/element/hooks/useElementFlip'
|
import useElementFlip from '@/views/components/element/hooks/useElementFlip'
|
||||||
@ -57,12 +57,9 @@ import useFilter from './useFilter'
|
|||||||
|
|
||||||
import ImageOutline from './ImageOutline/index.vue'
|
import ImageOutline from './ImageOutline/index.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTImageElement
|
||||||
type: Object as PropType<PPTImageElement>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const shadow = computed(() => props.elementInfo.shadow)
|
const shadow = computed(() => props.elementInfo.shadow)
|
||||||
const { shadowStyle } = useElementShadow(shadow)
|
const { shadowStyle } = useElementShadow(shadow)
|
||||||
|
@ -66,46 +66,23 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onMounted, onUnmounted, PropType, ref } from 'vue'
|
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore, useKeyboardStore } from '@/store'
|
import { useMainStore, useKeyboardStore } from '@/store'
|
||||||
import { KEYS } from '@/configs/hotkey'
|
import { KEYS } from '@/configs/hotkey'
|
||||||
import { ImageClipedEmitData, OperateResizeHandlers } from '@/types/edit'
|
import { ImageClipedEmitData, OperateResizeHandlers } from '@/types/edit'
|
||||||
import { ImageClipDataRange, ImageElementClip } from '@/types/slides'
|
import { ImageClipDataRange, ImageElementClip } from '@/types/slides'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
src: {
|
src: string
|
||||||
type: String,
|
clipPath: string
|
||||||
required: true,
|
width: number
|
||||||
},
|
height: number
|
||||||
clipData: {
|
top: number
|
||||||
type: Object as PropType<ImageElementClip>,
|
left: number
|
||||||
},
|
rotate: number
|
||||||
clipPath: {
|
clipData?: ImageElementClip
|
||||||
type: String,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
width: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
height: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
top: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
left: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
rotate: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: 'clip', payload: ImageClipedEmitData | null): void
|
(event: 'clip', payload: ImageClipedEmitData | null): void
|
||||||
|
@ -23,23 +23,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType, toRef } from 'vue'
|
import { toRef } from 'vue'
|
||||||
import { PPTElementOutline } from '@/types/slides'
|
import { PPTElementOutline } from '@/types/slides'
|
||||||
import useElementOutline from '@/views/components/element/hooks/useElementOutline'
|
import useElementOutline from '@/views/components/element/hooks/useElementOutline'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
width: {
|
width: number
|
||||||
type: Number,
|
height: number
|
||||||
required: true,
|
outline?: PPTElementOutline
|
||||||
},
|
}>()
|
||||||
height: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
outline: {
|
|
||||||
type: Object as PropType<PPTElementOutline>
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
outlineWidth,
|
outlineWidth,
|
||||||
|
@ -20,27 +20,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType, toRef } from 'vue'
|
import { toRef } from 'vue'
|
||||||
import { PPTElementOutline } from '@/types/slides'
|
import { PPTElementOutline } from '@/types/slides'
|
||||||
import useElementOutline from '@/views/components/element/hooks/useElementOutline'
|
import useElementOutline from '@/views/components/element/hooks/useElementOutline'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
width: {
|
width: number
|
||||||
type: Number,
|
height: number
|
||||||
required: true,
|
createPath: (width: number, height: number) => string
|
||||||
},
|
outline?: PPTElementOutline
|
||||||
height: {
|
}>()
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
outline: {
|
|
||||||
type: Object as PropType<PPTElementOutline>
|
|
||||||
},
|
|
||||||
createPath: {
|
|
||||||
type: Function,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
outlineWidth,
|
outlineWidth,
|
||||||
|
@ -23,26 +23,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType, toRef } from 'vue'
|
import { toRef } from 'vue'
|
||||||
import { PPTElementOutline } from '@/types/slides'
|
import { PPTElementOutline } from '@/types/slides'
|
||||||
import useElementOutline from '@/views/components/element/hooks/useElementOutline'
|
import useElementOutline from '@/views/components/element/hooks/useElementOutline'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
width: {
|
width: number
|
||||||
type: Number,
|
height: number
|
||||||
required: true,
|
outline?: PPTElementOutline
|
||||||
},
|
radius?: string
|
||||||
height: {
|
}>(), {
|
||||||
type: Number,
|
radius: '0',
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
outline: {
|
|
||||||
type: Object as PropType<PPTElementOutline>
|
|
||||||
},
|
|
||||||
radius: {
|
|
||||||
type: String,
|
|
||||||
default: '0',
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { PPTImageElement } from '@/types/slides'
|
import { PPTImageElement } from '@/types/slides'
|
||||||
import useClipImage from '../useClipImage'
|
import useClipImage from '../useClipImage'
|
||||||
|
|
||||||
@ -32,12 +32,9 @@ import ImageRectOutline from './ImageRectOutline.vue'
|
|||||||
import ImageEllipseOutline from './ImageEllipseOutline.vue'
|
import ImageEllipseOutline from './ImageEllipseOutline.vue'
|
||||||
import ImagePolygonOutline from './ImagePolygonOutline.vue'
|
import ImagePolygonOutline from './ImagePolygonOutline.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTImageElement
|
||||||
type: Object as PropType<PPTImageElement>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const clip = computed(() => props.elementInfo.clip)
|
const clip = computed(() => props.elementInfo.clip)
|
||||||
const { clipShape } = useClipImage(clip)
|
const { clipShape } = useClipImage(clip)
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore, useSlidesStore } from '@/store'
|
import { useMainStore, useSlidesStore } from '@/store'
|
||||||
import { ImageElementClip, PPTImageElement } from '@/types/slides'
|
import { ImageElementClip, PPTImageElement } from '@/types/slides'
|
||||||
@ -81,19 +81,11 @@ import useFilter from './useFilter'
|
|||||||
import ImageOutline from './ImageOutline/index.vue'
|
import ImageOutline from './ImageOutline/index.vue'
|
||||||
import ImageClipHandler from './ImageClipHandler.vue'
|
import ImageClipHandler from './ImageClipHandler.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTImageElement
|
||||||
type: Object as PropType<PPTImageElement>,
|
selectElement: (e: MouseEvent | TouchEvent, element: PPTImageElement, canMove?: boolean) => void
|
||||||
required: true,
|
contextmenus: () => ContextmenuItem[] | null
|
||||||
},
|
}>()
|
||||||
selectElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTImageElement, canMove?: boolean) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
contextmenus: {
|
|
||||||
type: Function as PropType<() => ContextmenuItem[] | null>,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const mainStore = useMainStore()
|
const mainStore = useMainStore()
|
||||||
const slidesStore = useSlidesStore()
|
const slidesStore = useSlidesStore()
|
||||||
|
@ -35,15 +35,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from 'vue'
|
|
||||||
import { PPTLatexElement } from '@/types/slides'
|
import { PPTLatexElement } from '@/types/slides'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTLatexElement
|
||||||
type: Object as PropType<PPTLatexElement>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -42,24 +42,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from 'vue'
|
|
||||||
import { PPTLatexElement } from '@/types/slides'
|
import { PPTLatexElement } from '@/types/slides'
|
||||||
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
||||||
import emitter, { EmitterEvents } from '@/utils/emitter'
|
import emitter, { EmitterEvents } from '@/utils/emitter'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTLatexElement
|
||||||
type: Object as PropType<PPTLatexElement>,
|
selectElement: (e: MouseEvent | TouchEvent, element: PPTLatexElement, canMove?: boolean) => void
|
||||||
required: true,
|
contextmenus: () => ContextmenuItem[] | null
|
||||||
},
|
}>()
|
||||||
selectElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTLatexElement, canMove?: boolean) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
contextmenus: {
|
|
||||||
type: Function as PropType<() => ContextmenuItem[] | null>,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const handleSelectElement = (e: MouseEvent | TouchEvent) => {
|
const handleSelectElement = (e: MouseEvent | TouchEvent) => {
|
||||||
if (props.elementInfo.lock) return
|
if (props.elementInfo.lock) return
|
||||||
|
@ -48,19 +48,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { PPTLineElement } from '@/types/slides'
|
import { PPTLineElement } from '@/types/slides'
|
||||||
import { getLineElementPath } from '@/utils/element'
|
import { getLineElementPath } from '@/utils/element'
|
||||||
import useElementShadow from '@/views/components/element/hooks/useElementShadow'
|
import useElementShadow from '@/views/components/element/hooks/useElementShadow'
|
||||||
|
|
||||||
import LinePointMarker from './LinePointMarker.vue'
|
import LinePointMarker from './LinePointMarker.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTLineElement
|
||||||
type: Object as PropType<PPTLineElement>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const shadow = computed(() => props.elementInfo.shadow)
|
const shadow = computed(() => props.elementInfo.shadow)
|
||||||
const { shadowStyle } = useElementShadow(shadow)
|
const { shadowStyle } = useElementShadow(shadow)
|
||||||
|
@ -17,29 +17,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
id: {
|
id: string
|
||||||
type: String,
|
position: 'start' | 'end'
|
||||||
required: true,
|
type: 'dot' | 'arrow'
|
||||||
},
|
baseSize: number
|
||||||
position: {
|
color?: string
|
||||||
type: String as PropType<'start' | 'end'>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: String as PropType<'dot' | 'arrow'>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
color: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
baseSize: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const pathMap = {
|
const pathMap = {
|
||||||
dot: 'm0 5a5 5 0 1 0 10 0a5 5 0 1 0 -10 0z',
|
dot: 'm0 5a5 5 0 1 0 10 0a5 5 0 1 0 -10 0z',
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { PPTLineElement } from '@/types/slides'
|
import { PPTLineElement } from '@/types/slides'
|
||||||
import { getLineElementPath } from '@/utils/element'
|
import { getLineElementPath } from '@/utils/element'
|
||||||
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
||||||
@ -68,19 +68,11 @@ import useElementShadow from '@/views/components/element/hooks/useElementShadow'
|
|||||||
|
|
||||||
import LinePointMarker from './LinePointMarker.vue'
|
import LinePointMarker from './LinePointMarker.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTLineElement
|
||||||
type: Object as PropType<PPTLineElement>,
|
selectElement: (e: MouseEvent | TouchEvent, element: PPTLineElement, canMove?: boolean) => void
|
||||||
required: true,
|
contextmenus: () => ContextmenuItem[] | null
|
||||||
},
|
}>()
|
||||||
selectElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTLineElement, canMove?: boolean) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
contextmenus: {
|
|
||||||
type: Function as PropType<() => ContextmenuItem[] | null>,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const handleSelectElement = (e: MouseEvent | TouchEvent) => {
|
const handleSelectElement = (e: MouseEvent | TouchEvent) => {
|
||||||
if (props.elementInfo.lock) return
|
if (props.elementInfo.lock) return
|
||||||
|
@ -22,31 +22,16 @@ import { indentCommand } from '@/utils/prosemirror/commands/setTextIndent'
|
|||||||
import { toggleList } from '@/utils/prosemirror/commands/toggleList'
|
import { toggleList } from '@/utils/prosemirror/commands/toggleList'
|
||||||
import { TextFormatPainterKeys } from '@/types/edit'
|
import { TextFormatPainterKeys } from '@/types/edit'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
elementId: {
|
elementId: string
|
||||||
type: String,
|
defaultColor: string
|
||||||
required: true,
|
defaultFontName: string
|
||||||
},
|
value: string
|
||||||
defaultColor: {
|
editable?: boolean
|
||||||
type: String,
|
autoFocus?: boolean
|
||||||
required: true,
|
}>(), {
|
||||||
},
|
editable: false,
|
||||||
defaultFontName: {
|
autoFocus: false,
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
editable: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
value: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
autoFocus: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { PPTShapeElement, ShapeText } from '@/types/slides'
|
import { PPTShapeElement, ShapeText } from '@/types/slides'
|
||||||
import useElementOutline from '@/views/components/element/hooks/useElementOutline'
|
import useElementOutline from '@/views/components/element/hooks/useElementOutline'
|
||||||
import useElementShadow from '@/views/components/element/hooks/useElementShadow'
|
import useElementShadow from '@/views/components/element/hooks/useElementShadow'
|
||||||
@ -69,12 +69,9 @@ import useElementFlip from '@/views/components/element/hooks/useElementFlip'
|
|||||||
|
|
||||||
import GradientDefs from './GradientDefs.vue'
|
import GradientDefs from './GradientDefs.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTShapeElement
|
||||||
type: Object as PropType<PPTShapeElement>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const outline = computed(() => props.elementInfo.outline)
|
const outline = computed(() => props.elementInfo.outline)
|
||||||
const { outlineWidth, outlineStyle, outlineColor } = useElementOutline(outline)
|
const { outlineWidth, outlineStyle, outlineColor } = useElementOutline(outline)
|
||||||
|
@ -19,27 +19,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from 'vue'
|
withDefaults(defineProps<{
|
||||||
|
id: string
|
||||||
defineProps({
|
type: 'linear' | 'radial'
|
||||||
id: {
|
color1: string
|
||||||
type: String,
|
color2: string
|
||||||
required: true,
|
rotate?: number
|
||||||
},
|
}>(), {
|
||||||
type: {
|
rotate: 0,
|
||||||
type: String as PropType<'linear' | 'radial'>,
|
|
||||||
},
|
|
||||||
color1: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
color2: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
rotate: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
@ -78,7 +78,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, nextTick, PropType, ref, watch } from 'vue'
|
import { computed, nextTick, ref, watch } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore, useSlidesStore } from '@/store'
|
import { useMainStore, useSlidesStore } from '@/store'
|
||||||
import { PPTShapeElement, ShapeText } from '@/types/slides'
|
import { PPTShapeElement, ShapeText } from '@/types/slides'
|
||||||
@ -91,19 +91,11 @@ import useHistorySnapshot from '@/hooks/useHistorySnapshot'
|
|||||||
import GradientDefs from './GradientDefs.vue'
|
import GradientDefs from './GradientDefs.vue'
|
||||||
import ProsemirrorEditor from '@/views/components/element/ProsemirrorEditor.vue'
|
import ProsemirrorEditor from '@/views/components/element/ProsemirrorEditor.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTShapeElement
|
||||||
type: Object as PropType<PPTShapeElement>,
|
selectElement: (e: MouseEvent | TouchEvent, element: PPTShapeElement, canMove?: boolean) => void
|
||||||
required: true,
|
contextmenus: () => ContextmenuItem[] | null
|
||||||
},
|
}>()
|
||||||
selectElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTShapeElement, canMove?: boolean) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
contextmenus: {
|
|
||||||
type: Function as PropType<() => ContextmenuItem[] | null>,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const mainStore = useMainStore()
|
const mainStore = useMainStore()
|
||||||
const slidesStore = useSlidesStore()
|
const slidesStore = useSlidesStore()
|
||||||
|
@ -26,17 +26,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from 'vue'
|
|
||||||
import { PPTTableElement } from '@/types/slides'
|
import { PPTTableElement } from '@/types/slides'
|
||||||
|
|
||||||
import StaticTable from './StaticTable.vue'
|
import StaticTable from './StaticTable.vue'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTTableElement
|
||||||
type: Object as PropType<PPTTableElement>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -14,11 +14,10 @@
|
|||||||
import { onBeforeUnmount, ref, watch } from 'vue'
|
import { onBeforeUnmount, ref, watch } from 'vue'
|
||||||
import { pasteCustomClipboardString, pasteExcelClipboardString } from '@/utils/clipboard'
|
import { pasteCustomClipboardString, pasteExcelClipboardString } from '@/utils/clipboard'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
value: {
|
value?: string
|
||||||
type: String,
|
}>(), {
|
||||||
default: '',
|
value: '',
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, nextTick, onMounted, onUnmounted, PropType, ref, watch } from 'vue'
|
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
||||||
import { debounce, isEqual } from 'lodash'
|
import { debounce, isEqual } from 'lodash'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { nanoid } from 'nanoid'
|
import { nanoid } from 'nanoid'
|
||||||
@ -81,34 +81,16 @@ import useSubThemeColor from './useSubThemeColor'
|
|||||||
|
|
||||||
import CustomTextarea from './CustomTextarea.vue'
|
import CustomTextarea from './CustomTextarea.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
data: {
|
data: TableCell[][]
|
||||||
type: Array as PropType<TableCell[][]>,
|
width: number
|
||||||
required: true,
|
cellMinHeight: number
|
||||||
},
|
colWidths: number[]
|
||||||
width: {
|
outline: PPTElementOutline
|
||||||
type: Number,
|
theme?: TableTheme
|
||||||
required: true,
|
editable?: boolean
|
||||||
},
|
}>(), {
|
||||||
cellMinHeight: {
|
editable: true,
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
colWidths: {
|
|
||||||
type: Array as PropType<number[]>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
outline: {
|
|
||||||
type: Object as PropType<PPTElementOutline>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
theme: {
|
|
||||||
type: Object as PropType<TableTheme>,
|
|
||||||
},
|
|
||||||
editable: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
@ -41,40 +41,22 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, PropType, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
import { PPTElementOutline, TableCell, TableTheme } from '@/types/slides'
|
import { PPTElementOutline, TableCell, TableTheme } from '@/types/slides'
|
||||||
import { getTextStyle, formatText } from './utils'
|
import { getTextStyle, formatText } from './utils'
|
||||||
import useHideCells from './useHideCells'
|
import useHideCells from './useHideCells'
|
||||||
import useSubThemeColor from './useSubThemeColor'
|
import useSubThemeColor from './useSubThemeColor'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
data: {
|
data: TableCell[][]
|
||||||
type: Array as PropType<TableCell[][]>,
|
width: number
|
||||||
required: true,
|
cellMinHeight: number
|
||||||
},
|
colWidths: number[]
|
||||||
width: {
|
outline: PPTElementOutline
|
||||||
type: Number,
|
theme?: TableTheme
|
||||||
required: true,
|
editable?: boolean
|
||||||
},
|
}>(), {
|
||||||
cellMinHeight: {
|
editable: true,
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
colWidths: {
|
|
||||||
type: Array as PropType<number[]>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
outline: {
|
|
||||||
type: Object as PropType<PPTElementOutline>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
theme: {
|
|
||||||
type: Object as PropType<TableTheme>,
|
|
||||||
},
|
|
||||||
editable: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const colSizeList = ref<number[]>([])
|
const colSizeList = ref<number[]>([])
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { nextTick, onMounted, onUnmounted, PropType, ref, watch } from 'vue'
|
import { nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore, useSlidesStore } from '@/store'
|
import { useMainStore, useSlidesStore } from '@/store'
|
||||||
import { PPTTableElement, TableCell } from '@/types/slides'
|
import { PPTTableElement, TableCell } from '@/types/slides'
|
||||||
@ -55,19 +55,11 @@ import useHistorySnapshot from '@/hooks/useHistorySnapshot'
|
|||||||
|
|
||||||
import EditableTable from './EditableTable.vue'
|
import EditableTable from './EditableTable.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTTableElement
|
||||||
type: Object as PropType<PPTTableElement>,
|
selectElement: (e: MouseEvent | TouchEvent, element: PPTTableElement, canMove?: boolean) => void
|
||||||
required: true,
|
contextmenus: () => ContextmenuItem[] | null
|
||||||
},
|
}>()
|
||||||
selectElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTTableElement, canMove?: boolean) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
contextmenus: {
|
|
||||||
type: Function as PropType<() => ContextmenuItem[] | null>,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const mainStore = useMainStore()
|
const mainStore = useMainStore()
|
||||||
const slidesStore = useSlidesStore()
|
const slidesStore = useSlidesStore()
|
||||||
|
@ -43,18 +43,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType, computed, StyleValue } from 'vue'
|
import { computed, StyleValue } from 'vue'
|
||||||
import { PPTTextElement } from '@/types/slides'
|
import { PPTTextElement } from '@/types/slides'
|
||||||
import ElementOutline from '@/views/components/element/ElementOutline.vue'
|
import ElementOutline from '@/views/components/element/ElementOutline.vue'
|
||||||
|
|
||||||
import useElementShadow from '@/views/components/element/hooks/useElementShadow'
|
import useElementShadow from '@/views/components/element/hooks/useElementShadow'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTTextElement
|
||||||
type: Object as PropType<PPTTextElement>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const shadow = computed(() => props.elementInfo.shadow)
|
const shadow = computed(() => props.elementInfo.shadow)
|
||||||
const { shadowStyle } = useElementShadow(shadow)
|
const { shadowStyle } = useElementShadow(shadow)
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onMounted, onUnmounted, PropType, ref, watch } from 'vue'
|
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { debounce } from 'lodash'
|
import { debounce } from 'lodash'
|
||||||
import { useMainStore, useSlidesStore } from '@/store'
|
import { useMainStore, useSlidesStore } from '@/store'
|
||||||
@ -73,19 +73,11 @@ import useHistorySnapshot from '@/hooks/useHistorySnapshot'
|
|||||||
import ElementOutline from '@/views/components/element/ElementOutline.vue'
|
import ElementOutline from '@/views/components/element/ElementOutline.vue'
|
||||||
import ProsemirrorEditor from '@/views/components/element/ProsemirrorEditor.vue'
|
import ProsemirrorEditor from '@/views/components/element/ProsemirrorEditor.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTTextElement
|
||||||
type: Object as PropType<PPTTextElement>,
|
selectElement: (e: MouseEvent | TouchEvent, element: PPTTextElement, canMove?: boolean) => void
|
||||||
required: true,
|
contextmenus: () => ContextmenuItem[] | null
|
||||||
},
|
}>()
|
||||||
selectElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTTextElement, canMove?: boolean) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
contextmenus: {
|
|
||||||
type: Function as PropType<() => ContextmenuItem[] | null>,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const mainStore = useMainStore()
|
const mainStore = useMainStore()
|
||||||
const slidesStore = useSlidesStore()
|
const slidesStore = useSlidesStore()
|
||||||
|
@ -19,15 +19,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from 'vue'
|
|
||||||
import { PPTVideoElement } from '@/types/slides'
|
import { PPTVideoElement } from '@/types/slides'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTVideoElement
|
||||||
type: Object as PropType<PPTVideoElement>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, inject, PropType, ref } from 'vue'
|
import { computed, inject, ref } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSlidesStore } from '@/store'
|
import { useSlidesStore } from '@/store'
|
||||||
import { PPTVideoElement } from '@/types/slides'
|
import { PPTVideoElement } from '@/types/slides'
|
||||||
@ -34,12 +34,9 @@ import { injectKeySlideId, injectKeySlideScale } from '@/types/injectKey'
|
|||||||
|
|
||||||
import VideoPlayer from './VideoPlayer/index.vue'
|
import VideoPlayer from './VideoPlayer/index.vue'
|
||||||
|
|
||||||
defineProps({
|
defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTVideoElement
|
||||||
type: Object as PropType<PPTVideoElement>,
|
}>()
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { currentSlide } = storeToRefs(useSlidesStore())
|
const { currentSlide } = storeToRefs(useSlidesStore())
|
||||||
|
|
||||||
|
@ -118,27 +118,15 @@
|
|||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
import useMSE from './useMSE'
|
import useMSE from './useMSE'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
width: {
|
width: number
|
||||||
type: Number,
|
height: number
|
||||||
required: true,
|
src: string
|
||||||
},
|
poster?: string
|
||||||
height: {
|
scale?: number
|
||||||
type: Number,
|
}>(), {
|
||||||
required: true,
|
poster: '',
|
||||||
},
|
scale: 1,
|
||||||
src: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
poster: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
scale: {
|
|
||||||
type: Number,
|
|
||||||
default: 1,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const secondToTime = (second = 0) => {
|
const secondToTime = (second = 0) => {
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from 'vue'
|
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useMainStore } from '@/store'
|
import { useMainStore } from '@/store'
|
||||||
import { PPTVideoElement } from '@/types/slides'
|
import { PPTVideoElement } from '@/types/slides'
|
||||||
@ -46,19 +45,11 @@ import { ContextmenuItem } from '@/components/Contextmenu/types'
|
|||||||
|
|
||||||
import VideoPlayer from './VideoPlayer/index.vue'
|
import VideoPlayer from './VideoPlayer/index.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
elementInfo: {
|
elementInfo: PPTVideoElement
|
||||||
type: Object as PropType<PPTVideoElement>,
|
selectElement: (e: MouseEvent | TouchEvent, element: PPTVideoElement, canMove?: boolean) => void
|
||||||
required: true,
|
contextmenus: () => ContextmenuItem[] | null
|
||||||
},
|
}>()
|
||||||
selectElement: {
|
|
||||||
type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTVideoElement, canMove?: boolean) => void>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
contextmenus: {
|
|
||||||
type: Function as PropType<() => ContextmenuItem[] | null>,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const { canvasScale } = storeToRefs(useMainStore())
|
const { canvasScale } = storeToRefs(useMainStore())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user