chao 2 months ago
parent
commit
f213f14400

+ 1 - 1
dist/assets/Details-C051sbtc.js → dist/assets/Details-fdnfLjPy.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-QoZShK4q.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-s02F6gaJ.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};

File diff suppressed because it is too large
+ 0 - 0
dist/assets/admin-7j6HRxr3.js


File diff suppressed because it is too large
+ 0 - 0
dist/assets/index-RlFoAsrD.css


File diff suppressed because it is too large
+ 0 - 0
dist/assets/index-s02F6gaJ.js


+ 2 - 2
dist/index.html

@@ -8,8 +8,8 @@
     <script>
       document.domain = "cocorobo.cn"
     </script>
-    <script type="module" crossorigin src="./assets/index-QoZShK4q.js"></script>
-    <link rel="stylesheet" crossorigin href="./assets/index-JnCyhDlZ.css">
+    <script type="module" crossorigin src="./assets/index-s02F6gaJ.js"></script>
+    <link rel="stylesheet" crossorigin href="./assets/index-RlFoAsrD.css">
   </head>
   <body>
     <div id="app"></div>

BIN
src/assets/img/《初识人工智能》教师指导手册.docx


+ 0 - 1
src/components/main/courseSelect.vue

@@ -778,7 +778,6 @@ const getUpdateCourse = async (dataList, id) => {
       return x
     })
   }
-  console.log(m, '1111111111')
   currentData.value = m
   getUpdateCourseId.value = id
 }

+ 89 - 41
src/components/main/downloadCourse.vue

@@ -710,52 +710,88 @@ const updateReduction = () => {
 
 const getDate = async (id) => {
   // currentData
-  let dataList = []
-  getUpdateCourseId.value = id
-  let m = currentData.value
-  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) {
-      let datachapters = JSON.parse(res.value[0][0].chapters)
+  let dataList = [];
+
+  return new Promise((resolve, reject) => {
+    top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/selectCourseDetailSz", [id], function (res) {
+      console.log(res);
+      if (!res || !res.value || res.value[0].length === 0 || res.value[0][0].chapters.length === 0) {
+        reject(new Error("Invalid response or no chapters found"));
+        return;
+      }
+
+      const datachapters = JSON.parse(res.value[0][0].chapters);
+
       for (let i = 0; i < datachapters.length; i++) {
-        let data = datachapters[i]
+        const data = datachapters[i];
         for (let j = 0; j < data.chapterInfo.length; j++) {
-          let dataChapterInfo = data.chapterInfo[j]
+          const dataChapterInfo = data.chapterInfo[j];
           for (let k = 0; k < dataChapterInfo.taskJson.length; k++) {
-            let DatahapterData = dataChapterInfo.taskJson[k]
+            const DatahapterData = dataChapterInfo.taskJson[k];
             for (let l = 0; l < DatahapterData.chapterData.length; l++) {
-              let obj = DatahapterData.chapterData[l]
-              // let obj = chapterDatas
-              obj.checked = false
-              dataList.push(obj)
+              const obj = DatahapterData.chapterData[l];
+              obj.checked = false;
+              dataList.push(obj);
             }
           }
         }
       }
-    }
-  }, [], { "type": "POST", "withCredentials": true });
 
-  await m.xia.map(x => {
-    if (x.dataId == id) {
-      x.dataList = dataList
-    }
-    return x
+      resolve(dataList);
+    }, [], { "type": "POST", "withCredentials": true });
   })
+    .then((dataList) => {
+      getUpdateCourse(dataList, id);
+    })
+    .catch((error) => {
+      console.error("Error fetching data:", error);
+    });
+};
+
+const getUpdateCourse = async (dataList, id) => {
+  let m = currentData.value
+
+  if (volumes.value) {
+    await m.shang.map(x => {
+      if (x.dataId == id) {
+        x.dataList = dataList
+      }
+      return x
+    })
+  } else {
+    await m.xia.map(x => {
+      if (x.dataId == id) {
+        x.dataList = dataList
+      }
+      return x
+    })
+  }
   currentData.value = m
-  // console.log("currentData", currentData)
+  getUpdateCourseId.value = id
 }
 
 const checkedAll = (id) => {
   let data = currentData.value
-  data.xia.map(x => {
-    if (x.dataId == id) {
-      x.dataList.map(y => {
-        y.checked = !checked1.value
-      })
-    }
-    return x
-  })
-  console.log(id, checked1.value)
+
+  if (volumes.value) {
+    data.shang.map(x => {
+      if (x.dataId == id) {
+        x.dataList.map(y => {
+          y.checked = !checked1.value
+        })
+      }
+      return x
+    })
+  } else {
+    data.xia.map(x => {
+      if (x.dataId == id) {
+        x.dataList.map(y => {
+          y.checked = !checked1.value
+        })
+      }
+      return x
+    })
+  }
   console.log(data)
   currentData.value = data
   // checked1.value = true
@@ -792,17 +828,29 @@ const downloadCourseOne = (url, fileName) => {
 const DownloadProcessing = async () => {
   let data = currentData.value
   let urls = []
-  await data.xia.map(x => {
-    console.log(x)
-    x.dataList.length > 0 && x.dataList.map(m => {
-      if (m.checked) {
-        urls.push(m)
-      }
-      return m
+  if (volumes.value) {
+    await data.shang.map(x => {
+      // console.log(x)
+      x.dataList.length > 0 && x.dataList.map(m => {
+        if (m.checked) {
+          urls.push(m)
+        }
+        return m
+      })
+      return x
     })
-    return x
-  })
-  console.log("urls", urls)
+  } else {
+    await data.xia.map(x => {
+      // console.log(x)
+      x.dataList.length > 0 && x.dataList.map(m => {
+        if (m.checked) {
+          urls.push(m)
+        }
+        return m
+      })
+      return x
+    })
+  }
   try {
     console.log("urls", [user.user.userid, getUpdateCourseId.value, '4', urls.length])
     top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/addOperationTimeT", [user.user.userid, getUpdateCourseId.value, '4', urls.length], function (res) {

Some files were not shown because too many files changed in this diff