diff --git a/.env.production b/.env.production index 0919367..b7f30f3 100644 --- a/.env.production +++ b/.env.production @@ -22,4 +22,4 @@ VITE_APP_BUILD_BASE_PATH = 'https://prev.ysaix.com:7868/' VITE_APP_WS_URL = 'wss://file.ysaix.com:7868' # 是否显示开发工具 -VITE_SHOW_DEV_TOOLS = 'false' +VITE_SHOW_DEV_TOOLS = 'true' diff --git a/package.json b/package.json index 0f251bf..21aff1b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aix-win-ws", - "version": "2.5.4", + "version": "2.5.5", "description": "", "main": "./out/main/index.js", "author": "上海交大重庆人工智能研究院", diff --git a/src/renderer/src/AixPPTist/src/App.vue b/src/renderer/src/AixPPTist/src/App.vue index b28a3fb..c06919f 100644 --- a/src/renderer/src/AixPPTist/src/App.vue +++ b/src/renderer/src/AixPPTist/src/App.vue @@ -40,8 +40,8 @@ const slidesStore = useSlidesStore() const { databaseId } = storeToRefs(mainStore) const { screening } = storeToRefs(useScreenStore()) -if (import.meta.env.MODE !== 'development') { - window.onbeforeunload = () => false +if (import.meta.env.MODE === 'development') { + // window.onbeforeunload = () => false } onMounted(async () => { diff --git a/src/renderer/src/AixPPTist/src/api/index.ts b/src/renderer/src/AixPPTist/src/api/index.ts index aa255d2..f54a141 100644 --- a/src/renderer/src/AixPPTist/src/api/index.ts +++ b/src/renderer/src/AixPPTist/src/api/index.ts @@ -110,6 +110,9 @@ export class PPTApi { const rid = await API_entpcoursefile.addEntpcoursefileReturnId(params) if (!!rid) { data.id = rid + params.id = rid + params.activityContent = null + slidesStore.addWorkItem(params) slidesStore.updateSlide(data) // msgUtils.msgSuccess('新增成功') this.isUpdate = false // 新增后会触发监听,不再更新数据 @@ -148,8 +151,6 @@ export class PPTApi { static updateSlide(data: object): Promise { return new Promise(async (resolve, reject) => { const res: Result = await API_entpcoursefile.updateEntpcoursefileNew(data) - console.log(data,'data'); - console.log(res,'dresata'); if (res.code === 200) { 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 79f1e66..37ba6b2 100644 --- a/src/renderer/src/AixPPTist/src/store/slides.ts +++ b/src/renderer/src/AixPPTist/src/store/slides.ts @@ -146,45 +146,18 @@ export const useSlidesStore = defineStore('slides', { this.workItem = list }, addWorkItem(data: any) { - const id = data?.parentid + const id = data?.id if (!id) return - this.workItem.splice(this.slideIndex, 0, data) + this.workItem.splice(this.slideIndex + 1, 0, data) + this.slideIndex += 1 }, addSlide(slide: Slide | Slide[]) { - const resource = sessionStore.get('curr.resource')||{} - const enpt = sessionStore.get('curr.entp')||{} - const {id, ...content} = slide - const params = { - parentid: resource.id, - activityContent:null, - entpid: userStore.user.deptId, - entpcourseid: enpt.id, - ppttype: 'file', - title: '', - fileurl: '', - filetype: 'slide', - datacontent: JSON.stringify(content), - filekey: '', - filetag: '', - fileidx: 0, - dflag: 0, - status: '', - edituserid: userStore.id, - } const slides = Array.isArray(slide) ? slide : [slide] for (const slide of slides) { if (slide.sectionTag) delete slide.sectionTag } - API_entpcoursefile.addEntpcoursefileReturnId(params).then((rid:number) => { - if(!!rid){ - params.id = rid - this.addWorkItem(params) - const addIndex = this.slideIndex + 1 - this.slides.splice(addIndex, 0, ...slides) - this.slideIndex = addIndex - } - }) + this.slides.splice(this.slideIndex, 0, ...slides) }, updateSlide(props: Partial, slideId?: string) { 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 index a2e20b9..d55e688 100644 --- 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 @@ -90,7 +90,8 @@ import { sessionStore } from '@/utils/store' import { useGetHomework } from '@/hooks/useGetHomework' import { PPTApi } from '../../../../../api/index' import { storeToRefs } from 'pinia' -import {useSlidesStore} from '../../../../../store' +import {useSlidesStore} from '../../../../../store' +import { updateEntpcoursefileNew } from '@/api/education/entpcoursefile' const slidesStore = useSlidesStore() const { slides, slideIndex, currentSlide, workItem } = storeToRefs(slidesStore) @@ -277,7 +278,6 @@ const getCurrentPPtData = async () => { workList.value = [] objItem.value = workItem.value[slideIndex.value] paramData.value.id = objItem.value.id - console.log(paramData.value.id,'paramData.value.id'); paramData.value.activityContent = objItem.value?.activityContent if (objItem.value?.activityContent) { @@ -302,15 +302,16 @@ const getData = async (data: WorkItem) => { dialogVisible.value = false } const upDateData = async () => { - await PPTApi.updateSlide(paramData.value) + // await PPTApi.updateSlide(paramData.value) loadingActive.value = true + await updateEntpcoursefileNew(paramData.value) const res = await homeworklist({ ids: paramData.value.activityContent, pageSize: 100 }) await formatClassWorkFile(res.rows) const resource = sessionStore.get('curr.resource') await PPTApi.getSlideList(resource.id) } // 判断是否做操作 -const objectsAreEqual = (obj1: any[], obj2: any[]) => { +const objectsAreEqual = (obj1: Record, obj2: Record) => { const keys1 = Object.keys(obj1); const keys2 = Object.keys(obj2); if (keys1.length !== keys2.length) return false; diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index afa567f..7e766f8 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -1,7 +1,8 @@
    -
  • +
  • 学校认证 {{ userStore.DeptInfo.register.schoolName }} @@ -19,8 +19,8 @@
  • 加入学校
  • 个人中心
  • -
  • 学校管理
  • -
  • 班级中心
  • +
  • 学校管理
  • +
  • 班级中心
  • 退出登录
@@ -53,7 +53,7 @@