Compare commits
No commits in common. "62248dfafafaad30d68ead5d5e7d3e16efb60591" and "2926b4bd63829b4ddd1d89d4dd1f352f2e4c0d46" have entirely different histories.
62248dfafa
...
2926b4bd63
|
@ -41,7 +41,7 @@ function createMainWindow() {
|
||||||
width: 1200,
|
width: 1200,
|
||||||
height: 700,
|
height: 700,
|
||||||
show: false,
|
show: false,
|
||||||
frame: false,// 无边框
|
frame: false,
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
...(process.platform === 'linux' ? { icon } : {}),
|
...(process.platform === 'linux' ? { icon } : {}),
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
|
@ -68,15 +68,15 @@ function createMainWindow() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 作业窗口相关-开发中
|
// 作业窗口相关-开发中
|
||||||
let openWindow
|
let workWindow
|
||||||
function createOpenWin(data) {
|
function createWork(data) {
|
||||||
if (openWindow) return
|
if (workWindow) return
|
||||||
openWindow = new BrowserWindow({
|
workWindow = new BrowserWindow({
|
||||||
width: 650,
|
width: 650,
|
||||||
height: 500,
|
height: 500,
|
||||||
show: false,
|
show: false,
|
||||||
frame: true,
|
frame: true,
|
||||||
maximizable: true,
|
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
...(process.platform === 'linux' ? { icon } : {}),
|
...(process.platform === 'linux' ? { icon } : {}),
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
|
@ -84,20 +84,30 @@ function createOpenWin(data) {
|
||||||
nodeIntegration: true
|
nodeIntegration: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
let cookieDetails = {...data.cookieData}
|
|
||||||
openWindow.webContents.session.cookies.set(cookieDetails).then(()=>{
|
workWindow.webContents.session.cookies.set(
|
||||||
console.log('Cookie set successfully.')
|
{
|
||||||
}).catch(err =>{
|
url: 'https://file.ysaix.com:7868',
|
||||||
|
name: 'Admin-Token',
|
||||||
|
value: data
|
||||||
|
},
|
||||||
|
function (error) {
|
||||||
|
if (error) {
|
||||||
console.error('Set cookie failed:', error)
|
console.error('Set cookie failed:', error)
|
||||||
})
|
} else {
|
||||||
|
console.log('Cookie set successfully.')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
workWindow.loadURL(
|
||||||
|
'https://file.ysaix.com:7868/teaching/classtaskassign?titleName=%E4%BD%9C%E4%B8%9A%E5%B8%83%E7%BD%AE'
|
||||||
|
)
|
||||||
|
|
||||||
openWindow.loadURL(data.fullPath)
|
workWindow.once('ready-to-show', () => {
|
||||||
|
workWindow.show()
|
||||||
openWindow.once('ready-to-show', () => {
|
|
||||||
openWindow.show()
|
|
||||||
})
|
})
|
||||||
openWindow.on('closed', () => {
|
workWindow.on('closed', () => {
|
||||||
openWindow = null
|
workWindow = null
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +165,7 @@ app.on('ready', () => {
|
||||||
|
|
||||||
//打开作业窗口
|
//打开作业窗口
|
||||||
ipcMain.on('openWork', (e, data) => {
|
ipcMain.on('openWork', (e, data) => {
|
||||||
createOpenWin(data)
|
createWork(data)
|
||||||
})
|
})
|
||||||
|
|
||||||
createLoginWindow()
|
createLoginWindow()
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
|
|
||||||
// 作业
|
|
||||||
export const homeWorkConfig = {
|
|
||||||
// host 设置token 等
|
|
||||||
host: 'https://file.ysaix.com:7868',
|
|
||||||
name: 'Admin-Token',
|
|
||||||
// 完整路径
|
|
||||||
fullPath: 'https://file.ysaix.com:7868/teaching/classtaskassign?titleName=%E4%BD%9C%E4%B8%9A%E5%B8%83%E7%BD%AE'
|
|
||||||
}
|
|
|
@ -37,7 +37,7 @@
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<el-button @click="handleHomeWork">布置作业</el-button>
|
<el-button>布置作业</el-button>
|
||||||
<el-button @click="isDialogOpen = true">上传资料</el-button>
|
<el-button @click="isDialogOpen = true">上传资料</el-button>
|
||||||
<el-button type="primary" style="margin-left: 10px" @click="createFile">新建课件</el-button>
|
<el-button type="primary" style="margin-left: 10px" @click="createFile">新建课件</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -73,10 +73,7 @@ import { toTimeText } from '@/utils/date'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile'
|
import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile'
|
||||||
import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue'
|
import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue'
|
||||||
import useUserStore from '@/store/modules/user'
|
|
||||||
import { homeWorkConfig } from '@/utils/config'
|
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Prepare',
|
name: 'Prepare',
|
||||||
components: { ChooseTextbook, Refresh, uploadDialog, FileListItem, FileOperBatch, MoveFile },
|
components: { ChooseTextbook, Refresh, uploadDialog, FileListItem, FileOperBatch, MoveFile },
|
||||||
|
@ -101,8 +98,7 @@ export default {
|
||||||
fileRoot: '备课'
|
fileRoot: '备课'
|
||||||
},
|
},
|
||||||
// 当前教材封面图
|
// 当前教材封面图
|
||||||
curBookImg: '',
|
curBookImg: ''
|
||||||
userStore: ''
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -118,7 +114,6 @@ export default {
|
||||||
this.callback(param)
|
this.callback(param)
|
||||||
})
|
})
|
||||||
this.lastAsyncAllTime = localStorage.getItem('lastAsyncAllTime')
|
this.lastAsyncAllTime = localStorage.getItem('lastAsyncAllTime')
|
||||||
this.userStore = useUserStore()
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
|
@ -250,18 +245,7 @@ export default {
|
||||||
this.uploadData.levelThirdId = cata[2]
|
this.uploadData.levelThirdId = cata[2]
|
||||||
this.uploadData.textbookId = data.textBook.curBookId
|
this.uploadData.textbookId = data.textBook.curBookId
|
||||||
this.asyncAllFile()
|
this.asyncAllFile()
|
||||||
},
|
|
||||||
// 布置组后也
|
|
||||||
handleHomeWork(){
|
|
||||||
ipcRenderer.send('openWork',{
|
|
||||||
fullPath: homeWorkConfig.fullPath,
|
|
||||||
cookieData: {
|
|
||||||
url: homeWorkConfig.host,
|
|
||||||
name: homeWorkConfig.name,
|
|
||||||
value: this.userStore.token
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue