Browse Source

Merge branch 'dev-fivelayer0725' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev-fivelayer0725

master
13176889840 3 years ago
parent
commit
08ba217048
  1. 80
      src/views/modules/visual/command/cpts/map.vue
  2. 732
      src/views/modules/visual/command/cpts/popup.vue
  3. 56
      src/views/modules/visual/command/index.vue

80
src/views/modules/visual/cpts/map/command.vue → src/views/modules/visual/command/cpts/map.vue

@ -9,6 +9,8 @@
切换深色模式
</div>
<div class="btn" v-else @click="shiftMapStyle('light')">切换浅色模式</div>
<cpt-popup ref="popup" />
</div>
</template>
@ -17,7 +19,15 @@ import { requestPost } from "@/js/dai/request";
import cptCard from "@/views/modules/visual/cpts/card";
import cptTb from "@/views/modules/visual/cpts/tb";
import nextTick from "dai-js/tools/nextTick";
import { Scene, PolygonLayer, LineLayer, PointLayer } from "@antv/l7";
import cptPopup from "@/views/modules/visual/command/cpts/popup";
import {
Scene,
PolygonLayer,
LineLayer,
PointLayer,
Marker,
Popup,
} from "@antv/l7";
import { GaodeMap, Map } from "@antv/l7-maps";
import { spliceIntoChunks } from "@/utils/index";
@ -136,6 +146,7 @@ export default {
components: {
cptCard,
cptTb,
cptPopup,
},
watch: {},
@ -519,21 +530,15 @@ export default {
scene.addLayer(dotLayer);
dotBgLayer.on("click", (e) => {
console.log(e.feature.properties);
this.$emit("clickDot", e.feature.properties);
console.log("--------clickDot", e);
this.handleClickDot(
e.feature.properties,
e.feature.geometry.coordinates
);
});
dotBgLayer.on("mousemove", (e) => {
// console.log(e);
if (e.feature.properties.content) {
const popup = new Popup({
offsets: [0, -0],
closeButton: false,
})
.setLnglat(e.feature.geometry.coordinates)
.setHTML(`<span>${e.feature.properties.content}</span>`);
scene.addPopup(popup);
}
});
dotBgLayer.on("unmousemove", (e) => {});
@ -558,30 +563,51 @@ export default {
scene.addLayer(dotLayer2);
dotLayer2.on("click", (e) => {
console.log(e.feature.properties);
this.$emit("clickDot", e.feature.properties);
console.log("--------clickDot2", e);
this.handleClickDot(
e.feature.properties,
e.feature.geometry.coordinates
);
});
dotLayer2.on("mousemove", (e) => {
// console.log(e);
if (e.feature.properties.content) {
const popup = new Popup({
offsets: [0, -0],
closeButton: false,
})
.setLnglat(e.feature.geometry.coordinates)
.setHTML(`<span>${e.feature.properties.content}</span>`);
scene.addPopup(popup);
}
});
dotLayer2.on("unmousemove", (e) => {});
},
async handleClickDot(item, posArr) {
console.log("handleClickDot", item, posArr);
const res = await this.$refs.popup.show(item);
if (res) {
const popup = new Popup({
closeButton: true,
closeOnClick: true,
maxWidth: 400,
})
.setLnglat(posArr)
.setDOMContent(this.$refs.popup.$el);
scene.addPopup(popup);
}
},
async setDotMarker(item, posArr) {
const marker = new Marker().setLnglat(posArr);
marker.on("click", (e) => {
console.log("click", e);
this.handleClickDot(item, posArr);
});
scene.addMarker(marker);
scene.setZoomAndCenter(18, posArr);
},
//
zoomInABit() {
// let current = scene.getZoom();
// scene.setZoomAndCenter(current + 0.5);
// let current = scene.getZoom();
// scene.setZoomAndCenter(current + 0.5);
},
shiftMapStyle(type) {
@ -634,13 +660,13 @@ export default {
searchPos(name) {
return new Promise((reslove) => {
window.AMap.plugin("AMap.Autocomplete", function () {
window.AMap.plugin("AMap.PlaceSearch", function () {
// Autocomplete
var autoOptions = {
//city
city: "全国",
};
var autoComplete = new window.AMap.Autocomplete(autoOptions);
var autoComplete = new window.AMap.PlaceSearch(autoOptions);
autoComplete.search(name, function (status, result) {
reslove(result);
});

732
src/views/modules/visual/command/cpts/popup.vue

@ -0,0 +1,732 @@
<template>
<div class="m-pop" v-show="!hidden">
<div class="info">
<div v-show="placeType === 'resi' || placeType === 'special_resi'">
<div class="info-title">居民信息</div>
<div class="item">
姓名
<span>{{ info.icUserName || "--" }}</span>
</div>
<div class="item">
所属网格
<span>{{ info.gridName || "--" }}</span>
</div>
<div class="item">
所属小区
<span>{{ info.villageName || "--" }}</span>
</div>
<div class="item">
本地户籍
<span>{{ info.isBdhjShow || "--" }}</span>
</div>
<div class="item">
手机
<span>{{ info.mobile || "--" }}</span>
</div>
<div class="item">
性别
<span>{{ info.genderShow || "--" }}</span>
</div>
<div class="item">
身份证号
<span>{{ info.idCard || "--" }}</span>
</div>
<div class="item">
工作单位
<span>{{ info.gzdw || "--" ? info.gzdw : "--" }}</span>
</div>
<div class="item">
人户状况
<span>{{ info.rhzkShow || "--" }}</span>
</div>
<div class="item">
人员类别
<span>{{ info.resiCategoryNames || "--" }}</span>
</div>
<div class="operate">
<div @click="toPeople" class="btn">更多</div>
</div>
</div>
<div v-show="placeType === 'dangerous_chemicals'">
<div class="info-title">企业信息</div>
<div class="item">
企业名称
<span>{{ info.name || "--" }}</span>
</div>
<div class="item">
企业类型
<span>{{ info.categoryName || "--" }}</span>
</div>
<div class="item">
周边安全距离
<span>{{ info.safeDistance || "--" }}</span>
</div>
<div class="item">
危化品种类
<span>{{ info.dangerTypeName || "--" }}</span>
</div>
<div class="item">
负责人
<span>{{ info.principalName || "--" }}</span>
</div>
<div class="item">
联系电话
<span>{{ info.principalMobile || "--" }}</span>
</div>
<div class="item">
经营地址
<span>{{ info.address || "--" }}</span>
</div>
<div class="item">
备注
<span>{{ info.remark || "--" }}</span>
</div>
</div>
<div
v-show="
placeType === 'public_service' ||
placeType === 'city_management' ||
placeType === 'superior_resource'
"
>
<div class="info-title">场所信息</div>
<div class="item">
场所名称
<span>{{ info.name || "--" }}</span>
</div>
<div class="item">
场所分类
<span>{{ info.categoryName || "--" }}</span>
</div>
<div class="item">
占地面积
<span>{{ info.areaCovered || "--" }}</span>
</div>
<div class="item">
容纳人数
<span>{{ info.capacity || "--" }}</span>
</div>
<div class="item">
地址
<span>{{ info.address || "--" }}</span>
</div>
</div>
<div v-show="placeType === 'event'">
<div class="info-title">难点痛点</div>
<div class="item">
所属网格
<span>{{ info.gridName || "--" }}</span>
</div>
<div class="item">
发生时间
<span>{{ info.happenTime || "--" }}</span>
</div>
<div class="item">
事件内容
<span>{{ info.eventContent || "--" }}</span>
</div>
<div
v-if="info.imageList && info.imageList.length > 0"
class="info-prop"
>
<span>图片</span>
<div class="item-pics">
<img
:src="src"
:key="src"
style="width: 100px; height: 100px; padding-right: 10px"
v-for="src in info.imageList"
@click="watchImg(src)"
/>
</div>
</div>
<div
v-if="info.voiceList && info.voiceList.length > 0"
class="info-prop"
>
<span>音频</span>
<div class="item-pics">
<audio controls>
<source
:src="item.url"
type=""
:key="item.url"
v-for="item in info.voiceList"
/>
</audio>
</div>
</div>
<div class="item">
反映渠道
<span>{{ info.sourceTypeName || "--" }}</span>
</div>
<div class="item">
地址
<span>{{ info.address || "--" }}</span>
</div>
<div class="item">
报事人
<span>{{ info.name || "--" }}</span>
</div>
<div class="item">
手机号
<span>{{ info.mobile || "--" }}</span>
</div>
<div class="item">
身份证号
<span>{{ info.idCard || "--" }}</span>
</div>
</div>
<div v-show="placeType === 'community_org'">
<div class="info-title">组织信息</div>
<div class="item">
组织名称
<span>{{ info.organizationName || "--" }}</span>
</div>
<div class="item">
组织分类
<span>{{ info.categoryName || "--" }}</span>
</div>
<div class="item">
组织人数
<span>{{ info.organizationPersonCount || "--" }}</span>
</div>
<div class="item">
组织成员
<span>{{ info.organizationPersonnelShow || "--" }}</span>
</div>
<div class="item">
服务事项
<span>{{ info.serviceItem || "--" }}</span>
</div>
<div class="item">
负责人
<span>{{ info.principalName || "--" }}</span>
</div>
<div class="item">
联系电话
<span>{{ info.principalPhone || "--" }}</span>
</div>
<div class="item">
创建时间
<span>{{ info.organizationCreatedTime || "--" }}</span>
</div>
</div>
<div v-show="placeType === 'group_rent'">
<div class="info-title">房屋信息</div>
<div class="item">
房屋名称
<span>{{ info.houseName || "--" }}</span>
</div>
<div class="item">
房屋类型
<span>{{ info.houseTypeName || "--" }}</span>
</div>
<div class="item">
房屋用途
<span>{{ info.purposeName || "--" }}</span>
</div>
<div class="item">
房屋状态
<span>{{ info.rentName || "--" }}</span>
</div>
<div class="item">
房主姓名
<span>{{ info.ownerName || "--" }}</span>
</div>
<div class="item">
联系方式
<span>{{ info.ownerPhone || "--" }}</span>
</div>
<div class="item">
房主身份证
<span>{{ info.ownerIdCard || "--" }}</span>
</div>
</div>
<div v-show="placeType === 'enterprise_patrol'">
<div class="info-title">企事业信息</div>
<div class="item">
场所类型
<span>{{ info.placeTypeName || "--" }}</span>
</div>
<div class="item">
场所区域
<span>{{ info.gridName || "--" }}</span>
</div>
<div class="item">
场所名称
<span>{{ info.placeOrgName || "--" }}</span>
</div>
<div class="item">
场所地址
<span>{{ info.address || "--" }}</span>
</div>
<div class="item">
规模
<span>{{ info.scale || "--" }}</span>
</div>
<div class="item">
负责人
<span>{{ info.personInCharge || "--" }}</span>
</div>
<div class="item">
联系电话
<span>{{ info.mobile || "--" }}</span>
</div>
</div>
<div v-show="placeType === 'party_unit'">
<div class="info-title">联建单位信息</div>
<div class="item">
单位名称
<span>{{ info.unitName || "--" }}</span>
</div>
<div class="item">
分类
<span>{{ info.typeName || "--" }}</span>
</div>
<div class="item">
服务事项
<span>{{ info.serviceMatterListShow || "--" }}</span>
</div>
<div class="item">
联系人
<span>{{ info.contact || "--" }}</span>
</div>
<div class="item">
联系电话
<span>{{ info.contactMobile || "--" }}</span>
</div>
<div class="item">
在职党员
<span>{{ info.memberCount || "--" }}</span>
</div>
<div class="item">
备注
<span>{{ info.remark || "--" }}</span>
</div>
<div class="item">
地理位置
<span>{{ info.address || "--" }}</span>
</div>
</div>
</div>
</div>
</template>
<script>
import { requestPost } from "@/js/dai/request";
export default {
name: "popup",
props: {
item: {
type: Object,
default: () => ({}),
},
},
data() {
return {
hidden: true,
placeType: "",
info: {},
eventInfo: {},
};
},
computed: {},
watch: {},
mounted() {},
methods: {
toPeople() {
// this.showPeopleInfo = true;
},
async show(item) {
const { placeType, id, latitude, longitude } = item;
if (!id || !placeType) {
return false;
}
if (!latitude || !longitude) {
this.$message.warning("请先完善坐标位置");
return false;
}
if (placeType === "resi" || placeType === "special_resi") {
await this.loadResi(item);
}
if (placeType === "public_service") {
//
await this.loadPublicService(item);
}
if (placeType === "dangerous_chemicals") {
//
await this.loadDangerousChemicals(item);
}
if (placeType === "event") {
//
await this.loadEvent(item);
}
if (placeType === "city_management") {
//
await this.loadCityManagement(item);
}
if (placeType === "community_org") {
//
await this.loadCommunityOrg(item);
}
if (placeType === "superior_resource") {
//
await this.loadSuperiorResource(item);
}
if (placeType === "group_rent") {
//
await this.loadGroupRent(item);
}
if (placeType === "party_unit") {
//
await this.loadPartyUnit(item);
}
if (placeType === "enterprise_patrol") {
//
await this.loadEnterprisePartrol(item);
}
this.placeType = item.placeType;
this.hidden = false;
return true;
},
confirm() {
console.log(1111111);
},
async loadResi(info) {
const url = "/epmetuser/icresiuser/resi-brief/" + info.id;
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/distribution"
let params = {};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
data.icUserName = data.icUserName ? data.icUserName : "--";
data.gridName = data.gridName ? data.gridName : "--";
data.villageName = data.villageName ? data.villageName : "--";
data.mobile = data.mobile ? data.mobile : "--";
data.idCard = data.idCard ? data.idCard : "--";
data.birthday = data.birthday ? data.birthday : "--";
data.contacts = data.contacts ? data.contacts : "--";
data.contactsMobile = data.contactsMobile ? data.contactsMobile : "--";
data.isBdhjShow = data.isBdhj
? data.isBdhj === "0"
? "否"
: "是"
: "--";
data.genderShow = data.gender
? data.gender === "0"
? "女"
: "男"
: "--";
if (data.rhzk === "rhyz") {
data.rhzkShow = "人户一致";
} else if (data.rhzk === "rzhbz") {
data.rhzkShow = "人在户不在";
} else if (data.rhzk === "hzrbz") {
data.rhzkShow = "户在人不在";
} else {
data.rhzkShow = "--";
}
let categoriesArray = [];
for (let key in data.volunteerCategories) {
categoriesArray.push(data.volunteerCategories[key]);
}
if (categoriesArray.length > 0) {
data.categories = categoriesArray.join(",");
} else {
data.categories = "--";
}
this.info = JSON.parse(JSON.stringify(data));
} else {
this.$message.error(msg);
}
},
async loadPublicService(info) {
const url = "/gov/org/icPublicService/detail";
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/icPublicService/detail"
let params = {
icPublicServiceId: info.id,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
data.name = data.name ? data.name : "--";
data.categoryName = data.categoryName ? data.categoryName : "--";
data.areaCovered = data.areaCovered
? data.areaCovered + "平方公里"
: "--";
data.capacity = data.capacity ? data.capacity : "--";
data.address = data.address ? data.address : "--";
this.info = JSON.parse(JSON.stringify(data));
} else {
this.$message.error(msg);
}
},
async loadEvent(info) {
const url = "/gov/project/icEvent/detail";
//const url = "http://yapi.elinkservice.cn/mock/245/api/gov/project/icEvent/processAnalysis/eventDetail/" + this.eventId;
const { data, code, msg } = await requestPost(url, {
icEventId: info.id,
});
if (code === 0) {
this.info = JSON.parse(JSON.stringify(data));
} else {
this.$message.error(msg);
}
},
async loadDangerousChemicals(info) {
const url = "/gov/org/icDangerousChemicals/detail";
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/icDangerousChemicals/detail"
let params = {
icDangerousChemicalsId: info.id,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
data.name = data.name ? data.name : "--";
data.categoryName = data.categoryName ? data.categoryName : "--";
data.safeDistance = data.safeDistance ? data.safeDistance : "--";
data.dangerTypeName = data.dangerTypeName ? data.dangerTypeName : "--";
data.principalName = data.principalName ? data.principalName : "--";
data.principalMobile = data.principalMobile
? data.principalMobile
: "--";
data.address = data.address ? data.address : "--";
data.remark = data.remark ? data.remark : "--";
this.info = JSON.parse(JSON.stringify(data));
} else {
this.$message.error(msg);
}
},
async loadCityManagement(info) {
const url = "/gov/org/icCityManagement/detail";
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/icCityManagement/detail"
let params = {
icCityManagementId: info.id,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
data.name = data.name ? data.name : "--";
data.categoryName = data.categoryName ? data.categoryName : "--";
data.areaCovered = data.areaCovered
? data.areaCovered + "平方公里"
: "--";
data.capacity = data.capacity ? data.capacity : "--";
data.address = data.address ? data.address : "--";
this.info = JSON.parse(JSON.stringify(data));
} else {
this.$message.error(msg);
}
},
async loadCommunityOrg(info) {
// const url = "/gov/org/icCityManagement/detail"
const url =
"/heart/iccommunityselforganization/community-self-org-detail/" +
info.id;
let params = {};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
data.orgPersonArray = [];
data.organizationPersonnel.forEach((element) => {
let orgPersonnel =
element.personName + "(" + element.personPhone + ")";
data.orgPersonArray.push(orgPersonnel);
});
data.organizationPersonnelShow = data.orgPersonArray.join(",");
this.info = JSON.parse(JSON.stringify(data));
} else {
this.$message.error(msg);
}
},
async loadSuperiorResource(info) {
const url = "/gov/org/icSuperiorResource/detail";
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/icSuperiorResource/detail"
let params = {
icSuperiorResourceId: info.id,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
data.name = data.name ? data.name : "--";
data.categoryName = data.categoryName ? data.categoryName : "--";
data.areaCovered = data.areaCovered
? data.areaCovered + "平方公里"
: "--";
data.capacity = data.capacity ? data.capacity : "--";
data.address = data.address ? data.address : "--";
this.info = JSON.parse(JSON.stringify(data));
} else {
this.$message.error(msg);
}
},
async loadEnterprisePartrol(info) {
const url = "/gov/org/enterprise/detail/" + info.id;
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/enterprise/detail"
const { data, code, msg } = await requestPost(url);
if (code === 0) {
// debugger
this.info = JSON.parse(JSON.stringify(data));
} else {
this.$message.error(msg);
}
},
async loadGroupRent(info) {
const url = "/gov/org/ichouse/" + info.id;
const { data, code, msg } = await requestGet(url);
if (code === 0) {
// debugger
this.info = JSON.parse(JSON.stringify(data));
} else {
this.$message.error(msg);
}
},
async loadPartyUnit(info) {
const url = "/heart/icpartyunit/detail";
// const url = 'http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/detail'
let params = {
id: info.id,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
if (!data.serviceMatterList || !Array.isArray(data.serviceMatterList)) {
data.serviceMatterList = [];
} else {
data.serviceMatterListShow = data.serviceMatterNameList.join(",");
}
this.info = JSON.parse(JSON.stringify(data));
} else {
this.$message.error(msg);
}
},
async requestList() {
const url = "/data/aggregator/coverage/analysis/resourceCategories";
let params = {
agencyId: this.orgId,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.menuList = data.map((item) => {
item.selected = false;
item.folded = true;
item.categories.forEach((subitem) => {
subitem.selected = false;
});
item.placeTypesInAnalysis.forEach((subitem) => {
subitem.selected = false;
subitem.folded = true;
subitem.categories.forEach((granditem) => {
granditem.selected = false;
});
});
return item;
});
} else {
this.$message.error(msg);
}
},
},
};
</script>
<style lang="scss" scoped>
.m-pop {
width: 380px;
color: #333;
font-size: 14px;
line-height: 20px;
.info {
.info-title {
margin-bottom: 10px;
font-size: 16px;
font-weight: bold;
}
.item-pics {
display: flex;
margin: 20px 0;
img {
display: block;
width: 32%;
height: 90px;
margin-right: 9px;
object-fit: cover;
}
}
}
.btn {
margin-top: 20px;
width: 100px;
line-height: 30px;
border: 1px solid #eee;
text-align: center;
}
}
</style>

56
src/views/modules/visual/command/index.vue

@ -74,7 +74,7 @@
@click.stop="handleClickSearchLi(li, item)"
>
<span v-if="item.type == 'position'">{{
li.name + " " + li.district
li.name + " " + li.address
}}</span>
<span v-if="item.type == 'resi'">{{
li.name + "(" + li.idCard + ")"
@ -96,7 +96,7 @@
@click.stop="handleClickSearchLi(li, item)"
>
<span v-if="item.type == 'position'">{{
li.name + " " + li.district
li.name + " " + li.address
}}</span>
<span v-if="item.type == 'resi'">{{
li.name + "(" + li.idCard + ")"
@ -180,7 +180,7 @@ import { Loading } from "element-ui"; //引入Loading服务
import { requestPost } from "@/js/dai/request";
import People from "@/views/modules/visual/basicinfo/people";
import cptCard from "@/views/modules/visual/cpts/card";
import gridMap from "@/views/modules/visual/cpts/map/command";
import gridMap from "@/views/modules/visual/command/cpts/map";
import sidemenu from "@/views/modules/visual/command/cpts/sidemenu";
import sidemenuLeft from "@/views/modules/visual/command/cpts/sidemenu-left";
import ScreenLoading from "@/views/modules/visual/cpts/loading";
@ -389,6 +389,18 @@ export default {
},
methods: {
handleClickDotBtn(type, info) {
if (type == "create-service") {
//
} else if (type == "watch-resi") {
//
} else if (type == "watch-event") {
//
} else if (type == "create-demand") {
//
}
},
handleClickMapBox() {
this.showedSearchResult = false;
},
@ -439,6 +451,7 @@ export default {
},
handleChangeMenu(list) {
console.log("handleChangeMenu", list);
let categoryKeys = [];
let coverageTypes = [];
list.forEach((item) => {
@ -657,6 +670,18 @@ export default {
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
data.userInfos.forEach((item) => {
item.placeType = "resi";
item.id = item.icUserId;
});
data.eventInfos.forEach((item) => {
item.placeType = "event";
item.id = item.eventId;
});
data.resourceInfos.forEach((item) => {
item.placeType = item.resourceType;
item.id = item.resourceId;
});
this.searchResult[1].list = data.userInfos.slice(0, 2);
this.searchResult[1].allList = data.userInfos;
this.searchResult[2].list = data.eventInfos.slice(0, 2);
@ -679,15 +704,28 @@ export default {
console.log("检索位置", data);
if (data && Array.isArray(data.tips) && data.tips.length > 0) {
this.searchResult[0].list = data.tips.slice(0, 2);
this.searchResult[0].allList = data.tips;
if (
data &&
data.poiList &&
Array.isArray(data.poiList.pois) &&
data.poiList.pois.length > 0
) {
let list = data.poiList.pois.map((item) => {
item.longitude = item.location.lng;
item.latitude = item.location.lat;
return item;
});
this.searchResult[0].list = list.slice(0, 2);
this.searchResult[0].allList = list;
}
},
handleClickSearchLi(li, item) {
console.log(li);
console.log(item);
handleClickSearchLi(li) {
this.$refs.map.setDotMarker(li, [
parseFloat(li.longitude),
parseFloat(li.latitude),
]);
this.showedSearchResult = false;
},
handleClickSearchResultMore(item) {

Loading…
Cancel
Save