diff --git a/src/renderer/src/api/subject/index.js b/src/renderer/src/api/subject/index.js index 127416a..3e7c614 100644 --- a/src/renderer/src/api/subject/index.js +++ b/src/renderer/src/api/subject/index.js @@ -9,7 +9,6 @@ export const listEvaluation = (params)=> { }) } - export const addFileToPrepare = (params) => { return request({ url: '/smarttalk/file/addFileToPrepare', @@ -17,3 +16,4 @@ export const addFileToPrepare = (params) => { params }) } + diff --git a/src/renderer/src/api/teaching/classwork.js b/src/renderer/src/api/teaching/classwork.js new file mode 100644 index 0000000..caeea2d --- /dev/null +++ b/src/renderer/src/api/teaching/classwork.js @@ -0,0 +1,19 @@ +import request from '@/utils/request' + +// 查询classwork列表 +export function homeworklist(params) { + return request({ + url: '/education/classwork/list', + method: 'get', + params + }) +} + +// 查询entpcourse列表 +export function listEntpcourse(query) { + return request({ + url: '/education/entpcourse/list', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/src/renderer/src/assets/iconfont/iconfont.css b/src/renderer/src/assets/iconfont/iconfont.css index d4e9d4e..0b91d55 100644 --- a/src/renderer/src/assets/iconfont/iconfont.css +++ b/src/renderer/src/assets/iconfont/iconfont.css @@ -1,9 +1,9 @@ @font-face { font-family: "iconfont"; /* Project id 2794390 */ - src: url('iconfont.woff2?t=1721815727687') format('woff2'), - url('iconfont.woff?t=1721815727687') format('woff'), - url('iconfont.ttf?t=1721815727687') format('truetype'), - url('iconfont.svg?t=1721815727687#iconfont') format('svg'); + src: url('iconfont.woff2?t=1722323882803') format('woff2'), + url('iconfont.woff?t=1722323882803') format('woff'), + url('iconfont.ttf?t=1722323882803') format('truetype'), + url('iconfont.svg?t=1722323882803#iconfont') format('svg'); } .iconfont { @@ -14,6 +14,10 @@ -moz-osx-font-smoothing: grayscale; } +.icon-zuoye1:before { + content: "\e610"; +} + .icon-xiazai9:before { content: "\e60b"; } diff --git a/src/renderer/src/assets/iconfont/iconfont.js b/src/renderer/src/assets/iconfont/iconfont.js index 79b363e..497b716 100644 --- a/src/renderer/src/assets/iconfont/iconfont.js +++ b/src/renderer/src/assets/iconfont/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_2794390='',function(v){var h=(h=document.getElementsByTagName("script"))[h.length-1],l=h.getAttribute("data-injectcss"),h=h.getAttribute("data-disable-injectsvg");if(!h){var c,a,t,i,z,p=function(h,l){l.parentNode.insertBefore(h,l)};if(l&&!v.__iconfont__svg__cssinject__){v.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(h){console&&console.log(h)}}c=function(){var h,l=document.createElement("div");l.innerHTML=v._iconfont_svg_string_2794390,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(h=document.body).firstChild?p(l,h.firstChild):h.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(c,0):(a=function(){document.removeEventListener("DOMContentLoaded",a,!1),c()},document.addEventListener("DOMContentLoaded",a,!1)):document.attachEvent&&(t=c,i=v.document,z=!1,d(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,M())})}function M(){z||(z=!0,t())}function d(){try{i.documentElement.doScroll("left")}catch(h){return void setTimeout(d,50)}M()}}(window); \ No newline at end of file +window._iconfont_svg_string_2794390='',function(v){var h=(h=document.getElementsByTagName("script"))[h.length-1],l=h.getAttribute("data-injectcss"),h=h.getAttribute("data-disable-injectsvg");if(!h){var c,a,t,i,z,p=function(h,l){l.parentNode.insertBefore(h,l)};if(l&&!v.__iconfont__svg__cssinject__){v.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(h){console&&console.log(h)}}c=function(){var h,l=document.createElement("div");l.innerHTML=v._iconfont_svg_string_2794390,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(h=document.body).firstChild?p(l,h.firstChild):h.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(c,0):(a=function(){document.removeEventListener("DOMContentLoaded",a,!1),c()},document.addEventListener("DOMContentLoaded",a,!1)):document.attachEvent&&(t=c,i=v.document,z=!1,d(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,M())})}function M(){z||(z=!0,t())}function d(){try{i.documentElement.doScroll("left")}catch(h){return void setTimeout(d,50)}M()}}(window); \ No newline at end of file diff --git a/src/renderer/src/assets/iconfont/iconfont.json b/src/renderer/src/assets/iconfont/iconfont.json index 5549155..6427af2 100644 --- a/src/renderer/src/assets/iconfont/iconfont.json +++ b/src/renderer/src/assets/iconfont/iconfont.json @@ -5,6 +5,13 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "8023423", + "name": "作业", + "font_class": "zuoye1", + "unicode": "e610", + "unicode_decimal": 58896 + }, { "icon_id": "720967", "name": "更多", diff --git a/src/renderer/src/assets/iconfont/iconfont.svg b/src/renderer/src/assets/iconfont/iconfont.svg index bdabebc..d74c21e 100644 --- a/src/renderer/src/assets/iconfont/iconfont.svg +++ b/src/renderer/src/assets/iconfont/iconfont.svg @@ -14,6 +14,8 @@ /> + + diff --git a/src/renderer/src/assets/iconfont/iconfont.ttf b/src/renderer/src/assets/iconfont/iconfont.ttf index 409d7e1..3448f74 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.ttf and b/src/renderer/src/assets/iconfont/iconfont.ttf differ diff --git a/src/renderer/src/assets/iconfont/iconfont.woff b/src/renderer/src/assets/iconfont/iconfont.woff index 607d8f9..e48a4a1 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.woff and b/src/renderer/src/assets/iconfont/iconfont.woff differ diff --git a/src/renderer/src/assets/iconfont/iconfont.woff2 b/src/renderer/src/assets/iconfont/iconfont.woff2 index 2acffdf..ebbec28 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.woff2 and b/src/renderer/src/assets/iconfont/iconfont.woff2 differ diff --git a/src/renderer/src/components/file-image/index.vue b/src/renderer/src/components/file-image/index.vue index 081612d..efe374e 100644 --- a/src/renderer/src/components/file-image/index.vue +++ b/src/renderer/src/components/file-image/index.vue @@ -1,5 +1,5 @@ @@ -36,10 +36,15 @@ const getFileTypeIcon = () => { rar: 'icon-rar', } - return '#' + iconObj[name] + if (iconObj[name]) { + return '#' + iconObj[name] + } + else { + return '#icon-zuoye1' + } + } - \ No newline at end of file + \ No newline at end of file diff --git a/src/renderer/src/views/prepare/container/file-list-item.vue b/src/renderer/src/views/prepare/container/file-list-item.vue index 794210e..538c32f 100644 --- a/src/renderer/src/views/prepare/container/file-list-item.vue +++ b/src/renderer/src/views/prepare/container/file-list-item.vue @@ -10,6 +10,10 @@
+ + @@ -236,6 +258,10 @@ export default { display: flex; justify-content: center; align-items: center; + .icon-zuoye{ + font-size: 40px; + color: #707070 + } } .prepare-body-main-item-tool { diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index ac5400b..23e0c33 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -68,15 +68,19 @@ import ChooseTextbook from '@/components/choose-textbook/index.vue' import uploadDialog from '@/components/upload-dialog/index.vue' import { Refresh } from '@element-plus/icons-vue' import uploaderState from '@/store/modules/uploader' +import useUserStore from '@/store/modules/user' import MoveFile from '@/components/move-file/index.vue' import FileListItem from '@/views/prepare/container/file-list-item.vue' import { getSmarttalkPage, moveSmarttalk } from '@/api/file' +import { homeworklist, listEntpcourse } from '@/api/teaching/classwork' import { toTimeText } from '@/utils/date' import { ElMessage } from 'element-plus' import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile' import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue' import outLink from '@/utils/linkConfig' import { createWindow } from '@/utils/tool' +import { uniqBy, cloneDeep } from 'lodash' + const { ipcRenderer } = window.electron || {} export default { @@ -104,6 +108,10 @@ export default { }, // 当前教材封面图 curBookImg: '', + // 用户信息 + userStore: '', + entpcourseid: '', + timerId: null } }, computed: { @@ -114,6 +122,7 @@ export default { } }, created() { + this.userStore = useUserStore().user ipcRenderer.removeAllListeners('copy-file-default-reply') ipcRenderer.on('copy-file-default-reply', (e, param) => { this.callback(param) @@ -245,7 +254,7 @@ export default { this.isLoading = false }) }, - nodeClick(data) { + async nodeClick(data) { if (this.currentNode.id === data.node.id) return this.curBookImg = data.textBook.curBookImg this.checkFileList = [] @@ -256,15 +265,100 @@ export default { this.uploadData.levelThirdId = cata[2] this.uploadData.textbookId = data.textBook.curBookId this.asyncAllFile() + if (this.uploadData.levelSecondId) { + // 获取作业列表所需ID + const res = await this.getChapterId() + this.entpcourseid = res.rows[0].id + // 查询作业 + this.getHomeWorkList() + } }, + // 打开外部链接 - handleOutLink(key){ + handleOutLink(key) { + if (key == 'homeWork') { + // 查询作业 + this.createTimer() + } // key 对应的 linkConfig.js 外部链接配置 let configObj = outLink[key] // 通知主进程 ipcRenderer.send('openWindow', { fullPath: configObj.fullPath, - cookieData: {...(configObj.data)} + cookieData: { ...(configObj.data) } + }) + }, + // 根据教材章节单元ID 查询作业列表所需ID + getChapterId() { + return listEntpcourse({ evalid: this.uploadData.levelSecondId, edituserid: this.userStore.userId, pageSize: 500 }) + }, + // + createTimer() { + this.timerId = setInterval(() => { + this.getHomeWorkList() + }, 1500) + }, + // 查询作业列表 + getHomeWorkList() { + homeworklist({ entpcourseid: this.entpcourseid, edituserid: this.userStore.userId, pageSize: 100 }).then(res => { + + //以下代码 参照AIx web端 作业布置 + let list = [] + for (var i = 0; i < res.rows.length; i++) { + + res.rows[i].taskconfig = []; + + // 找child + for (var j = 0; j < res.rows.length; j++) { + if (res.rows[j].parentid == res.rows[i].id) { + var ss = []; + if (res.rows[j].classworkdatastudentids != null) { + ss = JSON.parse('[' + res.rows[j].classworkdatastudentids + ']'); + } + var js = { + id: res.rows[j].id, + classid: res.rows[j].classid, + classcaption: res.rows[j].classcaption, + parentid: 0, + worktype: '', + workkey: res.rows[j].workkey, + worktag: '', + entpcourseid: 0, + evalid: 0, + edusubject: '', + edudegree: '', + workdate: '', + title: '', + workcodes: '', + studentlist: ss, + deaddate: res.rows[j].deaddate, + timelength: res.rows[j].timelength, + weights: res.rows[j].weights, + feedtype: res.rows[j].feedtype + } + res.rows[i].taskconfig.push(js); + } + } + res.rows[i].fileShowName = res.rows[i].uniquekey + + // 注意slideid>0的,这一些作业是添加到PPT页面的,所以在作业管理中不能出现 + // 2024-05-15,酉阳,jackyshen + if (res.rows[i].classid == 0 && res.rows[i].slideid == 0) { + list.push(res.rows[i]); + } + + + // 如果是习题训练任务,则检查一共有多少道 + if (res.rows[i].entpcourseworklist != '') { + res.rows[i].entpcourseworklistarray = JSON.parse('[' + res.rows[i].entpcourseworklist + ']'); + } else { + res.rows[i].entpcourseworklistarray = []; + } + } + // 去重 + let ary = uniqBy([...this.currentFileList, ...list], 'id') + // 深度克隆 + this.currentFileList = cloneDeep(ary) }) }, // 打开PDF-课件 @@ -275,6 +369,13 @@ export default { openLesson() { createWindow('tool-sphere', { url: '/tool/sphere' }) } + }, + watch: { + $route(to) { + if (to.path != '/prepare' && this.timerId) { + clearInterval(this.timerId) + } + } } } @@ -330,7 +431,8 @@ export default { justify-content: center; position: relative; background: linear-gradient(#b0d1ef, #3e7bcb); - .top-zoom-style{ + + .top-zoom-style { position: absolute; width: 90%; height: 30px; @@ -338,7 +440,8 @@ export default { bottom: 0; clip-path: polygon(3% 0%, 97% 0%, 100% 100%, 0% 100%); } - .textbook-img{ + + .textbook-img { height: 120px; background-color: #ffffff; padding: 5px; @@ -347,36 +450,43 @@ export default { margin-right: 20px; z-index: 1; } - .top-item{ + + .top-item { width: 230px; position: relative; flex-wrap: wrap; z-index: 1; - .btn{ + + .btn { width: 102px; background: none; color: #ffffff; border-width: 2px; border-color: #ffffff; - &:hover{ + + &:hover { background: rgba(255, 255, 255, 0.3) } - &:first-child{ + + &:first-child { margin-left: 12px; margin-bottom: 15px; } - &:nth-child(2){ + + &:nth-child(2) { margin-bottom: 15px; } } } - .to-class-btn{ + + .to-class-btn { width: 130px; height: 80px; margin-left: 25px; font-size: 18px; z-index: 1; - .icon-lingdang{ + + .icon-lingdang { margin-right: 5px; color: #ffffff; font-size: 20px;