+
+
+
+ 布置
+
+
@@ -142,6 +148,7 @@ import { toTimeText } from '@/utils/date'
import { ElMessage, ElMessageBox } from 'element-plus'
import { deleteSmarttalk, updateSmarttalk, getPrepareById } from '@/api/file'
import useUserStore from '@/store/modules/user'
+import outLink from '@/utils/linkConfig'
const { ipcRenderer } = window.electron || {}
export default {
@@ -256,6 +263,18 @@ export default {
// 删除作业
deleteHomework(item){
this.$emit('on-delhomework', item)
+ },
+ // 文件资源打开web AIX 布置作业
+ openFileLink(item){
+ // key 对应的 linkConfig.js 外部链接配置
+ let key = 'filehomework'
+ let configObj = outLink()[key]
+ // 通知主进程
+ ipcRenderer.send('openWindow', {
+ key,
+ fullPath: configObj.fullPath + `&fileShowName=${item.fileShowName}&fileFullPath=${item.fileFullPath}`,
+ cookieData: { ...configObj.data }
+ })
}
},
mounted() {
diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue
index c086d14..489c993 100644
--- a/src/renderer/src/views/prepare/index.vue
+++ b/src/renderer/src/views/prepare/index.vue
@@ -192,10 +192,10 @@ export default {
// 用户信息
userStore: '',
entpcourseid: '',
- timerId: null,
// 布置作业弹窗
setDialog: false,
- row: ''
+ row: '',
+ isOpenHomework: false
}
},
computed: {
@@ -205,13 +205,7 @@ export default {
)
}
},
- watch: {
- $route(to) {
- if (to.path != '/prepare' && this.timerId) {
- clearInterval(this.timerId)
- }
- }
- },
+
created() {
this.userStore = useUserStore().user
ipcRenderer.removeAllListeners('copy-file-default-reply')
@@ -229,6 +223,16 @@ export default {
setTimeout(this.initReserv, 500)
}
)
+ // electron 当前窗口
+ const curWin = Remote.getCurrentWindow()
+ curWin.on('focus', ()=>{
+ if(!this.isOpenHomework) return
+ console.log(100)
+ this.initHomeWork()
+ this.isOpenHomework = false
+ })
+
+
},
// activated() {
// if (this.uploadData.textbookId !== null) {
@@ -423,9 +427,7 @@ export default {
await this.asyncAllFile()
},
async initHomeWork() {
- if (this.timerId) {
- clearInterval(this.timerId)
- }
+
if (this.uploadData.levelSecondId) {
// 获取作业列表所需ID 可能存在没有
let { rows } = await this.getChapterId()
@@ -468,9 +470,8 @@ export default {
},
// 打开外部链接
handleOutLink(key) {
- if (key == 'homeWork') {
- // 查询作业
- this.createTimer()
+ if(key == 'homeWork'){
+ this.isOpenHomework = true
}
// key 对应的 linkConfig.js 外部链接配置
let configObj = outLink()[key]
@@ -483,19 +484,13 @@ export default {
},
// 根据教材章节单元ID 查询作业列表所需ID
getChapterId() {
- console.log(this.userStore, 'this.userStore')
return listEntpcourse({
evalid: this.uploadData.levelSecondId,
edituserid: this.userStore.userId,
pageSize: 500
})
},
- // 查询作业列表定时器
- createTimer() {
- this.timerId = setInterval(() => {
- this.getHomeWorkList()
- }, 2500)
- },
+
// 查询作业列表
getHomeWorkList() {
homeworklist({