update
This commit is contained in:
@@ -88,27 +88,27 @@ export function downloadExcel(url: string, name: string, type = '.xlsx') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const selectOne = {
|
export const selectOne = {
|
||||||
one: getOption(40, 3, 5, true),
|
one: getOption(40, 3, 5, true, '次/分钟'),
|
||||||
two: getOption(100, 3, 10, true),
|
two: getOption(100, 3, 10, true, '次/分钟'),
|
||||||
};
|
};
|
||||||
export const selectTwo = {
|
export const selectTwo = {
|
||||||
one: getOption(75, 4, 5, true),
|
one: getOption(75, 4, 5, true, '%'),
|
||||||
};
|
};
|
||||||
export const selectThree = {
|
export const selectThree = {
|
||||||
two: getOption(80, 10, 1, true),
|
two: getOption(80, 20, 1, true),
|
||||||
};
|
};
|
||||||
export const selectFour = {
|
export const selectFour = {
|
||||||
one: getOption(34.0, 20, 0.1, false),
|
one: getOption(34.0, 20, 0.1, false, '℃'),
|
||||||
two: getOption(37.2, 13, 0.1, false),
|
two: getOption(37.2, 13, 0.1, false, '℃'),
|
||||||
};
|
};
|
||||||
|
|
||||||
function getOption(start: number, length: number, step: any, b: boolean) {
|
function getOption(start: number, length: number, step: any, b: boolean, unit = '') {
|
||||||
let result: any[] = [];
|
let result: any[] = [];
|
||||||
let c = 0;
|
let c = 0;
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
c = parseFloat(start + i * step).toFixed(b ? 0 : 1);
|
c = parseFloat(parseFloat(start + i * step).toFixed(b ? 0 : 1));
|
||||||
result.push({
|
result.push({
|
||||||
label: c,
|
label: c + unit,
|
||||||
value: c,
|
value: c,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user