diff --git a/package.json b/package.json index 5034c80..0f251bf 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "file-saver": "^2.0.5", "hfmath": "^0.0.2", "html-to-image": "^1.11.11", + "html2canvas": "^1.4.1", "im_electron_sdk": "^8.0.5904", "js-cookie": "^3.0.5", "jsencrypt": "^3.3.2", diff --git a/src/renderer/index.html b/src/renderer/index.html index d1459f5..8bb269e 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -8,7 +8,7 @@ http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" /> --> - + diff --git a/src/renderer/src/AixPPTist/src/api/index.ts b/src/renderer/src/AixPPTist/src/api/index.ts index 13f8b73..629a040 100644 --- a/src/renderer/src/AixPPTist/src/api/index.ts +++ b/src/renderer/src/AixPPTist/src/api/index.ts @@ -55,7 +55,8 @@ export class PPTApi { return new Promise(async (resolve, reject) => { const params: object = { parentid, orderByColumn: 'fileidx', isAsc: 'asc', pageSize: 9999 } const res: Result = await API_entpcoursefile.listEntpcoursefileNew(params) - if (res.code === 200) { + console.log(res.rows,'res.rows'); + if (res.code === 200) { const slides = (res.rows || []).map(o => { if (!!o.datacontent) { const json = JSON.parse(o.datacontent) @@ -65,8 +66,15 @@ export class PPTApi { // 如果没有数据,默认空白页 return {id: o.id,elements:[],background:{type:"solid",color:"#fff"}} }) + // 活动列表处理 + const workList = (res.rows || []).map(o => o.activityContent) + const workItem = [...res.rows] slidesStore.updateSlideIndex(0) // 下标0 为第一页 slidesStore.setSlides(slides) // 写入数据 + // 写入作业列表数据 + slidesStore.setWorkList(workList) + // 获取所有的pptlist的数据 + slidesStore.setWorkItem(workItem) resolve(true) } else msgUtils.msgError(res.msg || '获取数据失败');resolve(false) }) diff --git a/src/renderer/src/AixPPTist/src/store/slides.ts b/src/renderer/src/AixPPTist/src/store/slides.ts index c5a0def..78e9d02 100644 --- a/src/renderer/src/AixPPTist/src/store/slides.ts +++ b/src/renderer/src/AixPPTist/src/store/slides.ts @@ -31,6 +31,8 @@ export interface SlidesState { slideIndex: number viewportSize: number viewportRatio: number + workList:Object[], + workItem:Object[], } export const useSlidesStore = defineStore('slides', { @@ -41,6 +43,8 @@ export const useSlidesStore = defineStore('slides', { slideIndex: 0, // 当前页面索引 viewportSize: 1000, // 可视区域宽度基数 viewportRatio: 0.5625, // 可视区域比例,默认16:9 + workList:[],// 活动的列表 + workItem:[],// 获取到的所有pptlist }), getters: { @@ -131,6 +135,13 @@ export const useSlidesStore = defineStore('slides', { setSlides(slides: Slide[]) { this.slides = slides }, + // 更新活动列表 + setWorkList(list: Object[]) { + this.workList = list + }, + setWorkItem(list: Object[]) { + this.workItem = list + }, addSlide(slide: Slide | Slide[]) { const slides = Array.isArray(slide) ? slide : [slide] diff --git a/src/renderer/src/AixPPTist/src/types/toolbar.ts b/src/renderer/src/AixPPTist/src/types/toolbar.ts index 5e87881..5746777 100644 --- a/src/renderer/src/AixPPTist/src/types/toolbar.ts +++ b/src/renderer/src/AixPPTist/src/types/toolbar.ts @@ -6,4 +6,5 @@ export const enum ToolbarStates { SLIDE_DESIGN = 'slideDesign', SLIDE_ANIMATION = 'slideAnimation', MULTI_POSITION = 'multiPosition', + EL_ACTIVE = 'elActive', } \ 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 0340b20..a0d73aa 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue @@ -81,6 +81,7 @@ +
@@ -110,6 +111,18 @@ @update="data => { createLatexElement(data); latexEditorVisible = false }" /> + + + + +
@@ -135,6 +148,7 @@ import Modal from '../../../components/Modal.vue' 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' const mainStore = useMainStore() const { creatingElement, creatingCustomShape, showSelectPanel, showSearchPanel, showNotesPanel } = storeToRefs(mainStore) @@ -172,12 +186,17 @@ const insertImageElement = (files: FileList) => { getImageDataURL(imageFile).then(dataURL => createImageElement(dataURL)) } +const onhtml2canvas = (imgbs64: string) => { + createImageElement(imgbs64) +} + const shapePoolVisible = ref(false) const linePoolVisible = ref(false) const chartPoolVisible = ref(false) const tableGeneratorVisible = ref(false) const mediaInputVisible = ref(false) const latexEditorVisible = ref(false) +const classWorkTaskVisible = ref(false) const textTypeSelectVisible = ref(false) const shapeMenuVisible = ref(false) const moreVisible = ref(false) @@ -343,6 +362,9 @@ const toggleNotesPanel = () => { font-size: 13px; } } +.class-work-task-modal{ + height: 80vh; +} @media screen and (width <= 1200px) { .right-handler .text { diff --git a/src/renderer/src/AixPPTist/src/views/Editor/Thumbnails/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/Thumbnails/index.vue index 9edc344..e61e623 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/Thumbnails/index.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/Thumbnails/index.vue @@ -66,6 +66,9 @@
幻灯片 {{slideIndex + 1}} / {{slides.length}}
+ + + @@ -85,12 +88,13 @@ import ThumbnailSlide from '../../../views/components/ThumbnailSlide/index.vue' import LayoutPool from './LayoutPool.vue' import Popover from '../../../components/Popover.vue' import Draggable from 'vuedraggable' +import Active from '../Toolbar/ElementStylePanel/Active/index.vue' const mainStore = useMainStore() const slidesStore = useSlidesStore() const keyboardStore = useKeyboardStore() const { selectedSlidesIndex: _selectedSlidesIndex, thumbnailsFocus } = storeToRefs(mainStore) -const { slides, slideIndex, currentSlide } = storeToRefs(slidesStore) +const { slides, slideIndex, currentSlide, workList, workItem } = storeToRefs(slidesStore) const { ctrlKeyState, shiftKeyState } = storeToRefs(keyboardStore) const { slidesLoadLimit } = useLoadSlides() @@ -123,6 +127,8 @@ const { updateSectionTitle, } = useSectionHandler() +const activeRef = ref() + // 页面被切换时 const thumbnailsRef = ref>() watch(() => slideIndex.value, () => { @@ -145,6 +151,9 @@ watch(() => slideIndex.value, () => { // 切换页面 const changeSlideIndex = (index: number) => { + console.log(workItem.value[index],'hasSection'); + activeRef.value.clickPPTList(workItem.value[index]) + mainStore.setActiveElementIdList([]) if (slideIndex.value === index) return diff --git a/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue new file mode 100644 index 0000000..9bf72ac --- /dev/null +++ b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue @@ -0,0 +1,291 @@ + + + \ No newline at end of file diff --git a/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/index.vue index 49bfd8e..ea16b24 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/index.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/index.vue @@ -25,6 +25,8 @@ import SlideDesignPanel from './SlideDesignPanel.vue' import SlideAnimationPanel from './SlideAnimationPanel.vue' import MultiPositionPanel from './MultiPositionPanel.vue' import SymbolPanel from './SymbolPanel.vue' +// 新增的活动页面 +import SymbolActivePanel from './ElementStylePanel/Active/index.vue' import Tabs from '../../../components/Tabs.vue' interface ElementTabs { @@ -54,6 +56,7 @@ const slideTabs = [ { label: '设计', key: ToolbarStates.SLIDE_DESIGN }, { label: '切换', key: ToolbarStates.SLIDE_ANIMATION }, { label: '动画', key: ToolbarStates.EL_ANIMATION }, + { label: '活动', key: ToolbarStates.EL_ACTIVE }, ] const multiSelectTabs = [ { label: '样式', key: ToolbarStates.EL_STYLE }, @@ -86,6 +89,7 @@ const currentPanelComponent = computed(() => { [ToolbarStates.SLIDE_ANIMATION]: SlideAnimationPanel, [ToolbarStates.MULTI_POSITION]: MultiPositionPanel, [ToolbarStates.SYMBOL]: SymbolPanel, + [ToolbarStates.EL_ACTIVE]: SymbolActivePanel,// 新增的活动页面 } return panelMap[toolbarState.value] || null }) diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue index 55ff885..b1a52f2 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue @@ -1,6 +1,6 @@