智慧园区前端大屏
linwe
2024-11-23 af1e2244d0e3375f61e0ef1636dfd1ad0fbe18b4
代码优化
6 files modified
213 ■■■■ changed files
src/pages/layout/components/scomponents/layersControl.vue 68 ●●●●● patch | view | raw | blame | history
src/pages/layout/components/scomponents/popup/panorama.vue 2 ●●●●● patch | view | raw | blame | history
src/styles/base/dc-base.scss 17 ●●●●● patch | view | raw | blame | history
src/views/companyInfo/components/box/fireTrend.vue 2 ●●● patch | view | raw | blame | history
src/views/pac/components/box/dataContent.vue 2 ●●● patch | view | raw | blame | history
src/views/space/components/leftContainer.vue 122 ●●●●● patch | view | raw | blame | history
src/pages/layout/components/scomponents/layersControl.vue
@@ -498,29 +498,6 @@
          const { attrParams } = e.overlay
          // 删除
          destroy()
          // if (!attrParams.imageUrl) {
          //   return
          // }
          // addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          // window.$viewer.addLayer(addPupoLayers[attrParams.name])
          // let iconEl = `<div class="marsBlueGradientPnl">
          //         <div>${attrParams.fullName}</div>
          //         <img src="${attrParams.imageUrl}" width="160" height="160" />
          //       </div>`
          // let divIcon = new DC.DivIcon(
          //   new DC.Position(attrParams.lng, attrParams.lat, 64),
          //   `<div class="public-map-popup-two">
          //           ${iconEl}
          //         </div>`
          // )
          // let incident = () => {
          //   destroy()
          // }
          // divIcon.on(DC.MouseEventType.CLICK, incident)
          // addPupoLayers[attrParams.name].addOverlay(divIcon)
          // 删除
          destroy()
          addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPupoLayers[attrParams.name])
          let iconEl = `<div class="marsBlueGradientPnl">
@@ -554,12 +531,41 @@
  {
    id: '7',
    label: '地图全景点位分布',
    label: '空中全景分布',
    type: 'layer',
    subType: 'labelPoint',
    method: getPanoramaList,
    params: {
      size: 1000
      size: 1000,
      remark: '1'
    },
    backgroundIcon: VITE_APP_BASE + 'img/mapicon/qj.png',
    showPanel: false,
    layerName: 'kzqjdwfb',
    incident: (e) => {
      const { attrParams } = e.overlay
      panoramaTitle.value = attrParams.name
      if (
        attrParams.url.indexOf("http://vr.jxpskj.com:180") != -1
      ) {
        attrParams.url = attrParams.url.replace(
          "http://vr.jxpskj.com:180",
          "/panorama"
        )
      }
      panoramaUrl.value = attrParams.url
      panoramaShow.value = true
    }
  },
  {
    id: '8',
    label: '地面全景分布',
    type: 'layer',
    subType: 'labelPoint',
    method: getPanoramaList,
    params: {
      size: 1000,
      remark: '2'
    },
    backgroundIcon: VITE_APP_BASE + 'img/mapicon/qj.png',
    showPanel: false,
@@ -610,12 +616,14 @@
  if (checkType(nodes) == 'arr') {
    nodes.forEach(item => {
      if (item.type == 'layer') {
        collectedNodes.value.push(item)
      }
      if (item) {
        if (item.type == 'layer') {
          collectedNodes.value.push(item)
        }
      if (item.children && item.children.length > 0) {
        collectNodesWithFlag(item.children)
        if (item.children && item.children.length > 0) {
          collectNodesWithFlag(item.children)
        }
      }
    })
  }
src/pages/layout/components/scomponents/popup/panorama.vue
@@ -42,8 +42,10 @@
  // background: -webkit-linear-gradient(to right, #3a7bd5, #00d2ff);
  /* Chrome 10-25, Safari 5.1-6 */
  // background: linear-gradient(to right, #3a7bd5, #00d2ff);
  background-color: rgba($color: #000000, $alpha: 1.0);
  /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
  pointer-events: auto;
  box-shadow: inset 0 0 200px #0377eb;
  .title {
    padding: 0 10px;
src/styles/base/dc-base.scss
@@ -170,6 +170,23 @@
  }
}
.yjwz-height-box {
  bottom: 120px;
  &::after {
    content: "";
    position: absolute;
    bottom: -120px;
    left: calc(50% - 3px);
    display: block;
    width: 3px;
    height: 120px;
    // 0px 0px 6px rgb(255, 179, 0, 0.8)
    background: linear-gradient(to bottom, rgb(255, 179, 0, 0.8), rgb(255, 179, 0, 0.2));
    // border-right: 3px solid #fff;
  }
}
.fxy-ordinary {
  &::after {
    background: linear-gradient(to bottom, rgba(255, 201, 0, 0.8), rgba(255, 201, 0, 0.2));
src/views/companyInfo/components/box/fireTrend.vue
@@ -125,7 +125,7 @@
                `
    let divIcon = new DC.DivIcon(
      new DC.Position(row.lng, row.lat, 64),
      `<div class="public-map-popup ${'qyfb-box'}">
      `<div class="public-map-popup  qyfb-box yjwz-height-box ">
                    ${iconEl}
                  </div>`
    )
src/views/pac/components/box/dataContent.vue
@@ -126,7 +126,7 @@
    }
  })
  if (row.type == 2) {
  if (row.type == 2 || row.type == 3) {
    EventBus.emit('restHandleCheckChange', `3-3-2`)
    EventBus.emit('restHandleCheckChange', `3-3-4`)
  } else {
src/views/space/components/leftContainer.vue
@@ -16,6 +16,29 @@
const resData = reactive({
  data: []
})
const gawList = ref([
  {
    label: '给水管网',
    value: "3-3-1",
    select: false
  },
  {
    label: '燃气管网',
    value: "3-3-3",
    select: false
  },
  {
    label: '污水管网',
    value: "3-3-2",
    select: true
  },
  {
    label: '雨水管网',
    value: "3-3-4",
    select: true
  },
])
const curSelect = ref('')
// 获取下拉字典
@@ -36,18 +59,42 @@
}
const tabClick = (item) => {
  if (curSelect.value) EventBus.emit('restHandleDelChange', `3-${curSelect.value}`)
  console.log('tabClick', item)
  if (curSelect.value) {
    if (curSelect.value == '3') {
      EventBus.emit('restHandleDelChange', `3-3-1`)
      EventBus.emit('restHandleDelChange', `3-3-2`)
      EventBus.emit('restHandleDelChange', `3-3-3`)
      EventBus.emit('restHandleDelChange', `3-3-4`)
    } else {
      EventBus.emit('restHandleDelChange', `3-${curSelect.value}`)
    }
  }
  curSelect.value = item.value
  EventBus.emit('restHandleCheckChange', `3-${item.value}`)
  if (item.value == '3') {
    EventBus.emit('restHandleCheckChange', `3-3-2`)
    EventBus.emit('restHandleCheckChange', `3-3-4`)
  } else {
    EventBus.emit('restHandleCheckChange', `3-${item.value}`)
  }
  EventBus.emit('spaceTabChange', item.value)
  EventBus.emit('flyToyqfw', 'flyToyqfw')
}
const tabClickGW = (item) => {
  if (item.select) {
    EventBus.emit('restHandleDelChange', item.value)
    item.select = false
  } else {
    EventBus.emit('restHandleCheckChange', item.value)
    item.select = true
  }
}
const showOn = computed(() => (item) => {
  if (curSelect.value == item.value) {
    return true
  }
  return false
})
@@ -55,19 +102,38 @@
onUnmounted(() => {
  if (curSelect.value) EventBus.emit('restHandleDelChange', `3-${curSelect.value}`)
  EventBus.emit('restHandleDelChange', `3-3-1`)
  EventBus.emit('restHandleDelChange', `3-3-2`)
  EventBus.emit('restHandleDelChange', `3-3-3`)
  EventBus.emit('restHandleDelChange', `3-3-4`)
})
</script>
<template>
  <div class="left-container cur-container">
    <div class="tablist h100">
      <div class="cursor-p" :class="{ on: showOn(item) }" v-for="item, index in resData.data" :key="index"
        @click="tabClick(item)">
        <div class="label-box">
          {{ item.label }}
  <div>
    <div class="left-container cur-container">
      <div class="tablist h100">
        <div class="cursor-p" :class="{ on: showOn(item) }" v-for="item, index in resData.data" :key="index"
          @click="tabClick(item)">
          <div class="label-box">
            {{ item.label }}
          </div>
        </div>
      </div>
    </div>
    <div v-if="curSelect == '3'">
      <div class="left-container cur-container-title">
        <div class="tablist h100">
          <div class="cursor-p" :class="{ on: item.select }" v-for="item, index in gawList" :key="index"
            @click="tabClickGW(item)">
            <div class="label-box">
              {{ item.label }}
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
@@ -110,4 +176,42 @@
    }
  }
}
.cur-container-title {
  background: transparent;
  pointer-events: none;
  margin-left: 120px;
  margin-top: 60px;
  font-size: 12px;
  .tablist {
    pointer-events: all;
    &>div {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-top: 16px;
      padding: 10px;
      width: 54px;
      height: 54px;
      border-radius: 50%;
      box-shadow: inset 0 0 40px #409eff;
      color: #fff;
      box-sizing: content-box;
      &.on {
        position: relative;
        // color: #75b1ff;
        box-shadow: inset 0 0 100px #2a8ef1;
      }
      .label-box {
        line-height: 14px;
        text-align: center;
      }
    }
  }
}
</style>