mirror of https://github.com/ElemeFE/element
Statistic:Fixed the thousandth bit bug (#22252)
* statistic:Fixed the thousandth bit bug statistic:Fixed the thousandth bit bug * Modifying Spaces Modifying Spacespull/22259/head
parent
1e969ef72a
commit
e33c040aa8
|
@ -102,7 +102,6 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
branch() {
|
branch() {
|
||||||
// console.log('timeIndices', this.timeIndices);
|
|
||||||
if (this.timeIndices) {
|
if (this.timeIndices) {
|
||||||
clearInterval(this.timeTask);
|
clearInterval(this.timeTask);
|
||||||
this.countDown();
|
this.countDown();
|
||||||
|
@ -110,12 +109,13 @@ export default {
|
||||||
this.dispose();
|
this.dispose();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
magnification(num, _mulriple = 1000, _groupSeparator = ',') { // magnification factor
|
||||||
magnification(num, mulriple = 1000, groupSeparator = ',') { // magnification factor
|
const level = String(_mulriple).length - 1;
|
||||||
if (_.isNumber(num)) return false;
|
const reg = new RegExp(`\\d{1,${level}}(?=(\\d{${level}})+$)`, 'g');
|
||||||
let result = String(_.divide(num, mulriple))
|
const result = String(num)
|
||||||
.split('.')
|
.replace(reg, '$&,')
|
||||||
.join(groupSeparator || ',');
|
.split(',')
|
||||||
|
.join(_groupSeparator);
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
dispose() {
|
dispose() {
|
||||||
|
@ -192,7 +192,6 @@ export default {
|
||||||
return (result);
|
return (result);
|
||||||
};
|
};
|
||||||
this.timeTask = setInterval(function() {
|
this.timeTask = setInterval(function() {
|
||||||
// console.log(diffTiem);
|
|
||||||
if (disappearTime(diffTiem)) clearInterval(than.timeTask);
|
if (disappearTime(diffTiem)) clearInterval(than.timeTask);
|
||||||
diffTiem = diffTiem < REFRESH_INTERVAL ? 0 : diffTiem - REFRESH_INTERVAL;
|
diffTiem = diffTiem < REFRESH_INTERVAL ? 0 : diffTiem - REFRESH_INTERVAL;
|
||||||
than.disposeValue = formatTimeStr(format, diffTiem);
|
than.disposeValue = formatTimeStr(format, diffTiem);
|
||||||
|
|
Loading…
Reference in New Issue