Parcourir la source

智联工地-项目地图、实时视频修改优化

Perperon il y a 3 mois
Parent
commit
e2bf387f1f

+ 21 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubCameraMapper.java

@@ -0,0 +1,21 @@
+package com.rtrh.projects.modules.projects.mapper;
+
+import com.rtrh.core.repository.mybatis.MyBatisRepository;
+import com.rtrh.projects.modules.projects.po.SubCamera;
+import com.rtrh.projects.modules.projects.vo.CameraTreeVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author dupengcheng
+ * @date 2025/1/7
+ * @apiNote
+ */
+@MyBatisRepository
+public interface SubCameraMapper {
+
+    List<CameraTreeVO> cameraTreeNew(@Param("subId") String subId);
+
+    List<SubCamera> getListCameraBySubId(@Param("subId") String subId);
+}

+ 50 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubCameraMapper.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.rtrh.projects.modules.projects.mapper.SubCameraMapper" >
+
+
+    <select id="cameraTreeNew" resultType="com.rtrh.projects.modules.projects.vo.CameraTreeVO" parameterType="string">
+        SELECT
+        a.id,
+        a.sub_id subId,
+        a.title,
+        b.sub_name subName
+        FROM
+        sub_camera a
+        LEFT JOIN sub_info b ON a.sub_id = b.id
+        WHERE
+        a.logic_delete_flag = 0
+        AND b.logic_delete_flag = 0
+        AND a.title != 'HSIPC'
+        and b.indus_kind in('210','99','2')
+        <if test="subId != null and subId != ''">
+            AND a.sub_id = #{subId}
+        </if>
+    </select>
+
+    <select id="getListCameraBySubId" resultType="com.rtrh.projects.modules.projects.po.SubCamera" parameterType="string">
+        SELECT
+            id,
+            sub_id as subId ,
+            code ,
+            encode_device_code as encodeDeviceCode ,
+            title ,
+            longitude ,
+            latitude ,
+            remark ,
+            create_time as createTime ,
+            is_show  as isShow ,
+            create_user_id  as createUserId ,
+            last_update_userId as lastUpdateUserId ,
+            last_update_time as lastUpdateTime ,
+            logic_delete_flag as logicDeleteFlag
+        FROM
+            sub_camera
+        WHERE
+        logic_delete_flag = 0
+        <if test="subId != null and subId != ''">
+            AND sub_id = #{subId}
+        </if>
+    </select>
+
+</mapper>

+ 2 - 3
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.java

@@ -1,8 +1,6 @@
 package com.rtrh.projects.modules.projects.mapper;
 
-import java.math.BigDecimal;
 import java.util.List;
-import java.util.Map;
 
 import com.rtrh.projects.modules.projects.dto.SubFixCbSearch;
 import com.rtrh.projects.modules.projects.po.RptCont;
@@ -12,7 +10,6 @@ import com.rtrh.projects.modules.projects.vo.*;
 import com.rtrh.projects.modules.projects.po.SubInfoGxj;
 import com.rtrh.projects.modules.projects.vo.export.*;
 import com.rtrh.projects.vo.projects.SubFixGetBeginRateVo;
-import org.apache.ibatis.annotations.MapKey;
 import org.apache.ibatis.annotations.Param;
 
 import com.rtrh.core.repository.mybatis.MyBatisRepository;
