|
@@ -13,8 +13,8 @@
|
|
|
</div>
|
|
|
<div class="ctl-item">
|
|
|
<cons-unit-tree
|
|
|
- :placeholder="$t('common.select', {name: $t('cons.consUnit')})"
|
|
|
- v-model="consUnit"
|
|
|
+ :placeholder="$t('common.select', {name: $t('cons.consUnit')})"
|
|
|
+ v-model="consUnit"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -74,18 +74,18 @@
|
|
|
<MachineIndex v-if="selectMachine" :select-machine="selectMachine">
|
|
|
<template v-slot:title-right="scop">
|
|
|
<el-tooltip
|
|
|
- class="item"
|
|
|
- effect="dark"
|
|
|
- content="click to machine"
|
|
|
- placement="top"
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="click to machine"
|
|
|
+ placement="top"
|
|
|
>
|
|
|
<svg-icon icon-class="location" @click="()=>{locationMachine(scop.data)}"/>
|
|
|
</el-tooltip>
|
|
|
<el-tooltip
|
|
|
- class="item"
|
|
|
- effect="dark"
|
|
|
- content="close"
|
|
|
- placement="top"
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="close"
|
|
|
+ placement="top"
|
|
|
>
|
|
|
<i class="el-icon-close" @click="()=>{locationClose()}" style="margin-left: 5px"/>
|
|
|
</el-tooltip>
|
|
@@ -115,8 +115,10 @@ import maphandle from "@/components/map/maphandle";
|
|
|
import MachineIndex from "@/views/cons/screen/MachineIndex.vue";
|
|
|
import PileHoleDetail from "@/views/cons/screen/PileHoleDetail.vue";
|
|
|
import {copyObj} from "@/utils";
|
|
|
+import {Circle} from "@/components/map/GeoJson";
|
|
|
import pileMachine from "./img/pile-machine.svg"
|
|
|
import {MachineStatus} from "@/utils/EnumConst";
|
|
|
+import ComponentHandle from "@/utils/ComponentHandle"
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -318,22 +320,108 @@ export default {
|
|
|
listPileHoleRealtimeIndex({}).then(response => {
|
|
|
this.pileHoleList = response.data
|
|
|
this.pileHoleList.forEach((item, index) => {
|
|
|
- let circle = new BDLayers.Lib.Overlays.Circle(`circle${index}`, {
|
|
|
- center: [item.lng, item.lat], // 圆的中心点点坐标
|
|
|
+ const geom = new BDLayers.Lib.Overlays.FromGeoJson(Circle({
|
|
|
radius: 0.4,
|
|
|
- symbol: {
|
|
|
- lineColor: '#34495e',
|
|
|
- lineWidth: 1,
|
|
|
- polygonFill: '#1bbc9b',
|
|
|
- polygonOpacity: 0.2
|
|
|
- },
|
|
|
- });
|
|
|
- circle.cust = item
|
|
|
- circle.on('click', (e) => {
|
|
|
+ coordinates: [item.lng, item.lat],
|
|
|
+ symbol: [
|
|
|
+ {
|
|
|
+ lineColor: '#34495e',
|
|
|
+ lineWidth: 1,
|
|
|
+ polygonFill: '#1bbc9b',
|
|
|
+ polygonOpacity: 0.2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ textName: item.holeNum,
|
|
|
+ textFill: "#FF0000",
|
|
|
+ textSize: 4
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }).geojson);
|
|
|
+
|
|
|
+ geom.cust = item
|
|
|
+ geom.on('click', (e) => {
|
|
|
+ // const comp = ComponentHandle.createComponent({
|
|
|
+ // wrapper: 'testHH',
|
|
|
+ // component: ContentBlock,
|
|
|
+ // props: {
|
|
|
+ // title: '信息编辑huahuahu',
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // geom.setPopWindow({
|
|
|
+ // title: '信息编辑',
|
|
|
+ // content: comp.$el
|
|
|
+ // });
|
|
|
this.pileHoleClick(e.target.cust)
|
|
|
})
|
|
|
- this.pileHoleLayer.addGeometry(circle);
|
|
|
+ this.pileHoleLayer.addGeometry(geom);
|
|
|
})
|
|
|
+ // const geomCollection = [];
|
|
|
+ // Circle()
|
|
|
+ // const geomUpdateSymbol = [{
|
|
|
+ // lineColor: '#FFFF00',
|
|
|
+ // polygonFill: '#00FFFF'
|
|
|
+ // }];
|
|
|
+ // geomCollection.forEach((item, index) => {
|
|
|
+ // let geoJson = item.geojson
|
|
|
+ // const geom = new BDLayers.Lib.Overlays.FromGeoJson(geoJson);
|
|
|
+ // geom.index = index;
|
|
|
+ // const geomSymbol = geoJson.symbol;
|
|
|
+ // item.isSelected = false;
|
|
|
+ // item.symbol = geomSymbol;
|
|
|
+ // // 多边形编辑的信息
|
|
|
+ // item.attr = {
|
|
|
+ // name: '',
|
|
|
+ // desc: ''
|
|
|
+ // };
|
|
|
+ //
|
|
|
+ // geom.on('click', e => {
|
|
|
+ // const curSelectedGeom = geomCollection.filter((item, i) => i !== index && item.isSelected)[0];
|
|
|
+ // if (curSelectedGeom) {
|
|
|
+ // curSelectedGeom.isSelected = false;
|
|
|
+ // curSelectedGeom.geom.updateSymbol(curSelectedGeom.symbol);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // // geom根据选中状态切换样式
|
|
|
+ // geomCollection[index].isSelected = !geomCollection[index].isSelected;
|
|
|
+ // const isSelected = geomCollection[index].isSelected;
|
|
|
+ // geom.updateSymbol(isSelected ? geomUpdateSymbol : geomSymbol);
|
|
|
+ //
|
|
|
+ // if (isSelected) {
|
|
|
+ // const comp = ComponentHandle.createComponent({
|
|
|
+ // wrapper: 'testHH',
|
|
|
+ // component: ContentBlock,
|
|
|
+ // props: {
|
|
|
+ // title: '信息编辑huahuahu',
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // geom.setPopWindow({
|
|
|
+ // title: '信息编辑',
|
|
|
+ // content: comp.$el
|
|
|
+ // });
|
|
|
+ // // 点击确认按钮 保存信息
|
|
|
+ // document.querySelector('.btn-save').addEventListener('click', () => {
|
|
|
+ // geomCollection[index].attr.name = document.querySelector('.input-name').value;
|
|
|
+ // geomCollection[index].attr.desc = document.querySelector('.textarea-desc').value;
|
|
|
+ //
|
|
|
+ // geom.trigger('click');
|
|
|
+ // });
|
|
|
+ //
|
|
|
+ // // 点击取消按钮 关闭气泡弹窗
|
|
|
+ // document.querySelector('.btn-quit').addEventListener('click', () => {
|
|
|
+ // geom.closePopWindow();
|
|
|
+ // });
|
|
|
+ // // 点击气泡弹窗关闭按钮 geom取消选中状态
|
|
|
+ // geom.on('closePopWindow', () => {
|
|
|
+ // geomCollection[index].isSelected = false;
|
|
|
+ // geom.updateSymbol(geomSymbol);
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // geom.closePopWindow();
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // this.pileHoleLayer.addGeometry(geom);
|
|
|
+ // geomCollection[index].geom = geom;
|
|
|
+ // });
|
|
|
})
|
|
|
},
|
|
|
loaded(map) {
|