Browse Source

Merge branch 'dev-fivelayer0725'

feature
dai 3 years ago
parent
commit
5810657ca6
  1. 1274
      src/views/modules/communityService/fuwujilu/addForm.vue
  2. 2
      src/views/modules/cpts/base/cpts/edit.vue
  3. 117
      src/views/modules/visual/command/cpts/map.vue
  4. 76
      src/views/modules/visual/command/cpts/popup.vue
  5. 45
      src/views/modules/visual/command/cpts/serviceInfo.vue
  6. 10
      src/views/modules/visual/command/cpts/sidemenu-left.vue
  7. 23
      src/views/modules/visual/command/index.vue

1274
src/views/modules/communityService/fuwujilu/addForm.vue

File diff suppressed because it is too large

2
src/views/modules/cpts/base/cpts/edit.vue

@ -628,7 +628,7 @@ export default {
// map TMap.Map() // map TMap.Map()
map = new window.TMap.Map(document.getElementById("app"), { map = new window.TMap.Map(document.getElementById("app"), {
center: center, // center: center, //
zoom: 15, // zoom: 13, //
pitch: 43.5, // pitch: 43.5, //
rotation: 45, // rotation: 45, //
}); });

117
src/views/modules/visual/command/cpts/map.vue

@ -48,6 +48,7 @@ let dotLayer2;
let countTextLayer; let countTextLayer;
let countTextBgLayer; let countTextBgLayer;
let searchMarker; let searchMarker;
let searchBgLayer;
export default { export default {
name: "l7", name: "l7",
@ -146,25 +147,12 @@ export default {
}, },
}, },
computed: {},
components: { components: {
cptCard, cptCard,
cptTb, cptTb,
cptPopup, cptPopup,
}, },
watch: {},
async mounted() {
//
window._AMapSecurityConfig = {
securityJsCode: "92ea2c965c6cf1ba7ee3a8fe01449ef2",
};
this.iniMap();
},
computed: { computed: {
polygonData() { polygonData() {
const { srcGridData } = this; const { srcGridData } = this;
@ -313,6 +301,20 @@ export default {
}, },
}, },
async mounted() {
console.log("指挥调度map初始化啦");
//
window._AMapSecurityConfig = {
securityJsCode: "92ea2c965c6cf1ba7ee3a8fe01449ef2",
};
this.iniMap();
//
searchMarker = null;
searchBgLayer = null;
},
methods: { methods: {
iniMap() { iniMap() {
const { darkStyle, lightStyle, srcGridData } = this; const { darkStyle, lightStyle, srcGridData } = this;
@ -627,8 +629,83 @@ export default {
} }
}, },
drawSearchBg(lng, lat) {
function getPoints(lng, lat) {
// lng lat dis
let r = 6371; //
let dis = 1.5; //3
let dlng =
2 *
Math.asin(Math.sin(dis / (2 * r)) / Math.cos((lat * Math.PI) / 180));
dlng = (dlng * 180) / Math.PI; //
let dlat = dis / r;
dlat = (dlat * 180) / Math.PI; //
//
for (let sides = 1; sides <= 360; sides++) {
var angle = Math.PI * (1 / sides - 1 / 2);
var rotatedAngle, x, y;
var points = [];
for (var i = 0; i < sides; ++i) {
rotatedAngle = angle + (i * 2 * Math.PI) / sides;
x = lng + dlng * Math.cos(rotatedAngle);
y = lat + dlat * Math.sin(rotatedAngle);
points.push([x, y]);
}
}
console.log("points=======", points);
return points;
}
let sourceData;
if (lng) {
sourceData = {
type: "FeatureCollection",
features: [
{
type: "Feature",
properties: {
center: [lng, lat],
},
geometry: {
type: "Polygon",
coordinates: [getPoints(lng, lat)],
},
},
],
};
} else {
sourceData = {
type: "FeatureCollection",
features: [],
};
}
if (searchBgLayer) {
console.log("searchBgLayer已经存在了", searchBgLayer);
searchBgLayer.setData(sourceData);
} else {
searchBgLayer = new PolygonLayer({
// autoFit: true,
})
.source(sourceData)
.color("#f0f")
.shape("fill")
.style({
opacityLinear: {
enable: true, // true - false
dir: "out", // in - out
},
opacity: 0.3,
raisingHeight: 0,
});
scene.addLayer(searchBgLayer);
}
},
async setDotMarker(item, posArr) { async setDotMarker(item, posArr) {
this.removeDotMarker(); this.removeDotMarker();
this.drawSearchBg(...posArr);
const marker = new Marker({ const marker = new Marker({
offsets: [0, -20], offsets: [0, -20],
}).setLnglat(posArr); }).setLnglat(posArr);
@ -652,15 +729,20 @@ export default {
}); });
scene.addMarker(marker); scene.addMarker(marker);
scene.setZoomAndCenter(18, posArr); scene.setZoomAndCenter(14, posArr);
marker.openPopup(); marker.openPopup();
searchMarker = marker; searchMarker = marker;
}, },
removeDotMarker() { removeDotMarker() {
console.log("removeDotMarker");
if (searchMarker) { if (searchMarker) {
searchMarker.remove(); searchMarker.remove();
} }
if (searchBgLayer) {
console.log("removeDotMarker-----searchBgLayer");
this.drawSearchBg();
}
}, },
// //
@ -743,6 +825,13 @@ export default {
border-radius: 10px; border-radius: 10px;
overflow: hidden; overflow: hidden;
/deep/ .l7-popup-content {
background: rgba(#020340, 0.58);
}
/deep/ .l7-popup-close-button {
color: #fff;
}
#app { #app {
width: 100%; width: 100%;
height: 100%; height: 100%;

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

@ -1,7 +1,13 @@
<template> <template>
<div class="m-pop" v-show="!hidden"> <div class="m-pop" v-show="!hidden">
<div class="info"> <div class="info">
<div v-if="placeType === 'resi' || placeType === 'special_resi'"> <div
v-if="
placeType === 'resi' ||
placeType === 'special_resi' ||
placeType === 'volunteer'
"
>
<div class="info-title">居民信息</div> <div class="info-title">居民信息</div>
<div class="item"> <div class="item">
姓名 姓名
@ -47,13 +53,25 @@
</div> </div>
<div class="operate"> <div class="operate">
<div @click="handleClickBtn('watch-resi')" class="btn">查看更多</div> <div @click="handleClickBtn('watch-resi')" class="btn">查看更多</div>
<div <div
@click="handleClickBtn('create-demand')" @click="handleClickBtn('create-demand')"
v-if="info.agencyId == $store.state.user.agencyId" v-if="info.agencyId == $store.state.user.agencyId"
class="btn" class="btn z-blue"
> >
发布需求 发布需求
</div> </div>
<div
v-if="
info.agencyId == $store.state.user.agencyId &&
placeType === 'volunteer'
"
@click="handleClickBtn('create-service')"
class="btn z-yellow"
>
发起服务
</div>
</div> </div>
</div> </div>
@ -239,6 +257,14 @@
创建时间 创建时间
<span>{{ info.organizationCreatedTime || "--" }}</span> <span>{{ info.organizationCreatedTime || "--" }}</span>
</div> </div>
<div
v-if="info.agencyId == $store.state.user.agencyId"
@click="handleClickBtn('create-service')"
class="btn z-yellow"
>
发起服务
</div>
</div> </div>
<div v-if="placeType === 'group_rent'"> <div v-if="placeType === 'group_rent'">
@ -350,11 +376,19 @@
地理位置 地理位置
<span>{{ info.address || "--" }}</span> <span>{{ info.address || "--" }}</span>
</div> </div>
<div
v-if="info.agencyId == $store.state.user.agencyId"
@click="handleClickBtn('create-service')"
class="btn z-yellow"
>
发起服务
</div>
</div> </div>
<div v-if="placeType === 'grid'"> <div v-if="placeType === 'grid'">
<div class="operate"> <div class="operate">
<div @click="handleClickBtn('create-service')" class="btn"> <div @click="handleClickBtn('create-service')" class="btn z-yellow">
发起服务 发起服务
</div> </div>
</div> </div>
@ -394,6 +428,7 @@ export default {
return { return {
hidden: true, hidden: true,
placeType: "", placeType: "",
srcItem: {},
info: {}, info: {},
list: [], list: [],
}; };
@ -406,7 +441,11 @@ export default {
methods: { methods: {
handleClickBtn(type) { handleClickBtn(type) {
this.$emit("operate", type, this.info); this.$emit("operate", type, {
placeType: this.placeType,
id: this.srcItem.id,
...this.info,
});
}, },
handleClickListItem(item) { handleClickListItem(item) {
@ -415,7 +454,7 @@ export default {
}, },
async show(item) { async show(item) {
console.log("-----------------show"); console.log("-----------------show:", item);
const { placeType, latitude, longitude } = item; const { placeType, latitude, longitude } = item;
if (!placeType) { if (!placeType) {
return false; return false;
@ -429,7 +468,15 @@ export default {
this.list = item.dataList; this.list = item.dataList;
} }
if (placeType === "resi" || placeType === "special_resi") { if (placeType === "grid") {
this.info = { ...item };
}
if (
placeType === "resi" ||
placeType === "special_resi" ||
placeType === "volunteer"
) {
await this.loadResi(item); await this.loadResi(item);
} }
if (placeType === "public_service") { if (placeType === "public_service") {
@ -477,6 +524,7 @@ export default {
await this.loadEnterprisePartrol(item); await this.loadEnterprisePartrol(item);
} }
this.placeType = item.placeType; this.placeType = item.placeType;
this.srcItem = item;
this.hidden = false; this.hidden = false;
return true; return true;
}, },
@ -795,7 +843,7 @@ export default {
.m-pop { .m-pop {
@include scrollBar2; @include scrollBar2;
max-width: 380px; max-width: 380px;
color: #333; color: #fff;
font-size: 14px; font-size: 14px;
line-height: 20px; line-height: 20px;
max-height: 600px; max-height: 600px;
@ -831,10 +879,20 @@ export default {
.btn { .btn {
margin-top: 20px; margin-top: 20px;
margin-right: 20px; margin-right: 20px;
width: 100px; width: 80px;
line-height: 30px; line-height: 24px;
border: 1px solid #eee; border: 1px solid #eee;
text-align: center; text-align: center;
font-size: 14px;
border-radius: 2px;
&.z-blue {
background: #09a5ff;
border-color: #09a5ff;
}
&.z-yellow {
background: #fe6b53;
border-color: #fe6b53;
}
} }
} }
</style> </style>

45
src/views/modules/visual/command/cpts/serviceInfo.vue

@ -15,6 +15,7 @@
ref="demandEditForm" ref="demandEditForm"
:source="'visiual'" :source="'visiual'"
:formType="'add'" :formType="'add'"
:defaultData="defaultData"
@close="handleClose" @close="handleClose"
@handleClose="handleClose" @handleClose="handleClose"
@handleOk="handleOk" @handleOk="handleOk"
@ -27,14 +28,17 @@
<script> <script>
import cptCard from "@/views/modules/visual/cpts/card"; import cptCard from "@/views/modules/visual/cpts/card";
import { requestPost } from "@/js/dai/request";
import addForm from "@/views/modules/communityService/fuwujilu/addForm"; import addForm from "@/views/modules/communityService/fuwujilu/addForm";
export default { export default {
name: "dialogInfo", name: "dialogInfo",
props: {},
props: {
defaultData: {
type: Object,
default: null,
},
},
components: { components: {
cptCard, cptCard,
@ -42,47 +46,18 @@ export default {
}, },
data() { data() {
return { return {};
loading: false,
pageType: "dispose",
eventId: "1529724450524061698",
eventDetailData: {},
};
}, },
async mounted() { async mounted() {
this.loading = false; console.log('初始化serviceInfo', this.defaultData)
await this.handleSearch();
this.loading = true;
}, },
methods: { methods: {
async handleSearch() {
const url = "/gov/project/icEvent/detail";
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/icEvent/detail";
const { data, code, msg } = await requestPost(url, {
icEventId: this.eventId,
});
if (code === 0) {
this.eventDetailData = { ...data };
this.pageType = "dispose";
} else {
this.$message.error(msg);
}
},
handleClose() { handleClose() {
this.pageType = "";
this.$emit("handleClose"); this.$emit("handleClose");
// this.eventId = ""
}, },
handleOk() { handleOk() {
this.pageType = "";
// this.eventId = ""
this.pageNo = 1;
this.handleClose(); this.handleClose();
}, },

10
src/views/modules/visual/command/cpts/sidemenu-left.vue

@ -145,9 +145,19 @@ export default {
}, },
handleClickItem(item) { handleClickItem(item) {
console.log("handleClickItem", item);
if (item.categoryKey) { if (item.categoryKey) {
if (item.categoryKey != this.currentKey) {
this.currentKey = item.categoryKey; this.currentKey = item.categoryKey;
this.currentItem = { ...item }; this.currentItem = { ...item };
} else {
this.currentKey = "";
this.currentItem = {
categoryKey: "",
coverageType: "",
placeType: "",
};
}
} else { } else {
this.currentUnfolded = this.currentUnfolded =
this.currentUnfolded == item.placeType ? "" : item.placeType; this.currentUnfolded == item.placeType ? "" : item.placeType;

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

@ -51,6 +51,7 @@
v-model="searchName" v-model="searchName"
/> />
<img <img
v-show="searchName"
class="i-close" class="i-close"
@click="clearSearch" @click="clearSearch"
src="@/assets/img/shuju/command/close.png" src="@/assets/img/shuju/command/close.png"
@ -187,6 +188,7 @@
<service-info <service-info
v-if="pageType === 'create-service'" v-if="pageType === 'create-service'"
ref="ref_service" ref="ref_service"
:default-data="serviceDefaultData"
@handleClose="handleClose" @handleClose="handleClose"
/> />
@ -429,6 +431,7 @@ export default {
selGridId: "", selGridId: "",
eventId: "", eventId: "",
enterpriseId: "", enterpriseId: "",
serviceDefaultData: null,
}; };
}, },
@ -454,9 +457,23 @@ export default {
methods: { methods: {
handleClickDotBtn(type, info) { handleClickDotBtn(type, info) {
this.pageType = type;
if (type == "create-service") { if (type == "create-service") {
// //
if (
info.placeType == "volunteer" ||
info.placeType == "community_org" ||
info.placeType == "party_unit"
) {
this.serviceDefaultData = {
serviceOrgType:
info.placeType == "ic_user_volunteer" ? "" : info.placeType,
serviceOrgId: info.id,
};
} else if (info.placeType == "grid") {
this.serviceDefaultData = {
scopeIdArray: [info.id],
};
}
} else if (type == "watch-resi") { } else if (type == "watch-resi") {
this.toSubAgency("people", info.icResiUserId); this.toSubAgency("people", info.icResiUserId);
this.icResiUserId = info.icResiUserId; this.icResiUserId = info.icResiUserId;
@ -471,6 +488,7 @@ export default {
} else if (type == "watch-xuncha") { } else if (type == "watch-xuncha") {
this.enterpriseId = info.enterpriseId; this.enterpriseId = info.enterpriseId;
} }
this.pageType = type;
}, },
handleClose() { handleClose() {
@ -600,6 +618,9 @@ export default {
}, },
async requestMapDot2Count() { async requestMapDot2Count() {
if (!this.placeType2) {
return (this.gridCountData = []);
}
const url = "/data/aggregator/coverage/dataList-left-subtotal"; const url = "/data/aggregator/coverage/dataList-left-subtotal";
let params = { let params = {
orgId: this.orgId, orgId: this.orgId,

Loading…
Cancel
Save