From 3ad4391e108347bbbd09fdc6f3607fe408f6acae Mon Sep 17 00:00:00 2001 From: lyc Date: Tue, 3 Dec 2024 10:11:51 +0800 Subject: [PATCH 01/19] =?UTF-8?q?edit=20=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/choose-textbook/index.vue | 19 +- .../template-study/container/right.vue | 377 ++++++++++-------- .../src/components/typing-effect/index.vue | 37 +- .../examination-analysis/container/dialog.vue | 2 +- 4 files changed, 255 insertions(+), 180 deletions(-) diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index 3c4414d..781b86b 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -142,13 +142,18 @@ 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 + // 父级id == rootid 说明当前节点为一级节点 + if(nodeData.parentid == nodeData.rootid){ + 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/template-study/container/right.vue b/src/renderer/src/components/template-study/container/right.vue index 98a5b8d..ffcb56c 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 @@ -
- - +
+ +
@@ -83,7 +83,7 @@ \ No newline at end of file diff --git a/src/renderer/src/router/index.js b/src/renderer/src/router/index.js index 75b3c48..2e6a4fe 100644 --- a/src/renderer/src/router/index.js +++ b/src/renderer/src/router/index.js @@ -85,6 +85,12 @@ export const constantRoutes = [ name: 'questionUpload', meta: { title: '习题上传' } }, + { + path: 'aiKolors', + component: () => import('@/components/ai-kolors/index.vue'), + name: 'aiKolors', + meta: { title: '文生图片' } + }, ] }, diff --git a/src/renderer/src/utils/comm.js b/src/renderer/src/utils/comm.js index 5c26eaf..fc3b89e 100644 --- a/src/renderer/src/utils/comm.js +++ b/src/renderer/src/utils/comm.js @@ -395,5 +395,6 @@ export const dataSetJson = { "课标-高中-英语": "e889fcac9fd011efb22a0242ac140006", "课标-高中-数学": "e03aa4fe9fd011ef91270242ac140006", "课标-高中-地理": "270516829fd111efb13c0242ac140006", + "课标-高中-政治": "a7df2b01aafd11ef8bb40242ac140002", "鉴权": "ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm" } \ No newline at end of file diff --git a/src/renderer/src/views/model/index.vue b/src/renderer/src/views/model/index.vue index 72ed4a8..f39fc99 100644 --- a/src/renderer/src/views/model/index.vue +++ b/src/renderer/src/views/model/index.vue @@ -13,6 +13,7 @@ 打开PPTist 考试分析 测试 + 文生图片 @@ -54,6 +55,8 @@ import msgUtils from '@/plugins/modal' // 消息工具 import { createWindow, sessionStore } from '@/utils/tool' // 相关工具 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 +159,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) } From e6333e49f0ccd1f46f15ab43f7d623f9cdd1067f Mon Sep 17 00:00:00 2001 From: zdg Date: Wed, 4 Dec 2024 14:33:08 +0800 Subject: [PATCH 03/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0ppt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/AixPPTist/src/api/index.ts | 9 ++++ src/renderer/src/AixPPTist/src/api/watcher.ts | 10 +++- .../src/components/file-image/index.vue | 3 +- src/renderer/src/views/model/index.vue | 16 +++++++ .../views/prepare/container/class-start.vue | 39 ++++++++++++--- .../views/prepare/container/kj-list-item.vue | 6 +++ src/renderer/src/views/prepare/index.vue | 48 ++++++++++++++++--- 7 files changed, 116 insertions(+), 15 deletions(-) diff --git a/src/renderer/src/AixPPTist/src/api/index.ts b/src/renderer/src/AixPPTist/src/api/index.ts index 658ba69..8255435 100644 --- a/src/renderer/src/AixPPTist/src/api/index.ts +++ b/src/renderer/src/AixPPTist/src/api/index.ts @@ -6,6 +6,7 @@ import { toRaw } from 'vue' 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' // 外部-用户信息 @@ -166,6 +167,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/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/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/views/model/index.vue b/src/renderer/src/views/model/index.vue index 72ed4a8..7731148 100644 --- a/src/renderer/src/views/model/index.vue +++ b/src/renderer/src/views/model/index.vue @@ -52,6 +52,7 @@ import { Plus, Refresh, Upload, Files, UploadFilled } from '@element-plus/icons- import useUserStore from '@/store/modules/user' // 用户信息 import msgUtils from '@/plugins/modal' // 消息工具 import { createWindow, sessionStore } 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 // 组件引入 @@ -178,6 +179,19 @@ const getResourceList = async () => { // 统一HTTP处理 const HTTP_SERVER_API = (type, params = {}) => { switch (type) { + case 'addSmarttalk': { // 获取课程 + const def = { + fileId: '', // 文件id - Entpcoursefile 对应id + fileFlag: 'aptist', + fileShowName: courseObj.coursetitle + '.aptist', + textbookId: courseObj.textbookId, + levelFirstId: courseObj.levelFirstId, + levelSecondId: courseObj.levelSecondId, + fileSource: '个人', + fileRoot: '备课' + } + return API_smarttalk.creatAPT({...def, ...params}) + } case 'addEntpcourse': { // 添加课程 const node = courseObj.node || {} if (!node) return msgUtils.msgWarning('请选择章节?') @@ -260,6 +274,8 @@ const handleAll = async(type, row) =>{ } // 生成ppt课件-子级(slide) await HTTP_SERVER_API('addEntpcoursefile', params) + // 生成备课资源-Smarttalk + await HTTP_SERVER_API('addSmarttalk',{fileId: id}) // 刷新资源列表 await getResourceList() } else { 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 @@ + \ 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 @@ +
@@ -110,6 +111,17 @@ @update="data => { createLatexElement(data); latexEditorVisible = false }" /> + + + + +
@@ -178,6 +190,7 @@ 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) From ea204de407f0abca60022f5a87184f5f6171e89c 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: Wed, 4 Dec 2024 15:05:48 +0800 Subject: [PATCH 08/19] 1 --- src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue | 1 + 1 file changed, 1 insertion(+) 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 e0c8ab9..749e1ab 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue @@ -147,6 +147,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 SearchQuestion from '@/views/classTask/newClassTaskAssign/searchQuestion/index.vue' const mainStore = useMainStore() const { creatingElement, creatingCustomShape, showSelectPanel, showSearchPanel, showNotesPanel } = storeToRefs(mainStore) From 8b429a417497535919190848e09abde672271675 Mon Sep 17 00:00:00 2001 From: lyc Date: Wed, 4 Dec 2024 15:13:53 +0800 Subject: [PATCH 09/19] edit --- .../src/components/choose-textbook/index.vue | 5 +- .../template-study/container/right.vue | 66 +++++++++---------- .../src/components/typing-effect/index.vue | 4 +- src/renderer/src/views/profile/index.vue | 4 +- 4 files changed, 38 insertions(+), 41 deletions(-) diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index 781b86b..afa567f 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -143,8 +143,9 @@ const handleNodeClick = (data) => { //增加一个label 之前取的label nodeData.label = nodeData.itemtitle let parentNode - // 父级id == rootid 说明当前节点为一级节点 - if(nodeData.parentid == nodeData.rootid){ + // 存在children 则为一级节点 + if(nodeData.children){ + // 为一级节点 parentNode = null } else{ diff --git a/src/renderer/src/components/template-study/container/right.vue b/src/renderer/src/components/template-study/container/right.vue index ffcb56c..d62793a 100644 --- a/src/renderer/src/components/template-study/container/right.vue +++ b/src/renderer/src/components/template-study/container/right.vue @@ -52,7 +52,7 @@
- +
@@ -178,27 +178,22 @@ const getTempResult = () => { const scrollToBottom = (height,index) =>{ if (listRef.value) { - + let sum = 0 let listDom = listRef.value.children - for(let i = 0; i < index; i++){ - sum += listDom[i].clientHeight + if(index == 0){ + // 220 去掉头部 + let screenHeight = window.innerHeight - 220 + if(height > screenHeight){ + listRef.value.scrollTop = (height - screenHeight + 50) + } + } + else{ + for(let i = 0; i < index; i++){ + sum += listDom[i].clientHeight + } + listRef.value.scrollTop = sum + height } - - listRef.value.scrollTop = sum + height - - // isStarted.value[index] = height - - // const sum = isStarted.value.reduce((accumulator, currentValue) => { - // // 检查当前值是否为数字 - // if (typeof currentValue === 'number') { - // return accumulator + currentValue; - // } - // // 如果不是数字,则返回累加器的当前值 - // return accumulator; - // }, 0); - // listRef.value.scrollTop = sum - 150; - } } @@ -294,34 +289,28 @@ const params = reactive( ) // 重新研读 +const isAgain = ref(false) const againResult = async (index, item) => { - let sTop = isStarted.value[index] + isAgain.value = true isStarted.value[index] = false childTempList.value[index].answer = '' - - console.log(listRef.value.scrollTop,listRef.value.children[index].clientHeight); - - if(index == 0){ listRef.value.scrollTop = 0 }else{ - console.log( listRef.value.scrollTop - (listRef.value.children[index].clientHeight),'index') - listRef.value.scrollTop =listRef.value.scrollTop - listRef.value.children[index].clientHeight - 50 - + scrollToBottom(50, index) } + try { await nextTick() childTempList.value[index].loading = true item.aiShow = true - //params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析` - //const { data } = await completion(params) - //childTempList.value[index].answer = getResult(data.answer); - childTempList.value[index].answer = '根据知识库的内容,核心素\n\n综上所述,在大足石刻研学课程中应充分考虑语文学科核心素养的要求,通过实践活动提高学生语言运用能力、思维品质及文化认同' + params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析` + const { data } = await completion(params) + childTempList.value[index].answer = getResult(data.answer); isStarted.value[index] = true - - // onEditSave(item) + } finally { childTempList.value[index].loading = false } @@ -351,10 +340,17 @@ const getCompletion = async () => { } } -const handleCompleteText = (index) =>{ +const handleCompleteText = async (answer, index) =>{ if (index < childTempList.value.length - 1) { isStarted.value[index + 1] = true; // 开始显示下一个文本 } + if(isAgain.value){ + try{ + await editTempResult({ id: childTempList.value[index].resultId, content: answer }) + }finally{ + isAgain.value = false + } + } } // 替换分析结果 @@ -363,8 +359,6 @@ emitter.on('onSaveAdjust', (item) => { onEditSave(childTempList.value[curIndex.value]) }) - - // 保存 重新研读后的结果 const onEditSave = async (item) => { const { res } = await editTempResult({ id: item.resultId, content: item.answer }) diff --git a/src/renderer/src/components/typing-effect/index.vue b/src/renderer/src/components/typing-effect/index.vue index 8a771d4..b8c8a3c 100644 --- a/src/renderer/src/components/typing-effect/index.vue +++ b/src/renderer/src/components/typing-effect/index.vue @@ -45,11 +45,11 @@ const type = async () => { index.value++; setTimeout(() => { type(); - emit('updateScroll', typingEffectRef.value.offsetHeight); // 每次添加新字符后滚动到底部 + emit('updateScroll', typingEffectRef.value.clientHeight); // 每次添加新字符后滚动到底部 }, props.delay); } else { // 当所有字符都显示完毕时,触发 complete 事件 - emit('complete'); + emit('complete',displayedText.value); } }; diff --git a/src/renderer/src/views/profile/index.vue b/src/renderer/src/views/profile/index.vue index 0526cc3..93fc043 100644 --- a/src/renderer/src/views/profile/index.vue +++ b/src/renderer/src/views/profile/index.vue @@ -5,7 +5,7 @@
{{ state.user.nickName }}
- +
@@ -46,8 +46,10 @@ const state = reactive({ postGroup: {} }) +const isSubject = ref(false) async function getUser() { getUserProfile().then((response) => { + isSubject.value = response.roleGroup.indexOf('场馆管理员') != -1 // response.data.avatar = import.meta.env.VITE_APP_BASE_API + response.data.avatar Object.assign(state.user,response.data) state.roleGroup = response.roleGroup From 08a16929f71cd89ec006d614b868f46d1dfa2bae Mon Sep 17 00:00:00 2001 From: zdg Date: Wed, 4 Dec 2024 15:32:56 +0800 Subject: [PATCH 10/19] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/prepare/container/kj-list-item.vue | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/renderer/src/views/prepare/container/kj-list-item.vue b/src/renderer/src/views/prepare/container/kj-list-item.vue index e838978..fc1cc6d 100644 --- a/src/renderer/src/views/prepare/container/kj-list-item.vue +++ b/src/renderer/src/views/prepare/container/kj-list-item.vue @@ -332,10 +332,6 @@ export default { const { id, rootid } = sessionStore.get('subject.curNode') const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + id + "&bookId=" + rootid; let configObj = outLink().getBaseData() - configObj.fullPath = 'https://localhost:7860/' - configObj.data.url = 'https://localhost:7860/' - configObj.data.domain = 'localhost' - console.log(configObj) let fullPath = configObj.fullPath + path fullPath = fullPath.replaceAll('//', '/') // 通知主进程 From 91ceb712bf00fbb674562556e01db013f7ed3fac Mon Sep 17 00:00:00 2001 From: zdg Date: Wed, 4 Dec 2024 15:45:45 +0800 Subject: [PATCH 11/19] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/model/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/views/model/index.vue b/src/renderer/src/views/model/index.vue index a8dfa14..d2a6bf0 100644 --- a/src/renderer/src/views/model/index.vue +++ b/src/renderer/src/views/model/index.vue @@ -57,7 +57,7 @@ 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 { sessionStore } from '@/utils/store' // 学科名字文生图 // 组件引入 import ChooseTextbook from '@/components/choose-textbook/index.vue' import { menusEvent } from '@/plugins/vue3-menus' // 右键菜单 From 7811bbfe3e9fac5e27a1cfa179744dadb8182970 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Wed, 4 Dec 2024 16:28:52 +0800 Subject: [PATCH 12/19] =?UTF-8?q?s=E7=94=9F=E6=88=90PPT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron.vite.config.mjs | 2 +- src/renderer/src/views/model/index.vue | 8 +++--- .../views/prepare/container/ai-pptistV2.vue | 28 ++++++++++--------- .../views/prepare/container/pptist-dialog.vue | 2 +- 4 files changed, 21 insertions(+), 19 deletions(-) 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/src/renderer/src/views/model/index.vue b/src/renderer/src/views/model/index.vue index d2a6bf0..d09f75d 100644 --- a/src/renderer/src/views/model/index.vue +++ b/src/renderer/src/views/model/index.vue @@ -52,12 +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 { sessionStore } from '@/utils/store' // 学科名字文生图 // 组件引入 import ChooseTextbook from '@/components/choose-textbook/index.vue' import { menusEvent } from '@/plugins/vue3-menus' // 右键菜单 @@ -372,7 +372,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; @@ -387,4 +387,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/pptist-dialog.vue b/src/renderer/src/views/prepare/container/pptist-dialog.vue index 84bf25f..22b2155 100644 --- a/src/renderer/src/views/prepare/container/pptist-dialog.vue +++ b/src/renderer/src/views/prepare/container/pptist-dialog.vue @@ -13,7 +13,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') }) From be9d33fcd37f72551593d69143124144f79ae7cf 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: Wed, 4 Dec 2024 17:30:01 +0800 Subject: [PATCH 16/19] =?UTF-8?q?pptist=EF=BC=9A=20canvasTool=20=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=20=E6=96=B0=E5=A2=9E=E6=8F=92=E5=85=A5=E8=AF=95?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + .../src/views/Editor/CanvasTool/index.vue | 16 ++- .../newClassTaskAssign/myQuestion/index.vue | 34 +++++- .../questToPPTist/index.vue | 115 ++++++++++++++++++ .../searchQuestion/index.vue | 31 ++++- 5 files changed, 181 insertions(+), 16 deletions(-) create mode 100644 src/renderer/src/views/classTask/newClassTaskAssign/questToPPTist/index.vue 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/src/AixPPTist/src/views/Editor/CanvasTool/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue index 749e1ab..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,7 +81,7 @@ - +
@@ -116,9 +116,10 @@ v-model:visible="classWorkTaskVisible" :width="880" > - @@ -147,7 +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 SearchQuestion from '@/views/classTask/newClassTaskAssign/searchQuestion/index.vue' +import QuestToPPTist from '@/views/classTask/newClassTaskAssign/questToPPTist/index.vue' const mainStore = useMainStore() const { creatingElement, creatingCustomShape, showSelectPanel, showSearchPanel, showNotesPanel } = storeToRefs(mainStore) @@ -185,6 +186,10 @@ 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) @@ -357,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/views/classTask/newClassTaskAssign/myQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue index e605b51..23970f4 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue @@ -40,7 +40,7 @@ 查找 - 添加习题 + 添加习题 @@ -58,9 +58,9 @@