Commit 08754f9a authored by 罗嘉彧's avatar 罗嘉彧
Browse files

1

No related merge requests found
Showing with 3 additions and 44 deletions
+3 -44
......@@ -242,21 +242,15 @@ Page({
list: arr3,
});
} else if (type == 4) {
console.log(res.data)
let pType = JSON.parse(res.data.at(0).reportResult);
console.log(pType)
let arr = []
if (type == 2) {
arr = pType.splice(0, pType.length - 1);
} else {
arr = pType;
}
console.log(pType)
let obj = pType.at(-1);
console.log(obj)
obj.careerExample = JSON.parse(obj.careerExample);
obj.resultDescribe = JSON.parse(obj.resultDescribe);
obj.suggest = JSON.parse(obj.suggest);
let arr2 = [];
let group = {};
arr.forEach(item => {
......@@ -275,36 +269,7 @@ Page({
sPercent: ((a[1].score / (a[0].score + a[1].score)) * 100).toFixed(2),
});
});
let arr3 = [];
let result = obj.resultDescribe.splice(4)
obj.resultDescribe.forEach((item, index) => {
let o = arr2[index];
o.sPercent = isNaN(o.sPercent) ? 0 : o.sPercent;
if (index <= 3) {
arr3.push({
title: item.split("")[0],
content: item.split("")[1],
name: o.fPercent > o.sPercent ? (o.firstName + '(' + o.fPercent + '%' + ')') : (o.secondName + '(' + o.sPercent + '%' + ')')
})
}
});
let arr4 = [],
aIndex = -1;
result.forEach(item => {
let a = item.split(".")[0];
if (a && isNaN(Number(a))) {
arr4.push({
title: item.substring(0, item.length - 1),
content: ""
})
aIndex++
} else {
arr4[aIndex].content += item + '<br>'
}
});
let start = new Date(res.data.at(0).testtime);
let end = new Date(res.data.at(0).createTime);
let time = this.computedTime(start, end);
pType.forEach(item => {
item.careerExample = JSON.parse(typeof item.careerExample == 'string' ? item.careerExample : '[]');
item.resultDescribe = JSON.parse(typeof item.resultDescribe == 'string' ? item.resultDescribe : '[]');
......@@ -315,12 +280,6 @@ Page({
"group": group,
characterList: arr2,
list: pType,
"majorForm.careerExample": obj.careerExample,
'majorForm.resultDescribe': arr3,
'majorForm.resultDescribe2': arr4,
'majorForm.demension': obj.demension,
"majorForm.name": obj.result.split("[P]")[0],
'time': time,
});
this.ecComponent = this.selectComponent('#mychart-dom-line');
this.init()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment