Browse Source

地图加乡镇名字、态势修改

master
changtong 6 months ago
parent
commit
bb0f3d9913
  1. 4
      config/index.js
  2. 289
      src/views/screen/components/gisMapOfCounty.vue
  3. 6
      src/views/screen/county-screen.vue
  4. 301
      src/views/screen/global-travel.vue
  5. 81
      src/views/screen/smart-travel.vue

4
config/index.js

@ -12,8 +12,8 @@ module.exports = {
assetsPublicPath: '/',
proxyTable: {
'/api': {
target: 'http://localhost:9990',
// target: 'http://60.255.186.185:9024/api',
// target: 'http://localhost:9990',
target: 'http://60.255.186.185:9024/api',
changeOrigin: true,
pathRewrite: {
'^/api': ''

289
src/views/screen/components/gisMapOfCounty.vue

@ -4,7 +4,12 @@
<slot name="content" class="content"></slot>
<commonModal v-model="pointsState" width="800" title="聚合列表">
<div class="points">
<div class="item" v-for="(item, index) in points" :key="index" @click="getPoint(item.point)">
<div
class="item"
v-for="(item, index) in points"
:key="index"
@click="getPoint(item.point)"
>
{{ item.point[listItemKey] }}
</div>
</div>
@ -92,7 +97,7 @@ export default {
props: {
center: {
type: Array,
default: () => [104.619853, 28.900000],
default: () => [104.619853, 28.9],
},
zoom: {
type: Number,
@ -180,48 +185,214 @@ export default {
getTileUrl: (x, y, z) =>
`http://t0.tianditu.gov.cn/DataServer?T=img_w&tk=${this.common.mapKey}&x=${x}&y=${y}&l=${z}`,
});
this.map = new AMap.Map("center-map", {
layers: this.common.isSkyMap ? [imgLayer] : [new AMap.TileLayer.RoadNet()],
zoom: this.zoom,
zooms: [3, 16],
scrollWheel: true,
center: this.center || [104.62, 28.77], //
viewMode: "3D",
resizeEnable: true,
mapStyle: "amap://styles/darkblue",
features: ["bg", "road", "building", "point"],
const district = new AMap.DistrictSearch({
subdistrict: 3,
extensions: "all",
level: "district",
});
this.map.on("complete", () => {
if (this.aggregationPoint) {
this.aggregationPoint(this.pointList);
}
this.addPoints(); //
district.search(this.districtLocation, (status, result) => {
const bounds = result.districtList[0].boundaries;
const mask = bounds.map((bound) => [bound]);
const polygons = bounds.map(
(bound) =>
new AMap.Polygon({
strokeWeight: 1,
path: bound,
strokeColor: "#4dd6e6", // 线
strokeWeight: 3, // 线
fillColor: "#102C4F", //
fillOpacity: 0.5, //
})
);
this.map = new AMap.Map("center-map", {
mask,
layers: this.common.isSkyMap
? [imgLayer]
: [new AMap.TileLayer.RoadNet()],
zoom: this.zoom,
zooms: [3, 16],
scrollWheel: true,
center: this.center || [104.62, 28.77], //
viewMode: "3D",
resizeEnable: true,
mapStyle: "amap://styles/darkblue",
features: ["bg", "road", "building", "point"],
});
this.map.add(polygons);
this.map.on("complete", () => {
//
// this.loadCuiPingDistrict();
//
this.loadTownName();
if (this.aggregationPoint) {
this.aggregationPoint(this.pointList);
}
this.addPoints(); //
});
});
// GeoJSON
this.loadGeoJSON();
//
this.loadCuiPingDistrict();
// this.loadGeoJSON();
//
// this.map.on('click', this.handleMapClick);
},
loadTownName() {
let townNameList = [
{
name: "西郊街道",
center: [104.599429, 28.749492],
},
{
name: "安阜街道",
center: [104.609625, 28.78448],
},
{
name: "白沙湾街道",
center: [104.662791, 28.776612],
},
{
name: "象鼻街道",
center: [104.623461, 28.807056],
},
{
name: "沙坪街道",
center: [104.801208, 28.837212],
},
{
name: "合江门街道",
center: [104.63139, 28.767009],
},
{
name: "大观楼街道",
center: [104.621645, 28.764587],
},
{
name: "双城街道",
center: [104.73105, 28.862117],
},
{
name: "李庄镇",
center: [104.800546, 28.79974],
},
{
name: "菜坝镇",
center: [104.558742, 28.790712],
},
{
name: "金坪镇",
center: [104.749651, 28.906222],
},
{
name: "牟坪镇",
center: [104.879597, 28.651344],
},
{
name: "李端镇",
center: [104.860381, 28.598191],
},
{
name: "宗场镇",
center: [104.572331, 28.852856],
},
{
name: "宋家镇",
center: [104.860345, 28.747853],
},
{
name: "思坡镇",
center: [104.532224, 28.812268],
},
{
name: "思坡镇",
center: [104.532224, 28.812268],
},
{
name: "白花镇",
center: [104.614897, 29.09301],
},
{
name: "双谊镇",
center: [104.564516, 28.904037],
},
{
name: "永兴镇",
center: [104.562846, 29.023149],
},
{
name: "金秋湖镇",
center: [104.715309, 28.981108],
},
];
townNameList.forEach((item) => {
const labelMarker = new AMap.Marker({
position: item.center,
// zIndex: 500,
clickable: true,
content: `
<div style="
font-size: 16px;
font-weight: bold;
color: rgba(255, 255, 255, 0.6);
width: max-content;
">
${item.name}
</div>
`,
offset: new AMap.Pixel(-25, -10), //
});
// hover
labelMarker.on("mouseover", () => {
labelMarker.setContent(`
<div style="
font-size: 20px;
font-weight: bold;
color: #C6E1CA;
width: max-content;
">
${item.name}
</div>
`);
});
labelMarker.on("mouseout", () => {
labelMarker.setContent(`
<div style="
font-size: 16px;
font-weight: bold;
color: rgba(255, 255, 255, 0.6);
width: max-content;
">
${item.name}
</div>
`);
});
//
labelMarker.on("click", () => {
this.$emit("enterTown", item.name); //
});
labelMarker.setMap(this.map);
});
},
handleMapClick(e) {
const lngLat = e.lnglat;
console.log('点击坐标:', lngLat);
console.log("点击坐标:", lngLat);
this.polygons.forEach(polygon => {
this.polygons.forEach((polygon) => {
const path = polygon.getPath();
const isInPolygon = AMap.GeometryUtil.isPointInRing(lngLat.toArray(), path.map(p => p.toArray()));
const isInPolygon = AMap.GeometryUtil.isPointInRing(
lngLat.toArray(),
path.map((p) => p.toArray())
);
console.log('多边形:', isInPolygon);
console.log("多边形:", isInPolygon);
if (isInPolygon) {
const name = polygon.getExtData().name;
console.log('点击:', name);
console.log("点击:", name);
this.map.setZoomAndCenter(10, lngLat); //
alert(`您点击了乡镇:${name}`);
}
@ -235,31 +406,38 @@ export default {
});
const self = this; // 便使
districtSearch.search(this.districtLocation, function (status, result) {
if (status === "complete" && result.districtList && result.districtList.length) {
const district = result.districtList[0];
const boundaries = district.boundaries;
if (boundaries) {
//
self.drawCuiPingBase(boundaries);
districtSearch.search(
this.districtLocation,
function (status, result) {
if (
status === "complete" &&
result.districtList &&
result.districtList.length
) {
const district = result.districtList[0];
const boundaries = district.boundaries;
if (boundaries) {
//
self.drawCuiPingBase(boundaries);
} else {
console.warn("翠屏区无边界数据");
}
} else {
console.warn("翠屏区无边界数据");
console.error("行政区查询失败: " + status);
}
} else {
console.error("行政区查询失败: " + status);
}
});
);
},
drawCuiPingBase(boundaries) {
const mask = boundaries.map((boundary) => [boundary]);
boundaries.forEach((boundary) => {
const polygon = new AMap.Polygon({
path: boundary,
strokeColor: "#333", // 线
strokeColor: "#4dd6e6", // 线
strokeWeight: 3, // 线
fillColor: "#102C4F", //
fillOpacity: 0.7, //
fillOpacity: 0.5, //
});
this.map.add(polygon);
});
@ -277,9 +455,9 @@ export default {
},
loadGeoJSON() {
// 使 require GeoJSON
const geojsonData = require('@/assets/geojson/town_boundaries.geojson');
const geojsonData = require("@/assets/geojson/town_boundaries.geojson");
const colors = ['#33FFD450']; //
const colors = ["#33FFD450"]; //
// GeoJSON
geojsonData.features.forEach((feature, index) => {
@ -287,15 +465,17 @@ export default {
const name = properties.name; //
const coordinates = geometry.coordinates[0]; //
const center = this.getPolygonCenter(coordinates); //
console.log('多边形中心点:', center);
console.log("多边形中心点:", center);
//
const polygon = new AMap.Polygon({
zIndex: 100,
path: coordinates[0].map((coord) => new AMap.LngLat(coord[0], coord[1])), // AMap
path: coordinates[0].map(
(coord) => new AMap.LngLat(coord[0], coord[1])
), // AMap
strokeColor: colors[index % colors.length], // 线
strokeWeight: 2, // 线
fillColor: '#0A7EA8', //
fillColor: "#0A7EA8", //
fillOpacity: 0.5, //
bubble: true, //
});
@ -319,11 +499,11 @@ export default {
${name}
</div>
`,
offset: new AMap.Pixel(-25, -25), //
offset: new AMap.Pixel(-25, -25), //
});
// hover
labelMarker.on('mouseover', () => {
labelMarker.on("mouseover", () => {
labelMarker.setContent(`
<div style="
font-size: 20px;
@ -336,7 +516,7 @@ export default {
`);
});
labelMarker.on('mouseout', () => {
labelMarker.on("mouseout", () => {
labelMarker.setContent(`
<div style="
font-size: 16px;
@ -350,8 +530,8 @@ export default {
});
//
labelMarker.on('click', () => {
this.$emit('enterTown', name); //
labelMarker.on("click", () => {
this.$emit("enterTown", name); //
});
labelMarker.setMap(this.map);
@ -382,7 +562,10 @@ export default {
console.warn(`无效的坐标 ${index}:`, coord); //
}
});
return [lngSum / coordinates[0].length, latSum / coordinates[0].length];
return [
lngSum / coordinates[0].length,
latSum / coordinates[0].length,
];
},
aggregationPoint(pointList) {

6
src/views/screen/county-screen.vue

@ -5,13 +5,7 @@
<gis-map
ref="gisMapRef"
class="gismap"
pointType="全域旅游"
:point-list="dataList"
@currentPoint="currentPointFn"
@enterTown="enterTown"
:lngLat="lngLat"
list-item-key="name"
>
<template v-slot:content>
<div class="left">

301
src/views/screen/global-travel.vue

@ -2,16 +2,31 @@
<!-- 全域旅游 -->
<div class="eb-container" ref="appRef">
<MainTitle class="title" :title="title"></MainTitle>
<gis-map ref="gisMapRef" class="gismap" pointType="全域旅游" :point-list="dataList" @currentPoint="currentPointFn"
:lngLat="lngLat" list-item-key="name">
<gis-map
ref="gisMapRef"
class="gismap"
pointType="全域旅游"
:point-list="dataList"
@currentPoint="currentPointFn"
:lngLat="lngLat"
list-item-key="name"
>
<template v-slot:content>
<div class="center-window">
<div class="top-title" v-for="(item, index) in iconList" @click="changeType(item, index)">
<div
class="top-title"
v-for="(item, index) in iconList"
@click="changeType(item, index)"
>
<img :src="item.icon" />
<div class="text">
<p class="text-name">{{ item.label }}</p>
<p class="text-type">
<CountTo :startVal="0" :endVal="item.count" :duration="2000" />
<CountTo
:startVal="0"
:endVal="item.count"
:duration="2000"
/>
</p>
</div>
</div>
@ -22,9 +37,16 @@
</div>
<div class="content-info">
<div class="content-inof-list">
<div class="content-info-item" v-for="(item, index) in travleList" :key="index"
@click="selectTravelInfoById(item.id, item)">
<div class="content-info-item-title" style="font-size: 20px; color: #fff">
<div
class="content-info-item"
v-for="(item, index) in dataList"
:key="index"
@click="selectTravelInfoById(item.id, item)"
>
<div
class="content-info-item-title"
style="font-size: 20px; color: #fff"
>
{{ item.name }}
</div>
</div>
@ -38,66 +60,150 @@
<div class="content-info">
<!-- title -->
<div class="content-info-title">
<span style="
<span
style="
font-size: 24px;
color: #fff;
font-weight: bold;
">{{ detailInfo.name }}</span>
"
>{{ detailInfo.name }}</span
>
<span style="font-size: 18px; color: #c9c9c9">{{
typeList[detailInfo.type]
}}</span>
</div>
<!-- content -->
<div class="content-info-content" style="margin-top: 20px">
<span style="font-size: 24px; color: #fff">基础信息</span>
<div style="margin-top: 10px" v-if="detailInfo.address">
<span style="font-size: 18px; color: #c9c9c9">地址:
<div
class="content-info-content"
style="margin-top: 20px"
>
<!-- <div
style="
font-size: 24px;
color: #fff;
margin-bottom: 10px;
"
v-if="detailInfo.deviceUrl"
>
<span>资源监控</span>
<Button
type="text"
class="text-button"
@click="playMonitor"
>点击播放</Button
>
</div> -->
<span style="font-size: 24px; color: #fff"
>基础信息</span
>
<div
style="margin-top: 10px"
v-if="detailInfo.address"
>
<span style="font-size: 18px; color: #c9c9c9"
>地址:
</span>
<span style="font-size: 18px; color: #fff">{{
detailInfo.address
}}</span>
</div>
<!-- 工作时间 -->
<div style="margin-top: 10px" v-if="detailInfo.openHours">
<span style="font-size: 18px; color: #c9c9c9">工作时间:
<div
style="margin-top: 10px"
v-if="detailInfo.openHours"
>
<span style="font-size: 18px; color: #c9c9c9"
>工作时间:
</span>
<span style="font-size: 18px; color: #fff">{{
detailInfo.openHours
}}</span>
</div>
<!-- 简介 -->
<div style="margin-top: 10px" v-if="detailInfo.remark">
<span style="font-size: 18px; color: #c9c9c9">简介:
<div
style="margin-top: 10px"
v-if="detailInfo.remark"
>
<span style="font-size: 18px; color: #c9c9c9"
>简介:
</span>
<span style="font-size: 18px; color: #fff">{{
detailInfo.remark
}}</span>
</div>
<div
style="margin-top: 10px"
v-if="detailInfo.deviceUrl"
>
<span style="font-size: 18px; color: #c9c9c9"
>监控:
</span>
<video
:src="detailInfo.deviceUrl"
autoplay
controls
style="width: 100%; height: 200px"
></video>
</div>
<!-- 视频 -->
<div
style="margin-top: 10px"
v-else-if="detailInfo.videoList"
>
<span style="font-size: 18px; color: #c9c9c9"
>视频:
</span>
<video
:src="detailInfo.videoList"
autoplay
controls
style="width: 100%; height: 200px"
></video>
</div>
<!-- 图片 -->
<div style="margin-top: 10px" v-if="detailInfo.coverImage">
<span style="font-size: 18px; color: #c9c9c9">图片:
<div
style="margin-top: 10px"
v-else-if="detailInfo.coverImage"
>
<span style="font-size: 18px; color: #c9c9c9"
>图片:
</span>
<img :src="detailInfo.coverImage" alt="" style="width: 100%; height: 200px" />
<img
:src="detailInfo.coverImage"
alt=""
style="width: 100%; height: 200px"
/>
</div>
<div style="
<div
style="
display: flex;
align-items: center;
margin-top: 20px;
">
<Button type="text" class="text-button" @click="
openLineOrPlayAudio(detailInfo.type)
">
"
>
<Button
type="text"
class="text-button"
@click="
openLineOrPlayAudio(detailInfo.type)
"
>
{{
detailInfo.type == 4
? "播放音频"
? "语音讲解"
: detailInfo.type == "2"
? "查看路线"
: ""
? "查看路线"
: ""
}}
</Button>
<!-- 音频播放 -->
<audio ref="audioRef" class="audio-controls" v-if="detailInfo.type == 4"
:src="detailInfo.audioList" controls></audio>
<audio
ref="audioRef"
class="audio-controls"
v-if="detailInfo.type == 4"
:src="detailInfo.audioList"
controls
></audio>
</div>
</div>
</div>
@ -105,19 +211,33 @@
</template>
</gis-map>
<div class="page-bottom-bg"></div>
<div class="page-left-bg"></div>
<div class="page-right-bg"></div>
<commonModal v-model="lineVisible" title="相关路线" width="600">
<div class="line-box">
<div class="line-item" v-for="(item, index) in lineList" @click="openLine(item)" :key="index">
<span class="line-title">线路名称{{ item.lineName }}</span>
<div
class="line-item"
v-for="(item, index) in lineList"
@click="openLine(item)"
:key="index"
>
<span class="line-title"
>线路名称{{ item.lineName }}</span
>
<div class="line-content">
<span>线路途经{{ item.lineText }}</span>
</div>
</div>
</div>
</commonModal>
<commonModal
v-model="showPlayer"
title="资源监控"
width="800"
@close="showPlayer = false"
>
<commonLivePlayer :videoUrl="videoUrl"></commonLivePlayer>
</commonModal>
</div>
</template>
@ -126,14 +246,17 @@ import { useIndex } from "../../utils/utilsDramAdmin";
import MainTitle from "./components/MainTitle.vue";
import gisMap from "./components/gisMapOfCounty.vue";
import commonModal from "@/views/common-components/common-modal.vue";
import commonLivePlayer from "../common-components/common-live-player.vue";
export default {
name: "GlobalTravel",
components: { MainTitle, gisMap, commonModal },
components: { MainTitle, gisMap, commonModal, commonLivePlayer },
data() {
return {
title: "全域旅游",
boxTitle: "资源详情",
videoUrl: "",
showPlayer: false,
columns: [
//
{
@ -164,6 +287,7 @@ export default {
],
lineList: [],
lineVisible: false,
// 1 2 3 4 5 6
// 1宿 2 3 4 5 6 7 8
typeList: {
1: "住宿",
@ -175,17 +299,17 @@ export default {
7: "停车场",
8: "游客服务",
},
type: "",
type: "2",
iconList: [
// 1 2 3 4 5 6
{ icon: require("@/assets/mapIcon/jd.png"), label: "住宿", count: 0, type: "1" },
{ icon: require("@/assets/mapIcon/jq.png"), label: "景点", count: 0, type: "2" },
{ icon: require("@/assets/mapIcon/fd.png"), label: "美食", count: 0, type: "3" },
{ icon: require("@/assets/mapIcon/jj.png"), label: "讲解", count: 0, type: "4" },
{ icon: require("@/assets/mapIcon/sd.png"), label: "商店", count: 0, type: "5" },
{ icon: require("@/assets/mapIcon/wsj.png"), label: "卫生间", count: 0, type: "6" },
{ icon: require("@/assets/mapIcon/fwq.png"), label: "停车场", count: 0, type: "7" },
{ icon: require("@/assets/mapIcon/ykzx.png"), label: "游客服务", count: 0, type: "8" },
{icon: require("@/assets/mapIcon/jd.png"), label: "住宿", count: 0, type: "1"},
{icon: require("@/assets/mapIcon/jq.png"), label: "景点", count: 0, type: "2"},
{icon: require("@/assets/mapIcon/fd.png"), label: "美食", count: 0, type: "3"},
{icon: require("@/assets/mapIcon/jj.png"), label: "讲解", count: 0, type: "4"},
{icon: require("@/assets/mapIcon/sd.png"), label: "商店", count: 0, type: "5"},
{icon: require("@/assets/mapIcon/wsj.png"), label: "卫生间", count: 0, type: "6"},
{icon: require("@/assets/mapIcon/fwq.png"), label: "停车场", count: 0, type: "7"},
{icon: require("@/assets/mapIcon/ykzx.png"), label: "游客服务", count: 0, type: "8"},
],
travleList: [],
detailInfo: {},
@ -201,21 +325,22 @@ export default {
};
},
computed: {},
created() {
},
created() {},
mounted() {
const { calcRate, windowDraw } = useIndex(this.$refs.appRef);
calcRate();
windowDraw();
this.$nextTick(() => {
this.queryTravelInfoPage();
});
this.queryTravelAll();
this.queryTravelInfoPage();
// this.getIconList();
},
beforeDestroy() {
},
beforeDestroy() {},
methods: {
playMonitor() {
this.videoUrl = this.detailInfo.deviceUrl;
this.showPlayer = true;
},
selectTravelLineById(id, index) {
this.$http
.post(
@ -366,7 +491,11 @@ export default {
.then((res) => {
if (res.data.code == 200) {
this.lineList = res.data.data.records;
this.lineVisible = true;
if (this.lineList.length > 0) {
this.lineVisible = true;
} else {
this.$message.info("没有该景点的路线");
}
this.lineList.forEach((item, index) => {
this.selectTravelLineById(item.id, index);
});
@ -377,7 +506,6 @@ export default {
if (type == 4) {
this.$refs.audioRef.play();
} else if (type == 2) {
this.boxTitle = "旅游线路";
this.getLineList(this.detailInfo.id);
}
},
@ -422,7 +550,7 @@ export default {
// });
// },
selectTravelInfoById(id, item) {
// this.lngLat = [item.longitude, item.latitude];
// this.lngLat = item.lnglat;
if (this.driving != null) {
this.driving.clear();
this.$refs.gisMapRef.map.clearMap();
@ -491,6 +619,33 @@ export default {
}
});
},
queryTravelAll() {
const params = {
pageNum: 1,
pageSize: 10000,
type: "",
};
this.$http
.post(
"/travel/queryTravelInfoPage",
this.common.request(params)
)
.then((res) => {
if (res.data.code == 200) {
this.travleList = this.assembleData(
res.data.data.records
);
this.iconList.forEach((item) => {
let list = this.travleList.filter((element) => {
if (item.type == element.type) {
return true;
}
});
item.count = list.length;
});
}
});
},
},
};
</script>
@ -547,26 +702,27 @@ export default {
.content-info-item {
width: 100%;
height: 50px;
background: url("../../assets/largeScreen/list-item-bg.png") no-repeat;
line-height: 50px;
background: url("../../assets/largeScreen/list-item-bg.png")
no-repeat;
background-size: 100% 100%;
display: flex;
justify-content: flex-start;
align-items: center;
box-sizing: border-box;
cursor: pointer;
padding: 20px;
padding: 0 20px;
box-sizing: border-box;
border-radius: 5px;
box-shadow: 0.5px 1px 1.5px #293240;
transition: all 0.1s ease-in-out;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
&:hover {
background-image: linear-gradient(90deg,
#12181f 0%,
#293240 100%);
background-image: linear-gradient(
90deg,
#12181f 0%,
#293240 100%
);
}
}
}
@ -584,7 +740,10 @@ export default {
.content-pub-style(100%, calc(100% - 44px));
padding: 10px 20px;
box-sizing: border-box;
overflow: auto;
&::-webkit-scrollbar {
display: none;
}
.content-info-title {
display: flex;
flex-direction: column;
@ -609,9 +768,11 @@ export default {
width: 100%;
height: 140px;
border-radius: 8px;
background: linear-gradient(180deg,
rgba(0, 125, 165, 0.24) 0%,
rgba(1, 10, 43, 0) 100%);
background: linear-gradient(
180deg,
rgba(0, 125, 165, 0.24) 0%,
rgba(1, 10, 43, 0) 100%
);
display: flex;
flex-direction: column;
justify-content: space-between;
@ -740,9 +901,11 @@ export default {
width: 100%;
height: 140px;
border-radius: 8px;
background: linear-gradient(180deg,
rgba(0, 125, 165, 0.24) 0%,
rgba(1, 10, 43, 0) 100%);
background: linear-gradient(
180deg,
rgba(0, 125, 165, 0.24) 0%,
rgba(1, 10, 43, 0) 100%
);
display: flex;
flex-direction: column;
justify-content: space-between;

81
src/views/screen/smart-travel.vue

@ -42,13 +42,23 @@
}}</span>
</div>
</div>
<div class="video-list" v-else style="display: flex;justify-content: center;align-items: center;font-size: 18px;color: #aaaaaa;">
<div
class="video-list"
v-else
style="
display: flex;
justify-content: center;
align-items: center;
font-size: 18px;
color: #aaaaaa;
"
>
暂无监控资源
</div>
</div>
<div class="top-right-data">
<div
class="content-box"
class="content-box-item"
style="width: 100%; height: 25%"
>
<div class="box-title">实时客流</div>
@ -77,7 +87,7 @@
</div>
</div>
<div
class="content-box"
class="content-box-item"
style="width: 100%; height: 25%"
>
<div class="box-title">实时累计客流</div>
@ -106,7 +116,7 @@
</div>
</div>
<div
class="content-box"
class="content-box-item"
style="width: 100%; height: 48%"
>
<div class="box-title">实时客流来源</div>
@ -163,15 +173,15 @@
</div>
</div>
<div class="bottom-content">
<div class="content-box" style="width: 33%">
<div class="content-box-item" style="width: 33%">
<div class="box-title">近七日客流趋势</div>
<div id="chart1" style="flex: 1"></div>
</div>
<div class="content-box" style="width: 33%">
<div class="content-box-item" style="width: 33%">
<div class="box-title">客流年龄结构</div>
<div id="chart2" style="flex: 1"></div>
</div>
<div class="content-box" style="width: 33%">
<div class="content-box-item" style="width: 33%">
<div class="box-title">停留时长分布</div>
<div id="chart3" style="flex: 1"></div>
</div>
@ -555,7 +565,7 @@ export default {
this.videoList = [];
this.videoUrl = "";
this.currentTreeItem = data;
echartsClear()
echartsClear();
this.realtimeTourist();
this.touristCumulative();
this.beforeDaysTourist();
@ -582,11 +592,8 @@ export default {
pageSize: 100,
};
} else if (this.currentTreeItem.title == "合江门冠英街") {
params = {
pageNum: 1,
pageSize: 100,
deviceName: "合江门",
};
this.queryHJandGY();
return;
}
this.$http
.post("device/queryDeviceInfoPage", this.common.request(params))
@ -599,6 +606,46 @@ export default {
}
});
},
queryHJandGY() {
//
let params1 = {
pageNum: 1,
pageSize: 100,
deviceName: "合江门",
};
this.$http
.post(
"device/queryDeviceInfoPage",
this.common.request(params1)
)
.then((res) => {
if (res.data.code == 200) {
this.videoList = this.videoList.concat(
res.data.data.records
);
if (this.videoList.length > 0) {
this.changeVideo(this.videoList[0], 0);
}
}
});
let params2 = {
pageNum: 1,
pageSize: 100,
deviceType: "冠英街",
};
this.$http
.post(
"device/queryDeviceInfoPage",
this.common.request(params2)
)
.then((res) => {
if (res.data.code == 200) {
this.videoList = this.videoList.concat(
res.data.data.records
);
}
});
},
//
realtimeTourist() {
let params = {
@ -670,11 +717,11 @@ export default {
if (res.data.code == 200) {
let xData = res.data.data.map((item) => {
if (item.key == "3") {
item.key = item.key + '日及以上'
item.key = item.key + "日及以上";
} else {
item.key = item.key + '日'
item.key = item.key + "日";
}
return item.key
return item.key;
});
let yData = res.data.data.map((item) =>
parseFloat((item.value * 100).toFixed(2))
@ -863,7 +910,7 @@ export default {
}
}
}
.content-box {
.content-box-item {
width: 300px;
height: 100%;
background-color: #3b3d43;

Loading…
Cancel
Save