@@ -45,6 +42,8 @@ public interface SubInfoMapper {
 
     SubInfoGxj findById(@Param("id") String id);
 
+    SubInfo findByFgwId(@Param("id") String id);
+
     List<SubFixCbVo> subFixCbAll(@Param("subFixCbSearch") SubFixCbSearch subFixCbSearch);
 
     @Select("SELECT sub_id FROM sub_fix where year = #{subInfoToSubFixVo.year} and cat = #{subInfoToSubFixVo.cat}")

+ 103 - 59
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.xml

@@ -12,71 +12,72 @@
 
     <select id="smartSiteQuery" resultType="com.rtrh.projects.modules.projects.vo.SubSmartVO"  >
         SELECT
-            si.sub_name subName,
-            si.begin_date beginDate,
-            si.end_date endDate,
-            si.amt_total amtTotal,
-            si.amt_year amtYear,
-            src2.yearAmtSj,
-            si.name_zrr nameZrr,
-            si.name_lead nameLead,
-            si.abc,
-            si.status,
-            si.longitude,
-            si.latitude,
-            si.id,
-            (
-                SELECT
-                    num_bl
-                FROM
-                    sub_rpt_cont src
-                WHERE
-                    src.sub_id = si.id
-                  AND src.logic_delete_flag = 0
-                ORDER BY
-                    last_update_time DESC,
-                    create_time DESC
-                LIMIT 1
-            ) numBl
+        si.sub_name subName,
+        si.begin_date beginDate,
+        si.end_date endDate,
+        si.amt_total amtTotal,
+        si.amt_year amtYear,
+        src2.yearAmtSj,
+        si.name_zrr nameZrr,
+        si.name_lead nameLead,
+        si.abc,
+        si.status,
+        si.longitude,
+        si.latitude,
+        si.id,
+        (
+        SELECT
+        num_bl
         FROM
---             sub_camera sc
---             LEFT JOIN sub_info si ON sc.sub_id = si.id
-            sub_info si
-            LEFT JOIN (
-            SELECT
-            sum(amt) yearAmt,
-            sa.sub_id
-            FROM
-            sub_amtplan sa
-            WHERE
-            sa.logic_delete_flag = 0
-            AND sa.y_month LIKE  CONCAT('',#{year},'%')
-            GROUP BY
-            sa.sub_id
-            ) sa ON sa.sub_id = si.id
-            LEFT JOIN (
-            SELECT
-            sum(amt) yearAmtSj,
-            src.sub_id
-            FROM
-            sub_rpt_cont src
-            WHERE
-            src.logic_delete_flag = 0
-            AND src. LIKE  CONCAT('',#{year},'%')
-            GROUP BY
-            src.sub_id
-            ) src2 ON src2.sub_id = si.id
+        sub_rpt_cont src
         WHERE
---             sc.logic_delete_flag = 0
-           si.logic_delete_flag = 0
-            AND si.longitude is not null
-            AND si.latitude is not null
-          AND si.subject_id  in
+        src.sub_id = si.id
+        AND src.logic_delete_flag = 0
+        ORDER BY
+        last_update_time DESC,
+        create_time DESC
+        LIMIT 1
+        ) numBl
+        FROM
+        --             sub_camera sc
+        --             LEFT JOIN sub_info si ON sc.sub_id = si.id
+        sub_info si
+        LEFT JOIN (
+        SELECT
+        sum(amt) yearAmt,
+        sa.sub_id
+        FROM
+        sub_amtplan sa
+        WHERE
+        sa.logic_delete_flag = 0
+        AND sa.y_month LIKE  CONCAT('',#{year},'%')
+        GROUP BY
+        sa.sub_id
+        ) sa ON sa.sub_id = si.id
+        LEFT JOIN (
+        SELECT
+        sum(amt) yearAmtSj,
+        src.sub_id
+        FROM
+        sub_rpt_cont src
+        WHERE
+        src.logic_delete_flag = 0
+        AND src.kj_month LIKE  CONCAT('',#{year},'%')
+        GROUP BY
+        src.sub_id
+        ) src2 ON src2.sub_id = si.id
+        WHERE
+        --             sc.logic_delete_flag = 0
+        si.logic_delete_flag = 0
+        and si.indus_kind in('210','99','2')
+        AND si.longitude is not null
+        AND si.latitude is not null
+        AND si.subject_id  in
         <foreach  item="item" collection="subjectIds" index="index"  open="(" separator="," close=")">
             #{item}
         </foreach>
         GROUP BY
-            si.id
+        si.id
     </select>
 
 <!--    <resultMap id="BaseResultMap" type="com.rtrh.projects.modules.projects.po.SubInfoGxj">
@@ -341,6 +342,49 @@
         from sub_info
         where id = #{id}
     </select>
+    <select id="findByFgwId" resultType="com.rtrh.projects.modules.projects.po.SubInfo">
+        SELECT
+            id,
+            unit_id AS unitId,
+            unit_desc AS unitDesc,
+            sub_code AS subCode,
+            sub_name AS subName,
+            indus_kind AS indusKind,
+            amt_total AS amtTotal,
+            abc,
+            subject_id AS subjectId,
+            begin_date AS beginDate,
+            end_date AS endDate,
+            rt_date AS rtDate,
+            content AS content,
+            progress AS progress,
+            cb_status AS cbStatus,
+            qy_date AS qyDate,
+            xj_date AS xjDate,
+            zj_date AS zjDate,
+            tc_date AS tcDate,
+            cb_num AS cbNum,
+            xj_num AS xjNum,
+            zj_num AS zjNum,
+            remark,
+            name_zrr AS nameZrr,
+            tel AS tel,
+            name_lead AS nameLead,
+            tel_lead AS telLead,
+            status AS status,
+            rg_date AS rgDate,
+            create_user_id AS createUserId,
+            create_user_name AS createUserName,
+            create_time AS createTime,
+            last_update_user_id AS lastUpdateUserId,
+            last_update_user_name AS lastUpdateUserName,
+            last_update_time AS lastUpdateTime,
+            logic_delete_flag AS logicDeleteFlag,
+            status_lamp AS statusLamp,
+            kind_nature AS kindNature
+        from sub_info
+        where id = #{id}
+    </select>
 
     <select id="subFixCbAll" resultType="com.rtrh.projects.modules.projects.vo.SubFixCbVo">
         SELECT sub_info.id as id,

+ 4 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/SubCameraService.java

@@ -73,6 +73,8 @@ public interface SubCameraService {
      */
     SubInfoCameraVO getListBySubId(String subId);
 
+    SubInfoCameraVO getListBySubIdNew(String subId);
+
 
     /**
      * 通过项目id及编码设备id查询所有的摄像头信息(用于同步数据)
@@ -99,4 +101,6 @@ public interface SubCameraService {
      * @return
      */
     List<Map<String, Object>> cameraTree(String subId);
+
+    List<Map<String, Object>> cameraTreeNew(String subId);
 }

+ 45 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubCameraServiceImpl.java

@@ -9,6 +9,10 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.stream.Collectors;
 
+import com.rtrh.projects.modules.projects.mapper.SubCameraMapper;
+import com.rtrh.projects.modules.projects.mapper.SubInfoMapper;
+import com.rtrh.projects.modules.projects.po.SubInfoGxj;
+import com.rtrh.projects.util.TargetDataSource;
 import org.hibernate.criterion.Criterion;
 import org.hibernate.criterion.DetachedCriteria;
 import org.hibernate.criterion.Restrictions;
@@ -41,6 +45,10 @@ public class SubCameraServiceImpl implements SubCameraService {
     @Autowired
     private SubCameraDao subCameraDao;
     @Autowired
+    private SubCameraMapper subCameraMapper;
+    @Autowired
+    private SubInfoMapper subInfoMapper;
+    @Autowired
     private SubInfoDao subInfoDao;
 
     @Override
@@ -273,6 +281,17 @@ public class SubCameraServiceImpl implements SubCameraService {
         return subInfoCameraVO;
     }
 
+    @Override
+    @TargetDataSource(value = "secondary")
+    public SubInfoCameraVO getListBySubIdNew(String subId) {
+        SubInfoCameraVO subInfoCameraVO=new SubInfoCameraVO();
+        SubInfo subInfo=  subInfoMapper.findByFgwId(subId);
+        BeanUtils.copyProperties(subInfo,subInfoCameraVO);
+        List<SubCamera> list=subCameraMapper.getListCameraBySubId(subId);
+        subInfoCameraVO.setList(list);
+        return subInfoCameraVO;
+    }
+
     @Override
     public SubVideoVO getVideo(String subId) {
 
@@ -364,6 +383,32 @@ public class SubCameraServiceImpl implements SubCameraService {
 		return result;
 	}
 
+    @Override
+    @TargetDataSource(value = "secondary")
+    public List<Map<String, Object>> cameraTreeNew(String subId) {
+        List<Map<String, Object>> result = new ArrayList<>();
+        List<CameraTreeVO> cameraTreeData = subCameraMapper.cameraTreeNew(subId);
+        if(CollectionUtil.isNotEmpty(cameraTreeData)) {
+            Map<String, List<CameraTreeVO>> collect = cameraTreeData.stream().collect(Collectors.groupingBy(CameraTreeVO::getSubId));
+            collect.keySet().forEach(item->{
+                List<CameraTreeVO> list = collect.get(item);
+                for(CameraTreeVO vo : list) {
+                    vo.setUrl(ApiStaticUrl.getVideo(vo.getUrl()));
+                }
+                String subId2 = list.get(0).getSubId();
+                String subName = list.get(0).getSubName();
+                Map<String, Object> subInfo = new HashMap<>();
+                subInfo.put("id", subId2);
+                subInfo.put("disabled", true);
+                subInfo.put("subId", subId2);
+                subInfo.put("title", subName);
+                subInfo.put("children", list);
+                result.add(subInfo);
+            });
+        }
+        return result;
+    }
+
 
 
 	@Override

+ 2 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoQueryServiceImpl.java

@@ -30,6 +30,7 @@ import com.rtrh.projects.modules.system.service.ISubInduService;
 import com.rtrh.projects.modules.system.service.TSysTableService;
 import com.rtrh.projects.modules.system.vo.PersonInfoVO;
 import com.rtrh.projects.modules.utils.DateUtils;
+import com.rtrh.projects.util.TargetDataSource;
 import com.rtrh.projects.vo.projects.SubFixGetBeginRateVo;
 import com.rtrh.projects.vo.statics.OtherQueryVO;
 import com.rtrh.projects.vo.statics.ProjectQueryVO;
@@ -3098,6 +3099,7 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
     }
 
     @Override
+    @TargetDataSource(value="secondary")
     public List<SubSmartVO> smartSiteQuery(String subjectId) {
 
         Calendar calendar = Calendar.getInstance();

+ 4 - 2
projects/src/main/java/com/rtrh/projects/web/controller/smart/api/SubSmartSiteApiController.java

@@ -121,7 +121,8 @@ public class SubSmartSiteApiController extends BaseController {
     public Message getCameraListBySubId(@RequestBody SubIdVO subIdVO) {
     	Message message = new Message();
     	try {
-    		SubInfoCameraVO vo = subCameraService.getListBySubId(subIdVO.getSubId());
+    		//SubInfoCameraVO vo = subCameraService.getListBySubId(subIdVO.getSubId());
+    		SubInfoCameraVO vo = subCameraService.getListBySubIdNew(subIdVO.getSubId());
     		message.setData(vo);
 		} catch (Exception e) {
 			logger.error("", e);
@@ -139,7 +140,8 @@ public class SubSmartSiteApiController extends BaseController {
     public Message getCameraTree(@RequestBody SubIdVO subIdVO) {
     	Message message = new Message();
     	try {
-			List<Map<String,Object>> list = subCameraService.cameraTree(subIdVO.getSubId());
+			//List<Map<String,Object>> list = subCameraService.cameraTree(subIdVO.getSubId());
+			List<Map<String,Object>> list = subCameraService.cameraTreeNew(subIdVO.getSubId());
 			message.setData(list);
 		} catch (Exception e) {
 			logger.error("", e);

+ 4 - 4
projects/src/main/webapp/vmodules/leftMenu.jsp

@@ -207,14 +207,14 @@
                         {
                             code: '702',
                             txt: '项目地图',
-                            // url: 'smart/query'
-                            url: 'register/underConstruction'
+                            url: 'smart/query'
+                            //url: 'register/underConstruction'
                         },
                         {
                             code: '703',
                             txt: '实时视频',
-                            // url: 'smart/vedio'
-                            url: 'register/underConstruction'
+                            url: 'smart/vedio'
+                            //url: 'register/underConstruction'
                         },
                         {
                             txt: '周调度图片',

+ 279 - 279
projects/src/main/webapp/vmodules/map/map.jsp

@@ -7,13 +7,13 @@
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>地图</title>
-    <jsp:include page="../common/common-meta-include.jsp"></jsp:include>
-    <jsp:include page="../common/common-js-include.jsp"></jsp:include>
-    <jsp:include page="../common/common-css-include.jsp"></jsp:include>
-    <!--[if lt IE 9]>
-    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
-    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
-    <![endif]-->
+  <jsp:include page="../common/common-meta-include.jsp"></jsp:include>
+  <jsp:include page="../common/common-js-include.jsp"></jsp:include>
+  <jsp:include page="../common/common-css-include.jsp"></jsp:include>
+  <!--[if lt IE 9]>
+  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
+  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
+  <![endif]-->
 </head>
 <body>
 <script type="text/javascript" src="https://api.map.baidu.com/api?type=webgl&v=1.0&ak=fH2LyWBEJhhAgSPnKsI7RMFxsYNxkKt2"></script>
@@ -36,308 +36,308 @@
   </div>
 </div>
 <script type="text/javascript">
-new Vue({
-	el: '#app',
-	data: {
-		map: null,
-		subjectId: "${subjectId}",
-		subjectName : "${subjectName}"== "" ? "伊州区" : "${subjectName}",
-		clickTimeouts: [],
-		iconData: [],
-		regionName : [{
-            longitude: '92.26',
-            latitude: '44.45',
-            name: '巴里坤哈萨克自治县',
-            color: '#AEE4D1'
-        }, {
-            name: '伊吾县',
-            longitude: '94.86',
-            latitude: '43.58',
-            color: '#9C6A7B'
-        }, {
-            name: '伊州区',
-            longitude: '93.56',
-            latitude: '42.18',
-            color: '#599D62'
-        }]
-	},
-	mounted: function() {
-		this.initMap();
-		this.init();
-		this.getPointData();
-		if(this.subjectName) {
-			if(this.subjectName == '巴里坤县') {
-				this.subjectName = '巴里坤哈萨克自治县';
-			}
-			if(this.subjectName == '本市级') {
-				this.subjectName = '市本级';
-			}
-			//初始化范围
-			this.getBoundary(this.subjectName);
-		}
-	},
-	methods: {
-		init: function(){
-			var self = this;
-		    layui.form.on('select(subjectId)', function (data) {
-		      let value = data.value; // 获得被选中的值
-		      self.subjectId = value;
-		      let text = data.elem.selectedOptions[0].text;
-		      if(text == '本市级' || text == '高新区') {
-		    	  text = "伊州区";
-		      }
-		      if(text == '巴里坤县') {
-		    	  text = '巴里坤哈萨克自治县';
-		      }
-		      self.getPointData();
-		      self.getBoundary(text);
-		    });
-		},
-		initMap: function() {
-		  this.map = new BMapGL.Map("container");
-		  this.map.centerAndZoom(new BMapGL.Point(93.76, 43.45), 8);
-		  this.map.enableScrollWheelZoom();
-		},
-		getBoundary: function(val) {
-			var self = this;
-			let bdary = new BMapGL.Boundary();
-	        /* bdary.get(val, function (rs) { //获取行政区域
-	        	console.log(rs)
-	        	self.map.clearOverlays(); //清除地图覆盖物
-	        	let count = rs.boundaries.length; //行政区域的点有多少个
-	        	for (let i = 0; i < count; i++) {
-		          	let ply = new BMapGL.Polygon(rs.boundaries[i], {
-		            strokeWeight: 2,
-		            strokeColor: "#3B6DE2"
-		          }); //建立多边形覆盖物
-		          self.map.addOverlay(ply); //添加覆盖物
-		          self.map.setViewport(ply.getPath()); //调整视野
-		          self.getPointData();
-	        	}
-	        }); */
-	        self.map.clearOverlays()
-			let dist = new BMapGL.DistrictLayer({
-                name: '('+val+')',
-                kind: 2,
-                fillColor: '#fff',
-                strokeColor: '#4A83F7',
-            });
-            this.map.addDistrictLayer(dist);
+  new Vue({
+    el: '#app',
+    data: {
+      map: null,
+      subjectId: "${subjectId}",
+      subjectName : "${subjectName}"== "" ? "伊州区" : "${subjectName}",
+      clickTimeouts: [],
+      iconData: [],
+      regionName : [{
+        longitude: '92.26',
+        latitude: '44.45',
+        name: '巴里坤哈萨克自治县',
+        color: '#AEE4D1'
+      }, {
+        name: '伊吾县',
+        longitude: '94.86',
+        latitude: '43.58',
+        color: '#9C6A7B'
+      }, {
+        name: '伊州区',
+        longitude: '93.56',
+        latitude: '42.18',
+        color: '#599D62'
+      }]
+    },
+    mounted: function() {
+      this.initMap();
+      this.init();
+      this.getPointData();
+      if(this.subjectName) {
+        if(this.subjectName == '巴里坤县') {
+          this.subjectName = '巴里坤哈萨克自治县';
+        }
+        if(this.subjectName == '本市级') {
+          this.subjectName = '市本级';
+        }
+        //初始化范围
+        this.getBoundary(this.subjectName);
+      }
+    },
+    methods: {
+      init: function(){
+        var self = this;
+        layui.form.on('select(subjectId)', function (data) {
+          let value = data.value; // 获得被选中的值
+          self.subjectId = value;
+          let text = data.elem.selectedOptions[0].text;
+          if(text == '本市级' || text == '高新区') {
+            text = "伊州区";
+          }
+          if(text == '巴里坤县') {
+            text = '巴里坤哈萨克自治县';
+          }
+          self.getPointData();
+          self.getBoundary(text);
+        });
+      },
+      initMap: function() {
+        this.map = new BMapGL.Map("container");
+        this.map.centerAndZoom(new BMapGL.Point(93.76, 43.45), 8);
+        this.map.enableScrollWheelZoom();
+      },
+      getBoundary: function(val) {
+        var self = this;
+        let bdary = new BMapGL.Boundary();
+        /* bdary.get(val, function (rs) { //获取行政区域
+            console.log(rs)
+            self.map.clearOverlays(); //清除地图覆盖物
+            let count = rs.boundaries.length; //行政区域的点有多少个
+            for (let i = 0; i < count; i++) {
+                  let ply = new BMapGL.Polygon(rs.boundaries[i], {
+                strokeWeight: 2,
+                strokeColor: "#3B6DE2"
+              }); //建立多边形覆盖物
+              self.map.addOverlay(ply); //添加覆盖物
+              self.map.setViewport(ply.getPath()); //调整视野
+              self.getPointData();
+            }
+        }); */
+        self.map.clearOverlays()
+        let dist = new BMapGL.DistrictLayer({
+          name: '('+val+')',
+          kind: 2,
+          fillColor: '#fff',
+          strokeColor: '#4A83F7',
+        });
+        this.map.addDistrictLayer(dist);
 
-	        //添加文本
-	        self.regionName.forEach(item => {
-	        let point = new BMapGL.Point(item.longitude, item.latitude);
-                let content = item.name;
-                let label = new BMapGL.Label(content, { // 创建文本标注
-                    position: point,
-                    offset: new BMapGL.Size(10, 20)
-                })
-                self.map.addOverlay(label); // 将标注添加到地图中
-                label.setStyle({ // 设置label的样式
-                    color: '#000',
-                    fontSize: '12px',
-                    border: 'none',
-                    background: 'none',
-                })
-	        })
-		},
-		getOnLoadBoundary: function(val) {
-			return new Promise((resolve, reject) => {
-
-                let dist = new BMapGL.DistrictLayer({
-                    name: '(哈密市)',
-                    kind: 2,
-                    fillColor: ['#618bf8', '#0c0', '#ccc'],
-                    strokeColor: '#daeafa',
-                });
-                isfind = false
-                map.addDistrictLayer(dist);
-                regionName.forEach(item => {
-                    let point = new BMapGL.Point(item.longitude, item.latitude);
-                    let content = item.name;
-                    let label = new BMapGL.Label(content, { // 创建文本标注
-                        position: point,
-                        offset: new BMapGL.Size(10, 20)
-                    })
-                    map.addOverlay(label); // 将标注添加到地图中
-                    label.setStyle({ // 设置label的样式
-                        color: '#000',
-                        fontSize: '12px',
-                        border: 'none',
-                        background: 'none',
-                    })
-                })
-                map.centerAndZoom(new BMapGL.Point(93.76, 43.45), 8);
-                resolve('绘制成功')
+        //添加文本
+        self.regionName.forEach(item => {
+          let point = new BMapGL.Point(item.longitude, item.latitude);
+          let content = item.name;
+          let label = new BMapGL.Label(content, { // 创建文本标注
+            position: point,
+            offset: new BMapGL.Size(10, 20)
+          })
+          self.map.addOverlay(label); // 将标注添加到地图中
+          label.setStyle({ // 设置label的样式
+            color: '#000',
+            fontSize: '12px',
+            border: 'none',
+            background: 'none',
+          })
+        })
+      },
+      getOnLoadBoundary: function(val) {
+        return new Promise((resolve, reject) => {
 
+          let dist = new BMapGL.DistrictLayer({
+            name: '(哈密市)',
+            kind: 2,
+            fillColor: ['#618bf8', '#0c0', '#ccc'],
+            strokeColor: '#daeafa',
+          });
+          isfind = false
+          map.addDistrictLayer(dist);
+          regionName.forEach(item => {
+            let point = new BMapGL.Point(item.longitude, item.latitude);
+            let content = item.name;
+            let label = new BMapGL.Label(content, { // 创建文本标注
+              position: point,
+              offset: new BMapGL.Size(10, 20)
+            })
+            map.addOverlay(label); // 将标注添加到地图中
+            label.setStyle({ // 设置label的样式
+              color: '#000',
+              fontSize: '12px',
+              border: 'none',
+              background: 'none',
             })
-		},
-		drawMap: function() {
-			var self = this;    // 遍历数组,在地图上添加标记和文字
-		    this.iconData.forEach((item, index) => {
-		      let point = new BMapGL.Point(item.longitude, item.latitude);
-		      let iconPath = "";
-		      switch(item.status) {
-		      case "1": iconPath = App.getUrl("/asset/css/img/yellow.svg");break;
-		      case "6": iconPath = App.getUrl("/asset/css/img/blue.svg");break;
-		      case "7": iconPath = App.getUrl("/asset/css/img/blue-plus.svg");break;
-		      case "8": iconPath = App.getUrl("/asset/css/img/red.svg");break;
-		      case "A": iconPath = App.getUrl("/asset/css/img/green.svg");break;
-		      }
-		      let icon = new BMapGL.Icon(iconPath,new BMapGL.Size(35, 35), {
-		                imageSize: {
-		                  width: '35',
-		                  height: '35'
-		                },
-		      });
+          })
+          map.centerAndZoom(new BMapGL.Point(93.76, 43.45), 8);
+          resolve('绘制成功')
 
-              // 创建信息窗口
-              var opts = {
-                width: 250, // 信息窗口宽度
-                height: 60, // 信息窗口高度
-                title: "项目名称" // 信息窗口标题
-              };
-              var infoWindow = new BMapGL.InfoWindow(item.subName, opts);
+        })
+      },
+      drawMap: function() {
+        var self = this;    // 遍历数组,在地图上添加标记和文字
+        this.iconData.forEach((item, index) => {
+          let point = new BMapGL.Point(item.longitude, item.latitude);
+          let iconPath = "";
+          switch(item.status) {
+            case "1": iconPath = App.getUrl("/asset/css/img/yellow.svg");break;
+            case "6": iconPath = App.getUrl("/asset/css/img/blue.svg");break;
+            case "7": iconPath = App.getUrl("/asset/css/img/blue-plus.svg");break;
+            case "8": iconPath = App.getUrl("/asset/css/img/red.svg");break;
+            case "A": iconPath = App.getUrl("/asset/css/img/green.svg");break;
+          }
+          let icon = new BMapGL.Icon(iconPath,new BMapGL.Size(35, 35), {
+            imageSize: {
+              width: '35',
+              height: '35'
+            },
+          });
 
+          // 创建信息窗口
+          var opts = {
+            width: 250, // 信息窗口宽度
+            height: 60, // 信息窗口高度
+            title: "项目名称" // 信息窗口标题
+          };
+          var infoWindow = new BMapGL.InfoWindow(item.subName, opts);
 
-              // 创建自定义文字对象
-		      let overlayer = new BMapGL.Marker(point, {
-		        icon: icon,
-		        //label: Label
-		      }); // 创建标记,并设置图标
-		      self.map.addOverlay(overlayer); // 将标记添加到地图上
 
+          // 创建自定义文字对象
+          let overlayer = new BMapGL.Marker(point, {
+            icon: icon,
+            //label: Label
+          }); // 创建标记,并设置图标
+          self.map.addOverlay(overlayer); // 将标记添加到地图上
 
 
-              // 添加鼠标停留事件
-              overlayer.addEventListener('mouseover', function (e) {
-                console.log('mouseenter')
-                // 打开信息窗口
-                self.map.openInfoWindow(infoWindow, point); // 打开信息窗口,point是打开的位置
 
-              });
+          // 添加鼠标停留事件
+          overlayer.addEventListener('mouseover', function (e) {
+            console.log('mouseenter')
+            // 打开信息窗口
+            self.map.openInfoWindow(infoWindow, point); // 打开信息窗口,point是打开的位置
 
-              // // 为点添加鼠标离开事件监听
-              // overlayer.addEventListener("mouseout", function() {
-              //   // 关闭信息窗口
-              //   self.map.closeInfoWindow(); // 关闭信息窗口
-              // });
+          });
 
-		      // 添加单击事件监听
-		      overlayer.addEventListener('click', function (e) {
-		        // 清除之前可能存在的计时器
-		        if (self.clickTimeouts[index]) {
-		        	clearTimeout(self.clickTimeouts[index]);
-		        	self.clickTimeouts[index] = null;
-		          // 双击时已清除计时器,不再执行单击事件
-		          return;
-		        }
+          // // 为点添加鼠标离开事件监听
+          // overlayer.addEventListener("mouseout", function() {
+          //   // 关闭信息窗口
+          //   self.map.closeInfoWindow(); // 关闭信息窗口
+          // });
 
-		        // 设置延时执行单击事件
-		        self.clickTimeouts[index] = setTimeout(function () {
-				  App.openLayer({
-					  title:'项目详情',
-					  skin: 'vidio-pop',
-					  width: '1200',
-					  height: '900',
-					  shade: 0.6, // 遮罩透明度
-		              shadeClose: true, // 点击遮罩区域,关闭弹层
-		              maxmin: true, // 允许全屏最小化
-		              anim: 0, // 0-6 的动画形式,-1 不开启
-					  content: App.getUrl("/subject/subInfo/detailView?layer=true&subId="+ item.id +"&queryYear="+new Date().getFullYear())
-				  })
-		          // 在这里执行单击后的操作
-		        }, 200); // 延时200毫秒
-		      });
+          // 添加单击事件监听
+          overlayer.addEventListener('click', function (e) {
+            // 清除之前可能存在的计时器
+            if (self.clickTimeouts[index]) {
+              clearTimeout(self.clickTimeouts[index]);
+              self.clickTimeouts[index] = null;
+              // 双击时已清除计时器,不再执行单击事件
+              return;
+            }
 
-		      // 添加双击事件监听
-		      overlayer.addEventListener('dblclick', function (e) {
-		        // 清除单击事件的计时器
-		        if (self.clickTimeouts[index]) {
-		        	clearTimeout(self.clickTimeouts[index]);
-		        	self.clickTimeouts[index] = null;
-		        }
-		        window.location.href=App.getUrl("/smart/vedio?subId="+item.id);
-		        // 在这里执行双击后的操作
-		      });
-		    });
-		},
-		getPointData: function() {
-			var self = this;
-			App.postJson("/api/smart/smartSiteQuery", { subjectId: this.subjectId },function (res) {
-				if (res.success) {
-	            	 self.iconData = res.data;
-	              }
-	              self.drawMap();
-	         });
-		}
-	}
-})
+            // 设置延时执行单击事件
+            self.clickTimeouts[index] = setTimeout(function () {
+              App.openLayer({
+                title:'项目详情',
+                skin: 'vidio-pop',
+                width: '1200',
+                height: '900',
+                shade: 0.6, // 遮罩透明度
+                shadeClose: true, // 点击遮罩区域,关闭弹层
+                maxmin: true, // 允许全屏最小化
+                anim: 0, // 0-6 的动画形式,-1 不开启
+                content: App.getUrl("/subject/subInfo/detailView?layer=true&subId="+ item.id +"&queryYear="+new Date().getFullYear())
+              })
+              // 在这里执行单击后的操作
+            }, 200); // 延时200毫秒
+          });
+
+          // 添加双击事件监听
+          overlayer.addEventListener('dblclick', function (e) {
+            // 清除单击事件的计时器
+            if (self.clickTimeouts[index]) {
+              clearTimeout(self.clickTimeouts[index]);
+              self.clickTimeouts[index] = null;
+            }
+            window.location.href=App.getUrl("/smart/vedio?subId="+item.id);
+            // 在这里执行双击后的操作
+          });
+        });
+      },
+      getPointData: function() {
+        var self = this;
+        App.postJson("/api/smart/smartSiteQuery", { subjectId: this.subjectId },function (res) {
+          if (res.success) {
+            self.iconData = res.data;
+          }
+          self.drawMap();
+        });
+      }
+    }
+  })
 </script>
 </body>
 
 </html>
 <style>
   * {
-        padding: 0;
-        margin: 0;
-    }
+    padding: 0;
+    margin: 0;
+  }
 
-    .layui-input-group {
-      display: flex;
-      justify-content: center;
-      align-items: center;
-      width: 300px;
-      height: 24px;
-    }
+  .layui-input-group {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    width: 300px;
+    height: 24px;
+  }
 
-    .layui-input {
-        border: 1px solid #2C6EC6 !important;
-    }
+  .layui-input {
+    border: 1px solid #2C6EC6 !important;
+  }
 
-    .layui-input-suffix {
-        display: flex;
-        justify-content: center;
-        align-items: center;
-        border: 1px solid #0070CE !important;
-        background-color: #4A83F7 !important;
-        width: 30px;
-        height: 24px;
-    }
+  .layui-input-suffix {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    border: 1px solid #0070CE !important;
+    background-color: #4A83F7 !important;
+    width: 30px;
+    height: 24px;
+  }
 
-    .layui-icon-search:before {
-        color: #fff;
-    }
+  .layui-icon-search:before {
+    color: #fff;
+  }
 
 
 
-    .layui-input:hover,
-    .layui-textarea:hover {
-        border-color: #0070CE !important;
-    }
+  .layui-input:hover,
+  .layui-textarea:hover {
+    border-color: #0070CE !important;
+  }
 
-    .layui-input:focus,
-    .layui-textarea:focus {
-        border-color: #5BD1D9 !important;
-    }
+  .layui-input:focus,
+  .layui-textarea:focus {
+    border-color: #5BD1D9 !important;
+  }
 
-    #container {
-        width: 100%;
-        height: 100%;
-    }
+  #container {
+    width: 100%;
+    height: 100%;
+  }
 
-    .map-content {
-        position: relative;
-        width: 100%;
-        height: 100vh;
-        background-color: #fff;
-    }
+  .map-content {
+    position: relative;
+    width: 100%;
+    height: 100vh;
+    background-color: #fff;
+  }
 
-    .input-layer {
-        position: absolute;
-        top: 50px;
-        left: 30px;
-        z-index: 1000;
+  .input-layer {
+    position: absolute;
+    top: 50px;
+    left: 30px;
+    z-index: 1000;
 
-    }
+  }
 </style>