chao há 1 ano atrás
pai
commit
fbeef1c48b

+ 1 - 1
dist/assets/Details-iA6af48Y.js → dist/assets/Details-6y2hbEdF.js

@@ -1 +1 @@
-import{u as m,r as i,o as p,a as l,b as a,c as b,d as t,w as s,F as f,H as h,e as n,t as k,f as v,g,h as r,i as y,C,j as x,P as B,k as N}from"./index-4X4bePF6.js";const V={class:"iframDiv"},P={__name:"Details",setup(D){const{query:u,params:o}=m();console.log(u,o);const e=i("");return p(()=>{e.value=o.title}),(w,F)=>{const c=l("el-breadcrumb-item"),_=l("el-breadcrumb"),d=l("el-page-header");return a(),b(f,null,[t(h),t(d,null,{breadcrumb:s(()=>[t(_,{separator:"/"},{default:s(()=>[t(c,{to:{path:"/"}},{default:s(()=>[n(" 首页 ")]),_:1}),t(c,null,{default:s(()=>[n(k(v(o).title),1)]),_:1})]),_:1})]),default:s(()=>[g("div",V,[e.value=="课程列表"?(a(),r(C,{key:0})):e.value=="资源中心"?(a(),r(x,{key:1})):e.value=="实践中心"?(a(),r(B,{key:2})):e.value=="其他课程资源"?(a(),r(N,{key:3})):y("",!0)])]),_:1})],64)}}};export{P as default};
+import{u as m,r as i,o as p,a as l,b as a,c as b,d as t,w as s,F as f,H as h,e as n,t as k,f as v,g,h as r,i as y,C,j as x,P as B,k as N}from"./index-HBH9s_e2.js";const V={class:"iframDiv"},P={__name:"Details",setup(D){const{query:u,params:o}=m();console.log(u,o);const e=i("");return p(()=>{e.value=o.title}),(w,F)=>{const c=l("el-breadcrumb-item"),_=l("el-breadcrumb"),d=l("el-page-header");return a(),b(f,null,[t(h),t(d,null,{breadcrumb:s(()=>[t(_,{separator:"/"},{default:s(()=>[t(c,{to:{path:"/"}},{default:s(()=>[n(" 首页 ")]),_:1}),t(c,null,{default:s(()=>[n(k(v(o).title),1)]),_:1})]),_:1})]),default:s(()=>[g("div",V,[e.value=="课程列表"?(a(),r(C,{key:0})):e.value=="资源中心"?(a(),r(x,{key:1})):e.value=="实践中心"?(a(),r(B,{key:2})):e.value=="其他课程资源"?(a(),r(N,{key:3})):y("",!0)])]),_:1})],64)}}};export{P as default};

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
dist/assets/admin-VWcVjr02.js


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
dist/assets/index-HBH9s_e2.js


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
dist/assets/index-HpsxC3ab.css


+ 2 - 2
dist/index.html

@@ -8,8 +8,8 @@
     <script>
       document.domain = "cocorobo.cn"
     </script>
-    <script type="module" crossorigin src="./assets/index-4X4bePF6.js"></script>
-    <link rel="stylesheet" crossorigin href="./assets/index-KajjdPGY.css">
+    <script type="module" crossorigin src="./assets/index-HBH9s_e2.js"></script>
+    <link rel="stylesheet" crossorigin href="./assets/index-HpsxC3ab.css">
   </head>
   <body>
     <div id="app"></div>

+ 47 - 22
src/components/main/courseSelect.vue

@@ -11,24 +11,6 @@
   </div>
   <div class="course_select">
     <span class="grandTitle">{{ value }}</span>
