update
This commit is contained in:
@@ -22,24 +22,66 @@ export const tabList = [
|
||||
},
|
||||
{
|
||||
name: '急救路线',
|
||||
},
|
||||
];
|
||||
export const mapIcon1 = new URL('/@/assets/img/mapIcon1.png', import.meta.url).href;
|
||||
export const mapIcon2 = new URL('/@/assets/img/mapIcon2.png', import.meta.url).href;
|
||||
export const mapIcon3 = new URL('/@/assets/img/mapIcon3.png', import.meta.url).href;
|
||||
export const mapIcon4 = new URL('/@/assets/img/mapIcon4.png', import.meta.url).href;
|
||||
export const mapIcon5 = new URL('/@/assets/img/mapIcon5.png', import.meta.url).href;
|
||||
export const mapIcon6 = new URL('/@/assets/img/mapIcon6.png', import.meta.url).href;
|
||||
|
||||
export const legend1 = new URL('/@/assets/img/legend1.png', import.meta.url).href;
|
||||
export const legend2 = new URL('/@/assets/img/legend2.png', import.meta.url).href;
|
||||
export const legend3 = new URL('/@/assets/img/legend3.png', import.meta.url).href;
|
||||
export const legend4 = new URL('/@/assets/img/legend4.png', import.meta.url).href;
|
||||
export const legend5 = new URL('/@/assets/img/legend5.png', import.meta.url).href;
|
||||
export const legend6 = new URL('/@/assets/img/legend6.png', import.meta.url).href;
|
||||
export const mapIcons = [mapIcon1, mapIcon2, mapIcon3, mapIcon4, mapIcon5, mapIcon6];
|
||||
|
||||
export const legendList = [
|
||||
{ img: legend1, text: '油田医院' },
|
||||
{ img: legend2, text: '医疗点' },
|
||||
{ img: legend3, text: '救护车' },
|
||||
{ img: legend4, text: '合作医院' },
|
||||
{ img: legend5, text: '地方医院' },
|
||||
{ img: legend6, text: '直升机' },
|
||||
];
|
||||
|
||||
/**
|
||||
* @description 秒转小时
|
||||
* */
|
||||
export function convertSeconds(seconds) {
|
||||
let hours = Math.floor(seconds / 3600);
|
||||
let minutes = Math.floor((seconds % 3600) / 60);
|
||||
let remainingSeconds = seconds % 60;
|
||||
return {
|
||||
hours: hours,
|
||||
minutes: minutes,
|
||||
seconds: remainingSeconds,
|
||||
};
|
||||
}
|
||||
|
||||
export function convertMetersToKilometers(meters) {
|
||||
let kilometers = meters / 1000;
|
||||
return Math.round(kilometers * 100) / 100;
|
||||
}
|
||||
|
||||
export function getTimeStr(time) {
|
||||
let str = '';
|
||||
const { hours, minutes } = convertSeconds(time);
|
||||
|
||||
if (hours) {
|
||||
str += hours + '小时';
|
||||
}
|
||||
]
|
||||
export const mapIcon1 = new URL('/@/assets/img/mapIcon1.png', import.meta.url).href
|
||||
export const mapIcon2 = new URL('/@/assets/img/mapIcon2.png', import.meta.url).href
|
||||
export const mapIcon3 = new URL('/@/assets/img/mapIcon3.png', import.meta.url).href
|
||||
export const mapIcon4 = new URL('/@/assets/img/mapIcon4.png', import.meta.url).href
|
||||
export const mapIcon5 = new URL('/@/assets/img/mapIcon5.png', import.meta.url).href
|
||||
export const mapIcon6 = new URL('/@/assets/img/mapIcon6.png', import.meta.url).href
|
||||
if (minutes) {
|
||||
str += minutes + '分钟';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
export const legend1 = new URL('/@/assets/img/legend1.png', import.meta.url).href
|
||||
export const legend2 = new URL('/@/assets/img/legend2.png', import.meta.url).href
|
||||
export const legend3 = new URL('/@/assets/img/legend3.png', import.meta.url).href
|
||||
export const legend4 = new URL('/@/assets/img/legend4.png', import.meta.url).href
|
||||
export const legend5 = new URL('/@/assets/img/legend5.png', import.meta.url).href
|
||||
export const legend6 = new URL('/@/assets/img/legend6.png', import.meta.url).href
|
||||
export const mapIcons = [mapIcon1, mapIcon2, mapIcon3, mapIcon4, mapIcon5, mapIcon6]
|
||||
|
||||
export const legendList = [{img: legend1, text: '油田医院'}, {img: legend2, text: '医疗点'}, {
|
||||
img: legend3,
|
||||
text: '救护车'
|
||||
}, {img: legend4, text: '合作医院'}, {img: legend5, text: '地方医院'}, {img: legend6, text: '直升机'}]
|
||||
export function getKmStr(distance) {
|
||||
if (!distance) return '';
|
||||
let d = convertMetersToKilometers(distance);
|
||||
return d >= 1 ? d + '公里' : d * 100 + '米';
|
||||
}
|
||||
Reference in New Issue
Block a user