Compare commits

...

2 Commits

Author SHA1 Message Date
weipengfei 293f01adec 更新 2023-12-06 11:43:43 +08:00
weipengfei 18b5738927 更新 2023-12-06 10:48:18 +08:00
10 changed files with 221 additions and 144 deletions

View File

@ -44,3 +44,8 @@ export const dateCangeCrderCount = (data) => {
export const logisticsMapCount = (data) => { export const logisticsMapCount = (data) => {
return axios.get('dataview/logistics_map_count', { params: data }); return axios.get('dataview/logistics_map_count', { params: data });
} }
// 首页地图镇级统计信息
export const townMapCoun = (data) => {
return axios.get('dataview/town_map_count', { params: data });
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -78,6 +78,11 @@ const updateClock = () => {
seconds.toString().padStart(2, '0'); seconds.toString().padStart(2, '0');
} }
const logout = () => {
// router.replace('/login')
router.push('/login')
}
onMounted(() => { onMounted(() => {
mitt.emit('map_info', info); mitt.emit('map_info', info);
@ -120,7 +125,7 @@ onMounted(() => {
多云 多云
</div> </div>
<img class="icon item" src="/src/assets/head_img/icon.png" alt="" /> <img class="icon item" src="/src/assets/head_img/icon.png" alt="" />
<div class="item"> <div class="item" @click="logout">
<img src="/src/assets/head_img/close.png" alt="" /> <img src="/src/assets/head_img/close.png" alt="" />
</div> </div>
</div> </div>

View File

@ -6,11 +6,22 @@ let map = null;
const loading = ref(true); const loading = ref(true);
onMounted(() => { const props = defineProps({
list: {
type: Object,
default: () => []
},
open: {
type: String,
default: ''
}
})
const initMap = () => {
AMapLoader.load({ AMapLoader.load({
key: "4f8f55618010007147aab96fc72bb408", // WebKey load key: "4f8f55618010007147aab96fc72bb408", // WebKey load
version: "2.0", // JSAPI 1.4.15 version: "2.0", // JSAPI 1.4.15
plugins: [], // 使'AMap.Scale' plugins: ['AMap.Geocoder'], // 使'AMap.Scale'
Loca: { Loca: {
version: '2.0.0' version: '2.0.0'
} }
@ -32,6 +43,17 @@ onMounted(() => {
}); });
map.setPitch(30); map.setPitch(30);
let geocoder = new AMap.Geocoder();
geocoder.getLocation(props.open, function (status, result) {
if (status === 'complete' && result.info === 'OK') {
// result.geocodes
let latlong = result.geocodes[0].location;
let start = [latlong.lng, latlong.lat];
let line = [];
map.setCenter(start);
// AMap.Icon // AMap.Icon
const icon = new AMap.Icon({ const icon = new AMap.Icon({
size: new AMap.Size(50, 60), // size: new AMap.Size(50, 60), //
@ -42,7 +64,7 @@ onMounted(() => {
}); });
// Marker // Marker
const marker = new AMap.Marker({ const marker = new AMap.Marker({
position: new AMap.LngLat(105.441866, 28.87098), // [116.39, 39.9] position: start, // [116.39, 39.9]
icon: icon, icon: icon,
offset: new AMap.Pixel(-25, -60), // offset: new AMap.Pixel(-25, -60), //
}); });
@ -50,67 +72,66 @@ onMounted(() => {
// //
map.add(marker); map.add(marker);
props.list.forEach(item => {
geocoder.getLocation(item, function (status, result) {
if (status === 'complete' && result.info === 'OK') {
// result.geocodes
let geocodes = result.geocodes[0].location;
line.push([geocodes.lng, geocodes.lat]);
if (line.length == props.list.length) {
initLine(start, line);
}
} else {
//
console.log('获取经纬度失败');
}
})
})
} else {
//
console.log('获取经纬度失败');
}
});
})
.catch((e) => {
console.log(e);
});
}
const initLine = (start = [], line = []) => {
let features = [];
line.forEach((item => {
features.push({
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
start,
item
]
}
},)
}))
// Loca // Loca
var loca = new Loca.Container({ let loca = new Loca.Container({
map: map map: map
}); });
// //
var dataSource = new Loca.GeoJSONSource({ let dataSource = new Loca.GeoJSONSource({
// url: 'xxx.geojson', 使 data // url: 'xxx.geojson', 使 data
data: { data: {
"type": "FeatureCollection", "type": "FeatureCollection",
"features": [ "features": features
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[105.441866, 28.87098],
[105.449866, 28.87998]
]
}
},
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[105.441866, 28.87098],
[105.440866, 28.87658]
]
}
},
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[105.441866, 28.87098],
[105.435866, 28.87658]
]
}
},
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[105.441866, 28.87098],
[105.43, 28.87]
]
}
}
]
}, },
}); });
// 线 // 线
var pulseLink = new Loca.PulseLinkLayer({ let pulseLink = new Loca.PulseLinkLayer({
// loca, // loca,
zIndex: 30, zIndex: 30,
opacity: 1, opacity: 1,
@ -143,13 +164,14 @@ onMounted(() => {
headColor: 'rgba(91, 219, 246, 1)', headColor: 'rgba(91, 219, 246, 1)',
trailColor: 'rgba(255, 255,0,0)', trailColor: 'rgba(255, 255,0,0)',
}); });
//
loca.add(pulseLink); loca.add(pulseLink);
loca.animate.start(); loca.animate.start();
// }
})
.catch((e) => { onMounted(() => {
console.log(e); initMap();
});
}); });
onUnmounted(() => { onUnmounted(() => {

View File

@ -48,7 +48,7 @@ const initMap = () => {
let str = props.info.user_address; let str = props.info.user_address;
str = str.replace(/[1-10]队/, ''); str = str.replace(/\d+队/, '');
if (props.info.mer_lat && props.info.mer_long) { if (props.info.mer_lat && props.info.mer_long) {
let geocoder = new AMap.Geocoder({ let geocoder = new AMap.Geocoder({

View File

@ -7,13 +7,22 @@ import { logisticsMapCount } from "@/api/index.js";
const appStore = useAppStore(); const appStore = useAppStore();
const list = ref([]);
const open = ref({});
const initInfo = () => { const initInfo = () => {
logisticsMapCount({ logisticsMapCount({
areaCode: appStore.delivery_address.areaCode, areaCode: appStore.delivery_address.areaCode,
streetCode: appStore.delivery_address.streetCode, streetCode: appStore.delivery_address.streetCode,
courier_id: appStore.delivery_address.courier_id courier_id: appStore.delivery_address.courier_id
}).then(res => { }).then(res => {
console.log(res); res.data.latestTenOrder.forEach(item => {
list.value.push(item.receiver_address.replace(/\d+队/, ''))
})
// 使, , \d+5353
// list.value[0] += '';
// list.value[1] += '';
// list.value[2] += ' ';
open.value = res.data.latestOrder.mer_address;
}) })
} }
@ -30,7 +39,7 @@ onMounted(() => {
<template> <template>
<div class="box"> <div class="box">
<div class="map"> <div class="map">
<AMap></AMap> <AMap :list="list" :open="open"></AMap>
</div> </div>
<div class="border"></div> <div class="border"></div>
<div class="btn"> <div class="btn">

View File

@ -1,6 +1,33 @@
<script setup> <script setup>
import ball from "./ball.vue"; import ball from "./ball.vue";
import centerMap from "./centerMap.vue"; import centerMap from "./centerMap.vue";
import { townMapCoun } from "@/api/index.js";
import { useAppStore } from "@/store/app.js"
import { onMounted, ref } from "vue";
const appStore = useAppStore();
const list = ref([])
const initData = () => {
townMapCoun({
areaCode: appStore.address.areaCode,
streetCode: appStore.address.streetCode,
}).then((res) => {
res.data.townList.forEach(item => {
list.value.push({
...item,
...{
value: [item.lng, item.lat]
}
})
});
})
}
onMounted(() => {
initData()
})
</script> </script>
@ -9,7 +36,7 @@ import centerMap from "./centerMap.vue";
<div class="ball"> <div class="ball">
<ball class="ball1"></ball> <ball class="ball1"></ball>
</div> </div>
<centerMap class="c-map"></centerMap> <centerMap v-if="list.length > 0" class="c-map" :list="list"></centerMap>
</div> </div>
</template> </template>

View File

@ -11,9 +11,15 @@ import longma from "@/assets/json/longma.json";
import naxi from "@/assets/json/naxi.json"; import naxi from "@/assets/json/naxi.json";
import { useAppStore } from "@/store/app.js"; import { useAppStore } from "@/store/app.js";
const appStore = useAppStore(); const appStore = useAppStore();
const props = defineProps({
list: {
type: Object,
default: () => []
}
})
const mapType = reactive({ const mapType = reactive({
name: '', name: '',
json: '' json: ''
@ -30,36 +36,14 @@ const changeType = (name = 'luxian') => {
if (name == 'naxi') mapType.json = naxi; if (name == 'naxi') mapType.json = naxi;
} }
let dataValue = [ let dataValue = []
{
name: '测试一', value: [105.38, 29.15],
store: 2065, team: 33,
},
{
name: '测试二', value: [105.62, 29.05],
store: 665, team: 895,
},
{
name: '测试三', value: [105.55, 29.10],
store: 66, team: 5422,
},
{
name: '测试四', value: [105.70, 29.23],
store: 9887, team: 1562,
},
{
name: '泸县', value: [105.372029, 29.141426],
store: 9999, team: 1000,
},
]
const customFormatter = (params) => { const customFormatter = (params) => {
// console.log(params.data); // console.log(params.data);
return `{img|${params.data.name}}\n{t|店铺${params.data.store}个, 团队${params.data.team}个}` return `{img|${params.data.street_name}}\n{t|店铺${params.data.mer_count}个, 团队${params.data.service_group_count}个}`
} }
const initDateValue = () => { const initDataValue = () => {
dataValue.forEach(item => { dataValue.forEach(item => {
item.label = { item.label = {
show: true, // show: true, //
@ -279,13 +263,14 @@ const initMap = () => {
} }
onMounted(() => { onMounted(() => {
changeType(appStore.map_info); dataValue = props.list;
initDateValue(); changeType('xuyong');
initDataValue();
initMap(); initMap();
nextTick(() => { nextTick(() => {
mitt.on('map_info', e => { mitt.on('map_info', e => {
changeType(e.pinyin); changeType(e.pinyin);
initDateValue(); initDataValue();
initMap(); initMap();
}) })
}) })

View File

@ -98,6 +98,7 @@ const submit = () => {
<button class="btn" @click="submit">登录</button> <button class="btn" @click="submit">登录</button>
</div> </div>
</div> </div>
<div class="title"><span>吟龙物流信息监控溯源可视化大屏</span></div>
</div> </div>
</dv-full-screen-container> </dv-full-screen-container>
</template> </template>
@ -115,6 +116,29 @@ const submit = () => {
background-image: url(../../assets/login_img/bg.png); background-image: url(../../assets/login_img/bg.png);
background-size: 100% 100%; background-size: 100% 100%;
overflow: hidden; overflow: hidden;
position: relative;
.title {
position: absolute;
top: 20%;
right: 10%;
width: 35%;
padding-bottom: 0.4rem;
height: 4rem;
line-height: 4rem;
font-size: 2.6rem;
font-family: "ifonts";
background-image: url(../../assets/login_img/title.png);
background-size: 100% 100%;
span {
background-image: -webkit-linear-gradient(top, #061028, #144e8b);
-webkit-background-clip: text;
/* -webkit-text-fill-color: transparent; */
color: rgba(0, 0, 0, 0);
-webkit-text-stroke-color: #5fa2ec;
-webkit-text-stroke-width: 1px;
}
}
} }
.form { .form {