|
@@ -37,10 +37,10 @@
|
|
|
<span style="display: inline-block;width: 130px;" :title="dataitem.name">{{
|
|
|
dataitem.name.length > 10 ?
|
|
|
dataitem.name.substring(0, 8) + '...' : dataitem.name }}</span>
|
|
|
- <a :href="dataitem.url" :download="dataitem.name" v-if="!checked1" class="el_popover_a"
|
|
|
- style="position: relative;left: 20px;top: 5px;">
|
|
|
+ <span v-if="!checked1" class="el_popover_a" style="position: relative;left: 20px;top: 5px;"
|
|
|
+ @click="downloadOne(dataitem.url, dataitem.name)">
|
|
|
<img :src="DownloadImg" alt="">
|
|
|
- </a>
|
|
|
+ </span>
|
|
|
<el-checkbox v-if="checked1" v-model="dataitem.checked" label="全选" size="large" />
|
|
|
</div>
|
|
|
<el-button style="margin-top: 10px;" v-if="checked1"
|
|
@@ -171,6 +171,7 @@ const dialogVisible = ref(false)
|
|
|
const updateReductionId = ref("")
|
|
|
const checked1 = ref(false)
|
|
|
const visible = ref(false)
|
|
|
+const getUpdateCourseId = ref("")
|
|
|
|
|
|
const courseData = {
|
|
|
"三年级": {
|
|
@@ -375,6 +376,7 @@ const getImageUrl = (url) => {
|
|
|
|
|
|
const openCourseDetail = (id) => {
|
|
|
console.log(user.user)
|
|
|
+ getTimeCourse(id)
|
|
|
// 会返回复制得课程
|
|
|
top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/getcopyCourseByUseridSz", [id, user.user.userid], function (res) {
|
|
|
console.log(res)
|
|
@@ -390,6 +392,17 @@ const openCourseDetail = (id) => {
|
|
|
}, [], { "type": "POST", "withCredentials": true });
|
|
|
|
|
|
}
|
|
|
+const getTimeCourse = (id) => {
|
|
|
+ try {
|
|
|
+ setInterval(() => {
|
|
|
+ top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/addOperationTimeT", [user.user.userid, id, '5', 30], function (res) {
|
|
|
+ console.log(res, "22222222222222222");
|
|
|
+ }, [], { "type": "POST", "withCredentials": true });
|
|
|
+ }, 30000)
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+}
|
|
|
const updateCourse = id => {
|
|
|
// 会返回courseId和state 两个参数 然后打开
|
|
|
top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/getcopyCourseByUseridSz", [id, user.user.userid], function (res) {
|
|
@@ -477,6 +490,7 @@ const getDate = async (id) => {
|
|
|
return x
|
|
|
})
|
|
|
currentData.value = m
|
|
|
+ getUpdateCourseId.value = id
|
|
|
// console.log("currentData", currentData)
|
|
|
}
|
|
|
|
|
@@ -496,7 +510,15 @@ const checkedAll = (id) => {
|
|
|
// checked1.value = true
|
|
|
}
|
|
|
|
|
|
-const download = (url, fileName) => {
|
|
|
+const downloadOne = (url, fileName) => {
|
|
|
+ try {
|
|
|
+ console.log("urls", [user.user.userid, getUpdateCourseId.value, '4', 1])
|
|
|
+ top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/addOperationTimeT", [user.user.userid, getUpdateCourseId.value, '4', 1], function (res) {
|
|
|
+ console.log(res, '11111111111')
|
|
|
+ }, [], { "type": "POST", "withCredentials": true });
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
const a = document.createElement('a');
|
|
|
a.style.display = 'none';
|
|
|
a.href = url;
|
|
@@ -505,7 +527,6 @@ const download = (url, fileName) => {
|
|
|
a.click();
|
|
|
document.body.removeChild(a);
|
|
|
}
|
|
|
-
|
|
|
const DownloadProcessing = async () => {
|
|
|
let data = currentData.value
|
|
|
let urls = []
|
|
@@ -519,7 +540,15 @@ const DownloadProcessing = async () => {
|
|
|
})
|
|
|
return x
|
|
|
})
|
|
|
- console.log("urls", urls)
|
|
|
+ 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) {
|
|
|
+ console.log(res, '11111111111')
|
|
|
+ }, [], { "type": "POST", "withCredentials": true });
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+
|
|
|
for (let i = 0; i < urls.length; i++) {
|
|
|
fetch(urls[i].url)
|
|
|
.then(response => response.blob()) // 获取文件数据流
|