智慧园区前端大屏
shuishen
2024-12-24 bbc9839678d31edf1ba80281db13ae6e977f2deb
src/pages/map/components/scomponents/layersControl.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2024-10-31 10:47:29
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-12-24 16:31:17
 * @LastEditTime: 2024-12-24 17:04:32
 * @FilePath: \bigScreen\src\pages\map\components\scomponents\layersControl.vue
 * @Description:
 *
@@ -145,7 +145,7 @@
      {
        parentId: '3',
        id: '3-1',
        label: '应急池',
        label: '初期雨水收集池',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
@@ -156,7 +156,7 @@
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjc.png',
        className: 'yjc-box',
        showPanel: false,
        layerName: 'yjc-yq',
        layerName: 'cq-yssjc',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
@@ -187,175 +187,30 @@
      {
        parentId: '3',
        id: '3-2',
        label: '阀门',
        children: [
          {
            parentId: '3-2',
            id: '3-2-1',
            label: '园区',
            type: 'layer',
            subType: 'labelPoint',
            method: getList,
            params: {
              type: 2,
              size: 1000,
              category: 1
            },
            backgroundIcon: VITE_APP_BASE + 'img/mapicon/ysf.png',
            className: 'ysf-box',
            showPanel: false,
            layerName: 'fm-yq',
            incident: (e) => {
              const { attrParams } = e.overlay
              // 删除
              destroyPop()
              if (!attrParams.firmName) {
                return
              }
              addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
              window.$viewer.addLayer(addPopLayers[attrParams.id])
              let iconEl = `<div class="marsBlueGradientPnl">
            <div>企业名称:${attrParams.firmName}</div>
            <div>作用:${attrParams.mainFuncName}</div>
                </div>`
              let divIcon = new DC.DivIcon(
                new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
                `<div class="public-map-popup-two">
                    ${iconEl}
                  </div>`
              )
              let incident = () => {
                destroyPop()
              }
              divIcon.on(DC.MouseEventType.CLICK, incident)
              addPopLayers[attrParams.id].addOverlay(divIcon)
            }
          },
          {
            parentId: '3-2',
            id: '3-2-2',
            label: '企业',
            type: 'layer',
            subType: 'labelPoint',
            method: getList,
            params: {
              type: 2,
              size: 1000,
              category: 2
            },
            backgroundIcon: VITE_APP_BASE + 'img/mapicon/ysf.png',
            className: 'ysf-box',
            showPanel: false,
            layerName: 'fm-qy',
            incident: (e) => {
              const { attrParams } = e.overlay
              // 删除
              destroyPop()
              if (!attrParams.firmName) {
                return
              }
              addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
              window.$viewer.addLayer(addPopLayers[attrParams.id])
              let iconEl = `<div class="marsBlueGradientPnl">
            <div>企业名称:${attrParams.firmName}</div>
            <div>作用:${attrParams.mainFuncName}</div>
                </div>`
              let divIcon = new DC.DivIcon(
                new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
                `<div class="public-map-popup-two">
                    ${iconEl}
                  </div>`
              )
              let incident = () => {
                destroyPop()
              }
              divIcon.on(DC.MouseEventType.CLICK, incident)
              addPopLayers[attrParams.id].addOverlay(divIcon)
            }
          }
        ]
      },
      {
        parentId: '3',
        id: '3-3',
        label: '公共管网',
        children: [
          // 给水管网、污水管网、燃气管网、雨水管网
          {
            parentId: '3-3',
            id: '3-3-2',
            label: '污水管网',
            type: 'layer',
            subType: 'geojsonPipe',
            layerName: 'wsgw',
            source: wsgw,
            color: DC.Color.DARKBLUE.withAlpha(0.9),
            height: 60.2,
          },
          {
            parentId: '3-3',
            id: '3-3-4',
            label: '雨水管网',
            type: 'layer',
            subType: 'geojsonPipe',
            layerName: 'ysgw',
            source: ysgw,
            color: DC.Color.CYAN.withAlpha(0.9),
            height: 60,
          },
          // {
          //   id: '3-3-1',
          //   label: '给水管网',
          //   type: 'layer',
          //   subType: 'geojsonPipe',
          //   layerName: 'gsgw',
          //   source: gsgw,
          //   color: DC.Color.BLUE.withAlpha(0.9),
          //   height: 60.4,
          // },
          // {
          //   id: '3-3-3',
          //   label: '燃气管网',
          //   type: 'layer',
          //   subType: 'geojsonPipe',
          //   layerName: 'rqgw',
          //   source: rqgw,
          //   color: DC.Color.RED.withAlpha(0.9),
          //   height: 60.6,
          // },
        ]
      },
      {
        parentId: '3',
        id: '3-4',
        label: '污水提升泵站',
        label: '事故应急池',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        // className: 'sk-box',
        // showPanel: false,
        params: {
          type: 4,
          size: 1000
          type: 2,
          size: 1000,
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/wstsb.png',
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjc.png',
        className: 'yjc-box',
        showPanel: false,
        layerName: 'wstsbz',
        layerName: 'sg-yjc',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroyPop()
          if (!attrParams.imageUrl) {
          if (!attrParams.firmName) {
            return
          }
          addPopLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPopLayers[attrParams.name])
          addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
          window.$viewer.addLayer(addPopLayers[attrParams.id])
          let iconEl = `<div class="marsBlueGradientPnl">
                  <div>${attrParams.fullName}</div>
                  <img src="${attrParams.imageUrl}" width="160" height="160" />
            <div>企业名称:${attrParams.firmName}</div>
            <div>作用:${attrParams.mainFuncName}</div>
                </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
@@ -367,7 +222,49 @@
            destroyPop()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPopLayers[attrParams.name].addOverlay(divIcon)
          addPopLayers[attrParams.id].addOverlay(divIcon)
        }
      },
      {
        parentId: '3',
        id: '3-3',
        label: '切断阀',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 3,
          size: 1000
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/ysf.png',
        className: 'ysf-box',
        showPanel: false,
        layerName: 'qdf',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroyPop()
          if (!attrParams.firmName) {
            return
          }
          addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
          window.$viewer.addLayer(addPopLayers[attrParams.id])
          let iconEl = `<div class="marsBlueGradientPnl">
            <div>企业名称:${attrParams.firmName}</div>
            <div>作用:${attrParams.mainFuncName}</div>
                </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
            `<div class="public-map-popup-two">
                    ${iconEl}
                  </div>`
          )
          let incident = () => {
            destroyPop()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPopLayers[attrParams.id].addOverlay(divIcon)
        }
      },
@@ -412,137 +309,6 @@
          addPopLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
        parentId: '3',
        id: '3-6',
        label: '应急泵',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 6,
          size: 1000
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjb.png',
        className: 'yjb-box',
        showPanel: false,
        layerName: 'yjb',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroyPop()
          if (!attrParams.firmName) {
            return
          }
          addPopLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPopLayers[attrParams.name])
          let iconEl = `<div class="marsBlueGradientPnl">
            <div>企业名称:${attrParams.firmName}</div>
            <div>作用:${attrParams.mainFuncName}</div>
                </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
            `<div class="public-map-popup-two">
                    ${iconEl}
                  </div>`
          )
          let incident = () => {
            destroyPop()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPopLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
        parentId: '3',
        id: '3-8',
        label: '沟渠',
        type: 'layer',
        subType: 'geojsonPolygon',
        method: getGouQu,
        params: {
          type: 8,
          size: 1000
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/gouqu.png',
        className: 'xfs-box',
        showPanel: false,
        layerName: 'gouqu'
      },
      // {
      //   id: '3-9',
      //   label: '废水处理站',
      //   type: 'layer',
      //   subType: 'labelPoint',
      //   method: getList,
      //   params: {
      //     type: 9,
      //     size: 1000
      //     // name: '吉水县绿源污水处理厂',
      //   },
      //   backgroundIcon: VITE_APP_BASE + 'img/mapicon/wsclc.png',
      //   className: 'xfs-box',
      //   showPanel: false,
      //   layerName: 'fsclz'
      // },
      {
        parentId: '3',
        id: '3-10',
        label: '排水口',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 10,
          size: 1000
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/psk.png',
        className: 'xfs-box',
        showPanel: false,
        layerName: 'psk',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroyPop()
          if (!attrParams.firmName) {
            return
          }
          addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
          window.$viewer.addLayer(addPopLayers[attrParams.id])
          let iconEl = `<div class="marsBlueGradientPnl">
            <div>企业名称:${attrParams.firmName}</div>
            <div>作用:${attrParams.mainFuncName}</div>
                </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
            `<div class="public-map-popup-two">
                    ${iconEl}
                  </div>`
          )
          let incident = () => {
            destroyPop()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPopLayers[attrParams.id].addOverlay(divIcon)
        }
      },
      // {
      //   id: '3-11',
      //   label: '污水池',
      //   type: 'layer',
      //   subType: 'labelPoint',
      //   method: getList,
      //   params: {
      //     type: 11,
      //     size: 1000
      //   },
      //   backgroundIcon: VITE_APP_BASE + 'img/mapicon/wsc.png',
      //   className: 'xfs-box',
      //   showPanel: false,
      //   layerName: 'wsc'
      // }
    ]
  },