地图右侧统计

master
许宏杰 3 weeks ago
parent f6af695bcf
commit 41e7da9efc

@ -51,6 +51,7 @@
"js-cookie": "3.0.1", "js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1", "jsencrypt": "3.0.0-rc.1",
"leaflet": "^1.9.4", "leaflet": "^1.9.4",
"moment": "^2.30.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"postcss-px-to-viewport": "^1.1.1", "postcss-px-to-viewport": "^1.1.1",
"quill": "1.3.7", "quill": "1.3.7",

@ -179,3 +179,11 @@ export function exportLog(params) {
params, params,
}); });
} }
export function getrealTime(params) {
return request({
url: "/taicangpop/tc/tcUpdate",
method: "get",
params,
});
}

@ -22,11 +22,11 @@ const xiaoqu = {
for (let key in query) { for (let key in query) {
state.queryParmas[key] = query[key]; state.queryParmas[key] = query[key];
} }
if (query.buildingId) {
// if (query.buildingid) { state.panel.rightPanel = true;
// state.panel.bottomPanel = true; state.panel.bottomPanel = true;
// return; return;
// } }
if ( if (
query.color || query.color ||
query.type || query.type ||
@ -61,7 +61,7 @@ const xiaoqu = {
state.queryParmas = { state.queryParmas = {
xiaoquId: undefined, //小区 xiaoquId: undefined, //小区
parentid: undefined, //网格 parentid: undefined, //网格
buildingid: undefined, //楼栋 buildingId: undefined, //楼栋
deptId: undefined, //苑id deptId: undefined, //苑id
color: undefined, color: undefined,
type: undefined, type: undefined,
@ -70,7 +70,6 @@ const xiaoqu = {
isx: undefined, isx: undefined,
isj: undefined, isj: undefined,
}; };
console.log(state.queryParmas);
}, },
}, },
actions: { actions: {
@ -84,8 +83,8 @@ const xiaoqu = {
deptId: deptData.deptId, deptId: deptData.deptId,
}); });
commit("CHANGE_QUERY", { commit("CHANGE_QUERY", {
buildingid: buildingData.id, buildingId: buildingData.id,
deptId: deptData.deptId, // deptId: deptData.deptId,
}); });
}, },
}, },

@ -11,3 +11,5 @@ export { default as buildingStatistics } from "./xiaoqu/leftData/buildingStatist
export { default as mapSearchBox } from "./xiaoqu/mapSearchBox.vue"; export { default as mapSearchBox } from "./xiaoqu/mapSearchBox.vue";
export { default as bottomList } from "./xiaoqu/bottomList.vue"; export { default as bottomList } from "./xiaoqu/bottomList.vue";
export { default as xiaoquRight } from "./xiaoqu/rightData/index.vue";

