From edabc0336f481fbb5abb2de2344535b07e5f2e4b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=8F=E6=9D=A8?= <666>
Date: Wed, 4 Dec 2024 14:57:56 +0800
Subject: [PATCH] =?UTF-8?q?add=EF=BC=9A=E6=96=B0=E5=A2=9Epptlist=E6=B4=BB?=
=?UTF-8?q?=E5=8A=A8=E5=88=97=E8=A1=A8;?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/renderer/src/AixPPTist/src/api/index.ts | 10 +-
.../src/AixPPTist/src/store/slides.ts | 11 +
.../src/AixPPTist/src/types/toolbar.ts | 1 +
.../src/views/Editor/Thumbnails/index.vue | 11 +-
.../ElementStylePanel/Active/index.vue | 291 ++++++++++++++++++
.../src/views/Editor/Toolbar/index.vue | 4 +
.../classTask/newClassTaskAssign/index.vue | 52 +++-
7 files changed, 369 insertions(+), 11 deletions(-)
create mode 100644 src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue
diff --git a/src/renderer/src/AixPPTist/src/api/index.ts b/src/renderer/src/AixPPTist/src/api/index.ts
index 658ba69..236f171 100644
--- a/src/renderer/src/AixPPTist/src/api/index.ts
+++ b/src/renderer/src/AixPPTist/src/api/index.ts
@@ -53,7 +53,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)
@@ -63,8 +64,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/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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{item.worktype}}
+
+ {{item.title||item.uniquekey}}
+
+
删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.worktype }}
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+
\ 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 @@
-
+
删除
批量推送
@@ -10,7 +10,7 @@
-
+
{
currentRow.value = {id:0};
- console.log('propsQueryCourseObj', JSON.parse(propsQueryCourseObj));
- if(propsQueryCourseObj&&JSON.parse(propsQueryCourseObj)){
- courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj // 版本
- courseObj.levelFirstId = JSON.parse(propsQueryCourseObj).levelFirstId // 单元
- courseObj.levelSecondId = JSON.parse(propsQueryCourseObj).levelSecondId // 章节
- courseObj.coursetitle = JSON.parse(propsQueryCourseObj).coursetitle // (单元/章节) 名称
- courseObj.node = JSON.parse(propsQueryCourseObj).node; // 保存当前节点
+ if(propsQueryCourseObj){
+ if(JSON.parse(propsQueryCourseObj)){
+ courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj // 版本
+ courseObj.levelFirstId = JSON.parse(propsQueryCourseObj).levelFirstId // 单元
+ courseObj.levelSecondId = JSON.parse(propsQueryCourseObj).levelSecondId // 章节
+ courseObj.coursetitle = JSON.parse(propsQueryCourseObj).coursetitle // (单元/章节) 名称
+ courseObj.node = JSON.parse(propsQueryCourseObj).node; // 保存当前节点
+ }
+ }else{
+ if(props.currentCourse){
+ courseObj.textbookId = props.currentCourse.textbookId // 版本
+ courseObj.levelFirstId = props.currentCourse.levelFirstId // 单元
+ courseObj.levelSecondId = props.currentCourse.levelSecondId // 章节
+ courseObj.coursetitle = props.currentCourse.coursetitle // (单元/章节) 名称
+ courseObj.node = props.currentCourse.node; // 保存当前节点
+ classWorkForm.worktype = props.currentCourse.worktype
+ currentRow.value = {
+ id:props.currentCourse.id,
+ worktype:props.currentCourse.worktype
+ }
+ isShow.value = true;
+ }else{
+ isShow.value = false;
+ }
}
initHomeWork();
})
+watch(() => props.currentCourse, (newVal, oldVal) => {
+ if(newVal){
+ courseObj.textbookId = newVal.textbookId // 版本
+ courseObj.levelFirstId = newVal.levelFirstId // 单元
+ courseObj.levelSecondId = newVal.levelSecondId // 章节
+ courseObj.coursetitle = newVal.coursetitle // (单元/章节) 名称
+ courseObj.node = newVal.node; // 保存当前节点
+ classWorkForm.worktype = newVal.worktype
+ currentRow.value = {
+ id:props.currentCourse.id,
+ worktype:props.currentCourse.worktype
+ }
+ }
+ console.log(newVal,'newval');
+},{deep:true})
//---------作业设计---
const handleItemClick = (itemName) => {
console.log('itemName', itemName);