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/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/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/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 @@ -
- - +
+ +
@@ -83,7 +83,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 0617ab3..6085346 100644 --- a/src/renderer/src/views/model/index.vue +++ b/src/renderer/src/views/model/index.vue @@ -357,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; @@ -372,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/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('//', '/') // 通知主进程 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 @@