limeng пре 1 месец
родитељ
комит
2efb45485c

+ 3 - 0
event-ui/public/index.html

@@ -6,6 +6,7 @@
   <meta name="renderer" content="webkit">
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
   <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+  <link href="/SuperMap3D/Build/Cesium/Widgets/widgets.css" rel="stylesheet" />
   <!--<title><%= webpackConfig.name %></title>-->
   <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
   <style>
@@ -266,6 +267,8 @@
     }
 
   </style>
+  <script type="text/javascript" src="/SuperMap3D/Build/Cesium/Cesium.js"></script>
+  <script type="text/javascript" src="/SuperMap3D/examples/webgl/js/supermap/SuperMap.Include.js"></script>
 </head>
 <body>
 <div id="app">

+ 10 - 0
event-ui/src/api/event/eventProcess/eventProcess.js

@@ -17,3 +17,13 @@ export function getCompositeEventDetail(query) {
     params: query
   })
 }
+
+// 事件新增
+export function insertProcessEvent(data) {
+  return request({
+    url: '/center-event/eventProcess/insertProcessEvent',
+    method: 'post',
+    data: data
+  })
+}
+

+ 1 - 1
event-ui/src/components/ImageUpload/index.vue

@@ -57,7 +57,7 @@ export default {
     },
     // 大小限制(MB)
     fileSize: {
-       type: Number,
+      type: Number,
       default: 10,
     },
     // 文件类型, 例如['png', 'jpg', 'jpeg']

+ 187 - 0
event-ui/src/views/components/ISuperMap.vue

@@ -0,0 +1,187 @@
+<template>
+  <div>
+    <el-dialog title="经纬度" :visible.sync="showLongitude" append-to-body width="80%"  @close='close' >
+      <el-input v-show="false" v-model="obj.longitude"></el-input>
+      <el-input v-show="false" v-model="obj.latitude"></el-input>
+      <Supermap ref="Supermap" style="width: 100%;height: 75vh;" :mapDiv="uuid" :mapSite="{doubleClickZoom:false}"
+                :codes="['9fa5']" :isSideBySide="false" :showLatLng="showLL"></Supermap>
+      <el-button type="primary" @click="closeDialog">确定</el-button>
+    </el-dialog>
+    <el-dialog title="线坐标" :visible.sync="showLongitudex" append-to-body @close='close' width="80%" >
+      <Supermap ref="LineSupermap" style="width: 100%;height:75vh"
+                :mapDiv="uuid" :mapSite="{doubleClickZoom:false}" :codes="['9fa5']" :isSideBySide="false"
+                :showLineLatLng="showAreaLatLng"></Supermap>
+      <el-button type="primary" @click="closeDialog">确定</el-button>
+    </el-dialog>
+    <el-dialog title="区域坐标" :visible.sync="showLongitudeq"  @close='close' width="80%" >
+      <Supermap ref="areaSupermap" style="width: 100%;height:75vh"
+                :mapDiv="uuid" :mapSite="{doubleClickZoom:false}" :codes="['9fa5']"
+                :isSideBySide="false" :showAreaLatLng="showAreaLatLng"></Supermap>
+      <el-button type="primary" @click="closeDialog">确定</el-button>
+    </el-dialog>
+    <el-dialog :title="(sign===1?'经纬度':(sign===2?'线坐标':'区域坐标'))" :visible.sync="visible" append-to-body width="80%"
+               @close='close'>
+      <supermap ref="supermap" style="width: 100%; height: 75vh" :putSmUserID_layer="putSmUserID_layer"
+                @showLatLng="showLatLng"></supermap>
+      <el-button type="primary" @click="closeDialog">确定</el-button>
+    </el-dialog>
+  </div>
+</template>
+
+
+<script>
+  import {getConfigKey} from "@/api/system/config";
+
+  const uuidv4 = require("uuid/v4")
+  import supermap from '@/views/components/supermap-2.5d';
+
+
+  export default {
+    name: "ISuperMap",
+    components: {supermap},
+    data() {
+      return {
+        uuid: '',
+        sign: undefined,
+        title: "",
+        visible: false,
+        showLongitude: false,
+        showLongitudex: false,
+        showLongitudeq: false,
+        obj: {
+          longitude: undefined,
+          latitude: undefined,
+          xiantude: undefined,
+        }
+      };
+    },
+    methods: {
+      putSmUserID_layer: function (entity) {
+
+      },
+      showAreaLatLng: function (latlng) {
+        this.obj.xiantude = JSON.stringify(latlng);
+      },
+      showLatLng: function (val) {
+        if (this.sign === 1) {
+          this.obj.longitude = val.longitude;
+          this.obj.latitude = val.latitude;
+        }
+        if (this.sign === 2 || this.sign === 3) {
+          this.obj.xiantude = JSON.stringify(val.markerList);
+        }
+      },
+      showLL: function (lat, lng) {
+        this.obj.latitude = lat;
+        this.obj.longitude = lng;
+      },
+      init(sign, form,NB) {
+        if(NB=='NB'){
+          getConfigKey('supermapKey').then(response => {
+            let isN = response.msg;
+            if (isN === 'true') this.visible = true;
+            if (isN === 'false') sign === 2 ? this.showLongitudex = true : (sign === 1 ? this.showLongitude = true : this.showLongitudeq = true);
+            this.sign = sign;
+            this.uuid = uuidv4();
+            this.$nextTick(() => {
+                //2.5d 线/区域 轨迹
+                if ((this.sign === 2 && this.visible === true) || (this.sign === 3 && this.visible === true)) {
+                  const arr = JSON.parse(form.xiantude == undefined || form.xiantude == null ? "[]" : form.xiantude);
+                  setTimeout(() => {
+                    this.$refs.supermap.superMapInfo(this.sign, arr,NB);
+                  }, 2000);
+                }
+              }
+            )
+          })
+        }
+        else {
+          getConfigKey('supermapKey').then(response => {
+            let isN = response.msg;
+            if (isN === 'true') this.visible = true;
+            if (isN === 'false') sign === 2 ? this.showLongitudex = true : (sign === 1 ? this.showLongitude = true : this.showLongitudeq = true);
+            this.sign = sign;
+            this.uuid = uuidv4();
+            this.$nextTick(() => {
+                //2d 点
+                if (this.sign === 1 && this.showLongitude === true) {
+                  setTimeout(() => {
+                    this.$refs.Supermap.clearM(false);
+                    if (form.longitude!==null && form.longitude!=='' && form.longitude!==undefined) {
+                      this.$refs.Supermap.setMarkers([{lng: form.longitude, lat: form.latitude, icon: "marker"}])
+                    }
+                  }, 2000);
+                }
+                // //2.5d 点
+                // if (this.sign === 1 && this.visible === true) {
+                //   setTimeout(() => {
+                //     this.$refs.supermap.superMapInfo(this.sign, {longitude: form.longitude, latitude: form.latitude});
+                //   }, 2000)
+                // }
+                //2.5d 点
+                if (this.sign === 1 && this.visible === true) {
+                  setTimeout(() => {
+                    this.$refs.supermap.superMapInfo(this.sign, {longitude: form.longitude, latitude: form.latitude});
+                  }, 2000);
+                  setTimeout(() => {
+                    this.$refs.supermap.loadRoad()
+                  }, 7000);
+                }
+                //2.5d 线/区域
+                if ((this.sign === 2 && this.visible === true) || (this.sign === 3 && this.visible === true)) {
+                  const arr = JSON.parse(form.xiantude == undefined || form.xiantude == null ? "[]" : form.xiantude);
+                  const array = [];
+                  for (let i = 0; i < arr.length; i++) {
+                    array.push(arr[i].lng);
+                    array.push(arr[i].lat);
+                  }
+                  setTimeout(() => {
+                    this.$refs.supermap.superMapInfo(this.sign, {
+                      graphicsList: array && array.length > 0 ? array : [],
+                      color: "rgba(23,22,22,0)",
+                      withAlpha: 0.8
+                    });
+                  }, 2000)
+                }
+
+
+                //2d 线
+                if (this.sign === 2 && this.showLongitudex === true) {
+                  const arr = JSON.parse(form.xiantude);
+                  setTimeout(() => {
+                    this.$refs.LineSupermap.setConnectList(arr && arr.length > 0 ? arr : [], "#1a1919");
+                  }, 2000)
+                }
+                //2d 区域
+                if (this.sign === 3 && this.showLongitudeq === true) {
+                  const arr = JSON.parse(form.xiantude);
+                  setTimeout(() => {
+                    this.$refs.areaSupermap.setGraphicsList(
+                      arr && arr.length > 0 ? arr : [],
+                      "#1a1919");
+                  }, 2000)
+                }
+              }
+            )
+          })
+
+        }
+      },
+      closeDialog() {
+        if (this.obj.longitude || (this.obj.xiantude && JSON.parse(this.obj.xiantude).length > 0)) this.$emit('send', this.obj);
+        this.visible = false;
+        this.showLongitude = false;
+        this.showLongitudex = false;
+        this.showLongitudeq = false;
+      },
+      close() {
+        this.$emit('send', true);
+        this.visible = false;
+        this.showLongitude = false;
+        this.showLongitudex = false;
+        this.showLongitudeq = false;
+      },
+    }
+
+  };
+</script>

