From e3199b43debbc56bf6f6214e4a77725d1348d468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Fri, 6 Dec 2024 15:26:22 +0800 Subject: [PATCH 1/3] 1 --- .../AixPPTist/src/views/Editor/CanvasTool/index.vue | 10 ++++------ .../element/ImageElement/ImageClipHandler.vue | 9 ++++++--- .../newClassTaskAssign/questToPPTist/index.vue | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue index a0d73aa..12d9df4 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue @@ -112,16 +112,14 @@ /> - + + - + @@ -363,7 +361,7 @@ const toggleNotesPanel = () => { } } .class-work-task-modal{ - height: 80vh; + height: 70vh; } @media screen and (width <= 1200px) { diff --git a/src/renderer/src/AixPPTist/src/views/components/element/ImageElement/ImageClipHandler.vue b/src/renderer/src/AixPPTist/src/views/components/element/ImageElement/ImageClipHandler.vue index 5d96bce..14065e6 100644 --- a/src/renderer/src/AixPPTist/src/views/components/element/ImageElement/ImageClipHandler.vue +++ b/src/renderer/src/AixPPTist/src/views/components/element/ImageElement/ImageClipHandler.vue @@ -154,13 +154,15 @@ const topImgWrapperPositionStyle = computed(() => { const topImgPositionStyle = computed(() => { const bottomWidth = imgPosition.value.width const bottomHeight = imgPosition.value.height + console.log("底层图片位置大小(遮罩区域图片)", imgPosition.value) const { top, left, width, height } = topImgWrapperPosition.value - + console.log("width", ((bottomWidth / width * 100) - (left * (100 / width))) + '%') + console.log("height", bottomHeight / height * 100 + '%') return { left: -left * (100 / width) + '%', top: -top * (100 / height) + '%', - width: bottomWidth / width * 100 + '%', + width: ((bottomWidth / width * 100) - (left * (100 / width))) + '%' , height: bottomHeight / height * 100 + '%', } }) @@ -228,6 +230,7 @@ const updateRange = () => { width: parseInt(topImgPositionStyle.value.width), height: parseInt(topImgPositionStyle.value.height), } + console.log('retPosition', retPosition) const widthScale = 100 / retPosition.width const heightScale = 100 / retPosition.height @@ -475,7 +478,7 @@ const scaleClipRange = (e: MouseEvent, type: OperateResizeHandlers) => { isMouseDown = false document.onmousemove = null document.onmouseup = null - +console.log('----------------------------------') updateRange() setTimeout(() => isSettingClipRange.value = false, 0) diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/questToPPTist/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/questToPPTist/index.vue index 26be2e9..2d7e448 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/questToPPTist/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/questToPPTist/index.vue @@ -68,7 +68,7 @@ defineExpose({ .page-resource { user-select: none; - height: calc(100% - 55px); + height: 100%; display: flex; flex-direction: row; flex-wrap: nowrap; From 560e6f0e7056722d156f20d6e7af98b46a910d25 Mon Sep 17 00:00:00 2001 From: lyc Date: Fri, 6 Dec 2024 16:39:47 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=8F=92=E5=85=A5=E7=B4=A0=E6=9D=90-pptlis?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/AixPPTist/src/plugins/icon.ts | 2 + .../Editor/CanvasTool/MaterialDialog.vue | 173 ++++++++++++++++++ .../src/views/Editor/CanvasTool/index.vue | 27 +++ src/renderer/src/utils/ruoyi.js | 53 ++++-- 4 files changed, 243 insertions(+), 12 deletions(-) create mode 100644 src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue diff --git a/src/renderer/src/AixPPTist/src/plugins/icon.ts b/src/renderer/src/AixPPTist/src/plugins/icon.ts index da9ce97..2bffc0e 100644 --- a/src/renderer/src/AixPPTist/src/plugins/icon.ts +++ b/src/renderer/src/AixPPTist/src/plugins/icon.ts @@ -125,6 +125,7 @@ import { User, Switch, More, + Material } from '@icon-park/vue-next' export interface Icons { @@ -255,6 +256,7 @@ export const icons: Icons = { IconUser: User, IconSwitch: Switch, IconMore: More, + IconMaterial: Material } export default { diff --git a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue new file mode 100644 index 0000000..8295fe0 --- /dev/null +++ b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue @@ -0,0 +1,173 @@ + + + + + \ No newline at end of file diff --git a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue index a0d73aa..dcd6eb0 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue @@ -82,6 +82,7 @@ +
@@ -123,6 +124,13 @@ /> + + + + +
@@ -149,6 +157,7 @@ import Divider from '../../../components/Divider.vue' import Popover from '../../../components/Popover.vue' import PopoverMenuItem from '../../../components/PopoverMenuItem.vue' import QuestToPPTist from '@/views/classTask/newClassTaskAssign/questToPPTist/index.vue' +import MaterialDialog from './MaterialDialog.vue' const mainStore = useMainStore() const { creatingElement, creatingCustomShape, showSelectPanel, showSearchPanel, showNotesPanel } = storeToRefs(mainStore) @@ -200,6 +209,7 @@ const classWorkTaskVisible = ref(false) const textTypeSelectVisible = ref(false) const shapeMenuVisible = ref(false) const moreVisible = ref(false) +const materiaVisible = ref(false) // 绘制文字范围 const drawText = (vertical = false) => { @@ -246,6 +256,23 @@ const toggleSraechPanel = () => { const toggleNotesPanel = () => { mainStore.setNotesPanelState(!showNotesPanel.value) } + +// 插入素材 +interface MaterialParams { + type: string, + data: string +} +const insertMaterial = (item: MaterialParams) =>{ + const { type, data } = item + if(type == 'video'){ + createVideoElement(data) + } + else{ + createImageElement(data) + } + materiaVisible.value = false + +}