From 398de60dcd3c5e7f4e71f669a1969f1eb01a906d Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Thu, 21 Nov 2024 17:32:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=AD=E8=87=AA=E5=8A=A8=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=96=87=E4=BB=B6=EF=BC=8C=E8=B6=85=E8=BF=87150M?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8D=E5=85=81=E8=AE=B8=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/prepare/container/file-list-item.vue | 4 ++-- src/renderer/src/views/prepare/container/kj-list-item.vue | 4 ++-- src/renderer/src/views/resource/container/resoure-list.vue | 6 +++++- src/renderer/src/views/resource/container/third-list.vue | 4 ++++ 4 files changed, 13 insertions(+), 5 deletions(-) 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 8d9bc5f..c2e3e90 100644 --- a/src/renderer/src/views/prepare/container/file-list-item.vue +++ b/src/renderer/src/views/prepare/container/file-list-item.vue @@ -280,14 +280,14 @@ export default { cookie, fileType: item.fileType }) - ipcRenderer.on('listen-file-change-on' + item.fileNewName, () => { + /*ipcRenderer.on('listen-file-change-on' + item.fileNewName, () => { items.async = 'on' }) ipcRenderer.on('listen-file-change-success' + item.fileNewName, (e, { data, md5 }) => { items.fileSize = data.fileSize items.md5 = md5 items.async = true - }) + })*/ } }) }) diff --git a/src/renderer/src/views/prepare/container/kj-list-item.vue b/src/renderer/src/views/prepare/container/kj-list-item.vue index 7a9a56a..8936e22 100644 --- a/src/renderer/src/views/prepare/container/kj-list-item.vue +++ b/src/renderer/src/views/prepare/container/kj-list-item.vue @@ -357,14 +357,14 @@ export default { cookie, fileType: item.fileType }) - ipcRenderer.on('listen-file-change-on' + item.fileNewName, () => { + /*ipcRenderer.on('listen-file-change-on' + item.fileNewName, () => { items.async = 'on' }) ipcRenderer.on('listen-file-change-success' + item.fileNewName, (e, { data, md5 }) => { items.fileSize = data.fileSize items.md5 = md5 items.async = true - }) + })*/ } }) }) diff --git a/src/renderer/src/views/resource/container/resoure-list.vue b/src/renderer/src/views/resource/container/resoure-list.vue index 517d97f..9b2bf8f 100644 --- a/src/renderer/src/views/resource/container/resoure-list.vue +++ b/src/renderer/src/views/resource/container/resoure-list.vue @@ -161,7 +161,11 @@ const delRow = (item) => { } // 加入备课 -const addLesson = ({ id }) => { +const addLesson = ({ id, fileSize }) => { + if (fileSize>1024*1024*150) { + ElMessage.warning('文件超过150M,暂停超过150M资源的下载,请重新选择') + return + } let data = { id, fileRoot: '备课', diff --git a/src/renderer/src/views/resource/container/third-list.vue b/src/renderer/src/views/resource/container/third-list.vue index 204dc12..3fb5cca 100644 --- a/src/renderer/src/views/resource/container/third-list.vue +++ b/src/renderer/src/views/resource/container/third-list.vue @@ -125,6 +125,10 @@ const handleRow = (item) => { thirdPreview.value.init(item.itemId) } const openChapter = (item)=>{ + if (item.size>1024*1024*150) { + ElMessage.warning('文件超过150M,暂停超过150M资源的下载,请重新选择') + return + } currentItem.value = item // 打开弹窗 treelogRef.value.openDialog()