+ 735 - 0
event-ui/src/views/components/supermap-2.5d.vue

@@ -0,0 +1,735 @@
+<template>
+  <div id="cesiumContainer" style="width: 100%; height: 100%;background: none;">
+  </div>
+</template>
+
+<script>
+  import {
+    iconList
+  } from '@/api/components/supermap.js'
+  import {
+    getConfigKey
+  } from '@/api/system/config'
+  import Cookies from 'js-cookie'
+
+  export default {
+    name: 'supermap-2.5d',
+    data() {
+      return {
+        chooseMode: [
+          Cesium.DrawMode.Line,
+          Cesium.DrawMode.Polygon,
+        ],
+        markerList: [],
+        bindPopupHtml: null,
+        mapshow: false,
+        superMapRootUrl: null,
+        layerList: [],
+        viewer: null,
+        scene: null,
+        handler: null,
+        pick: null,
+        back_position: null,
+        type: null,
+        content: null,
+        mvtMap0: null,
+        shuixi_name: null,
+        mvtMap1: null,
+        mvtMap2: null,
+        mvtMap3: null,
+        road_name: null,
+        layer_xiangzhenjie_name: null,
+        markerboxEntity: [],//地图落点实体
+        connectBoxEntity: null,//地图线实体
+        graphicsBoxEntity: null,//地图面实体
+        markerboxEntityRadius: [],//地图落点实体
+        connectBoxEntityTwo: null,//地图线实体
+        /*************************原地图属性*********************/
+        isEditableLayers: false, //绘图控件
+
+        /*************************原地图属性*********************/
+        aac: null,
+        queryParams: {
+          name: null,
+          mapData: null,
+          mapName: null
+        },
+      }
+    },
+    watch: {},
+    created() {
+    },
+    mounted() {
+      // this.superMapInfo();
+    },
+    props: {
+      putSmUserID_layer: null,
+    },
+    methods: {
+      superMapInfo(type, obj,NB) {
+        getConfigKey('superMap.iServer').then(response => {
+          this.superMapRootUrl = response.msg;
+          this.onload(type, obj,NB);
+        })
+      },
+      //清除所有
+      clearAll() {
+        this.viewer.entities.removeAll()
+      },
+      //移除之前添加的点
+      clearMRadius() {
+        if (this.markerboxEntityRadius != null && this.markerboxEntityRadius.length > 0) {
+          for (let i = 0; i < this.markerboxEntityRadius.length; i++) {
+            this.viewer.entities.remove(this.markerboxEntityRadius[i])
+          }
+          this.markerboxEntityRadius = []
+        }
+      },
+      //移除之前添加的线
+      clearTwoC() {
+        if (this.connectBoxEntityTwo != null) {
+          this.viewer.entities.remove(this.connectBoxEntityTwo)
+          this.connectBoxEntityTwo = null
+        }
+      },
+      /**
+       * 地图落点-覆盖范围
+       */
+      setMarkersRadius(makerList) {
+        let that = this
+        that.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)
+        for (let i in makerList) {
+          let longitude = makerList[i].lng;
+          let latitude = makerList[i].lat;
+          let marker = that.viewer.entities.add({
+            name: "",
+            position: Cesium.Cartesian3.fromDegrees(longitude, latitude),
+            billboard: {
+              image: iconList[makerList[i].icon],
+              width: 48,
+              height: 48,
+              heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+              disableDepthTestDistance: Number.POSITIVE_INFINITY
+            },
+            description: makerList[i].bindPopupHtml,
+            click: makerList[i].click,
+            parameter: makerList[i].parameter
+          })
+          that.markerboxEntityRadius.push(marker)
+          //绘制摄像头的圈(覆盖范围)
+          let markerRadius = that.viewer.entities.add({
+            position: Cesium.Cartesian3.fromDegrees(makerList[i].lng, makerList[i].lat, 2),
+            ellipse: {
+              semiMinorAxis: makerList[i].radius,
+              semiMajorAxis: makerList[i].radius,
+              height: 0.0,
+              material: Cesium.Color.DODGERBLUE.withAlpha(0.4),
+              outline: true,
+              outlineColor: Cesium.Color.DEEPSKYBLUE.withAlpha(1),
+              outlineWidth: 1,
+            },
+          });
+          that.markerboxEntityRadius.push(markerRadius)
+        }
+        that.viewer.scene.globe.depthTestAgainstTerrain = false
+        that.createLeftClickDescription()
+        that.createRightClickDescription()
+      },
+      /**
+       * 地图画线(贴地)
+       */
+      setConnectTwoList(connectList, color, withAlpha) {
+        let that = this
+        //Cesium.Color.fromCssColorString('#67ADDF')   16进制颜色设置
+        let material = Cesium.Color.fromCssColorString(color).withAlpha(withAlpha);
+        that.connectBoxEntityTwo = that.viewer.entities.add({
+          Type: 'Polyline',
+          polyline: {
+            positions: Cesium.Cartesian3.fromDegreesArray(connectList),
+            clampToGround: true,//贴地 true,不贴地  false
+            width: 5,
+            material: material
+          }
+        })
+      },
+      //移除之前添加的点
+      clearM() {
+        if (this.markerboxEntity != null && this.markerboxEntity.length > 0) {
+          for (let i = 0; i < this.markerboxEntity.length; i++) {
+            this.viewer.entities.remove(this.markerboxEntity[i])
+          }
+          this.markerboxEntity = []
+        }
+      },
+      //移除之前添加的线
+      clearC() {
+        if (this.connectBoxEntity != null) {
+          this.viewer.entities.remove(this.connectBoxEntity)
+          this.connectBoxEntity = null
+        }
+      },
+      //移除之前添加的面
+      clearG() {
+        if (this.graphicsBoxEntity != null) {
+          this.viewer.entities.remove(this.graphicsBoxEntity)
+          this.graphicsBoxEntity = null
+        }
+      },
+      reload(list) {
+        this.removeAll();
+        this.layerList = list;
+        for (let i = 0; i < this.layerList.length; i++) {
+          if (this.layerList[i] == "lindi") {
+            this.loadLindi();
+          } else if (this.layerList[i] == "shuixi") {
+            this.loadShuixi();
+          } else if (this.layerList[i] == "road") {
+            this.loadRoad();
+          } else if (this.layerList[i] == "nongtian") {
+            this.loadNongtian();
+          }
+        }
+      },
+      loadShuixi() {//水系
+        let that = this;
+        if (that.mvtMap0 != null) {
+          that.mvtMap0.show = true;
+          that.shuixi_name.then(function (layers) {
+            let textlayer = that.viewer.scene.layers.find('ShuiXi@SiPing#1');//文字图层
+            textlayer.visible = true;
+          });
+        }
+      },
+      loadLindi() {//林地
+        if (this.mvtMap1 != null) {
+          this.mvtMap1.show = true;
+        }
+      },
+      loadNongtian() {//农田
+        if (this.mvtMap2 != null) {
+          this.mvtMap2.show = true;
+        }
+      },
+      loadRoad() {//路网
+        let that = this;
+        if (that.mvtMap3 != null) {
+          that.mvtMap3.show = true;
+          that.road_name.then(function (layers) {
+            let provinceRoad_textLayer = that.viewer.scene.layers.find('ProvinceRoad_L@SiPing#1');//文字图层
+            let countyRoad_textLayer = that.viewer.scene.layers.find('CountyRoad_L@SiPing#1');//文字图层
+            let stateRoad_textLayer = that.viewer.scene.layers.find('StateRoad_L@SiPing#1');//文字图层
+            provinceRoad_textLayer.visible = true;
+            countyRoad_textLayer.visible = true;
+            stateRoad_textLayer.visible = true;
+          });
+        }
+      },
+      removeAll() {
+        let that = this;
+        // 移除方法,暂存:this.viewer.scene.removeVectorTilesMap(this.mvtMap3.name);
+        if (that.mvtMap0 != null) {
+          that.mvtMap0.show = false;
+          //that
+          that.shuixi_name.then(function (layers) {
+            let textlayer = that.viewer.scene.layers.find('ShuiXi@SiPing#1');//文字图层
+            textlayer.visible = false;
+          });
+        }
+        if (that.mvtMap1 != null) {
+          that.mvtMap1.show = false
+        }
+        if (that.mvtMap2 != null) {
+          that.mvtMap2.show = false
+        }
+        if (that.mvtMap3 != null) {
+          that.mvtMap3.show = false
+
+          //NAME隐藏
+          that.road_name.then(function (layers) {
+            let provinceRoad_textLayer = that.viewer.scene.layers.find('ProvinceRoad_L@SiPing#1');//文字图层
+            let countyRoad_textLayer = that.viewer.scene.layers.find('CountyRoad_L@SiPing#1');//文字图层
+            let stateRoad_textLayer = that.viewer.scene.layers.find('StateRoad_L@SiPing#1');//文字图层
+            provinceRoad_textLayer.visible = false;
+            countyRoad_textLayer.visible = false;
+            stateRoad_textLayer.visible = false;
+          });
+        }
+      },
+      onload(type, obj,NB) {
+        let that = this;
+        //1.添加地形数据
+        that.viewer = new Cesium.Viewer('cesiumContainer', {
+          //创建地形服务提供者的实例,url为SuperMap iServer发布的TIN地形服务
+          terrainProvider: new Cesium.CesiumTerrainProvider({
+            url: that.superMapRootUrl + "/3D-sipingchangjing/rest/realspace/datas/dem@spyx4326",
+            //isSct : false,//地形服务源自SuperMap iServer发布时需设置isSct为true
+            invisibility: true
+          }),
+          infoBox: false,
+          navigation: false
+        }, {
+          contextOptions: {
+            msaaLevel: 4,
+            requestWebgl2: true
+          },
+          orderIndependentTranslucency: false
+        });
+        let scene = that.viewer.scene;
+        that.viewer.cesiumWidget.creditContainer.style.display = "none" // 去掉超图logo水印
+
+        //2.添加SuperMap iServer发布的影像服务
+        let layer = that.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
+          url: that.superMapRootUrl + "/3D-sipingchangjing/rest/realspace/datas/siping_2m@spyx4326",
+        }));
+
+        //3.添加SuperMap 建筑场景
+        let aaaa = that.superMapRootUrl + "/3D-local3DCache-Data3/rest/realspace";
+        scene.open(aaaa);
+
+        //飞行值坐标点,每3秒推进一级
+        //heading-代表镜头左右方向,正值为右,负值为左
+        //pitch-代表镜头上下方向,正值为上,负值为下.
+        //roll-代表镜头左右倾斜,正值,向右倾斜,负值向左倾斜
+        setTimeout(function () {
+          that.viewer.camera.flyTo({
+            destination: Cesium.Cartesian3.fromDegrees(124.49980650138238, 43.428263986216815, 950000),
+            orientation: {
+              // heading :  Cesium.Math.toRadians(346.4202942851978),
+              // pitch : Cesium.Math.toRadians(-56.74026687972041),
+              // roll : Cesium.Math.toRadians(0)
+            }
+          });
+
+        }, 3000);
+        setTimeout(function () {
+          that.viewer.camera.flyTo({
+            destination: Cesium.Cartesian3.fromDegrees(124.49980650138238, 43.428263986216815, 650000),
+            orientation: {
+              // heading :  Cesium.Math.toRadians(346.4202942851978),
+              // pitch : Cesium.Math.toRadians(-56.74026687972041),
+              // roll : Cesium.Math.toRadians(0)
+            }
+          });
+
+        }, 3000);
+        setTimeout(function () {
+          that.viewer.camera.flyTo({
+            destination: Cesium.Cartesian3.fromDegrees(124.49980650138238, 43.428263986216815, 350000),
+            orientation: {
+              // heading :  Cesium.Math.toRadians(346.4202942851978),
+              // pitch : Cesium.Math.toRadians(-56.74026687972041),
+              // roll : Cesium.Math.toRadians(0)
+            }
+          });
+
+        }, 3000);
+
+        //开始加载专题图等数据,8秒后开始执行
+        setTimeout(function () {
+          //3.水系
+          let shuixi = that.superMapRootUrl + "/map-mvt-shuixiMian/restjsr/v1/vectortile/maps/shuixi_Mian";
+          that.mvtMap0 = scene.addVectorTilesMap({
+            url: shuixi,
+            canvasWidth: 512,
+            name: 'mvt_map0',
+            viewer: that.viewer
+          });
+          that.mvtMap0.selectedColor = new Cesium.Color(6, 169, 254, 0.5);
+          that.mvtMap0.show = false;
+
+          //4.林地
+          let lindi = that.superMapRootUrl + "/map-mvt-lindi/restjsr/v1/vectortile/maps/lindi";
+          that.mvtMap1 = scene.addVectorTilesMap({
+            url: lindi,
+            canvasWidth: 512,
+            name: 'mvt_map1',
+            viewer: that.viewer
+          });
+          that.mvtMap1.selectedColor = new Cesium.Color(6, 254, 181, 0.5);
+          that.mvtMap1.show = false;
+
+          //5.农田
+          let nongtian = that.superMapRootUrl + "/map-mvt-nongtian/restjsr/v1/vectortile/maps/nongtian";
+          that.mvtMap2 = scene.addVectorTilesMap({
+            url: nongtian,
+            canvasWidth: 512,
+            name: 'mvt_map2',
+            viewer: that.viewer
+          });
+          that.mvtMap2.selectedColor = new Cesium.Color(250, 236, 246, 1.0);
+          that.mvtMap2.show = false;
+
+          //6.路网
+          let road = that.superMapRootUrl + "/map-mvt-roadXian/restjsr/v1/vectortile/maps/road_Xian";
+          that.mvtMap3 = scene.addVectorTilesMap({
+            url: road,
+            canvasWidth: 512,
+            name: 'mvt_map3',
+            viewer: that.viewer
+          });
+          that.mvtMap3.show = false;
+
+          //7.添加路网NAME
+          let road_name_url = that.superMapRootUrl + '/3D-road_Name_S/rest/realspace';
+          that.road_name = scene.open(road_name_url);
+
+          that.road_name.then(function (layers) {
+            let provinceRoad_textLayer = scene.layers.find('ProvinceRoad_L@SiPing#1');//文字图层
+            let countyRoad_textLayer = scene.layers.find('CountyRoad_L@SiPing#1');//文字图层
+            let stateRoad_textLayer = scene.layers.find('StateRoad_L@SiPing#1');//文字图层
+            //加载后隐藏
+            provinceRoad_textLayer.visible = false;
+            countyRoad_textLayer.visible = false;
+            stateRoad_textLayer.visible = false;
+            //关闭避让
+            provinceRoad_textLayer.isOverlapDisplayed = true;
+            countyRoad_textLayer.isOverlapDisplayed = true;
+            stateRoad_textLayer.isOverlapDisplayed = true;
+          });
+          // 8.添加水系NAME
+          let shuixi_name_url = that.superMapRootUrl + '/3D-shuixi_Name/rest/realspace';
+          that.shuixi_name = scene.open(shuixi_name_url);
+          that.shuixi_name.then(function (layers) {
+            let textlayer = scene.layers.find('ShuiXi@SiPing#1');//文字图层
+            //加载后隐藏
+            textlayer.visible = false;
+            //关闭避让
+            textlayer.isOverlapDisplayed = true;
+          });
+
+          //9.添加县界和乡镇界
+          let layer_xianjie = that.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
+            url: that.superMapRootUrl + "/map-SIPING/rest/maps/XianJie_XiangZhenJie",
+          }));
+
+          //10.添加区县乡镇村名称
+          let layer_xiangzhenjie_name = that.superMapRootUrl + '/3D-Name_he/rest/realspace';
+          scene.open(layer_xiangzhenjie_name);
+          that.road_name.then(function (layers) {
+            let xianJie_textLayer = scene.layers.find('XianJie@SiPing#1');//区县文字图层
+            let xiangZhenJie_textLayer = scene.layers.find('XiangZhenJie@SiPing#2');//乡镇文字图层
+            let cun_textLayer = scene.layers.find('Cun@SiPing#1');//村文字图层
+            //关闭避让
+            xianJie_textLayer.isOverlapDisplayed = true;
+            xiangZhenJie_textLayer.isOverlapDisplayed = true;
+            cun_textLayer.isOverlapDisplayed = true;
+          });
+
+          // //9.添加乡镇界
+          // let layer_xiangzhenjie = that.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
+          //   url : that.superMapRootUrl+"/map-SIPING/rest/maps/XiangZhenJie",
+          // }));
+          //
+          // //10.添加县界
+          // let layer_xianjie = that.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
+          //   url : that.superMapRootUrl+"/map-SIPING/rest/maps/XianJie",
+          // }));
+
+          // //11.添加县界名称 此处要先添加县界名称 否则县界名会不显示
+          // let layer_xianjie_name = that.superMapRootUrl+'/3D-XianJie_Name/rest/realspace';
+          // scene.open(layer_xianjie_name);
+          //
+          // //12.添加乡镇界名称
+          // let layer_xiangzhenjie_name = that.superMapRootUrl+'/3D-XiangZhenJie_Name/rest/realspace';
+          // scene.open(layer_xiangzhenjie_name);
+
+        }, 3000);
+        if (NB!='NB') {
+          if (type == 1) {//拾取点位
+            that.getLeftClickDescription(obj);
+          }
+          if (type == 2) {//标线
+            that.entityHandler(0);
+            that.setConnectList(obj.graphicsList, obj.color, obj.withAlpha);
+          }
+          if (type == 3) {//标面
+            that.entityHandler(1);
+            that.setGraphicsList(obj.graphicsList, obj.color, obj.withAlpha);
+          }
+        }
+        if (NB=='NB' && type == 2){
+          // console.log(obj)
+          that.entityHandler(0);
+          // that.setConnectList(obj.graphicsList, obj.color, obj.withAlpha);
+          for (let i = 0; i < obj.length; i++) {
+            let arrayBlue = [];
+            let arrayRed = [];
+            // if (Array.isArray(obj[i].params)){
+              for (let j = 0; j < obj[i].params.length; j++) {
+                if (obj[i].id===666){
+                  arrayBlue.push(obj[i].params[j].lng);
+                  arrayBlue.push(obj[i].params[j].lat);
+                }
+                else {
+                  arrayRed.push(obj[i].params[j].lng);
+                  arrayRed.push(obj[i].params[j].lat);
+                }
+              }
+              that.setConnectTwoList(
+                Array.isArray(arrayRed) && arrayRed.length > 0 ? arrayRed : [],
+                "rgba(232,14,14,0)",
+                0.8
+              );
+            that.setConnectTwoList(
+              Array.isArray(arrayBlue) && arrayBlue.length > 0 ? arrayBlue : [],
+              "rgba(14,25,231,0)",
+              0.8
+            );
+            // }
+          }
+        }
+        that.viewer.selectedEntityChanged.addEventListener(function (entity) {
+          if (entity != undefined && Reflect.has(entity, 'layerID')) {
+            that.putSmUserID_layer(entity);
+          }
+        });
+      },
+      entityHandler(chooseDrawMode) {
+        let that = this;
+        that.markerList = [];
+        that.handler = new Cesium.DrawHandler(that.viewer, that.chooseMode[chooseDrawMode]);
+        that.handler.activeEvt.addEventListener(function (isActive) {
+          if (isActive == true) {
+            that.viewer.enableCursorStyle = false;
+            that.viewer._element.style.cursor = '';
+          } else {
+            that.viewer.enableCursorStyle = true;
+          }
+        });
+        that.viewer.scene.globe.depthTestAgainstTerrain = false
+        that.handler.activate();
+        var newhandler = new Cesium.ScreenSpaceEventHandler(that.viewer.scene.canvas);
+        newhandler.setInputAction(function (event) {
+          // 屏幕坐标转世界坐标——关键点
+          var ellipsoid = that.viewer.scene.globe.ellipsoid;
+          var cartesian = that.viewer.camera.pickEllipsoid(event.position, ellipsoid);
+          //将笛卡尔坐标转换为地理坐标
+          var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
+          //将弧度转为度的十进制度表示
+          var lon = Cesium.Math.toDegrees(cartographic.longitude);
+          var lat = Cesium.Math.toDegrees(cartographic.latitude);
+          let draw = {lng: 0, lat: 0};
+          draw.lng = lon;
+          draw.lat = lat;
+          if (!that.markerList.includes(draw)) {
+            that.markerList.push(draw);
+            that.$emit("showLatLng", {markerList: that.markerList});
+          }
+        }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
+      },
+      getLeftClickDescription(obj) {
+        let that = this
+        that.handler = new Cesium.ScreenSpaceEventHandler(that.viewer.scene.canvas);
+        if (obj.longitude) {
+          //在点击位置添加对应点
+          that.viewer.entities.add({
+            name: '',
+            position: Cesium.Cartesian3.fromDegrees(obj.longitude, obj.latitude),
+            billboard: {
+              image: iconList['marker'],
+              width: 48,
+              height: 48,
+              disableDepthTestDistance: Number.POSITIVE_INFINITY
+            },
+          })
+        }
+        //设置鼠标左键单击回调事件
+        that.handler.setInputAction(function (e) {
+          //首先移除之前添加的点
+          that.viewer.entities.removeAll();
+          //获取点击位置笛卡尔坐标
+          let position = that.viewer.scene.pickPosition(e.position);
+          //将笛卡尔坐标转化为经纬度坐标
+          let cartographic = Cesium.Cartographic.fromCartesian(position);
+          let longitude = Cesium.Math.toDegrees(cartographic.longitude);
+          let latitude = Cesium.Math.toDegrees(cartographic.latitude);
+          that.$emit("showLatLng", {latitude: latitude, longitude: longitude})
+          //在点击位置添加对应点
+          that.viewer.entities.add({
+            name: '',
+            position: Cesium.Cartesian3.fromDegrees(longitude, latitude),
+            billboard: {
+              image: iconList['marker'],
+              width: 48,
+              height: 48,
+              heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+              disableDepthTestDistance: Number.POSITIVE_INFINITY
+            },
+          })
+          that.markerboxEntity.push(marker)
+          that.viewer.scene.globe.depthTestAgainstTerrain = false
+        }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
+      },
+      /**
+       * 地图落点
+       */
+      setMarkers(makerList) {
+        let that = this
+        that.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)
+        for (let i in makerList) {
+          let longitude = makerList[i].lng;
+          let latitude = makerList[i].lat;
+          let marker = that.viewer.entities.add({
+            name: "",
+            position: Cesium.Cartesian3.fromDegrees(longitude, latitude),
+            billboard: {
+              image: iconList[makerList[i].icon],
+              width: 48,
+              height: 48,
+              heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+              disableDepthTestDistance: Number.POSITIVE_INFINITY
+            },
+            description: makerList[i].bindPopupHtml,
+            click: makerList[i].click,
+            parameter: makerList[i].parameter
+          })
+          that.markerboxEntity.push(marker)
+        }
+        that.viewer.scene.globe.depthTestAgainstTerrain = false
+        that.createLeftClickDescription()
+        that.createRightClickDescription()
+      },
+      /**
+       *鼠标左击事件是原来的气泡
+       */
+      createLeftClickDescription() {
+        let that = this;
+        that.handler.setInputAction(function (movement) {
+          that.pick = that.viewer.scene.pick(movement.position);
+          if (that.pick && that.pick) {
+            let id = Cesium.defaultValue(that.viewer.scene.pick(movement.position).id, that.viewer.scene.pick(
+              movement.position).primitive.id);
+
+            let html = id._description;
+            if (html != undefined && html._value != null && html._value != '') {
+              that.bindPopupHtml = html
+              that.mapshow = true
+            } else {
+              that.mapshow = false
+            }
+          } else {
+            that.mapshow = false
+          }
+        }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
+      },
+      /**
+       *鼠标右击事件是原来的点击
+       */
+      createRightClickDescription() {
+        let that = this;
+        that.handler.setInputAction(function (movement) {
+          that.mapshow = false
+          // 监听鼠标的当前位置坐标,然后根据当前坐标去动态更新气泡窗口div的显示位置;
+          that.pick = that.viewer.scene.pick(movement.position);
+          if (that.pick && that.pick) {
+            let id = Cesium.defaultValue(that.viewer.scene.pick(movement.position).id, that.viewer.scene.pick(movement.position).primitive.id);
+            let clickName = id._click;
+            that.$emit(clickName, id._parameter)
+          }
+        }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
+      },
+      /**
+       * 落点定位
+       */
+      dropLocation(lat, lng) {
+        this.viewer.camera.flyTo({
+          destination: Cesium.Cartesian3.fromDegrees(lng, lat, 3000),
+        });
+      },
+      /**
+       * 地图画线(贴地)
+       */
+      setConnectList(connectList, color, withAlpha) {
+        let that = this
+        //Cesium.Color.fromCssColorString('#67ADDF')   16进制颜色设置
+        let material = Cesium.Color.fromCssColorString(color).withAlpha(withAlpha);
+        that.connectBoxEntity = that.viewer.entities.add({
+          Type: 'Polyline',
+          polyline: {
+            positions: Cesium.Cartesian3.fromDegreesArray(connectList),
+            clampToGround: true,//贴地 true,不贴地  false
+            width: 5,
+            material: material
+          }
+        })
+      },
+      /**
+       * 地图图形(贴地)
+       */
+      setGraphicsList(graphicsList, color, withAlpha) {
+        let that = this
+        //Cesium.Color.fromCssColorString('#67ADDF')   16进制颜色设置
+
+        let material = Cesium.Color.fromCssColorString(color).withAlpha(withAlpha);
+        that.graphicsBoxEntity = that.viewer.entities.add({
+          polygon: {
+            hierarchy: Cesium.Cartesian3.fromDegreesArray(graphicsList),
+            clampToGround: true,//贴地 true,不贴地  false
+            width: 5,
+            material: material
+          }
+        })
+      }
+    },
+  }
+</script>
+
+<style rel="stylesheet/scss" lang="scss" scoped>
+  .map-tit {
+    position: absolute;
+    top: 90px;
+    left: 50%;
+    transform: translatex(-50%);
+    border: 1px solid #15519b;
+    z-index: 9999;
+    background: linear-gradient(rgba(4, 23, 62, 0.6), rgba(0, 28, 70, 0.6));
+    min-width: 300px;
+
+    .top-tit {
+      width: 100%;
+      height: 28px;
+      line-height: 28px;
+      display: flex;
+      flex-direction: row;
+      justify-content: space-between;
+      background: #15519b80;
+      padding: 0px 10px;
+      align-items: center;
+
+      i {
+        color: #10ccff;
+        font-size: 18px;
+        text-shadow: 0px 0px 5px #23b3b3;;
+      }
+
+      span img {
+        display: block;
+        width: 12px;
+        height: 12px;
+        color: #fff;
+        cursor: pointer;
+      }
+    }
+
+    .map-txt {
+      padding: 10px 15px;
+      color: #fff;
+      line-height: 20px;
+      font-size: 12px;
+
+      .d-l-con {
+      }
+    }
+  }
+
+  .fade-enter-active,
+  .fade-leave-active {
+    transition: 1s;
+  }
+
+  .fade-enter,
+  .fade-leave-to {
+    opacity: 0;
+    transform: translateY(-10rem);
+  }
+</style>

+ 0 - 726
event-ui/src/views/components/supermap.vue

@@ -1,726 +0,0 @@
-<template>
-  <div v-bind:id="mapDivId" ref="map" style="width: 100%; height: 100%;background: none;"></div>
-</template>
-
-<script>
-import 'leaflet-side-by-side'
-import '@supermap/iclient-leaflet'
-import 'leaflet/dist/leaflet.css'
-import 'leaflet.markercluster/dist/leaflet.markercluster-src.js';
-import 'leaflet.markercluster/dist/MarkerCluster.css';
-import 'leaflet.markercluster/dist/MarkerCluster.Default.css';
-import 'leaflet-draw';
-import 'leaflet-draw/dist/leaflet.draw.css'
-
-import L from 'leaflet'
-
-import {getSuperMap, iconList} from '@/api/components/supermap.js'
-// import {setToken} from '../plugins/auth'
-import modal from '@/plugins/modal'
-
-export default {
-  name: "sookaSuperMap",
-  data() {
-    return {
-      mapDivId: "",
-      map: null,
-      layers: [],
-      isAggregationLayers: [],
-      radiusLayers: [],
-      myGroup: [],
-      isAggregationMyGroup: [],
-      polygon: null,
-      connectLayer: [],
-      graphicsLayer: [],
-      latLngLayers: [],
-      latLngGroup: [],
-      isEditableLayers: false,//绘图控件
-      drawControl: null,//绘图控件
-      deckglLayer : null,//图层Layer
-    }
-  },
-  watch: {
-    isEditableLayers: {
-      handler (newValue, oldValue) {
-        if (newValue) {
-          var editableLayers = new window.L.FeatureGroup();
-          this.map.addLayer(editableLayers);
-          let options = {
-            position: 'topleft',
-            draw: {
-              polyline: {},
-              polygon: {},
-              circle: {},
-              rectangle: {},
-              marker: {},
-              remove: {}
-            },
-            edit: {
-              featureGroup: editableLayers,
-              remove: true
-            }
-          };
-          this.drawControl = new window.L.Control.Draw(options);
-          this.map.addControl(this.drawControl);
-          this.map.on(window.L.Draw.Event.CREATED, function (e) {
-            let editableLayer = e.layer;
-            let layerType = e.layerType;
-            editableLayer.on('dblclick', function (e) {
-              if (layerType === "polygon"||layerType === "rectangle") {
-                let latlng = editableLayer.getLatLngs()[0];
-                //一个自定义的计算面积的函数
-                var seeArea = window.L.GeometryUtil.geodesicArea(latlng);
-                let area = (seeArea / 10e5).toFixed(2) + "k㎡";
-                modal.msg(area);
-              } else if (layerType === "polyline") {
-                let latlng = editableLayer.getLatLngs();
-                //一个自定义的计算长度的函数
-                let dis = 0;
-                for (let i = 0; i < latlng.length - 1; i++) {
-                  let start = latlng[i];
-                  let end = latlng[i + 1];
-                  dis += window.L.latLng([start.lat, start.lng]).distanceTo([end.lat, end.lng]);//计算两个点之间的距离,并累加
-                }
-                //结果得到的也是number类型,单位是KM
-                modal.msg((dis / 10e2).toFixed(2) + "km");
-              }
-            })
-            if(layerType === "marker"){
-              let icon = new window.L.Icon({
-                iconUrl: iconList['marker'],
-                iconSize: [48, 48],
-                iconAnchor: [24, 40],
-                popupAnchor: [-3, -40],
-                shadowSize: [41, 41],
-              })
-              editableLayer.options.icon=icon;
-            }
-            editableLayers.addLayer(editableLayer);
-          });
-        }else{
-          this.map.removeControl(this.drawControl);
-        }
-      },
-    }
-  },
-  mounted() {
-    this.initMap();
-    //添加画图的提示信息
-    window.L.drawLocal.draw.toolbar = {
-      actions: {
-        title: '取消绘图',
-        text: '取消'
-      },
-      finish: {
-        title: '完成绘图',
-        text: '完成'
-      },
-      undo: {
-        title: '删除最后绘制的点',
-        text: '删除最后一个点'
-      },
-      buttons: {
-        polyline: '绘制折线',
-        polygon: '绘制多边形',
-        rectangle: '绘制矩形',
-        circle: '绘制圆圈',
-        marker: '绘制标记',
-        circlemarker: '绘制圆圈标记'
-      }
-    }
-    window.L.drawLocal.draw.handlers = {
-      circle: {
-        tooltip: {
-          start: '单击并拖动以绘制圆形'
-        },
-        radius: '半径'
-      },
-      circlemarker: {
-        tooltip: {
-          start: '点击地图放置圆圈标记'
-        }
-      },
-      marker: {
-        tooltip: {
-          start: '点击地图放置标记'
-        }
-      },
-      polygon: {
-        tooltip: {
-          start: '点击开始绘制形状',
-          cont: '点击继续绘制形状',
-          end: '单击第一个点以关闭此形状'
-        }
-      },
-      polyline: {
-        error: '<strong>Error:</strong> shape edges cannot cross!',
-        tooltip: {
-          start: '点击开始画线',
-          cont: '点击继续画线',
-          end: '单击最后一点以完成线'
-        }
-      },
-      rectangle: {
-        tooltip: {
-          start: '单击并拖动以绘制矩形'
-        }
-      },
-      simpleshape: {
-        tooltip: {
-          end: '释放鼠标完成绘图'
-        }
-      }
-    }
-    window.L.drawLocal.edit = {
-      toolbar: {
-        actions: {
-          save: {
-            title: '保存更改',
-            text: '保存'
-          },
-          cancel: {
-            title: '取消编辑,放弃所有更改',
-            text: '取消'
-          },
-          clearAll: {
-            title: '清除所有图层',
-            text: '清除所有'
-          }
-        },
-        buttons: {
-          edit: '编辑图层',
-          editDisabled: '没有可编辑的图层',
-          remove: '删除图层',
-          removeDisabled: '没有可删除的图层'
-        }
-      },
-      handlers: {
-        edit: {
-          tooltip: {
-            text: '拖动手柄或标记以编辑要素',
-            subtext: '单击取消以撤消更改'
-          }
-        },
-        remove: {
-          tooltip: {
-            text: '单击要删除的功能'
-          }
-        }
-      }
-    }
-  },
-  props: {
-    mapDiv: null,
-    codes: null,
-    mapSite: {},
-    isSideBySide: null,
-    showLatLng: null,
-    showAreaLatLng: null,
-    showLineLatLng: null,
-  },
-  methods: {
-    clearM: async function (isAggregation) {//清理地图标点
-      if (isAggregation) {
-        if (this.isAggregationMyGroup != undefined && this.isAggregationMyGroup != false) {
-          this.isAggregationMyGroup.clearLayers()
-        }
-        this.map.removeLayer(this.isAggregationLayers);
-        this.isAggregationLayers = [];
-        this.radiusLayers = [];
-        this.isAggregationLayers = window.L.markerClusterGroup({
-          //设置为true时显示聚类所占据的范围
-          showCoverageOnHover: true,
-          //设置为true时会向低一级聚类缩放
-          zoomToBoundsOnClick: true,
-          //增加点位时增加聚合动画(否则会出问题)
-          animateAddingMarkers: true,
-          //最大缩放级别点击聚合图标展开图标
-          spiderfyOnMaxZoom:true,
-        });
-
-      } else {
-        if (this.myGroup != undefined && this.myGroup != false) {
-          this.myGroup.clearLayers()
-        }
-        this.layers = []
-      }
-
-    },
-    clearC: async function () {//清理地图画线
-      if (this.connectLayer != undefined && this.connectLayer != false) {
-        this.connectLayer.clearLayers();
-      }
-    },
-    clearG: async function () {//清理地图图形
-      if (this.graphicsLayer != undefined && this.graphicsLayer != false) {
-        this.graphicsLayer.clearLayers();
-      }
-    },
-    clearP: async function () {//清理点击事件落点
-      if (this.latLngGroup != undefined && this.latLngGroup != false) {
-        this.latLngGroup.clearLayers()
-      }
-      this.latLngLayers = []
-    },
-    initMap: function () {
-      let _that = this;
-      this.mapDivId = this.mapDiv;
-      let mapSite = this.mapSite;
-      let isSideBySide = this.isSideBySide;
-      // setToken("eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6ImY5Zjg3ZjVmLWQ4NTctNDQxZC04NmQ5LTg4OWExZWRlODE4ZSIsInVzZXJuYW1lIjoiYWRtaW4ifQ.26mAzmaM9pUza9585aLnRMyRd4GxvrWbCxN0erYsuiBDYQiYnyc-TwXVNDI7Xrpt3Bqmbnul-XMszOxYQi12LA");
-      _that.isAggregationLayers = window.L.markerClusterGroup({
-        //设置为true时显示聚类所占据的范围
-        showCoverageOnHover: true,
-        //设置为true时会向低一级聚类缩放
-        zoomToBoundsOnClick: true,
-        //增加点位时增加聚合动画(否则会出问题)
-        animateAddingMarkers: true,
-        //最大缩放级别点击聚合图标展开图标
-        spiderfyOnMaxZoom:true,
-      });
-      if (!isSideBySide) {  //只有一个地图
-        if (this.codes.length != 1) {
-          modal.msgError("请输入一个地图code!");
-          return
-        }
-        getSuperMap(this.codes).then(resp => {
-          let mapList = resp.data;
-          if (mapList != null && mapList.length > 0) {
-            let url = mapList[0].url;
-            let centerLat = mapList[0].centerLat;
-            let centerLng = mapList[0].centerLng;
-            let zoom = mapList[0].zoom;  //默认比例
-            let maxZoom = mapList[0].maxZoom;  //最大比例
-            let minZoom = mapList[0].minZoom; //最小比例
-            let zoomControl = mapList[0].zoomControl == null ? true : mapList[0].zoomControl;  //地图缩放+-号是否显示
-            let attributionControl = mapList[0].attributionControl == null ? true : mapList[0].attributionControl; //logo是否显示
-            let logoControl = mapList[0].logoControl == null ? false : mapList[0].logoControl; //logo是否显示
-            let dragging = mapList[0].dragging == null ? true : mapList[0].dragging; //地图是否允许鼠标拖拽
-
-            let defaultConfigure = {
-              crs: window.L.CRS.EPSG4326,
-              center: [centerLat, centerLng],
-              maxZoom: maxZoom,
-              minZoom: minZoom,
-              zoom: zoom,
-              editable: true,
-              zoomControl: zoomControl,
-              attributionControl: attributionControl,
-              dragging: dragging,
-              logoControl: logoControl
-            };
-            let loadConfiguration = Object.assign(defaultConfigure, mapSite);
-            this.map = window.L.map(this.mapDiv, loadConfiguration);
-            //鼠标双击落点
-            if (this.showLatLng != undefined) {
-              let icon = new window.L.Icon({
-                iconUrl: iconList['marker'],
-                iconSize: [48, 48],
-                iconAnchor: [24, 40],
-                popupAnchor: [-3, -40],
-                shadowSize: [41, 41],
-              })
-
-              this.map.on('dblclick', function (e) {
-                _that.clearP();
-                _that.showLatLng(e.latlng.lat, e.latlng.lng);
-                let marker = window.L.marker([e.latlng.lat, e.latlng.lng], {
-                  icon: icon
-                }).addTo(_that.map);
-                _that.latLngLayers.push(marker)
-                _that.latLngGroup = window.L.layerGroup(_that.latLngLayers)
-                _that.map.addLayer(_that.latLngGroup)
-              })
-            }
-            //鼠标绘制区域
-            if (this.showAreaLatLng != undefined) {
-              var editableLayers = new window.L.FeatureGroup();
-              this.map.addLayer(editableLayers);
-              let options = {
-                position: 'topleft',
-                draw: {
-                  polyline: null,
-                  polygon: {},
-                  circle: null,
-                  rectangle: null,
-                  circlemarker: null,
-                  marker: null,
-                  remove: {}
-                },
-                edit: {
-                  featureGroup: editableLayers,
-                  remove: true
-                }
-              };
-              var drawControl = new window.L.Control.Draw(options);
-              this.map.addControl(drawControl);
-              this.map.on(window.L.Draw.Event.CREATED, function (e) {
-                let editableLayer = e.layer;
-                let layerType = e.layerType;
-                if (layerType === "polygon"||layerType === "rectangle") {
-                  let latlng = editableLayer.getLatLngs()[0];
-                  _that.showAreaLatLng(latlng)
-                }
-                editableLayers.addLayer(editableLayer);
-              });
-            }
-            //鼠标绘制线段
-            if (this.showLineLatLng != undefined) {
-              var editableLayers = new window.L.FeatureGroup();
-              this.map.addLayer(editableLayers);
-              let options = {
-                position: 'topleft',
-                draw: {
-                  polyline: {},
-                  polygon: null,
-                  circle: null,
-                  rectangle: null,
-                  circlemarker: null,
-                  marker: null,
-                  remove: {}
-                },
-                edit: {
-                  featureGroup: editableLayers,
-                  remove: true
-                }
-              };
-              var drawControl = new window.L.Control.Draw(options);
-              this.map.addControl(drawControl);
-              this.map.on(window.L.Draw.Event.CREATED, function (e) {
-                let editableLayer = e.layer;
-                let layerType = e.layerType;
-                if (layerType === "polyline") {
-                  let latlng = editableLayer.getLatLngs();
-                  _that.showLineLatLng(latlng)
-                }
-                editableLayers.addLayer(editableLayer);
-              });
-            }
-            window.L.supermap.tiledMapLayer(url).addTo(_that.map);
-          }
-        })
-      } else {  //卷帘地图
-        if (this.codes.length != 2) {
-          modal.msgError("请输入两个地图code!");
-          return
-        }
-        getSuperMap(this.codes).then(resp => {
-          let mapList = resp.data;
-          if (mapList != null && mapList.length == 2) {
-            let stamenurl = mapList[0].url;
-            let osmurl = mapList[1].url;
-            let centerLat = mapList[0].centerLat;
-            let centerLng = mapList[0].centerLng;
-            let zoom = mapList[0].zoom;  //默认比例
-            let maxZoom = mapList[0].maxZoom;  //最大比例
-            let minZoom = mapList[0].minZoom; //最小比例
-            let zoomControl = mapList[0].zoomControl == null ? true : mapList[0].zoomControl;  //地图缩放+-号是否显示
-            let attributionControl = mapList[0].attributionControl == null ? true : mapList[0].attributionControl; //logo是否显示
-            let logoControl = mapList[0].logoControl == null ? false : mapList[0].logoControl; //logo是否显示
-            let dragging = mapList[0].dragging == null ? true : mapList[0].dragging; //地图是否允许鼠标拖拽
-
-            let defaultConfigure = {
-              crs: window.L.CRS.EPSG4326,
-              center: [centerLat, centerLng],
-              maxZoom: maxZoom,
-              minZoom: minZoom,
-              zoom: zoom,
-              editable: true,
-              zoomControl: zoomControl,
-              attributionControl: attributionControl,
-              dragging: dragging,
-              logoControl: logoControl
-            };
-
-            let loadConfiguration = Object.assign(defaultConfigure, mapSite);
-            this.map = window.L.map(this.mapDiv, loadConfiguration);
-            //鼠标双击落点
-            if (this.showLatLng != undefined) {
-              let icon = new window.L.Icon({
-                iconUrl: iconList['marker'],
-                iconSize: [48, 48],
-                iconAnchor: [24, 40],
-                popupAnchor: [-3, -40],
-                shadowSize: [41, 41],
-              })
-
-              _that.map.on('dblclick', function (e) {
-                _that.clearP();
-                _that.showLatLng(e.latlng.lat, e.latlng.lng);
-                let marker = window.L.marker([e.latlng.lat, e.latlng.lng], {
-                  icon: icon
-                }).addTo(_that.map);
-                _that.latLngLayers.push(marker)
-                _that.latLngGroup = window.L.layerGroup(_that.latLngLayers)
-                _that.map.addLayer(_that.latLngGroup)
-              })
-            }
-            //鼠标绘制区域
-            if (this.showAreaLatLng != undefined) {
-              var editableLayers = new window.L.FeatureGroup();
-              this.map.addLayer(editableLayers);
-              let options = {
-                position: 'topleft',
-                draw: {
-                  polyline: null,
-                  polygon: {},
-                  circle: null,
-                  rectangle: null,
-                  circlemarker: null,
-                  marker: null,
-                  remove: {}
-                },
-                edit: {
-                  featureGroup: editableLayers,
-                  remove: true
-                }
-              };
-              var drawControl = new window.L.Control.Draw(options);
-              this.map.addControl(drawControl);
-              this.map.on(window.L.Draw.Event.CREATED, function (e) {
-                let editableLayer = e.layer;
-                let layerType = e.layerType;
-                editableLayer.on('dblclick', function (e) {
-                  if (layerType === "polygon"||layerType === "rectangle") {
-                    let latlng = editableLayer.getLatLngs()[0];
-                    _that.showAreaLatLng(latlng)
-                  }
-                })
-                editableLayers.addLayer(editableLayer);
-              });
-            }
-            //鼠标绘制线段
-            if (this.showLineLatLng != undefined) {
-              var editableLayers = new window.L.FeatureGroup();
-              this.map.addLayer(editableLayers);
-              let options = {
-                position: 'topleft',
-                draw: {
-                  polyline: {},
-                  polygon: null,
-                  circle: null,
-                  rectangle: null,
-                  circlemarker: null,
-                  marker: null,
-                  remove: {}
-                },
-                edit: {
-                  featureGroup: editableLayers,
-                  remove: true
-                }
-              };
-              var drawControl = new window.L.Control.Draw(options);
-              this.map.addControl(drawControl);
-              this.map.on(window.L.Draw.Event.CREATED, function (e) {
-                let editableLayer = e.layer;
-                let layerType = e.layerType;
-                editableLayer.on('dblclick', function (e) {
-                  if (layerType === "polyline") {
-                    let latlng = editableLayer.getLatLngs();
-                    _that.showLineLatLng(latlng)
-                  }
-                })
-                editableLayers.addLayer(editableLayer);
-              });
-            }
-
-            let stamenLayer = window.L.supermap.tiledMapLayer(stamenurl).addTo(this.map);
-            let osmLayer = window.L.supermap.tiledMapLayer(osmurl).addTo(this.map);
-            L.control.sideBySide(stamenLayer, osmLayer).addTo(this.map);
-          }
-        })
-      }
-    },
-    // 获取面积
-    /**
-     * polygon [{lat:30,lng:104},{lat:30,lng:104},{lat:30,lng:104}]
-     */
-    formatArea: function (polygon) {
-      //L.GeometryUtil.geodesicArea(),返回number类型的数据,单位是平方米,这里做了一下转化
-      var seeArea = window.L.GeometryUtil.geodesicArea(polygon);
-      let area = (seeArea / 10e5).toFixed(2) + "k㎡";
-      return area;
-    },
-    // 获取长度
-    /**
-     * line[{lat:30,lng:104},{lat:30,lng:104},{lat:30,lng:104}]
-     */
-    formatLength: function (line) {
-      let dis = 0;
-      for (let i = 0; i < line.length - 1; i++) {
-        let start = line[i];
-        let end = line[i + 1];
-        dis += window.L.latLng([start.lat, start.lng]).distanceTo([end.lat, end.lng]);//计算两个点之间的距离,并累加
-      }
-      //结果得到的也是number类型,单位是 米
-      return (dis / 10e2).toFixed(2) + "km";
-    },
-    setMarkers: function (markersList) {//地图标点
-      const _that = this;
-      for (let i = 0; i < markersList.length; i++) {
-        let isAggregation = markersList[i].isAggregation == null ? false : markersList[i].isAggregation;  //是否聚合点位
-        let keepBindPopup = isAggregation == true ? false : markersList[i].keepBindPopup;  //提示气泡是否一直显示
-
-        let icon = new window.L.Icon({
-          iconUrl: iconList[markersList[i].icon],
-          iconSize: [48, 48],
-          iconAnchor: [24, 40],
-          popupAnchor: [-3, -40],
-          shadowSize: [41, 41],
-        })
-        let markerClick = window.L.marker([markersList[i].lat, markersList[i].lng], {
-          icon: icon
-        }).addTo(this.map);
-        if (markersList[i].bindPopupHtml != null && markersList[i].bindPopupHtml !== "") {
-          let html = markersList[i].bindPopupHtml;
-          if (keepBindPopup) {
-            markerClick.bindPopup(html, {
-              autoClose: false,
-              closeOnClick: null,
-              closeButton: false
-            }).openPopup(markerClick.getLatLng());
-          } else {
-            markerClick.on('mouseover', function () {
-              let html = markersList[i].bindPopupHtml;
-              this.bindPopup(html).openPopup(this.getLatLng());
-            }).on('mouseout', function () {
-              this.closePopup();
-            })
-          }
-        }
-        if (markersList[i].click != null && markersList[i].click !== "") {
-          if(markersList[i].parameter != null && markersList[i].parameter !== ""){
-            markerClick.on('click', function () {
-              let clickName = markersList[i].click;
-              _that.$emit(clickName,markersList[i].parameter);
-            })
-          }else{
-            markerClick.on('click', function () {
-              let clickName = markersList[i].click;
-              _that.$emit(clickName);
-            })
-          }
-        }
-        if (isAggregation) {
-          _that.isAggregationLayers.addLayer(markerClick)
-          _that.isAggregationMyGroup = window.L.layerGroup(_that.isAggregationLayers)
-          this.map.addLayer(_that.isAggregationLayers);
-        } else {
-          _that.layers.push(markerClick)
-          _that.myGroup = window.L.layerGroup(_that.layers)
-          this.map.addLayer(_that.myGroup)
-        }
-
-      }
-    },
-    setMarkersRadius: function (markersList) {//地图标点带范围
-      const _that = this;
-      for (let i = 0; i < markersList.length; i++) {
-        let isAggregation = markersList[i].isAggregation == null ? false : markersList[i].isAggregation;  //是否聚合点位
-        let keepBindPopup = isAggregation == true ? false : markersList[i].keepBindPopup;  //提示气泡是否一直显示
-
-        _that.polygon = window.L.circle([markersList[i].lat, markersList[i].lng], {radius: markersList[i].radius * 1000});
-        let icon = new window.L.Icon({//传感器
-          iconUrl: iconList[markersList[i].icon],
-          iconSize: [48, 48],
-          iconAnchor: [24, 40],
-          popupAnchor: [-3, -40],
-          shadowSize: [41, 41],
-        })
-        let marker = window.L.marker([markersList[i].lat, markersList[i].lng], {
-          icon: icon
-        });
-        if (markersList[i].bindPopupHtml != null && markersList[i].bindPopupHtml !== "") {
-          let html = markersList[i].bindPopupHtml;
-          if (keepBindPopup) {
-            marker.bindPopup(html, {
-              autoClose: false,
-              closeOnClick: null,
-              closeButton: false
-            }).openPopup(marker.getLatLng());
-          } else {
-            marker.on('mouseover', function () {
-              let html = markersList[i].bindPopupHtml;
-              this.bindPopup(html).openPopup(this.getLatLng());
-            }).on('mouseout', function () {
-              this.closePopup();
-            })
-          }
-        }
-        if (markersList[i].click != null && markersList[i].click != "") {
-          if(markersList[i].parameter != null && markersList[i].parameter !== ""){
-            marker.on('click', function () {
-              let clickName = markersList[i].click;
-              _that.$emit(clickName,markersList[i].parameter);
-            })
-          }else{
-            marker.on('click', function () {
-              let clickName = markersList[i].click;
-              _that.$emit(clickName);
-            })
-          }
-        }
-        marker.addTo(this.map);
-
-
-        if (isAggregation) {
-          _that.isAggregationLayers.addLayer(marker);
-          _that.radiusLayers.push(_that.polygon);
-          this.map.addLayer(_that.isAggregationLayers);
-          _that.isAggregationMyGroup = window.L.layerGroup(_that.radiusLayers)
-          this.map.addLayer(_that.isAggregationMyGroup)
-        } else {
-          _that.layers.push(marker);
-          _that.layers.push(_that.polygon);
-          _that.myGroup = window.L.layerGroup(_that.layers)
-          this.map.addLayer(_that.myGroup)
-        }
-      }
-    },
-    setConnectList: function (connectList, color) {//地图画线
-      const _that = this;
-      let points = [];
-      for (let i = 0; i < connectList.length; i++) {
-        points.push([connectList[i].lat, connectList[i].lng]);//创建点
-      }
-      let polyline = window.L.polyline(points, {color: color});
-      _that.connectLayer = window.L.featureGroup().addTo(this.map);
-      _that.connectLayer.addLayer(polyline);
-    },
-    setGraphicsList: function (graphicsList, color) {//地图图形
-      const _that = this;
-      let points = [];
-      for (let i = 0; i < graphicsList.length; i++) {
-        points.push([graphicsList[i].lat, graphicsList[i].lng]);//创建点
-      }
-      let polygon = window.L.polygon(points, {color: color});
-      polygon.addTo(this.map);
-      _that.graphicsLayer = window.L.featureGroup().addTo(this.map);
-      _that.graphicsLayer.addLayer(polygon);
-    },
-    dropLocation: function (lat, lng) {//落点定位
-      this.controlLevel(10)
-      setTimeout(() => {
-        this.map.panTo([lat, lng]);
-      },500)
-    },
-    controlLevel: function (level) {//控制地图缩放级别
-      this.map.setZoom(level)
-    },
-    layerSwitching: function (url,isClear) {//图层切换  url 图层地址   isClear  是否清除图层
-      if(isClear){
-        if(this.deckglLayer!=null){
-          this.deckglLayer.remove()
-        }
-      }
-      this.deckglLayer = window.L.supermap.tiledMapLayer(url,{
-      });
-      this.map.addLayer(this.deckglLayer);
-    },
-  }
-}
-</script>
-
-<style scoped>
-
-</style>

+ 230 - 15
event-ui/src/views/event/eventProcess/index.vue

@@ -23,7 +23,7 @@
         </el-select>
       </el-form-item>
       <el-form-item label="事件分类" prop="eventType" width="500">
-        <el-cascader ref="eventType" :options="eventTypeOptions" :props="{checkStrictly: true}" filterable clearable @change="handleEventTypeChange"/>
+        <el-cascader ref="eventType" :options="eventTypeOptions" :props="{checkStrictly: true}" filterable clearable @change="handleEventTypeChangeStrictly"/>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -32,7 +32,7 @@
     </el-form>
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
-        <el-button type="primary" plain icon="el-icon-plus" size="mini">新增</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button type="warning" plain icon="el-icon-download" size="mini">下载录像</el-button>
@@ -62,8 +62,83 @@
     </el-table>
     <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="selectCompositeEventList"/>
 
+    <!-- 事件新增对话框 -->
+    <el-dialog :title="title" :visible.sync="open_add" width="800px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="106px">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="事件名称" prop="eventName">
+              <el-input v-model="form.eventName" placeholder="请输入事件名称" maxlength="100"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="事件分类" prop="eventType">
+              <el-cascader ref="eventType" :options="eventTypeOptions" v-model="form.eventType" filterable clearable @change="handleEventTypeChange"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="事件来源" prop="reportSource">
+              <el-select v-model="form.reportSource" placeholder="请选择事件来源" style="width: 240px" disabled>
+                <el-option v-for="dict in dict.type.reporting_source" :key="dict.value" :label="dict.label" :value="dict.value"/>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="所属部门" prop="deptId">
+              <treeselect
+                :allowSelectingDisabledDescendants="true"
+                :show-count="true"
+                v-model="form.deptId" :options="deptOptions"
+                placeholder="请选择归属部门"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="经度" prop="longitude" @dblclick.native="openSuperMap">
+              <el-input v-model="form.longitude" placeholder="请输入经度"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="纬度" prop="latitude" @dblclick.native="openSuperMap">
+              <el-input v-model="form.latitude" placeholder="请输入纬度"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="上报具体位置" prop="address">
+              <el-input v-model="form.address" placeholder="请输入上报具体位置"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="事件描述" prop="eventDescription">
+              <el-input v-model="form.eventDescription" placeholder="请输入事件描述" type="textarea" :rows="4" resize="none"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="事件图片" prop="pictureList">
+              <image-upload v-model="form.pictureList"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
     <!-- 事件详情对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
+    <el-dialog :title="title" :visible.sync="open_view" width="1200px" append-to-body>
       <el-row :gutter="20">
         <!-- 左侧:事件详情 -->
         <el-col :span="14">
@@ -155,28 +230,44 @@
         </el-col>
       </el-row>
       <div slot="footer" class="dialog-footer">
-        <el-button @click="open = false">关 闭</el-button>
+        <el-button @click="open_view = false">关 闭</el-button>
       </div>
     </el-dialog>
 
+    <!-- 超图选点对话框 -->
+    <ISuperMap ref="ISuperMap" v-if="open_sm" @send="send"/>
+
   </div>
 </template>
 <script>
-import {getCompositeEventDetail, selectCompositeEventList} from "@/api/event/eventProcess/eventProcess";
-import {getEventTypeTree} from "@/api/event/eventtype/eventtype";
+import {
+  getCompositeEventDetail,
+  insertProcessEvent,
+  selectCompositeEventList
+} from "@/api/event/eventProcess/eventProcess";
+import {getEventTypeTree} from "@/api/event/eventType/eventType";
+import {checkLat, checkLon} from "@/api/rules/rules";
+import {treeselect} from "@/api/system/dept";
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import ISuperMap from '@/views/components/ISuperMap'
 
 export default {
   name: "eventProcess",
-  components: {},
+  components: {Treeselect, ISuperMap},
   dicts: ['reporting_source', 'event_status', 'event_log_type'],
   data() {
     return {
       // 总条数
       total: 0,
       // 标题
-      title: "事件详情",
+      title: null,
+      // 新增弹层开关
+      open_add: false,
       // 详情弹层开关
-      open: false,
+      open_view: false,
+      // superMap开关
+      open_sm: false,
       // 选中数组
       eventIds: [],
       // 遮罩层
@@ -196,10 +287,51 @@ export default {
         reportTimeEnd: null,
         reportSource: null,
       },
-      form: {}, // 事件表单
+      form: {
+        eventName: null,
+        reporter: null,
+        reportTime: null,
+        eventTypeName: null,
+        eventStatus: null,
+        eventType: null,
+        reportSource: 'reporting_source_2',
+        deptId: null,
+        longitude: null,
+        latitude: null,
+        address: null,
+        eventDescription: null,
+        pictureList: []
+      }, // 事件表单
       eventLogList: [], // 事件日志
       compositeEventList: [],
       eventTypeOptions: [], // 事件类型树形数据源
+      deptOptions: undefined,// 部门树选项
+      // 表单校验
+      rules: {
+        eventName: [
+          {required: true, message: '事件名称不能为空', trigger: 'blur'}
+        ],
+        eventDescription: [
+          {required: true, message: '事件描述不能为空', trigger: 'blur'}
+        ],
+        eventType: [
+          {required: true, message: '事件分类不能为空', trigger: 'change'}
+        ],
+        deptId: [
+          {required: true, message: '所属部门不能为空', trigger: 'change'}
+        ],
+        longitude: [
+          {required: true, message: '经度不能为空', trigger: ['blur']},
+          {validator: checkLon, trigger: 'blur'}
+        ],
+        latitude: [
+          {required: true, message: '纬度不能为空', trigger: ['blur']},
+          {validator: checkLat, trigger: 'blur'}
+        ],
+        address: [
+          {required: true, message: '上报具体位置不能为空', trigger: 'blur'}
+        ],
+      },
     }
   },
   async mounted() {
@@ -212,7 +344,7 @@ export default {
     this.selectCompositeEventList();
   },
   created() {
-
+    this.getTreeselect();
   },
   methods: {
     /** 查询数据列表 */
@@ -231,30 +363,62 @@ export default {
     },
     /** 查询数据详情 */
     handleDetail(row) {
+      this.title = "事件详情";
       const param = {
         ...this.queryParams,
         eventId: row.eventId,
         eventStatus: row.eventStatus,
       }
       getCompositeEventDetail(param).then(response => {
-        console.log(response.data)
         const { data } = response;
         // 设置事件基本信息
         this.form = data;
         // 设置事件日志列表
         this.eventLogList = data.eventLogList || [];
-        this.open = true;
+        this.open_view = true;
       });
     },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open_add = true;
+      this.title = "事件新增";
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          // 新增 deptIdList 字段,并赋值为 [deptId]
+          this.form.deptIdList = this.form.deptId ? [this.form.deptId] : [];
+          if (this.form.pictureList) {
+            if (typeof this.form.pictureList === 'string') {
+              this.form.pictureList = this.form.pictureList.split(',');
+            }
+          }
+          insertProcessEvent(this.form).then(response => {
+            this.$modal.msgSuccess("新增成功");
+            this.open_add = false;
+            this.selectCompositeEventList();
+          });
+        } else {
+          return false;
+        }
+      });
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data
+      })
+    },
     /** 获取事件类型数据源 */
     getEventTypeTree() {
       getEventTypeTree().then(response => {
         this.eventTypeOptions = response.data
-        console.log(this.eventTypeOptions)
       })
     },
     /** 获取选中事件类型 */
