| | |
| | | |
| | | export function Img_DeleteByIds(params) { |
| | | //请æ±å°å |
| | | return service.get("Img/DeleteByIds?ids=" + params); |
| | | return service.get("/Img/DeleteByIds?ids=" + params); |
| | | } |
| | | |
| | | |
| | | export function Grid_SelectById(params) { |
| | | //请æ±å°å |
| | | return service.get("Grid/SelectById?id=" + params); |
| | | return service.get("/Grid/SelectById?id=" + params); |
| | | } |
| | | export function Grid_Insert(params) { |
| | | //请æ±å°å |
| | | return service.post("Grid/Insert", params); |
| | | return service.post("/Grid/Insert", params); |
| | | } |
| | | |
| | | export function Grid_UpdateById(params) { |
| | | //请æ±å°å |
| | | return service.post("/Grid/UpdateById", params); |
| | | } |
| | | export function Grid_DeleteByIds(params) { |
| | | //请æ±å°å |
| | | return service.get("/Grid/DeleteByIds?ids=" + params); |
| | | } |
| | | |
| | | //京åç»å½ |
| | |
| | | |
| | | store.state.isshowGrid = false; |
| | | |
| | | this.drawPoint(res); |
| | | // this.drawPoint(res); |
| | | this.drawRects(res) |
| | | |
| | | }, |
| | | |
| | | drawRects: function (res) { |
| | | this.cc = 0; |
| | | var rect = viewer.entities.getById(this.id); |
| | | if (!rect) return; |
| | | var points = rect.polygon.hierarchy.getValue().positions; |
| | | viewer.entities.removeAll(); // viewer.entities.remove(rect); |
| | | |
| | | var r0 = Cesium.Cartographic.fromCartesian(points[0]); |
| | | var r1 = Cesium.Cartographic.fromCartesian(points[1]); |
| | | var r2 = Cesium.Cartographic.fromCartesian(points[2]); |
| | | |
| | | var p0 = turf.point([(r0.longitude * 180) / Math.PI, (r0.latitude * 180) / Math.PI]); |
| | | var p1 = turf.point([(r1.longitude * 180) / Math.PI, (r1.latitude * 180) / Math.PI]); |
| | | var p2 = turf.point([(r2.longitude * 180) / Math.PI, (r2.latitude * 180) / Math.PI]); |
| | | |
| | | // åæ 3 * 4 çç½æ ¼ |
| | | // var wCount = 3, hCount = 4; |
| | | var wCount = res.col, hCount = res.row; |
| | | this.flag = parseInt(wCount) * parseInt(hCount); |
| | | var op = { units: "meters", }; |
| | | var wStep = turf.distance(p0, p1, op) / wCount; |
| | | var hStep = turf.distance(p1, p2, op) / hCount; |
| | | var wAngle = turf.bearing(p0, p1); |
| | | var hAngle = turf.bearing(p1, p2); |
| | | this.removeRect(); |
| | | for (var i = 0; i < wCount; i++) { |
| | | var ds = turf.destination(p0, wStep * i, wAngle, op); |
| | | for (var j = 0; j < hCount; j++) { |
| | | var d1 = turf.destination(ds.geometry.coordinates, hStep * j, hAngle, op); |
| | | var d2 = turf.destination(d1.geometry.coordinates, wStep, wAngle, op); |
| | | var d3 = turf.destination(d2.geometry.coordinates, hStep, hAngle, op); |
| | | var d4 = turf.destination(d1.geometry.coordinates, hStep, hAngle, op); |
| | | |
| | | // var arr = [d1.geometry.coordinates, d2.geometry.coordinates, d3.geometry.coordinates, d4.geometry.coordinates]; |
| | | var arr = [ |
| | | [d1.geometry.coordinates[0], d1.geometry.coordinates[1], 18], |
| | | [d2.geometry.coordinates[0], d2.geometry.coordinates[1], 18], |
| | | [d3.geometry.coordinates[0], d3.geometry.coordinates[1], 18], |
| | | [d4.geometry.coordinates[0], d4.geometry.coordinates[1], 18], |
| | | [d1.geometry.coordinates[0], d1.geometry.coordinates[1], 18] |
| | | ] |
| | | this.setInsertGridData(arr, ((i + 1) * (j + 1))); |
| | | } |
| | | } |
| | | }, |
| | | async setInsertGridData(res, num) { |
| | | var obj = |
| | | { |
| | | "type": "Feature", |
| | | "properties": |
| | | { "ID": num, "NAME": "Area8", "REMARK": "" }, |
| | | { "ID": num, "NAME": "Area" + num, "REMARK": "", "TYPE": 'DrawGrid' }, |
| | | "geometry": |
| | | { |
| | | "type": "Polygon", |
| | |
| | | ] |
| | | } |
| | | } |
| | | |
| | | const data = await Grid_Insert({ json: JSON.stringify(obj) }) |
| | | if (data.status == 200) { |
| | | this.ids.push(data.data) |
| | | } |
| | | |
| | | if (this.flag == num) { |
| | | if (this.ids.length == this.flag) { |
| | | var obj = { |
| | | id: new Date().getTime(), |
| | | sourceType: 'DrawGrid', |
| | |
| | | Bus.$emit("addOtherData", "对象", obj); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | }; |
| | | export default drawGrid |
| | |
| | | var source = [] |
| | | import { Grid_SelectById } from '@/api/api' |
| | | import { Grid_SelectById ,Grid_DeleteByIds} from '@/api/api' |
| | | const mapGeo = { |
| | | source1: null, |
| | | type: null, |
| | | feature: [], |
| | | gridId: null, |
| | | init(res) { |
| | | if (this.type && this.type === res) { |
| | | return this.type = null |
| | |
| | | addGridLayer(res) { |
| | | var ids = res.style.ids; |
| | | var length = ids.length ; |
| | | |
| | | if (res.id == this.gridId) { |
| | | this.gridId = null; |
| | | return |
| | | } |
| | | this.gridId = res.id; |
| | | this.feature = []; |
| | | for (var i = 0; i < length; i++) { |
| | | this.getGridids(ids[i], length-1, i); |
| | | this.getGridids(ids[i], length); |
| | | } |
| | | }, |
| | | delGridLayer(res) { |
| | | if(!res)return |
| | | Viewer.dataSources.remove(Viewer.dataSources.getByName(res.id)[0]) |
| | | }, |
| | | removeGridData(res) { |
| | | this.delGridLayer(res); |
| | | var ids = res.style.ids; |
| | | for (var i = 0; i < ids.length; i++) { |
| | | this.delGridIds(ids[i]); |
| | | } |
| | | }, |
| | | async delGridIds(res) { |
| | | console.log(res) |
| | | const data = await Grid_DeleteByIds(res); |
| | | }, |
| | | async getGridids(id, length, index) { |
| | | const data = await Grid_SelectById(id) |
| | | if (data.status == 200) { |
| | | this.feature.push(data.data.features[0]) |
| | | } |
| | | console.log(index,length) |
| | | if (index == length) { |
| | | var val_data = data.data.features[0]; |
| | | val_data.properties["gid"] = id; |
| | | this.feature.push(val_data) |
| | | if (this.feature.length == length) { |
| | | var feature = { |
| | | "type": "FeatureCollection", |
| | | "name": "wangge", |
| | | "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, |
| | | "features": this.feature, |
| | | } |
| | | console.log(feature); |
| | | |
| | | this.addGridMenuGeoJson(feature) |
| | | } |
| | | } |
| | | |
| | | |
| | | }, |
| | | addGridMenuGeoJson(res){ |
| | | console.log(res); |
| | | var data = Cesium.GeoJsonDataSource.load(res, //è¦å è½½ç urlãGeoJSON 对象æ TopoJSON 对象ã |
| | | { |
| | | stroke: Cesium.Color.ORANGE, //æçº¿åå¤è¾¹å½¢è½®å»çé»è®¤é¢è²ã |
| | |
| | | } |
| | | ) |
| | | data.then((dataSource) => { |
| | | dataSource.name = "æ ¼ç½" |
| | | dataSource.name = this.gridId; |
| | | Viewer.dataSources.add( |
| | | dataSource |
| | | ); |
| | |
| | | this.mssageInfo = null; |
| | | store.state.isShowImgUpDate = false; |
| | | store.state.isShowImgUrl= null; |
| | | this.propertyNames=null |
| | | this.propertyNames=null; |
| | | store.state.isireamUrl = null; |
| | | store.state.isShowMenuCount = false; |
| | | |
| | | }, |
| | | setGeoJsonInfo(res) { |
| | |
| | | store.state.isShowMeasureCoord = true; |
| | | } |
| | | if (Cesium.defined(nPickFeature)) { |
| | | console.log(nPickFeature); |
| | | mapInfo.setRestLayer(); |
| | | if (nPickFeature.id && nPickFeature.id.id == 'Rectangle') |
| | | return |
| | | |
| | | if (nPickFeature.id && nPickFeature.id.properties) { |
| | | mapInfo.setGeoJsonInfo(nPickFeature.id.properties) |
| | | |
| | | } else if (nPickFeature && nPickFeature.getProperty("name")) { |
| | | if (nPickFeature.getProperty("name") == "DLJQT0007") { |
| | | var name = nPickFeature.getProperty("name"); |
| | | if (name == "DLJQT0007") { |
| | | store.state.isShowVideo = true; |
| | | } else if (name == "sensor001") { |
| | | |
| | | } else if (name == "DLLMJ0001") { |
| | | store.state.isireamUrl = "/Data/html/hd3dmap.html?id=3493&type=8"; |
| | | store.state.isShowMenuCount = true; |
| | | } |
| | | } |
| | | } |
| | |
| | | <meu-grid v-if="$store.state.isshowGrid"></meu-grid> |
| | | <batch-grid-menu v-if="$store.state.isshowBatchGrid"></batch-grid-menu> |
| | | <map-video v-if="$store.state.isShowVideo"></map-video> |
| | | <map-ifeam v-if="$store.state.isShowMenuCount"></map-ifeam> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import batchGridMenu from "@/components/left/layerTree/batchGridMenu.vue"; |
| | | import mapVideo from "@/components//left/layerTree/mapVideo.vue"; |
| | | import BatchGridMenu from './left/layerTree/batchGridMenu.vue'; |
| | | import mapIfeam from "./left/layerTree/mapIfeam.vue"; |
| | | export default { |
| | | name: "index", |
| | | components: { |
| | |
| | | meuGrid, |
| | | batchGridMenu, |
| | | mapVideo, |
| | | BatchGridMenu |
| | | BatchGridMenu, |
| | | mapIfeam |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | } else { |
| | | mapOL.removeLayerData(treeNode); |
| | | } |
| | | }else if(treeNode.sourceType == "DrawGrid"){ |
| | | if (isCheck) { |
| | | mapGeo.addGridLayer(treeNode); |
| | | } else { |
| | | mapGeo.delGridLayer(treeNode); |
| | | } |
| | | } |
| | | // åªè½åæ¶å è½½ä¸ä¸ªå°å½¢ |
| | | if ( |
| | |
| | | if (this.selectNode.sourceType === "imgUp") { |
| | | this.removeimgUpData(this.selectNode) |
| | | } |
| | | if (this.selectNode.sourceType === "DrawGrid") { |
| | | mapGeo.removeGridData(this.selectNode) |
| | | } |
| | | this.remove(this.selectNode); |
| | | this.$refs.tree && this.$refs.tree.setCurrentKey(null); |
| | | this.selectNode = undefined; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div id="mapInfo" class="modelBox"> |
| | | <div> |
| | | <div class="modleTitle "> |
| | | <div>详æ
</div> |
| | | <div class="modelClose" @click="$store.state.isShowMenuCount = false"> X</div> |
| | | </div> |
| | | </div> |
| | | <div class="modelContent "> |
| | | <div> |
| | | <iframe :src="src" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | export default { |
| | | name: "maoIfeam", |
| | | components: { |
| | | |
| | | }, |
| | | |
| | | data() { |
| | | return { |
| | | src: null, |
| | | srcList: null, |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.setLayerStart(); |
| | | }, |
| | | destroyed() { |
| | | |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | setLayerStart() { |
| | | this.src = layerData.config.BASE_URL + this.$store.state.isireamUrl; |
| | | }, |
| | | |
| | | setUrl(res) { |
| | | this.url = res; |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | .modelBox { |
| | | width: 45%; |
| | | height: 70%; |
| | | border: 1px solid white; |
| | | top: 15%; |
| | | left: 25%; |
| | | |
| | | background-color: rgba(0, 0, 0, 0.6); // #0048fd69 !important |
| | | z-index: 9999; |
| | | position: absolute; |
| | | |
| | | |
| | | .modleTitle { |
| | | height: 42px; |
| | | width: 90%; |
| | | background: #0048fd69 !important; |
| | | border-bottom: 1px solid white; |
| | | color: white; |
| | | font-weight: 700px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0% 5%; |
| | | |
| | | .modelClose { |
| | | height: 16px; |
| | | width: 16px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | background: rgba(128, 128, 128, 0.6); |
| | | font-size: 14x; |
| | | |
| | | } |
| | | } |
| | | |
| | | .modelContent { |
| | | width: calc(100% - 20px); |
| | | height: calc(100% - 42px); |
| | | padding: 10px 10px; |
| | | |
| | | position: absolute; |
| | | |
| | | div { |
| | | width: 100%; |
| | | height: calc(100% - 20px); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | </style> |
| | |
| | | <div>屿§ä¿¡æ¯</div> |
| | | <div class="modelmenu"> |
| | | <div v-show="showMenuGrid"> |
| | | <el-link style="color: white;font-size: 14x;">ç¼è¾</el-link> |
| | | <el-link v-show="disabled" @click="disabled = false" style="color: white;font-size: 14x;">ç¼è¾</el-link> |
| | | <el-link v-show="!disabled" @click="setObjSave" style="color: white;font-size: 14x;">ä¿å</el-link> |
| | | </div> |
| | | <div class="modelClose" @click="$store.state.showMessageInfo = false"> X</div> |
| | | </div> |
| | |
| | | <div>{{ item.name }}</div> |
| | | <div v-show="item.name == 'ID'">{{ item.value }} |
| | | </div> |
| | | <div v-show="item.name != 'ID'"><el-input style="width: 100%;" v-model="item.value" placeholder=""></el-input> |
| | | <div v-show="item.name == 'type'">{{ item.value }} |
| | | </div> |
| | | <div v-show="item.name != 'ID' && item.name != 'type'"><el-input style="width: 100%; text-align: center;" |
| | | v-model="item.value" :disabled="disabled"></el-input> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <script> |
| | | import model from '../../../assets/js/Layer/model'; |
| | | import mapInfo from '../../../assets/js/Layer/mapInfo'; |
| | | import {Grid_SelectById} from '@/api/api' |
| | | import { Grid_SelectById, Grid_UpdateById } from '../../../api/api' |
| | | export default { |
| | | name: "modelEdit", |
| | | components: { |
| | |
| | | return { |
| | | modelOption: null, |
| | | showMenuGrid: false, |
| | | disabled: true, |
| | | gid: null, |
| | | obj: null, |
| | | }; |
| | | }, |
| | | mounted() { |
| | |
| | | |
| | | }, |
| | | methods: { |
| | | |
| | | setLayerStart() { |
| | | this.obj = null; |
| | | var data = mapInfo.mssageInfo; |
| | | if (!data) { |
| | | this.$store.state.showMessageInfo = false; |
| | | return |
| | | } |
| | | var flag = false; |
| | | var id=null; |
| | | // for(var i in data){ |
| | | // if(data[i].name == 'ç±»å' && data[i].value =='ç½æ ¼'){ |
| | | // flag = true; |
| | | // } |
| | | // if(data[i].name =='ID'){ |
| | | // id=data[i].value; |
| | | // } |
| | | // } |
| | | // if(flag){ |
| | | // this.getInfoMessage(id) |
| | | // }else{ |
| | | // this.setInfoMesgData(data); |
| | | // } |
| | | for (var i in data) { |
| | | if (data[i].name == "TYPE" && data[i].value == 'DrawGrid') { |
| | | flag = true; |
| | | break; |
| | | } |
| | | } |
| | | if (flag) { |
| | | for (var i in data) { |
| | | if (data[i].name == "gid") { |
| | | this.gid = data[i].value |
| | | this.getInfoMessage(this.gid); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } else { |
| | | this.setInfoMesgData(data); |
| | | } |
| | | }, |
| | | setInfoMesgData(res) { |
| | | this.modelOption = res |
| | | }, |
| | | async setObjSave() { |
| | | var properties = this.obj.features[0].properties; |
| | | for (var key in properties) { |
| | | for (var i in this.modelOption) { |
| | | if (this.modelOption[i].name == key) { |
| | | properties[key] = this.modelOption[i].value |
| | | } |
| | | } |
| | | } |
| | | const data = await Grid_UpdateById({ |
| | | id: this.gid, |
| | | json: JSON.stringify(this.obj.features[0]) |
| | | }); |
| | | if (data.status == 200) { |
| | | this.$message({ |
| | | message: "ä¿åæå", |
| | | type: "success", |
| | | }); |
| | | this.disabled = true; |
| | | } |
| | | }, |
| | | async getInfoMessage(res){ |
| | | const data = await Grid_SelectById(res); |
| | | if(data.status == 200){ |
| | | this.obj = data.data; |
| | | var properties = this.obj.features[0].properties; |
| | | console.log(data.data.features[0]) |
| | | var std = []; |
| | | for (var key in properties) { |
| | | std.push({ |
| | | name: key, |
| | | value: properties[key] |
| | | }) |
| | | } |
| | | this.showMenuGrid = true |
| | | this.modelOption = std; |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | }, |
| | | |
| | | }; |
| | | </script> |
| | | |
| | |
| | | font-size: 14x; |
| | | margin-left: 20px; |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | // margin-bottom: 5%; |
| | | line-height: 50px; |
| | | border-right: 1px solid white; |
| | | border-top: 1px solid white !important; |
| | | } |
| | | |
| | | div:first-child { |
| | |
| | | } |
| | | |
| | | .contentMessage:first-child { |
| | | border-top: 1px solid white; |
| | | ; |
| | | border-top: 1px solid white !important; |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | </div> |
| | | |
| | | <div class="menubtn" @click="setMenuGrid()"> |
| | | <img class="bhImg" title="æ ¼ç½" src="@/assets/img/right/cx-s.png" /> |
| | | <img class="bhImg" title="æ ¼ç½" src="@/assets/img/right/gewang.png" /> |
| | | <span>æ ¼ç½</span> |
| | | </div> |
| | | <div class="menubtn" @click="setMenuQuery()"> |
| | | <img class="bhImg" title="æ¥è¯¢" src="@/assets/img/right/queyr.png" /> |
| | | <span>æ¥è¯¢</span> |
| | | </div> |
| | | <div class="menubtn" @click="setMenuCount()"> |
| | | <img class="bhImg" title="ç»è®¡" src="@/assets/img/right/tongji.png" /> |
| | | <span>ç»è®¡</span> |
| | | </div> |
| | | <div class="menubtn" @click="setImgUpDate()"> |
| | | <input id="imgs" type="file" multiple="multiple" v-show="false" @change="setImgUpload" accept=".jpg,.png" /> |
| | |
| | | setMenuGrid() { |
| | | drawGrid.drawRect(); |
| | | }, |
| | | setMenuCount(){ |
| | | this.$store.state.isireamUrl = "/Data/html/index.html" |
| | | this.$store.commit("setMenuCount", true) |
| | | }, |
| | | setImgUpDate() { |
| | | // this.$store.commit("setImgUpdate",true) |
| | | |
| | |
| | | isShowVideo: false, |
| | | isshowBatchGrid: false, |
| | | batchGridArr: [], |
| | | isShowMenuCount:false, |
| | | isireamUrl:null, |
| | | }, |
| | | mutations: { |
| | | selectedLayer(state, b) { |
| | |
| | | setMenuQuery(state, b) { |
| | | state.isShowMenuQuery = b; |
| | | }, |
| | | setMenuCount(state, b) { |
| | | state.isShowMenuCount = b; |
| | | }, |
| | | setImgUpdate(state, b) { |
| | | state.isShowImgUpDate = b; |
| | | }, |