@ -84,10 +84,9 @@ export default {
if (!e.id) { if (!e.id) {
if (_this.geoJsonLayerDTH && _this.geoJsonLayerDTH.length > 0) if (_this.geoJsonLayerDTH && _this.geoJsonLayerDTH.length > 0)
map.getLayerById("dth").clear(); // map.getLayerById("dth").clear(); //
_this.$store.commit("CHANGE_QUERY", { _this.$store.commit("CHANGE_QUERY", {
buildingid: undefined, buildingId: undefined,
deptId: undefined, // deptId: undefined,
}); // }); //
} }
}); });
@ -367,10 +366,6 @@ export default {
outlineWidth: 2, outlineWidth: 2,
}); });
} }
// _this.$store.commit("CHANGE_QUERY", {
// buildingid: 20,
// deptId: 30,
// });
_this.$store.dispatch("GetBuildingId", { _this.$store.dispatch("GetBuildingId", {
deptName: e.target.attr.yuanName, deptName: e.target.attr.yuanName,
name: e.target.attr.buildingNumber + "幢", name: e.target.attr.buildingNumber + "幢",

@ -0,0 +1,153 @@
<template>
<div class="color-list">
<div class="list-item" v-for="(item, index) in colorListL" :key="index">
<div class="item-name">
<ColorCell
:item="item"
v-if="item.color"
size="small"
class="color-item"
/>
<span>
{{ item.name }}
<span v-show="item.name == ''"
>(空关{{ colorListL[2].house }})</span
>
<span v-show="item.name == ''"
>(空关{{ colorListL[6].house }})</span
>
</span>
</div>
<div class="item-value">
<span>{{ item.house }}</span>
<span> </span>
<span>{{ item.person }}</span>
<span> </span>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import ColorCell from "@/components/ColorCell";
import { getColorList } from "@/api/taicangpop/new.js";
export default {
components: {
ColorCell,
},
data() {
return {
colorListL: [],
};
},
watch: {
queryParamsXiaoqu: {
handler(val) {
this.getColor();
},
deep: true,
},
},
computed: {
...mapGetters(["queryParamsXiaoqu", "leftColor", "rightTopColor"]),
},
created() {
this.getColor();
},
methods: {
async getColor() {
let res = await getColorList(this.queryParamsXiaoqu);
this.colorListL = this.resetColor(res.data);
},
resetColor(colorList) {
const nameOrder = ["HZ", "HL", "HO", "HF", "NZ", "NL", "NO", "NF"];
colorList.map((item) => {
let isColor = /^[a-zA-Z]+$/.test(item.name);
if (isColor) {
item.color = item.name;
for (let key in this.leftColor) {
if (item.name == key) {
item.leftColor = this.leftColor[key];
item.rightTopColor = this.rightTopColor[key];
}
}
}
});
// 便
const orderMap = nameOrder.reduce((map, name, index) => {
map[name] = index;
return map;
}, {});
//
let sortedArr = colorList.sort((obj1, obj2) => {
return orderMap[obj1.name] - orderMap[obj2.name];
});
return sortedArr;
},
},
};
</script>
<style lang="scss" scoped>
.color-list {
margin-top: 6px;
height: 59%;
background: rgba(15, 42, 79, 0.6);
border: 1px solid #1d5acc;
border-radius: 6px;
display: flex;
flex-direction: column;
padding: 10px 13px;
.list-item {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid rgba(0, 156, 255, 0.2);
.item-name {
display: flex;
align-items: center;
font-size: 15px;
color: #abc7ed;
font-family: "Alibaba-PuHuiTi-Regular.otf";
}
.item-value {
span:nth-child(odd) {
font-size: 15px;
color: #52ccff;
font-family: "DIN-Medium-2.otf";
}
span:nth-child(even) {
font-size: 14px;
color: #c9e1f5;
}
}
}
& > .list-item:last-child {
border: 0;
}
.list-item:nth-child(9) .item-value,
.list-item:nth-child(10) .item-value {
span:nth-child(odd) {
font-size: 15px;
color: #ffb400;
font-family: "DIN-Medium-2.otf";
}
}
.list-item:nth-child(9),
.list-item:nth-child(10) {
.item-name {
color: #fff;
}
}
// .list-item:nth-child(10) {
// border: 0;
// }
}
.color-item {
margin-right: 10px;
}
</style>

@ -0,0 +1,30 @@
<template>
<div class="info-container">
<threeCell />
<colorList />
<realTimeList />
</div>
</template>
<script>
import threeCell from "./threeCell.vue";
import colorList from "./colorList.vue";
import realTimeList from "./realTimeList.vue";
export default {
data() {
return {};
},
components: { threeCell, colorList, realTimeList },
};
</script>
<style lang="scss" scoped>
.info-container {
flex: 1;
box-sizing: border-box;
padding: 15px 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
</style>

@ -0,0 +1,216 @@
<template>
<div class="realTime">
<introduceTitle title="本月实时数据更新情况"></introduceTitle>
<div class="total-num">
<div>
已更新<span style="color: #ff9e00">{{ totalData.houseCount }}</span
><span style="color: #ff9e00">{{ totalData.count }}</span
>
</div>
</div>
<transition-group
name="animate__animated animate__bounce"
tag="ul"
enter-active-class="animate__zoomInRight"
leave-active-class="animate__zoomOutRight"
class="container"
v-if="items.length > 0"
id="scrollContainer"
appear
>
<div v-for="item in items" :key="item.uuid" class="item">
<span style="flex: 1.3"
>{{ item.deptName }}{{ item.buildingName }}{{ item.houseName }}</span
>
<span style="color: #00fbc6">
{{ momentjs(item.updateTime).format("YYYY-MM-DD") }}</span
>
<span style="flex: 1.2; color: #18b9f1"
>网格员:{{ item.updateBy }}</span
>
</div>
</transition-group>
<div class="container isNoData" v-else></div>
</div>
</template>
<script>
import introduceTitle from "@/views/components/introduceTitle/subTtile.vue";
import { getrealTime } from "@/api/home/index.js";
import { mapGetters } from "vuex";
export default {
components: {
introduceTitle,
},
data() {
const moment = require("moment");
return {
momentjs: moment,
timer: null,
queryParmas: {
startTime: undefined,
buildingId: undefined,
parentid: undefined,
},
totalData: {
houseCount: 0,
count: 0,
},
items: [],
};
},
watch: {
"queryParamsXiaoqu.parentid"(newValue, oldValue) {
this.handleChange();
},
"queryParamsXiaoqu.buildingId"(newValue, oldValue) {
this.handleChange();
},
},
computed: {
...mapGetters(["queryParamsXiaoqu"]),
},
created() {
this.queryParmas = {
buildingId: this.queryParamsXiaoqu.buildingId,
parentid: this.queryParamsXiaoqu.parentid,
xiaoquId: this.queryParamsXiaoqu.xiaoquId,
};
this.reset();
},
beforeDestroy() {
clearInterval(this.timer);
},
methods: {
handleChange() {
if (process.env.NODE_ENV === "development") return;
this.queryParmas.startTime = undefined;
clearInterval(this.timer);
this.totalData = {
houseCount: 0,
count: 0,
};
if (this.items.length > 0) this.backHomeTop();
this.items = [];
this.reset();
},
backHomeTop() {
let scrollContainer = document.getElementById("scrollContainer");
scrollContainer.scrollTop = 0;
},
reset() {
this.getList(false);
if (process.env.NODE_ENV === "development") return;
this.timer = setInterval(() => {
if (this.items.length > 1000) {
//dom,100,
this.items.splice(-100);
}
this.getList(true);
}, 10000);
},
getList(isopen) {
this.queryParmas = {
startTime: isopen
? this.momentjs().format("YYYY-MM-DD HH:mm:ss")
: undefined,
buildingId: this.queryParamsXiaoqu.buildingId,
parentid: this.queryParamsXiaoqu.parentid,
xiaoquId: this.queryParamsXiaoqu.xiaoquId,
};
getrealTime(this.queryParmas).then((res) => {
if (isopen) {
res.data.list.forEach((item, index) => {
setTimeout(() => {
this.items.unshift(item);
}, 500 * index);
});
} else {
this.items = res.data.list;
}
this.totalData.houseCount =
this.totalData.houseCount + res.data.houseCount;
this.totalData.count = this.totalData.count + res.data.count;
});
},
},
};
</script>
<style lang="scss" scoped>
.realTime {
display: flex;
flex-direction: column;
height: 26%;
}
.isNoData {
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
color: #ffffff;
font-family: "Alibaba-PuHuiTi-Regular.otf";
}
.container {
flex: 1;
position: relative;
padding: 0;
margin: 0;
overflow-y: auto;
overflow-x: hidden;
.item {
width: 100%;
padding: 5px;
background: rgba(0, 30, 57, 0.3);
border: 1px solid #016fbb;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
span {
flex: 0.8;
text-align: center;
font-weight: 400;
font-size: 12px;
color: #ffffff;
font-family: "Alibaba-PuHuiTi-Regular.otf";
}
margin-bottom: 6px;
}
& > div:nth-child(1) {
background: rgba(255, 158, 0, 0.3);
border-color: #ff9e00;
}
}
.total-num {
display: flex;
flex-direction: row-reverse;
margin: 6px 0;
font-weight: 400;
font-size: 14px;
color: #fffbf4;
font-family: "Alibaba-PuHuiTi-Regular.otf";
}
/*全局滚动条样式*/
::-webkit-scrollbar {
width: 3px;
height: 3px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
height: 10px;
width: 1px;
background: rgba(255, 255, 255, 0.5);
}
::-webkit-scrollbar-track {
background: transparent;
}
</style>

@ -0,0 +1,119 @@
<template>
<div class="three-cell">
<div class="cell-item">
<img src="@/assets/images/ui/icon_3.png" alt="" />
<div class="lable-value">
<div class="value-item">
<div class="value-data">{{ from.house }}</div>
<div class="value-lable">总户数</div>
</div>
<div class="value-item" style="margin-left: 6px">
<div class="value-data">{{ from.person }}</div>
<div class="value-lable">人口数</div>
</div>
</div>
</div>
<div class="cell-item" v-show="!queryParamsXiaoqu.parentid">
<img src="@/assets/images/ui/icon_1.png" alt="" />
<div class="value-item">
<div class="value-data">{{ from.network }}</div>
<div class="value-lable">网格总数</div>
</div>
</div>
<div class="cell-item" v-show="!queryParamsXiaoqu.buildingId">
<img src="@/assets/images/ui/icon_2.png" alt="" />
<div class="value-item">
<div class="value-data">{{ from.building }}</div>
<div class="value-lable">楼幢总数</div>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import { getTotaldata } from "@/api/home/index.js";
export default {
data() {
return {
from: {
house: 0,
person: 0,
network: 0,
building: 0,
},
};
},
computed: {
...mapGetters(["queryParamsXiaoqu"]),
},
watch: {
queryParamsXiaoqu: {
handler(val) {
this.getData();
},
deep: true,
},
},
created() {
this.getData();
},
methods: {
async getData() {
let res = await getTotaldata(this.queryParamsXiaoqu);
this.from = {
house: res.data["网格户数据"],
person: res.data["网格人数据"],
network: res.data["网格总数数据"],
building: res.data["网格楼栋数据"],
};
},
},
};
</script>
<style lang="scss" scoped>
.three-cell {
height: 15%;
display: flex;
justify-content: space-around;
align-items: center;
.cell-item {
display: flex;
flex-direction: column;
align-items: center;
img {
display: block;
width: 50px;
height: 55px;
}
.lable-value {
display: flex;
align-items: center;
& > div {
flex: 1;
}
}
.value-item {
div {
text-align: center;
}
.value-data {
margin: 2px 0;
font-size: 16px;
color: #ffffff;
font-family: "DIN-Medium-2.otf";
text-shadow: 0 0 10px #278873, 0 0 10px #278873, 0 0 30px #278873,
0 0 50px #278873;
}
.value-lable {
font-size: 14px;
color: #30ecf9;
font-family: "Alibaba-PuHuiTi-Medium.otf";
}
}
}
}
</style>

@ -435,6 +435,7 @@ export default {
this.xiaoquList = this.communityList.filter( this.xiaoquList = this.communityList.filter(
(item) => item.dept_id == e (item) => item.dept_id == e
)[0].children; )[0].children;
if (e == 100) { if (e == 100) {
e = undefined; e = undefined;
this.map.flyHome({ this.map.flyHome({

@ -23,7 +23,9 @@
/> />
<buildingStatistics v-if="queryParamsXiaoqu.buildingid" /> <buildingStatistics v-if="queryParamsXiaoqu.buildingid" />
</foldpanelLeft> </foldpanelLeft>
<foldpanelRight></foldpanelRight> <foldpanelRight>
<xiaoquRight />
</foldpanelRight>
<foldPaneBottom> <foldPaneBottom>
<bottomList /> <bottomList />
</foldPaneBottom> </foldPaneBottom>
@ -39,6 +41,7 @@ import {
foldpanelRight, foldpanelRight,
foldPaneBottom, foldPaneBottom,
xiaoquInfo, xiaoquInfo,
xiaoquRight,
networkInfo, networkInfo,
buildingStatistics, buildingStatistics,
mapSearchBox, mapSearchBox,
@ -55,6 +58,7 @@ export default {
foldpanelRight, foldpanelRight,
foldPaneBottom, foldPaneBottom,
xiaoquInfo, xiaoquInfo,
xiaoquRight,
networkInfo, networkInfo,
buildingStatistics, buildingStatistics,
mapSearchBox, mapSearchBox,

Loading…
Cancel
Save