|
@@ -397,6 +397,7 @@ export default {
|
|
|
org: this.$route.query.org,
|
|
|
role: this.$route.query.role,
|
|
|
cid: this.$route.query.cid,
|
|
|
+ isN: this.$route.query.isN,
|
|
|
title: "",
|
|
|
testType: [],
|
|
|
see: false,
|
|
@@ -624,7 +625,7 @@ export default {
|
|
|
courseid: this.works[i].courseid,
|
|
|
id: this.works[i].id,
|
|
|
userid: this.works[i].userid,
|
|
|
- name: this.works[i].username,
|
|
|
+ name: this.works[i].username ? this.works[i].username : '匿名',
|
|
|
time: this.works[i].time,
|
|
|
array: _json,
|
|
|
courseJson: JSON.parse(this.works[i].courseJson),
|
|
@@ -1068,7 +1069,7 @@ export default {
|
|
|
let score = this.score(JSON.parse(data.courseJson))
|
|
|
let isScore = this.score2(JSON.parse(data.courseJson))
|
|
|
let scoreContent = score ? `<b>(得分/总分)${isScore}/${score}</b>` : ''
|
|
|
- let _content = `<div style="text-align:center;margin-top: 20px;"><b style="margin-right:40px">(答题人)${_data.username}</b>${scoreContent}(填写范围)${this.testJson.juriP ? this.testJson.juriP : '所有人'}(提交时间)${_data.time}</div>`
|
|
|
+ let _content = `<div style="text-align:center;margin-top: 20px;"><b style="margin-right:40px">(答题人)${_data.username ? _data.username : '匿名'}</b>${scoreContent}(填写范围)${this.testJson.juriP ? this.testJson.juriP : '所有人'}(提交时间)${_data.time}</div>`
|
|
|
let _detail = this.testJson.brief ? `<div style="text-align:center;margin-top: 20px;">${this.testJson.brief}</div>` : ''
|
|
|
|
|
|
let _test = `<div style='margin-top:40px;'>`
|
|
@@ -1102,7 +1103,7 @@ export default {
|
|
|
}
|
|
|
_test += `</div>`
|
|
|
let _html = _title + _content + _detail + _test;
|
|
|
- this.exportToWord(_data.username + '-' + _data.time, _html);
|
|
|
+ this.exportToWord(_data.username ? _data.username : '匿名' + '-' + _data.time, _html);
|
|
|
},
|
|
|
async exportToWord(a, html) {
|
|
|
// 将html文件中需要用到的数据挂载到store上
|
|
@@ -1187,7 +1188,7 @@ export default {
|
|
|
let score = this.score(JSON.parse(data.courseJson))
|
|
|
let isScore = this.score2(JSON.parse(data.courseJson))
|
|
|
let scoreContent = score ? `<b>(得分/总分)${isScore}/${score}</b>` : ''
|
|
|
- let _content = `<div style="text-align:center;margin-top: 20px;"><b style="margin-right:40px">(答题人)${_data.username}</b>${scoreContent}(填写范围)${this.testJson.juriP ? this.testJson.juriP : '所有人'}(提交时间)${_data.time}</div>`
|
|
|
+ let _content = `<div style="text-align:center;margin-top: 20px;"><b style="margin-right:40px">(答题人)${_data.username ? _data.username : '匿名'}</b>${scoreContent}(填写范围)${this.testJson.juriP ? this.testJson.juriP : '所有人'}(提交时间)${_data.time}</div>`
|
|
|
let _detail = this.testJson.brief ? `<div style="text-align:center;margin-top: 20px;">${this.testJson.brief}</div>` : ''
|
|
|
|
|
|
let _test = `<div style='margin-top:40px;'>`
|
|
@@ -1222,7 +1223,7 @@ export default {
|
|
|
}
|
|
|
_test += `</div>`
|
|
|
let _html = _title + _content + _detail + _test;
|
|
|
- return this.exportToWordAll(_data.username + '-' + _data.time, _html);
|
|
|
+ return this.exportToWordAll(_data.username ? _data.username : '匿名' + '-' + _data.time, _html);
|
|
|
},
|
|
|
async exportToWordAll(a, html) {
|
|
|
// 将html文件中需要用到的数据挂载到store上
|
|
@@ -1329,7 +1330,7 @@ export default {
|
|
|
for (var i = 0; i < res.length; i++) {
|
|
|
var _json = {};
|
|
|
_json["序号"] = i + 1;
|
|
|
- _json["提交人"] = res[i].name;
|
|
|
+ _json["提交人"] = res[i].name ? res[i].name : '匿名';
|
|
|
_json["提交时间"] = res[i].time;
|
|
|
for (var j = 0; j < chapters.length; j++) {
|
|
|
_json[j + 1 + "." + chapters[j].json.title] = '';
|
|
@@ -1412,7 +1413,7 @@ export default {
|
|
|
let downFileArray = [];
|
|
|
let uniqueArr = data.filter((v,i,a)=>a.map(mb=>mb.userid).indexOf(v.userid)==i);
|
|
|
uniqueArr.forEach(i=>{
|
|
|
- downFileArray.push({userid:i.userid,username:i.username,urlList:data.filter(d=>d.userid==i.userid).map(m=>m)});
|
|
|
+ downFileArray.push({userid:i.userid,username:i.username ? i.username : '匿名',urlList:data.filter(d=>d.userid==i.userid).map(m=>m)});
|
|
|
})
|
|
|
let promises = [];
|
|
|
if(downFileArray.length==1){//只有一位老师的情况
|
|
@@ -1444,12 +1445,12 @@ export default {
|
|
|
promises.push(getFile(i.urlList[0].url).then((data) => {
|
|
|
if (data.data != 1) {
|
|
|
// 下载文件, 并存成ArrayBuffer对象
|
|
|
- const file_name = `${i.username}-${i.urlList[0].name}`; // 获取文件名
|
|
|
+ const file_name = `${i.username ? i.username : '匿名'}-${i.urlList[0].name}`; // 获取文件名
|
|
|
zip.file(file_name, data.data, { binary: true }); // 逐个添加文件
|
|
|
}
|
|
|
}))
|
|
|
}else if(i.urlList.length>1){//有多个文件的
|
|
|
- const folder = zip.folder(`${i.username}`);
|
|
|
+ const folder = zip.folder(`${i.username ? i.username : '匿名'}`);
|
|
|
i.urlList.forEach(ui=>{
|
|
|
const promise = getFile(ui.url).then((data) => {
|
|
|
if (data.data != 1) {
|