首页数据

master
lion 8 months ago
parent 3a60f329b7
commit ecdceeaa61

@ -518,20 +518,20 @@ 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 () {
@ -539,22 +539,13 @@ export default {
// //
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)",
},
},
});
} }
}); });
} }

Loading…
Cancel
Save