Merge branch 'main' into zouyf_dev

This commit is contained in:
“zouyf” 2024-10-25 10:21:33 +08:00
commit fab449cc96
8 changed files with 21 additions and 17 deletions

View File

@ -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 = 'true'
VITE_SHOW_DEV_TOOLS = 'false'

View File

@ -1,9 +1,9 @@
{
"name": "aix-win",
"version": "2.1.14",
"version": "2.1.18",
"description": "",
"main": "./out/main/index.js",
"author": "example.com",
"author": "上海交大重庆人工智能研究院",
"homepage": "https://electron-vite.org",
"scripts": {
"format": "prettier --write .",

View File

@ -271,12 +271,13 @@ app.on('window-all-closed', () => {
function handleAll() {
const chatInstance = chat.initialize() // im-chat 实例
// 新窗口创建-监听
ipcMain.on('new-window', (e, data) => {
ipcMain.handle('new-window', (e, data) => {
const { id, type } = data
const win = BrowserWindow.fromId(id)
win.type = type // 绑定独立标识
remote.enable(win.webContents) // 开启远程服务
chatInstance.enable(win.webContents) // 开启im-chat
console.log(`主进程 [${type}]: 窗口注册-远程代理-完毕(${Date.now()})`)
})
// 用于监听-状态管理变化-同步所有窗口
ipcMain.handle('pinia-state-change', (e, storeName, jsonStr) => {

View File

@ -33,7 +33,7 @@
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="changePage('/profile')">个人中心</el-dropdown-item>
<el-dropdown-item @click="changePage('/classReserv')">课程预约</el-dropdown-item>
<!-- <el-dropdown-item @click="changePage('/classReserv')">课程预约</el-dropdown-item>-->
<el-dropdown-item @click="changePage('/class')">班级中心</el-dropdown-item>
<el-dropdown-item divided command="logout">
<span>退出登录</span>

View File

@ -3,8 +3,8 @@ import { getSignature } from "./index";
import { ElMessage } from "element-plus";
import request from '@/utils/request'
let appId = "01ec9aa3";
let secret = "M2QxMDAxMjYyYTEzODMwMGRkZTQ4NmUy";
let appId = "a3c84da2";
let secret = "OTZkZDdhNDQ4MDk0NTZiYjcyY2RjZmYz";
let timestamp = Math.floor(Date.now() / 1000);
let signature = getSignature(appId, secret, timestamp);
let req = (url, type, data)=>{

View File

@ -131,7 +131,7 @@ export const createWindow = async (type, data) => {
data.isConsole = true // 是否开启控制台
data.isWeb = false // 是否开启web安全
data.option = {...defOption, ...option}
wins_tool = await toolWindow(data)
wins_tool = await toolWindow(type, data)
wins_tool.type = type // 唯一标识
wins_tool.show()
wins_tool.setFullScreen(true) // 设置窗口为全屏
@ -161,7 +161,7 @@ export const createWindow = async (type, data) => {
}
data.isConsole = true // 是否开启控制台
data.option = {...defOption, ...option}
const win = await toolWindow(data)
const win = await toolWindow(type, data)
win.type = type // 唯一标识
win.show()
win.setFullScreen(true) // 设置窗口为全屏
@ -193,7 +193,7 @@ export const createWindow = async (type, data) => {
}
data.isConsole = true // 是否开启控制台
data.option = {...defOption, ...option}
winChild = await toolWindow(data)
winChild = await toolWindow(type, data)
winChild.type = type // 唯一标识
winChild.show()
winChild.setFullScreen(false) // 设置窗口为全屏
@ -213,7 +213,7 @@ export const createWindow = async (type, data) => {
* @author: zdg
* @date 2021-07-05 14:07:01
*/
export function toolWindow({url, isConsole, isWeb=true, option={}}) {
export function toolWindow(type, {url, isConsole, isWeb=true, option={}}) {
// width = window.screen.width
let width = option?.width || 800
let height = option?.height || 600
@ -221,7 +221,7 @@ export function toolWindow({url, isConsole, isWeb=true, option={}}) {
const devUrl = `${BaseUrl}${url}`
const buildUrl = path.join(__dirname, 'index.html')
const urlAll = isDev ? devUrl : buildUrl
return new Promise((resolve) => {
return new Promise(async(resolve) => {
const config = {
width, height,
icon: path.join(appPath, '/resources/logo2.ico'),
@ -236,6 +236,9 @@ export function toolWindow({url, isConsole, isWeb=true, option={}}) {
}
// 创建-新窗口
let win = new Remote.BrowserWindow(config)
// 新窗口-创建事件(如:主进程加载远程服务)
await ipcMsgInvoke('new-window', {id:win.id, type})
console.log(`渲染进程 [${type}]: 窗口创建-成功${Date.now()}`)
if (!isDev) win.loadFile(urlAll,{hash: url}) // 加载文件
else win.loadURL(urlAll) // 加载url
win.once('ready-to-show', () => { // 窗口加载完成
@ -281,7 +284,7 @@ const eventHandles = (type, win) => {
})
// 新窗口-创建事件(如:主进程加载远程服务)
ipcRenderer.send('new-window', {id:win.id, type})
// ipcRenderer.send('new-window', {id:win.id, type})
}
switch(type) {
case 'tool-sphere': { // 创建-悬浮球

View File

@ -620,7 +620,7 @@ const changeCursor = (cursorStyle) => {
};
onMounted(() => {
// 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"
// let url = "https://bjcdn.openstorage.cn/xinghuo-privatedata/%2Ftmp/apiTempFileba724e0344f74e1480535eedf3ebec661601807661085006275/%E9%87%91%E9%A9%AC%E5%A5%96%E5%B0%B4%E5%B0%AC%E4%BA%8B%E4%BB%B6%E5%88%86%E6%9E%90%E4%B8%8E%E5%BA%94%E5%AF%B9%E7%AD%96%E7%95%A5.pptx"
// creatAIPPT(props.currentNode.itemtitle + '.pptx',url, props.uploadData).then((res) => {
// emit('addSuccess',res)
// })

View File

@ -226,7 +226,7 @@ const getClasscourseList = async type => {
const {classid} = classForm.form
const {entpcourseid} = myClassActive.value
if (!classid || !entpcourseid) return
const params = {classid, entpcourseid, entpcoursefileid: 0}
const params = {classid, entpcourseid, entpcoursefileid: 0, pageSize: 1000}
const res = await Http_Classcourse.listClasscourse(params)
if (res.code == 200) {
// zdg: id()
@ -255,9 +255,9 @@ const createClasscourse = async () => {
entpcourseid, evalid, coursetitle,
plandate: curDate, opendate: curDate
}
await Http_Classcourse.addClasscourseReturnId(params)
teacherForm.form.classcourseid = await Http_Classcourse.addClasscourseReturnId(params)
dt.loading = false
getClasscourseList('update') //
// getClasscourseList('update') //
ElMessage.success('创建课程-成功')
}