-    <div v-if="currentData && currentData.shang.length > 0">
-      <el-row :gutter="20">
-        <el-col :span="6" v-for="item in currentData.shang" :key="item.title">
-          <div class="grid-content ep-bg-purple">
-            <img :src="getImageUrl(item.url)" alt="">
-            <div class="course_content">
-              <p>{{ item.title }}<span>上册</span></p>
-              <div class="class_button" v-if="isupdateCourse">
-                <el-button
-                  style="width: 30%;background: rgba(240, 242, 245, 1);color: rgba(0, 0, 0, 0.6);">还原</el-button>
-                <el-button style="width: 30%;background: #fff" @click="updateCourse(item.id)">修改</el-button>
-                <el-button class="el_button_active" @click="openCourseDetail(item.id)">查看</el-button>
-              </div>
-            </div>
-          </div>
-        </el-col>
-      </el-row>
-    </div>
     <div v-if="currentData && currentData.xia.length > 0">
       <el-row :gutter="20">
         <el-col :span="6" v-for="item in currentData.xia" :key="item.title">
@@ -38,7 +20,8 @@
               <div class="div_title">
                 <span>下册</span>
                 {{ item.title }}
-                <el-popover placement="bottom" :width="200" trigger="click" show-after="1000">
+                <el-popover v-if="isupdateCourse" placement="bottom" :width="200" trigger="click" show-after="1000"
+                  @hide="checked1 = false">
                   <template #reference>
                     <img :src="DownloadImg" alt="" @click="getDate(item.id)">
                   </template>
@@ -51,7 +34,9 @@
                       <div v-for="dataitem in item.dataList" :key="dataitem.id">
                         <img :src="dataitem.url" alt="">
                         <span>{{ dataitem.name }}</span>
-                        <img :src="DownloadImg" alt="">
+                        <img :src="DownloadImg" alt="" @click="download(dataitem.url)">
+                        <el-checkbox v-if="checked1" v-model="dataitem.check" label="全选" size="large" />
+                        <el-button v-if="checked1" @click="DownloadProcessing()">批量下载</el-button>
                       </div>
                     </div>
                     <div v-else>
@@ -410,7 +395,7 @@ const getDate = async (id) => {
   let dataList = []
   let m = currentData.value
 
-  console.log(m,'11111111111111111')
+  console.log(m, '11111111111111111')
   await top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/selectCourseDetailSz", [id], function (res) {
     console.log(res)
     if (res.value[0].length > 0 && res.value[0][0].chapters.length > 0) {
@@ -421,7 +406,9 @@ const getDate = async (id) => {
           for (let k = 0; k < dataChapterInfo.taskJson.length; k++) {
             let DatahapterData = dataChapterInfo.taskJson[k]
             for (let l = 0; l < DatahapterData.length; l++) {
-              dataList.push(DatahapterData[l])
+              let obj = DatahapterData[l]
+              obj.check = false
+              dataList.push(obj)
             }
           }
         }
@@ -444,6 +431,44 @@ const checkedAll = (id) => {
   // checked1.value = true
 }
 
+const download = url => {
+  let proArr = []
+  if(Array.isArray(url)){
+    proArr = [url]
+  }else{
+    proArr = url
+  }
+  Promise.all(proArr).then((resArr) => {
+    if (resArr?.length > 0) {
+      resArr?.forEach((item) => {
+        setBtnLoad(false)
+        // 可以使用循环生成iframe方法实现批量下载
+        const iframe = document.createElement("iframe");
+        iframe.style.display = "none"; // 不可见
+        iframe.style.height = "0"; // 高度为0
+        iframe.src = item?.data?.url; // 下载地址
+        document.body.appendChild(iframe); // 必须有,iframe挂在到dom树触发请求
+
+        //window.open下载文件下载多个文件时,window.open会中断循环。
+        // window.open(item?.data?.url, '_self');
+
+      })
+    }
+  })
+}
+
+const DownloadProcessing = async () => {
+  let data = currentData
+  let urls = []
+  await data.xia.map(x => {
+    if (x.check) {
+      urls.push(x.url)
+    }
+    return x
+  })
+  console.log("urls", urls)
+}
+
 // 获取课程下载资料
 // top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/selectCourseDetailSz", ['课程id'], function (res) {}, [], { "type": "POST", "withCredentials": true });
 

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff