diff --git a/electron.vite.config.mjs b/electron.vite.config.mjs index dd0b3a1..962bf8f 100644 --- a/electron.vite.config.mjs +++ b/electron.vite.config.mjs @@ -34,7 +34,7 @@ export default defineConfig({ '/dev-api': { target: 'http://27.128.240.72:7865', // target: 'http://36.134.181.164:7863', - // target: 'http://192.168.2.52:7863', + // target: 'http://192.168.0.102:7865', changeOrigin: true, rewrite: (p) => p.replace(/^\/dev-api/, '') }, 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/App.vue b/src/renderer/src/AixPPTist/src/App.vue index 62045fc..5214d9b 100644 --- a/src/renderer/src/AixPPTist/src/App.vue +++ b/src/renderer/src/AixPPTist/src/App.vue @@ -60,14 +60,6 @@ window.addEventListener('unload', () => { const newDiscardedDB = JSON.stringify(discardedDBList) localStorage.setItem(LOCALSTORAGE_KEY_DISCARDED_DB, newDiscardedDB) }) -/** 接口类型 */ -interface Result { - code?: number, - msg?: string, - data?: any - rows?: Array, - total?: number -} // 获取参数 const initLoad: Function = () => { // 获取缓存的ppt 资源数据 diff --git a/src/renderer/src/AixPPTist/src/api/index.ts b/src/renderer/src/AixPPTist/src/api/index.ts index 658ba69..32bb25a 100644 --- a/src/renderer/src/AixPPTist/src/api/index.ts +++ b/src/renderer/src/AixPPTist/src/api/index.ts @@ -4,8 +4,10 @@ * @date 2024-11-26 */ import { toRaw } from 'vue' +import type { Result } from './types' // 接口类型 import msgUtils from '@/plugins/modal' // 消息工具 import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api +import * as API_smarttalk from '@/api/file' // 相关api import * as useStore from '../store' // pptist-状态管理 import { sessionStore } from '@/utils/store' // electron-store 状态管理 import useUserStore from '@/store/modules/user' // 外部-用户信息 @@ -53,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) @@ -63,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) }) @@ -166,6 +176,14 @@ export class PPTApi { } else msgUtils.msgError(res.msg || '删除失败');resolve(false) }) } + + // 更新-备课资源 标题 + static updateSmarttalk(data: object): Promise { + return API_smarttalk.updateSmarttalk(data).then(res => { + if (res.code === 200) return true + else msgUtils.msgError(res.msg || '更新失败');return false + }) + } } export default PPTApi \ No newline at end of file diff --git a/src/renderer/src/AixPPTist/src/api/store.ts b/src/renderer/src/AixPPTist/src/api/store.ts index 507c9db..7ec18ea 100644 --- a/src/renderer/src/AixPPTist/src/api/store.ts +++ b/src/renderer/src/AixPPTist/src/api/store.ts @@ -2,6 +2,7 @@ * @description api 无store循环引用 * @author zdg */ +import type { Result } from './types' // 接口类型 import msgUtils from '@/plugins/modal' // 消息工具 import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api diff --git a/src/renderer/src/AixPPTist/src/api/types.ts b/src/renderer/src/AixPPTist/src/api/types.ts new file mode 100644 index 0000000..8321031 --- /dev/null +++ b/src/renderer/src/AixPPTist/src/api/types.ts @@ -0,0 +1,8 @@ +/** 返回-接口类型 */ +export interface Result { + code?: number, + msg?: string, + data?: any + rows?: Array, + total?: number +} \ No newline at end of file diff --git a/src/renderer/src/AixPPTist/src/api/watcher.ts b/src/renderer/src/AixPPTist/src/api/watcher.ts index b5648ea..f1f21ba 100644 --- a/src/renderer/src/AixPPTist/src/api/watcher.ts +++ b/src/renderer/src/AixPPTist/src/api/watcher.ts @@ -7,7 +7,8 @@ import { PPTApi } from './index' import * as store from '../store' import { sessionStore } from '@/utils/store' // electron-store 状态管理 const slidesStore = store.useSlidesStore() -const resource = sessionStore.get('curr.resource') +const resource = sessionStore.get('curr.resource') // apt 资源 +const smarttalk = sessionStore.get('curr.smarttalk') // 备课资源 /** * @description 监听器 */ @@ -28,4 +29,11 @@ const updatePPT = async (data) => { data.id = resource.id await PPTApi.updateSlide(data) // 更新ppt内容 sessionStore.set('curr.resource.title', data.title) + // 更新smarttalk内容 + if (!!smarttalk && !!data.title) { + const {id, fileFlag} = smarttalk + const params = { id, fileShowName: `${data.title}.${fileFlag}` } + await PPTApi.updateSmarttalk(params) // 更新ppt内容 + sessionStore.set('curr.smarttalk.fileShowName', params.fileShowName) + } } \ No newline at end of file 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 }" /> + + + { onhtml2canvas(data); classWorkTaskVisible = 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 @@ + + + + + + + 活动引用 + + + + + + 习题训练 + + + + + + 课堂展示 + + + + + + 常规作业 + + + + + + + + + + + + + {{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/api/aiGeneratedImage/index.js b/src/renderer/src/api/aiGeneratedImage/index.js new file mode 100644 index 0000000..9939c5d --- /dev/null +++ b/src/renderer/src/api/aiGeneratedImage/index.js @@ -0,0 +1,81 @@ +import axios from 'axios' +import request from '@/utils/request' +import { getToken } from "@/utils/auth"; + +// 文生图片 +export function convertTextToPicture(data) { + return axios({ + url: 'https://ai.ysaix.com:7853/prompt', + method: 'post', + headers: { + 'Content-Type': 'application/json', + 'Accept': '*/*' + }, + data: data + }) +} +// 获取任务列表 +export function getQueue() { + return axios({ + url: `https://ai.ysaix.com:7853/queue`, + method: 'get', + }) +} + +// 获取生图任务id +export function getPromptId(id) { + return axios({ + url: `https://ai.ysaix.com:7853/history/${id}`, + method: 'get', + }) +} + +// 获取生成图片路径 +export function getPicture(data) { + return axios({ + url: 'https://ai.ysaix.com:7853/view', + method: 'get', + params: data + }) +} + +// 大模型对话生成prompt模板 +export function chattoprompt(dataset_id,prompt) { + return axios({ + url: '/api/v1/parse/docs', + method: 'post', + headers: { + 'Authorization': 'Bearer ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm', + }, + data: { + 'dataset_id': dataset_id, + 'prompt': prompt + } + }) +} + +// prompt敏感词校验 +export function textSensitiveWord(data) { + return request({ + url: '/verify/text', + method: 'post', + data: { + 'text' : data + } + }) + } + + // 图片上传资源库 + export function uploadPicture(data) { + return axios({ + url: '/dev-api/smarttalk/file/upload', + method: 'post', + headers: { + 'Accept': '*/*', + 'Content-Type': 'multipart/form-data', + 'Authorization': "Bearer " + getToken() + }, + data: data + }) + } + \ No newline at end of file diff --git a/src/renderer/src/components/ai-kolors/index.vue b/src/renderer/src/components/ai-kolors/index.vue new file mode 100644 index 0000000..0d70f0f --- /dev/null +++ b/src/renderer/src/components/ai-kolors/index.vue @@ -0,0 +1,627 @@ + + + + + + 反面提示词 + + + + + + 可选提示词 + + 风格特点 + + + + + + 主体对象 + + + + + + 场景 + + + + + + 添加 + 清空 + + + + + + + + + {{ ratio.label }} + + + + + + + + + {{ ratio.label }} + + + + + + + + 1 + + + 2 + + + 3 + + + 4 + + + + + + + + + + + + + + + + + + {{ resultItem }} + + + + + + + + + {{ buttonStates[resultIndex][index].text + }} + + + + + + + + + + + + + + + + + + + + {{ item }} + + + + + + + + + {{ !pictureLoading ? "生成图片" : "请等待" }} + + + + + + + + + + \ No newline at end of file diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index 3c4414d..afa567f 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -142,13 +142,19 @@ const handleNodeClick = (data) => { //增加一个label 之前取的label nodeData.label = nodeData.itemtitle - // 父级节点 如果当前是一级节点 父级则为null - let parent = { - id: nodeData.parentid, - label: nodeData.parenttitle, - itemtitle: nodeData.parenttitle - } - const parentNode = nodeData.parentid ? parent : null + let parentNode + // 存在children 则为一级节点 + if(nodeData.children){ + // 为一级节点 + parentNode = null + } + else{ + parentNode = { + id: nodeData.parentid, + label: nodeData.parenttitle, + itemtitle: nodeData.parenttitle + } + } nodeData.parentNode = parentNode let curData = { textBook: { diff --git a/src/renderer/src/components/file-image/index.vue b/src/renderer/src/components/file-image/index.vue index 092c238..3c6bd18 100644 --- a/src/renderer/src/components/file-image/index.vue +++ b/src/renderer/src/components/file-image/index.vue @@ -34,7 +34,8 @@ const getFileTypeIcon = () => { gif: 'icon-gif', txt: 'icon-txt', rar: 'icon-rar', - apt: 'icon-A' + apt: 'icon-A', + aptist: 'icon-A', } if (iconObj[name]) { return '#' + iconObj[name] diff --git a/src/renderer/src/components/template-study/container/right.vue b/src/renderer/src/components/template-study/container/right.vue index 98a5b8d..d62793a 100644 --- a/src/renderer/src/components/template-study/container/right.vue +++ b/src/renderer/src/components/template-study/container/right.vue @@ -26,52 +26,52 @@ - - - - - - #{{ item.name }} - - - - - - - - 编辑 - 移除 - - - - - {{ item.prompt }} - - - - - - - - - - - - - 重新研读 - - - - AI对话调整 - - - - 手动编辑结果 - - - - - + + + + + + #{{ item.name }} + + + + + + + + 编辑 + 移除 + + + + + {{ item.prompt }} + + + + + + + + + + + + + 重新研读 + + + + AI对话调整 + + + + 手动编辑结果 + + + + + @@ -83,7 +83,7 @@ diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue index b24c080..d09d913 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue @@ -71,9 +71,9 @@ - - - + + + {{ scope.row.entpname }} {{ scope.row.editusername }} {{ scope.row.worktag }} @@ -83,7 +83,8 @@ - 添加 + 选取该题 + 添加 @@ -104,7 +105,7 @@ - \ No newline at end of file diff --git a/src/renderer/src/views/examination-analysis/container/pdf.vue b/src/renderer/src/views/examination-analysis/container/pdf.vue index c83dfd0..c871a8d 100644 --- a/src/renderer/src/views/examination-analysis/container/pdf.vue +++ b/src/renderer/src/views/examination-analysis/container/pdf.vue @@ -14,8 +14,14 @@ const pdfUrl = ref('') onMounted(async () =>{ await nextTick() - const { fileurl } = sessionStore.get('subject.curBook') - pdfUrl.value = import.meta.env.VITE_APP_RES_FILE_PATH + fileurl.replace('.txt','.pdf') + + let data = sessionStore.get('subject.curBook') + let fileurl = data.fileurl + + if(fileurl == ''){ + fileurl = `${data.edustage}-${data.edusubject}-课标.txt` + } + pdfUrl.value = import.meta.env.VITE_APP_RES_FILE_PATH + fileurl.replace('.txt', '.pdf') }) diff --git a/src/renderer/src/views/model/index.vue b/src/renderer/src/views/model/index.vue index 72ed4a8..6085346 100644 --- a/src/renderer/src/views/model/index.vue +++ b/src/renderer/src/views/model/index.vue @@ -13,6 +13,7 @@ 打开PPTist 考试分析 测试 + 文生图片 @@ -51,9 +52,12 @@ import { useRouter } from 'vue-router' import { Plus, Refresh, Upload, Files, UploadFilled } from '@element-plus/icons-vue' import useUserStore from '@/store/modules/user' // 用户信息 import msgUtils from '@/plugins/modal' // 消息工具 -import { createWindow, sessionStore } from '@/utils/tool' // 相关工具 +import { createWindow } from '@/utils/tool' // 相关工具 +import * as API_smarttalk from '@/api/file' // 文件相关api import * as API_entpcourse from '@/api/education/entpcourse' // 相关api import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api +import { dataSetJson } from '@/utils/comm' // 数据集id文生图 +import { sessionStore } from '@/utils/store' // 学科名字文生图 // 组件引入 import ChooseTextbook from '@/components/choose-textbook/index.vue' import { menusEvent } from '@/plugins/vue3-menus' // 右键菜单 @@ -156,6 +160,21 @@ const onchange = (path) => { if (path == '/model/newClassTaskAssign') { // 作业管理 router.push({ path, query: { courseObj: JSON.stringify(courseObj) } }) + } else if (path == '/model/aiKolors') { + // ai生图 + let subjectdata = sessionStore.get('subject.curNode') + let datasubject = `课标-${subjectdata.edustage}-${subjectdata.edusubject}` + console.log(subjectdata) + router.push({ + path, + query: { + datasetId: dataSetJson[datasubject], + coursetitle: courseObj.coursetitle, + levelFirstId: subjectdata.parentid, + levelSecondId: subjectdata.id, + textbookId: subjectdata.rootid, + } + }); } else { router.push(path) } @@ -338,7 +357,7 @@ const getIcon = (o, type) => { justify-content: flex-start; .el-button { - flex: 1 1 15%; + flex: 1 1 15%; max-width: 15%; min-width: 15%; box-sizing: border-box; @@ -353,4 +372,4 @@ const getIcon = (o, type) => { } } } - \ No newline at end of file + diff --git a/src/renderer/src/views/prepare/container/ai-pptistV2.vue b/src/renderer/src/views/prepare/container/ai-pptistV2.vue index 0a1f50e..674c65a 100644 --- a/src/renderer/src/views/prepare/container/ai-pptistV2.vue +++ b/src/renderer/src/views/prepare/container/ai-pptistV2.vue @@ -57,11 +57,11 @@ 上一步 - 生成PPT + 生成PPT - + @@ -79,6 +79,7 @@ import { import CryptoJS from "crypto-js" import { getSignature } from "@/utils/index.js"; +import {sessionStore} from "@/utils/store"; let appId = "01ec9aa3"; let secret = "M2QxMDAxMjYyYTEzODMwMGRkZTQ4NmUy"; @@ -98,8 +99,8 @@ let secondArray = ref([]); //大纲的文字部分 const backGroundList = ref([]); - -const inputTheme = ref("高中语文《沁园春雪》的授课课件"); // 输入的主题 +let subjectdata = sessionStore.get('subject.curNode') +const inputTheme = ref(subjectdata.edustage + subjectdata.edusubject + "《" + subjectdata.itemtitle + "》的授课课件"); // 输入的主题 const inputRequire = ref("") // 输入的需求 const activeStep = ref(0); // 上方进度条 const combined = ref('') // 修改完毕的大纲数据,准备传入ppt生成模型 @@ -109,6 +110,8 @@ const status = ref("init"); const percentage = ref(0); +const createPPTLoading = ref(false); + const getBackgrounds = () => { treeData.value = []; getBackGroundV2().then((res) => { @@ -126,6 +129,8 @@ const outlineData = ref({ // templateId: 'auto', // ppt生成主题 author: 'AIX平台', isFigure: false, // 是否自动配图 + search: true, + language: "cn" } ) @@ -145,20 +150,17 @@ function updateStagingData(role, newData) { const outlineCreatePPT = () => { const newOutlineData = { ...outlineData.value, }; newOutlineData.query = outputText.value; - + createPPTLoading.value = true; createPPTV2(newOutlineData).then((res) => { console.log(res, "正在生成中"); + createPPTLoading.value = false; activeStep.value = 2 const checkProgress = () => { - getProgressV2(res.sid).then((response) => { - percentage.value = response.process; - if (response && response.pptUrl && response.pptUrl.length > 4) { - console.log('PPT',response) - // window.location.href = response.data.pptUrl; - //发消息到主进程,携带名称和URL,将URL下载下来后复制到文件列表并上传到服务 - // let url = "https://bjcdn.openstorage.cn/xinghuo-privatedata/%2Ftmp/apiTempFiledf28bf990a4c40ffb7477ed4b65392c27232357022409613439/%E3%80%8A%E9%9D%99%E5%A5%B3%E3%80%8B%E6%B7%B1%E5%BA%A6%E8%A7%A3%E8%AF%BB%E4%B8%8E%E7%A0%94%E7%A9%B6.pptx" - emit('addSuccess',res) + getProgressV2(res.sid).then(response => { + percentage.value = Math.round(response?.donePages/response?.totalPages)*100; + if (response.pptStatus === "done") { + emit('addSuccess',{...res,url:response.pptUrl}) ElMessage.success("生成成功"); } else { const sleepTime = 2000; diff --git a/src/renderer/src/views/prepare/container/class-start.vue b/src/renderer/src/views/prepare/container/class-start.vue index 7913a5c..3829064 100644 --- a/src/renderer/src/views/prepare/container/class-start.vue +++ b/src/renderer/src/views/prepare/container/class-start.vue @@ -59,14 +59,16 @@ - 开始新的课堂,需要点击先创建课堂,才能显示手机二维码 + 开始新的课堂,需要点击先创建课堂,才能显示手机二维码 + 开始新的课堂,需要点击先创建课堂 创建课堂 - 如果手机扫码后进入课堂,但本页面没自动跳转,请点击下面按钮 + 如果手机扫码后进入课堂,但本页面没自动跳转,请点击下面按钮 + 本页面没自动跳转,请点击下面按钮 开始上课 @@ -81,7 +83,7 @@
{{ resultItem }}
{{ item }}