From df84893509dff5181894ab20e08d4d2206dbe965 Mon Sep 17 00:00:00 2001 From: lyc Date: Fri, 2 Aug 2024 10:01:05 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=B8=83=E7=BD=AE=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/api/teaching/classwork.js | 9 ++ .../src/components/move-file/index.vue | 6 + .../views/prepare/container/set-homework.vue | 110 ++++++++++++++---- src/renderer/src/views/prepare/index.vue | 9 +- 4 files changed, 106 insertions(+), 28 deletions(-) diff --git a/src/renderer/src/api/teaching/classwork.js b/src/renderer/src/api/teaching/classwork.js index caeea2d..db353f3 100644 --- a/src/renderer/src/api/teaching/classwork.js +++ b/src/renderer/src/api/teaching/classwork.js @@ -16,4 +16,13 @@ export function listEntpcourse(query) { method: 'get', params: query }) +} + +// 布置作业 +export function saveByClassWorkArray(data) { + return request({ + url: '/education/classwork/saveByClassWorkArray', + method: 'post', + data: data + }) } \ No newline at end of file diff --git a/src/renderer/src/components/move-file/index.vue b/src/renderer/src/components/move-file/index.vue index c53f726..ebf1524 100644 --- a/src/renderer/src/components/move-file/index.vue +++ b/src/renderer/src/components/move-file/index.vue @@ -158,6 +158,12 @@ const getSubject = async () => { curBookId.value = subjectList.value[0].id } +const isHaveUnit = (id) => { + return evaluationList.value.some(item => { + return item.rootid == id + }) +} + const getTreeData = () => { //数据过滤 let upData = transData(volumeOne.value) diff --git a/src/renderer/src/views/prepare/container/set-homework.vue b/src/renderer/src/views/prepare/container/set-homework.vue index e23f526..94bd531 100644 --- a/src/renderer/src/views/prepare/container/set-homework.vue +++ b/src/renderer/src/views/prepare/container/set-homework.vue @@ -11,26 +11,28 @@
- + + + - - {{ tag.name }} - - + + {{ tag.name }} + + - + 必做 选做 - - + + @@ -41,7 +43,7 @@ @@ -181,6 +213,10 @@ const handleRow = () =>{ } .resource-list { + flex: 1; + display: flex; + flex-direction: column; + overflow: auto; .list-item { flex: 1; padding: 10px 20px; @@ -189,10 +225,13 @@ const handleRow = () =>{ justify-content: space-between; align-items: center; cursor: pointer; - + &:hover { + background-color: rgba(144, 147, 153, 0.2); + cursor: pointer; + } .item-left { align-items: center; - + flex: 1; .icon { font-size: 50px; } @@ -200,12 +239,14 @@ const handleRow = () =>{ .item-left-content { margin-left: 10px; flex-direction: column; + flex: 1; + text-align: left; } .name { font-size: 14px; color: #3b3b3b; - margin-bottom: 10px + margin-bottom: 10px; } .line { @@ -226,7 +267,6 @@ const handleRow = () =>{ color: #909399; font-size: 13px; } - } &:last-child { @@ -258,15 +298,13 @@ const handleRow = () =>{ margin-right: 3px; font-weight: bold; } - } - } .pagination-box { - margin-top: 20px; display: flex; justify-content: center; + height: 65px; } } - \ No newline at end of file + diff --git a/src/renderer/src/views/resource/index.vue b/src/renderer/src/views/resource/index.vue index d4565dd..4f66881 100644 --- a/src/renderer/src/views/resource/index.vue +++ b/src/renderer/src/views/resource/index.vue @@ -1,21 +1,28 @@ @@ -40,7 +47,7 @@ onMounted(async () => { // const res = await ipcMsgSend('tool-sphere:create', params) // console.log('消息返回:', res) }) -const testClick = async() => { +const testClick = async () => { const win = await createWindow('tool-sphere', { url: '/tool/sphere' }) console.log('消息返回:', win) } @@ -48,12 +55,11 @@ const testClick = async() => { const getData = (data) => { const { textBook, node } = data let textbookId = textBook.curBookId - let levelSecondId = node.id + let levelSecondId = node.id let levelFirstId - if(node.parentNode){ - levelFirstId = node.parentNode.id - } - else{ + if (node.parentNode) { + levelFirstId = node.parentNode.id + } else { levelFirstId = node.id levelSecondId = '' } @@ -63,7 +69,7 @@ const getData = (data) => { sourceStore.nodeData = { textbookId, levelFirstId, - levelSecondId, + levelSecondId } sourceStore.handleQuery() } @@ -73,7 +79,7 @@ const submitFile = (data) => { let fileList = toRaw(data) const { textbookId, levelFirstId, levelSecondId, fileSource, fileRoot } = sourceStore.query // 给每个文件添加属性 - fileList.forEach(item => { + fileList.forEach((item) => { let fileData = { textbookId, levelFirstId, levelSecondId, fileSource, fileRoot } fileData.fileShowName = item.fileData.fileShowName fileData.fileFlag = item.fileData.fileFlag @@ -83,17 +89,15 @@ const submitFile = (data) => { uploaderState().pushFile(fileList) } - const fileCallBack = (res) => { if (res.code == 200) { sourceStore.handleQuery() } } -onMounted(()=>{ +onMounted(() => { sourceStore.getCreate() }) - \ No newline at end of file