首页数据

master
lion 3 months ago
parent 3a60f329b7
commit ecdceeaa61

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

Loading…
Cancel
Save