diff --git a/.env.production b/.env.production index e103054..05e26a6 100644 --- a/.env.production +++ b/.env.production @@ -18,4 +18,4 @@ VITE_APP_RES_FILE_PATH = 'https://prev.ysaix.com:7868/src/assets/textbook/booktx VITE_APP_BUILD_BASE_PATH = 'https://prev.ysaix.com:7868/' -VITE_SHOW_DEV_TOOLS = 'false' +VITE_SHOW_DEV_TOOLS = 'true' diff --git a/.env.yc2 b/.env.yc2 new file mode 100644 index 0000000..d28d2aa --- /dev/null +++ b/.env.yc2 @@ -0,0 +1,21 @@ +# 页面标题 +VITE_APP_TITLE = 实训教学 + +# 生产环境配置 +VITE_APP_ENV = 'production' + +# AIx融合数字管理系统/生产环境 +VITE_APP_BASE_API = 'https://prev.ysaix.com:7868/prod-api' + +VITE_APP_DOMAIN = 'prev.ysaix.com' + +VITE_APP_UPLOAD_API = 'https://prev.ysaix.com:7868/prod-api' + +# 是否在打包时开启压缩,支持 gzip 和 brotli +VITE_BUILD_COMPRESS = gzip + +VITE_APP_RES_FILE_PATH = 'https://prev.ysaix.com:7868/src/assets/textbook/booktxt/' + +VITE_APP_BUILD_BASE_PATH = 'https://prev.ysaix.com:7868/' + +VITE_SHOW_DEV_TOOLS = 'false' diff --git a/package.json b/package.json index 57803ba..1705d80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aix-win", - "version": "2.1.36", + "version": "2.1.37", "description": "", "main": "./out/main/index.js", "author": "上海交大重庆人工智能研究院", @@ -17,15 +17,11 @@ "build:test": "electron-vite build --mode test && electron-builder --win --config ./electron-builder.yml", "build:prod": "electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml", "build:yc": "electron-vite build --mode yc && electron-builder --win --config ./electron-builder-yc.yml", + "build:yc2": "electron-vite build --mode yc2 && electron-builder --win --config ./electron-builder-yc.yml", "build:mac": "electron-vite build --mode production && electron-builder --mac --config ./electron-builder-prod.yml", "build:linux": "npm run build && electron-builder --linux" }, "dependencies": { - "@electron-toolkit/preload": "^3.0.1", - "@electron-toolkit/utils": "^3.0.0", - "@electron/remote": "^2.1.2", - "@element-plus/icons-vue": "^2.3.1", - "@vitejs/plugin-vue-jsx": "^4.0.0", "@antv/x6": "^2.18.1", "@antv/x6-plugin-clipboard": "^2.1.6", "@antv/x6-plugin-dnd": "^2.1.1", @@ -34,6 +30,11 @@ "@antv/x6-plugin-selection": "^2.2.2", "@antv/x6-plugin-snapline": "^2.1.7", "@antv/x6-plugin-transform": "^2.1.8", + "@electron-toolkit/preload": "^3.0.1", + "@electron-toolkit/utils": "^3.0.0", + "@electron/remote": "^2.1.2", + "@element-plus/icons-vue": "^2.3.1", + "@vitejs/plugin-vue-jsx": "^4.0.0", "@vue-office/docx": "^1.6.2", "@vue-office/excel": "^1.7.11", "@vue-office/pdf": "^2.0.2", @@ -53,20 +54,21 @@ "js-cookie": "^3.0.5", "jsencrypt": "^3.3.2", "jsondiffpatch": "0.6.0", + "less": "^4.2.0", + "less-loader": "^7.3.0", "lodash": "^4.17.21", "node-addon-api": "^8.1.0", "pdfjs-dist": "4.4.168", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.1", + "qs": "^6.13.1", "spark-md5": "^3.0.2", "vite-plugin-electron": "^0.28.8", "vue-qr": "^4.0.9", "vue-router": "^4.4.0", + "whiteboard_lyc": "^0.1.3", "xgplayer": "^3.0.19", - "xlsx": "^0.18.5", - "less": "^4.2.0", - "less-loader": "^7.3.0", - "whiteboard_lyc": "^0.1.3" + "xlsx": "^0.18.5" }, "devDependencies": { "@electron-toolkit/eslint-config": "^1.0.2", diff --git a/src/main/file.js b/src/main/file.js index 3de3333..d1d95fe 100644 --- a/src/main/file.js +++ b/src/main/file.js @@ -284,9 +284,10 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) { function downloadFiles(url,fileName) { console.log(url,fileName) return new Promise((resolve, reject)=>{ - const browserWindow = BrowserWindow.getFocusedWindow() + const browserWindow = BrowserWindow.getAllWindows() + console.log(browserWindow) const id = manager.download({ - window: browserWindow, + window: browserWindow[0], url: url, saveAsFilename: fileName, directory: appTempFilePath, diff --git a/src/main/index.js b/src/main/index.js index 22f49a2..e8f5f62 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -46,7 +46,7 @@ if(!gotTheLock){ function createLoginWindow() { if (loginWindow) return loginWindow = new BrowserWindow({ - width: import.meta.env.MODE==='yc'?1160:888, + width: import.meta.env.MODE==='yc'||import.meta.env.MODE==='yc2'?1160:888, height: 520, show: false, frame: false, diff --git a/src/renderer/src/assets/images/login/ycpeitu2.jpg b/src/renderer/src/assets/images/login/ycpeitu2.jpg new file mode 100644 index 0000000..4cc2f71 Binary files /dev/null and b/src/renderer/src/assets/images/login/ycpeitu2.jpg differ diff --git a/src/renderer/src/utils/ppt-request.js b/src/renderer/src/utils/ppt-request.js index ccfc55f..1a36d3d 100644 --- a/src/renderer/src/utils/ppt-request.js +++ b/src/renderer/src/utils/ppt-request.js @@ -96,5 +96,34 @@ const getProgress = async (id) => { throw error; } }; +const getBackGroundV2 = async () => { + try { + const response = await req("/api/aipptV2/themeListV2", "GET"); + return response.data; + } catch (error) { + console.error("请求失败:", error); + throw error; + } +}; +const createPPTV2 = async (data) => { + try { + const response = await req("/api/aipptV2/createV2", "POST", data); + console.log("createOutline response:", response); -export { createOutline, getBackGround, createPPT, getProgress, createByOutline }; + return response.data; + } catch (error) { + console.error("请求失败:", error); + throw error; + } +}; +const getProgressV2 = async (id) => { + try { + const response = await req(`/api/aipptV2/progressV2?sid=${id}`, "GET"); + return response.data; + } catch (error) { + console.error("请求失败:", error); + throw error; + } +}; + +export { createOutline, getBackGround, createPPT, getProgress, getBackGroundV2, createPPTV2, getProgressV2, createByOutline }; diff --git a/src/renderer/src/views/login/yc-login.vue b/src/renderer/src/views/login/yc-login.vue index 5350d7e..9a51ebf 100644 --- a/src/renderer/src/views/login/yc-login.vue +++ b/src/renderer/src/views/login/yc-login.vue @@ -1,13 +1,13 @@