首页数据

master
lion 4 months ago
parent 3a60f329b7
commit ecdceeaa61

@ -518,45 +518,36 @@ export default {
.catch((error) => {}); .catch((error) => {});
}, },
methods: { methods: {
formatResult(num) { formatResult(originalNum) {
// 1. 100100 // 1. 100100
if(!num){ if(!originalNum){
return '0' return 0
} }
const processed = Math.round(num * 100) / 100; const multiplied = Math.round(originalNum * 100); // 0.28 * 100 = 28 28
// 2. 0 // 2. 100
if (processed % 1 === 0) { if (multiplied % 1 === 0) {
// // 28
return processed.toString(); return multiplied;
} else { } else {
// // 56.50
return processed.toFixed(2); return (multiplied / 100).toFixed(2);
} }
}, },
async getCarry () { async getCarry () {
const res = await carry(this.carrySelect); const res = await carry(this.carrySelect);
// //
let setData = function(data, constData, showData) { let setData = function(data, constData, showData) {
data.filter(function(item) { data.forEach(function(item) {
if (item) { if (item && Number(item.value) !== 0) {
constData.push(1); constData.push(1);
showData.push(item); showData.push(item);
} else { } else {
constData.push(0); constData.push(1); // diamond
showData.push({ showData.push(null); // diamond
value: 1, }
itemStyle: { });
normal: {
borderColor: "rgba(0,0,0,0)",
borderWidth: 2,
color: "rgba(0,0,0,0)",
},
},
});
}
});
} }
// //
let setColor = function(colorArr) { let setColor = function(colorArr) {

Loading…
Cancel
Save