mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-13 04:46:44 +08:00
提交
This commit is contained in:
@@ -263,3 +263,78 @@ export function getUType(type) {
|
||||
let name = uTypeMaps[type];
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
export function experienceValue(total) {
|
||||
let data = {
|
||||
start:'',
|
||||
end:'',
|
||||
endValue:null,
|
||||
percentage:null,
|
||||
total,
|
||||
}
|
||||
if(total < 300) {
|
||||
data.start = 'LV1';
|
||||
data.end = 'LV2';
|
||||
data.endValue = 600;
|
||||
data.percentage = parseFloat((total / 600) * 100);
|
||||
} else if(total > 300 || total == 300 || total < 600){
|
||||
data.start = 'LV2';
|
||||
data.end = 'LV3';
|
||||
data.endValue = 1000;
|
||||
data.percentage = parseFloat((total / 1000) * 1000);
|
||||
} else if(total > 600 || total == 600 || total < 1000){
|
||||
data.start = 'LV3';
|
||||
data.end = 'LV4';
|
||||
data.endValue = 2000;
|
||||
data.percentage = parseFloat((total / 2000) * 100);
|
||||
} else if(total > 1000 || total == 1000 || total < 2000){
|
||||
data.start = 'LV4';
|
||||
data.end = 'LV5';
|
||||
data.endValue = 4000;
|
||||
data.percentage = parseFloat((total / 4000) * 4000);
|
||||
} else if(total > 2000 || total == 2000 || total < 4000){
|
||||
data.start = 'LV5';
|
||||
data.end = 'LV6';
|
||||
data.endValue = 8000;
|
||||
data.percentage = parseFloat((total / 8000) * 100);
|
||||
} else if(total > 4000 || total == 4000 || total < 8000){
|
||||
data.start = 'LV6';
|
||||
data.end = 'LV7';
|
||||
data.endValue = 15000;
|
||||
data.percentage = parseFloat((total / 15000) * 100);
|
||||
} else if(total > 8000 || total == 8000 || total < 15000){
|
||||
data.start = 'LV7';
|
||||
data.end = 'LV8';
|
||||
data.endValue = 20000;
|
||||
data.percentage = parseFloat((total / 20000) * 100);
|
||||
} else if(total > 15000 || total == 15000 || total < 20000){
|
||||
data.start = 'LV8';
|
||||
data.end = 'LV9';
|
||||
data.endValue = 30000;
|
||||
data.percentage = parseFloat((total / 30000) * 100);
|
||||
} else if(total > 20000 || total == 20000 || total < 30000){
|
||||
data.start = 'LV9';
|
||||
data.end = 'LV10';
|
||||
data.endValue = 30000;
|
||||
data.percentage = parseFloat((total / 30000) * 100);
|
||||
} else if(total > 30000 || total == 30000){
|
||||
data.start = 'LV9';
|
||||
data.end = 'LV10';
|
||||
data.endValue = 30000;
|
||||
data.percentage = parseFloat((total / 30000) * 100);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
export function translate(field) {
|
||||
let name = '';
|
||||
switch (field) {
|
||||
case 'total':name = '累计'; break;
|
||||
case 'weeks':name = '本周'; break;
|
||||
case 'months':name = '本月'; break;
|
||||
case 'years':name = '本年'; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user