2024-06-14 13:49:51 +08:00
|
|
|
export function restm (e) {
|
|
|
|
|
let index = ''
|
|
|
|
|
if (e == '8') {
|
|
|
|
|
index = 0
|
|
|
|
|
} else if (e == '9') {
|
|
|
|
|
index = 1
|
|
|
|
|
} else if (e == '10') {
|
|
|
|
|
index = 2
|
|
|
|
|
} else if (e == '11') {
|
|
|
|
|
index = 3
|
|
|
|
|
} else if (e == '12') {
|
|
|
|
|
index = 4
|
|
|
|
|
} else if (e == '13') {
|
|
|
|
|
index = 5
|
|
|
|
|
} else if (e == '14') {
|
|
|
|
|
index = 6
|
|
|
|
|
} else if (e == '15') {
|
|
|
|
|
index = 7
|
|
|
|
|
} else if (e == '16') {
|
|
|
|
|
index = 8
|
|
|
|
|
} else if (e == '17') {
|
|
|
|
|
index = 9
|
|
|
|
|
} else if (e == '18') {
|
|
|
|
|
index = 10
|
|
|
|
|
} else if (e == '19') {
|
|
|
|
|
index = 11
|
|
|
|
|
} else if (e == '20') {
|
|
|
|
|
index = 12
|
|
|
|
|
} else if (e == '21') {
|
|
|
|
|
index = 13
|
|
|
|
|
} else if (e == '22') {
|
|
|
|
|
index = 14
|
|
|
|
|
} else if (e == '23') {
|
|
|
|
|
index = 15
|
|
|
|
|
} else if (e == '0') {
|
|
|
|
|
index = 16
|
|
|
|
|
} else if (e == '1') {
|
|
|
|
|
index = 17
|
|
|
|
|
} else if (e == '2') {
|
|
|
|
|
index = 18
|
|
|
|
|
} else if (e == '3') {
|
|
|
|
|
index = 19
|
|
|
|
|
} else if (e == '4') {
|
|
|
|
|
index = 20
|
|
|
|
|
} else if (e == '5') {
|
|
|
|
|
index = 21
|
|
|
|
|
} else if (e == '6') {
|
|
|
|
|
index = 22
|
|
|
|
|
} else if (e == '7') {
|
|
|
|
|
index = 23
|
|
|
|
|
}
|
|
|
|
|
return index
|
|
|
|
|
}
|
2024-06-19 14:15:15 +08:00
|
|
|
export const adnmZhen = adcd => {
|
|
|
|
|
if (!adcd || !nameMap) {
|
|
|
|
|
return undefined
|
|
|
|
|
}
|
|
|
|
|
if (adcd.endsWith('000000000')) {
|
|
|
|
|
return undefined
|
|
|
|
|
} else if (adcd.endsWith('000000')) {
|
|
|
|
|
return nameMap[adcd]
|
|
|
|
|
}
|
|
|
|
|
return nameMap[`${adcd.substr(0, 9)}000000`]
|
|
|
|
|
}
|
2024-11-07 10:29:29 +08:00
|
|
|
|
|
|
|
|
export const fileChange = (file) => {
|
|
|
|
|
let blob = new Blob([file]);
|
|
|
|
|
let url = window.URL.createObjectURL(blob);
|
2024-11-12 17:58:06 +08:00
|
|
|
console.log("url",url);
|
2024-11-07 10:29:29 +08:00
|
|
|
|
|
|
|
|
return url
|
|
|
|
|
}
|
2024-11-08 17:57:53 +08:00
|
|
|
|
|
|
|
|
export function numberFormat(value) {
|
|
|
|
|
let param = {}
|
|
|
|
|
let k = 10000
|
|
|
|
|
let sizes = ['', '万', '亿', '万亿']
|
|
|
|
|
let i
|
|
|
|
|
if (value < k) {
|
|
|
|
|
param.value = value
|
|
|
|
|
param.unit = ''
|
|
|
|
|
} else {
|
|
|
|
|
i = Math.floor(Math.log(value) / Math.log(k));
|
|
|
|
|
param.value = ((value / Math.pow(k, i))).toFixed(2);
|
|
|
|
|
param.unit = sizes[i];
|
|
|
|
|
}
|
|
|
|
|
console.log(param)
|
|
|
|
|
return param;
|
|
|
|
|
}
|