From b4a7b8f07e95064b8f7de1312e17f5ad8f4fca47 Mon Sep 17 00:00:00 2001 From: yangjun <1173114630@qq.com> Date: Sat, 3 Aug 2024 08:57:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/file/download.ts | 30 + .../checkKecheng/dqxqkcMenu.vue | 4 +- .../checkKecheng/history/kcHistoryMenu.vue | 2 +- src/views/zy/zyInfo/StudentZyInfoList.vue | 2 +- src/views/zy/zyInfo/ZyInfoV2List.vue | 658 +++++++++++------- .../zy/zyInfo/components/ZyInfoDetailForm.vue | 2 +- .../zy/zyInfoStudent/ZyInfoStudent.data.ts | 1 + .../components/ZyInfoStudentScoreForm.vue | 18 +- .../components/ZyInfoStudentHpOneForm.vue | 1 - 9 files changed, 443 insertions(+), 275 deletions(-) diff --git a/src/utils/file/download.ts b/src/utils/file/download.ts index 168e235..a52c77a 100644 --- a/src/utils/file/download.ts +++ b/src/utils/file/download.ts @@ -89,3 +89,33 @@ export function downloadByUrl({ url, target = '_blank', fileName }: { url: strin openWindow(url, { target }); return true; } + + +export function openByUrl({ url, target = '_blank', fileName }: { url: string; target?: TargetContext; fileName?: string }): boolean { + const isChrome = window.navigator.userAgent.toLowerCase().indexOf('chrome') > -1; + const isSafari = window.navigator.userAgent.toLowerCase().indexOf('safari') > -1; + + if (/(iP)/g.test(window.navigator.userAgent)) { + console.error('Your browser does not support download!'); + return false; + } + if (isChrome || isSafari) { + const link = document.createElement('a'); + link.href = url; + link.target = target; + + if (link.download !== undefined) { + link.download = fileName || url.substring(url.lastIndexOf('/') + 1, url.length); + } + + if (document.createEvent) { + const e = document.createEvent('MouseEvents'); + e.initEvent('click', true, true); + link.dispatchEvent(e); + return true; + } + } + + openWindow(url, { target }); + return true; +} \ No newline at end of file diff --git a/src/views/site/renKeJiaoCheng/checkKecheng/dqxqkcMenu.vue b/src/views/site/renKeJiaoCheng/checkKecheng/dqxqkcMenu.vue index bf9241b..e13c67f 100644 --- a/src/views/site/renKeJiaoCheng/checkKecheng/dqxqkcMenu.vue +++ b/src/views/site/renKeJiaoCheng/checkKecheng/dqxqkcMenu.vue @@ -14,7 +14,7 @@ 课程简介 - 教学单元内容 + 教学单元 课程作业 @@ -75,7 +75,7 @@ 课程简介 - 教学单元内容 + 教学单元 课程作业 diff --git a/src/views/site/renKeJiaoCheng/checkKecheng/history/kcHistoryMenu.vue b/src/views/site/renKeJiaoCheng/checkKecheng/history/kcHistoryMenu.vue index 33f7bc6..a4f2182 100644 --- a/src/views/site/renKeJiaoCheng/checkKecheng/history/kcHistoryMenu.vue +++ b/src/views/site/renKeJiaoCheng/checkKecheng/history/kcHistoryMenu.vue @@ -11,7 +11,7 @@ 课程简介 通知公告 - 教学单元内容 + 教学单元 diff --git a/src/views/zy/zyInfo/StudentZyInfoList.vue b/src/views/zy/zyInfo/StudentZyInfoList.vue index df875a1..52f1259 100644 --- a/src/views/zy/zyInfo/StudentZyInfoList.vue +++ b/src/views/zy/zyInfo/StudentZyInfoList.vue @@ -31,7 +31,7 @@
{{ item.title }}
作业时间:{{ dayjs(item.startTime).format('YYYY.MM.DD HH:mm') }} ~ {{ dayjs(item.endTime).format('YYYY.MM.DD HH:mm') }} - 互评时间:{{ dayjs(item.endTime).format('YYYY.MM.DD HH:mm') }} ~ {{ dayjs(item.endTime).format('YYYY.MM.DD HH:mm') }}未设置互评 + 互评时间:{{ dayjs(item.xshpkssj).format('YYYY.MM.DD HH:mm') }} ~ {{ dayjs(item.xshpjssj).format('YYYY.MM.DD HH:mm') }}未设置互评 作业得分:{{ item.stuscore ? item.stuscore : '未评' }}分 互评分数:{{ item.xshpfs ? item.xshpfs : '未评' }}分 diff --git a/src/views/zy/zyInfo/ZyInfoV2List.vue b/src/views/zy/zyInfo/ZyInfoV2List.vue index 35739ca..76c630e 100644 --- a/src/views/zy/zyInfo/ZyInfoV2List.vue +++ b/src/views/zy/zyInfo/ZyInfoV2List.vue @@ -5,13 +5,13 @@ d