-    handleEventTypeChange(value) {
+    handleEventTypeChangeStrictly(value) {
       if (Array.isArray(value) && value.length > 0) {
         // 获取最后一项(叶子节点)
         this.queryParams.eventType = value[value.length - 1];
@@ -262,6 +426,16 @@ export default {
         this.queryParams.eventType = null;
       }
     },
+    /** 获取选中事件类型 */
+    handleEventTypeChange(value) {
+      if (Array.isArray(value) && value.length > 0) {
+        // 获取最后一项(叶子节点)
+        this.form.eventType = value[value.length - 1];
+      } else {
+        this.form.eventType = null;
+      }
+    },
+
     /** 设置事件状态默认值 */
     setDefaultEventStatus() {
       const trySetDefault = () => {
@@ -278,6 +452,47 @@ export default {
       const date = new Date().toISOString().split('T')[0];
       this.queryParams.reportTimeRange = [date, date];
     },
+    /** 打开超图选点弹层 */
+    openSuperMap() {
+      this.open_sm = true;
+      this.$nextTick(() => {
+        this.$refs.ISuperMap.init(1, {
+          id: this.form.id,
+          longitude: this.form.longitude,
+          latitude: this.form.latitude,
+        })
+      })
+    },
+    /** 超图组件交互方法 */
+    send(val) {
+      this.open_sm = false
+      this.form.longitude = val.longitude
+      this.form.latitude = val.latitude
+    },
+    /** 取消按钮 */
+    cancel() {
+      this.open_add = false;
+      this.reset();
+    },
+    /** 表单重置 */
+    reset() {
+      this.form = {
+        eventName: null,
+        reporter: null,
+        reportTime: null,
+        eventTypeName: null,
+        eventStatus: null,
+        eventType: null,
+        reportSource: 'reporting_source_2',
+        deptId: null,
+        longitude: null,
+        latitude: null,
+        address: null,
+        eventDescription: null,
+        pictureList: []
+      };
+      this.resetForm("form");
+    },
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;

+ 1 - 1
event-ui/src/views/event/eventtype/index.vue

@@ -73,7 +73,7 @@ import {
   addEventType,
   updateEventType,
   delEventType
-} from "@/api/event/eventtype/eventtype";
+} from "@/api/event/eventType/eventType";
 import treeSelect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";