update 看板接口对接 增加路由依赖
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { getAllList } from '/@/components/chinaMap/chinaMapApi.ts';
|
||||
import { getAllList, getAmbulanceList } from '/@/components/chinaMap/chinaMapApi.ts';
|
||||
|
||||
export enum TabType {
|
||||
all = '', //所有资源
|
||||
youTianYiYuan = '1', //油田医院
|
||||
heZuoYiYuan = '2', //合作医院
|
||||
yiLiaoDian = '3', //医疗点
|
||||
jiuHuChe = '4', //救护车
|
||||
}
|
||||
|
||||
export const tabList = [
|
||||
@@ -22,6 +23,7 @@ export const tabList = [
|
||||
},
|
||||
{
|
||||
name: '救护车',
|
||||
type: TabType.jiuHuChe,
|
||||
},
|
||||
{
|
||||
name: '合作医院',
|
||||
@@ -38,14 +40,50 @@ export const tabList = [
|
||||
},
|
||||
];
|
||||
|
||||
export function mapApiSwitch(type: string, params: any) {
|
||||
// 直升机位置数据
|
||||
export const aircraft = [
|
||||
{
|
||||
category: 3,
|
||||
lat: 108.861377,
|
||||
lon: 34.35965,
|
||||
img: WebRoot + '/webpage/com/jeecg/show/img/helicopter.gif',
|
||||
name: '直升机',
|
||||
},
|
||||
{
|
||||
category: 3,
|
||||
lat: 106.267358,
|
||||
lon: 38.520079,
|
||||
img: WebRoot + '/webpage/com/jeecg/show/img/helicopter.gif',
|
||||
name: '直升机',
|
||||
},
|
||||
{
|
||||
category: 3,
|
||||
lat: 109.505282,
|
||||
lon: 36.579381,
|
||||
img: WebRoot + '/webpage/com/jeecg/show/img/helicopter.gif',
|
||||
name: '直升机',
|
||||
},
|
||||
{
|
||||
category: 3,
|
||||
lat: 107.638372,
|
||||
lon: 35.734218,
|
||||
img: WebRoot + '/webpage/com/jeecg/show/img/helicopter.gif',
|
||||
name: '直升机',
|
||||
},
|
||||
];
|
||||
|
||||
export function mapApiSwitch(type, params: any) {
|
||||
const basicParams = {
|
||||
lat: 34, //纬度34
|
||||
lon: 108, //经度
|
||||
};
|
||||
if ([TabType.all, TabType.yiLiaoDian, TabType.heZuoYiYuan].includes(type)) {
|
||||
// 全部 油田 医疗点 合作医院
|
||||
if ([TabType.all, TabType.youTianYiYuan, TabType.yiLiaoDian, TabType.heZuoYiYuan].includes(type)) {
|
||||
return getAllList({ ...basicParams, ...params });
|
||||
}
|
||||
if ([TabType.jiuHuChe].includes(type)) {
|
||||
return getAmbulanceList({});
|
||||
}
|
||||
}
|
||||
|
||||
export const mapIcon1 = new URL('/@/assets/img/mapIcon1.png', import.meta.url).href;
|
||||
@@ -61,7 +99,6 @@ export const legend3 = new URL('/@/assets/img/legend3.png', import.meta.url).hre
|
||||
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: '油田医院' },
|
||||
@@ -71,111 +108,6 @@ export const legendList = [
|
||||
{ img: legend5, text: '地方医院' },
|
||||
{ img: legend6, text: '直升机' },
|
||||
];
|
||||
const bgImg = new URL('/@/assets/images/china-textur.jpg', import.meta.url).href;
|
||||
|
||||
export function createChartOption({ icons }) {
|
||||
return {
|
||||
tooltip: {
|
||||
show: false,
|
||||
// formatter: (params) => {
|
||||
// console.log('params', params);
|
||||
// if (!params?.data?.id) {
|
||||
// return '';
|
||||
// }
|
||||
// return `<div style="color:red;width:300px"> ${params.name}</div>
|
||||
// <div>id: ${params?.data?.id}</div>`;
|
||||
// },
|
||||
},
|
||||
geo: [
|
||||
{
|
||||
map: 'china',
|
||||
zlevel: 3,
|
||||
aspectScale: 0.8, //长宽比
|
||||
zoom: 1.1,
|
||||
// roam: true,
|
||||
// draggable: true,
|
||||
top: '60',
|
||||
left: 'center',
|
||||
itemStyle: {
|
||||
areaColor: '#173a58',
|
||||
shadowColor: '#173a58',
|
||||
shadowOffsetX: 0,
|
||||
shadowOffsetY: 5,
|
||||
borderWidth: 6, //外部边框
|
||||
borderColor: '#6ccffe',
|
||||
},
|
||||
},
|
||||
{
|
||||
map: 'china',
|
||||
zlevel: 2,
|
||||
aspectScale: 0.8, //长宽比
|
||||
zoom: 1.1,
|
||||
// roam: true,
|
||||
// draggable: true,
|
||||
top: '60',
|
||||
left: 'center',
|
||||
itemStyle: {
|
||||
areaColor: '#1e2c38',
|
||||
shadowColor: '#1e2c38',
|
||||
shadowOffsetX: 0,
|
||||
shadowOffsetY: 10,
|
||||
borderWidth: 6, //外部边框
|
||||
borderColor: '#384d61',
|
||||
},
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
map: 'china', // 这个是上面注册时的名字哦,registerMap('这个名字保持一致')
|
||||
name: '中国地图',
|
||||
type: 'map',
|
||||
selected: {}, // 默认所有省份都是未选中状态
|
||||
selectedMode: 'single', // 选中模式为单选
|
||||
zlevel: 9,
|
||||
zoom: 1.1,
|
||||
aspectScale: 0.8, //长宽比
|
||||
// roam: true,
|
||||
// draggable: true,
|
||||
hoverAnimation: false,
|
||||
silent: false,
|
||||
top: '60',
|
||||
left: 'center',
|
||||
label: {
|
||||
show: true,
|
||||
padding: [0, 10],
|
||||
height: 31,
|
||||
lineHeight: 31,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 13,
|
||||
marginLeft: 5,
|
||||
},
|
||||
},
|
||||
itemStyle: {
|
||||
// 给地图添加背景图片
|
||||
areaColor: {
|
||||
type: 'pattern',
|
||||
image: bgImg,
|
||||
repeat: 'no-repeat',
|
||||
},
|
||||
borderColor: '#359de5',
|
||||
borderWidth: 2, //内部边框,
|
||||
},
|
||||
// 鼠标悬浮
|
||||
emphasis: {
|
||||
label: {
|
||||
color: '#fff',
|
||||
},
|
||||
itemStyle: {
|
||||
// areaColor: '#008CFF',
|
||||
areaColor: '#002e64',
|
||||
},
|
||||
},
|
||||
},
|
||||
...icons.value,
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 秒转小时
|
||||
|
||||
Reference in New Issue
Block a user