xieqy %!s(int64=3) %!d(string=hai) anos
pai
achega
7dbb8e0b23

+ 12 - 12
src/config/bigScreenConfig.js

@@ -31,18 +31,18 @@ export const appconfig = {
         "name": "场景服务",
         "type": "scene",
         "config": {
-          "wscj": {
-            "name": "污水厂",
-            "url": BASE_URL + "/services/3D-liduershuichang/rest/realspace"
-          },
-          "scj": {
-            "name": "水厂",
-            "url": BASE_URL + "/services/3D-BaiYinShuiChang/rest/realspace"
-          },
-          "jzcj": {
-            "name": "建筑场景",
-            "url": BASE_URL + "/services/3D-TF_PAPN_BUILD-2/rest/realspace"
-          },
+          // "wscj": {
+          //   "name": "污水厂",
+          //   "url": BASE_URL + "/services/3D-liduershuichang/rest/realspace"
+          // },
+          // "scj": {
+          //   "name": "水厂",
+          //   "url": BASE_URL + "/services/3D-BaiYinShuiChang/rest/realspace"
+          // },
+          // "jzcj": {
+          //   "name": "建筑场景",
+          //   "url": BASE_URL + "/services/3D-TF_PAPN_BUILD-2/rest/realspace"
+          // },
           "gcgdcj": {
             "name": "设计管网",
             // "url": "/services/3D-hbyc_sj/rest/realspace"

+ 2 - 2
src/views/groupPage/districtPageModules/commonModules/SearchBox.vue

@@ -497,7 +497,6 @@ export default class SearchBox extends Vue {
     ;(this.$refs['pbsTree'] as any).searchOnline(code)
   }
   searchEntity(input) {
-    this.$store.state.bigScreen.currentDeviceShow = null
     this.searchDeviceList = []
     let dataSource = this.viewer.dataSources.getByName('monitorTree')
     // let target = dataSource[0].entities.getById(input)
@@ -514,6 +513,7 @@ export default class SearchBox extends Vue {
     })
   }
   deviceClickLocated(target) {
+    this.$store.state.bigScreen.currentDeviceShow = null
     if (target) {
       this.viewer.flyTo(target).then(() => {
         this.$store.state.bigScreen.currentDeviceShow = target.info
@@ -700,7 +700,7 @@ export default class SearchBox extends Vue {
     position: absolute;
     top: 0.21875rem /* 42/192 */;
     background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.24) 100%);
-    height: 1.354167rem /* 260/192 */;
+    max-height: 1.354167rem /* 260/192 */;
     width: 1.40625rem /* 270/192 */;
     overflow-y: auto;
     .deviceItem {

+ 18 - 1
src/views/groupPage/districtPageModules/customTools/excavationAnalysis/detailsTable.vue

@@ -1,5 +1,5 @@
 <template>
-  <div style="height: 85%; width: 95%">
+  <div style="height: 88%; width: 99%">
     <el-table
       ref="multipleTable"
       v-loading="false"
@@ -148,6 +148,23 @@ export default {
   .el-table__body tr:hover > td {
     background-color: #3d5f89 !important;
   }
+  //去掉白边
+  .el-table__header,
+  .el-table__body,
+  .el-table__footer {
+    width: 100% !important;
+  }
+  th.gutter {
+    width: 0px !important;
+    display: table-cell !important;
+    background: transparent;
+  }
+  .el-table__header colgroup col[name='gutter'] {
+    width: 0px !important;
+  }
+}
+/deep/ .el-table--border::after {
+  background-color: unset !important;
 }
 /deep/ .el-table::before {
   background-color: unset !important;

+ 46 - 4
src/views/groupPage/districtPageModules/customTools/excavationAnalysis/index.vue

@@ -1080,10 +1080,10 @@ export default class ExcavationAnalysis extends Vue {
   animation-delay: 0s; //动画延迟时间
 }
 .widget-ExcavationAnalysis {
-  bottom: 0.052083rem /* 10/192 */;
-  left: calc(50% - 2.734375rem /* 525/192 */);
-  width: 5.46875rem /* 1050/192 */;
-  height: 1.5625rem /* 300/192 */;
+  bottom: 0.078125rem /* 15/192 */;
+  left: calc(50% - 4.322917rem /* 830/192 */);
+  width: 8.854167rem /* 1700/192 */;
+  height: 1.770833rem /* 340/192 */;
   position: absolute;
   font-family: Source Han Sans CN;
   z-index: 999;
@@ -1140,6 +1140,48 @@ export default class ExcavationAnalysis extends Vue {
           border: none;
         }
       }
+      /deep/ .el-input-number {
+        width: 0.3125rem /* 60/192 */;
+        .el-input-group__append,
+        .el-input-group__prepend {
+          padding: 0 0.026042rem /* 5/192 */;
+        }
+        .el-input__inner {
+          color: rgba(43, 167, 255, 1);
+          border: none;
+          position: relative;
+          padding-right: 0.15625rem /* 30/192 */;
+          padding-left: 0;
+        }
+        .el-input-number__decrease,
+        .el-input-number__increase {
+          background: transparent;
+          border: none;
+          height: 50%;
+        }
+        .el-input-number__increase .el-icon-arrow-up:before {
+          content: '';
+          display: block;
+          // 定义元素宽高
+          margin-top: 0.010417rem /* 2/192 */;
+          width: 0.130208rem /* 25/192 */;
+          height: 0.078125rem /* 15/192 */;
+          background: url('~@/views/groupPage/images/三角上.png') no-repeat center center;
+          background-size: 100% 100%;
+          object-fit: contain;
+        }
+        .el-input-number__decrease .el-icon-arrow-down:before {
+          content: '';
+          display: block;
+          // 定义元素宽高
+          // margin-top: 0.010417rem /* 2/192 */;
+          width: 0.130208rem /* 25/192 */;
+          height: 0.078125rem /* 15/192 */;
+          background: url('~@/views/groupPage/images/三角下.png') no-repeat center center;
+          background-size: 100% 100%;
+          object-fit: contain;
+        }
+      }
     }
   }
   .el-container {

+ 276 - 1
src/views/groupPage/districtPageModules/customTools/projectPipeSpeedInfoCheck.vue

@@ -70,6 +70,7 @@ const Cesium = (window as any).Cesium
 let gCustomDataSource = null
 let gPrimitiveCollection = null
 let gHandler = null
+let pointDataSource = null //聚合源
 //进度查看模块
 @Component({ name: 'ProjectPipeSpeedInfoCheck', components: { CommonTreeList } })
 export default class ProjectPipeSpeedInfoCheck extends Vue {
@@ -124,6 +125,8 @@ export default class ProjectPipeSpeedInfoCheck extends Vue {
   }
   //防抖
   timeout = null
+  //聚合参数
+  pointArrCluster = [] //聚合点数组
   //
   get marks() {
     let t = {}
@@ -232,7 +235,6 @@ export default class ProjectPipeSpeedInfoCheck extends Vue {
       return
     } else {
       this.initScanTimes()
-      // this.showSpeedInfos(start, end)
     }
   }
   //时间分割函数
@@ -308,6 +310,9 @@ export default class ProjectPipeSpeedInfoCheck extends Vue {
         : '',
       endDate: date ? date.endDate : this.dateValue && this.dateValue[1] ? this.dateValue[1].replaceAll('-', '') : ''
     }
+    let s_dt = date ? date.beginDate : this.dateValue && this.dateValue[0] ? this.dateValue[0] : ''
+    let e_dt = date ? date.endDate : this.dateValue && this.dateValue[1] ? this.dateValue[1] : ''
+    this.showSpeedInfos(s_dt, e_dt)
     PipeAndNodeProcess(dateRange)
       .then((result) => {
         if (result.code !== 1 || result.result.length === 0) {
@@ -555,11 +560,274 @@ export default class ProjectPipeSpeedInfoCheck extends Vue {
       Cesium.ScreenSpaceEventType.MOUSE_MOVE
     )
   }
+  /**
+   * 显示进度信息
+   * @param {string} s_dt 起始日期
+   * @param {string} e_dt 终止日期
+   */
+  showSpeedInfos(s_dt, e_dt) {
+    const that = this
+    const data = {
+      SDate: s_dt,
+      EDate: e_dt
+    }
+    // this.clearPrimitives()
+    if (!gPrimitiveCollection) {
+      gPrimitiveCollection = new Cesium.PrimitiveCollection()
+      this.viewer.scene.primitives.add(gPrimitiveCollection)
+    } else {
+      return
+    }
+    GetProgress(data)
+      .then((result) => {
+        if (result.code === 1) {
+          if (Object.keys(result.result).length === 0) {
+            // this.$message.success('无进度信息')
+            return
+          }
+          that.pbsInfo(result.result)
+        } else {
+          this.$message.error('查询失败')
+        }
+      })
+      .catch((error) => {
+        console.log(error)
+      })
+  }
+  /**
+   * 该方法用于生成查询smid条件
+   * @param pbscodes
+   */
+  pbsInfo(pbscodes) {
+    const layers = []
+    for (let layername in pbscodes) {
+      const pbsLayer = layername.split(',')[0]
+      const codes = pbscodes[layername]
+      layers.push({ name: pbsLayer, codes: codes })
+    }
+    const fieldname = 'CODE'
+    if (layers.length == 0) {
+      this.$message.success('无施工进度信息')
+      return
+    }
+    const url = this.apiurls.smiddtfw
+    const filterPars = layers.map((item) => {
+      const pipeConfig = _.find(gPipe, function (pipe) {
+        return pipe.origindataset === item.name
+      })
+      let str = ''
+      item.codes.forEach((item, index) => {
+        if (index == 0) {
+          str += "'" + item + "'"
+        } else {
+          str += ",'" + item + "'"
+        }
+      })
+      return new SuperMap.REST.FilterParameter({
+        name: pipeConfig.smidmapname,
+        attributeFilter: fieldname + ' in (' + str + ')',
+        fields: [fieldname]
+      })
+    })
+    const options = {
+      url: url,
+      filterParameters: filterPars,
+      queryOption: SuperMap.REST.QueryOption.ATTRIBUTEANDGEOMETRY,
+      completed: this.queryComplete.bind(this),
+      failed: function (error) {
+        console.error(error)
+      }
+    }
+    queryMapByAttribute(options)
+  }
+  /**
+   * 查询成功
+   * @param result
+   */
+  queryComplete(result) {
+    this.flashMapService(result.originResult.recordsets)
+  }
+  /**
+   * 该方法用于添加二维管线高亮
+   * @param records
+   */
+  flashMapService(records) {
+    const that = this
+    if (!records || records.length === 0) return
+    // if (!gPrimitiveCollection) return
+    // const primtCol = gPrimitiveCollection
+    records.forEach((record) => {
+      if (record.features.length == 0) return false
+      record.features.forEach((feature) => {
+        const geometry = feature.geometry.points
+        const geotype = feature.geometry.type.toLowerCase().indexOf('line') > -1 ? 'LINE' : 'POINT'
+        if (geotype === 'LINE') {
+          const pointL = [geometry[0].x, geometry[0].y, geometry[0].z]
+          this.pointArrCluster.push(pointL)
+        } else {
+          const pointR = [geometry[0].x, geometry[0].y, geometry[0].z]
+          this.pointArrCluster.push(pointR)
+        }
+      })
+    })
+    this.clustering() //聚合显示
+  }
+  //聚合显示
+  clustering() {
+    var that = this
+    // this.viewer.dataSources.removeAll()
+    //聚合参数
+    pointDataSource = new Cesium.CustomDataSource('pointData')
+    this.pointArrCluster.forEach((item) => {
+      var entity = pointDataSource.entities.add({
+        position: Cesium.Cartesian3.fromDegrees(item[0], item[1], item[2] + 100),
+        billboard: {
+          image: that.getDrawCanvas(1, 5),
+          width: 50,
+          height: 50,
+          heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
+        }
+      })
+    })
+    var dataSourcePromise = this.viewer.dataSources.add(pointDataSource)
+    dataSourcePromise.then(function (dataSource) {
+      var pixelRange = 100 //聚合距离,以像素为单位,小于这个距离就会被聚合
+      var minimumClusterSize = 2 //每个聚合点的最小聚合个数
+      var enabled = true
+
+      dataSource.clustering.enabled = enabled
+      dataSource.clustering.pixelRange = pixelRange
+      dataSource.clustering.minimumClusterSize = minimumClusterSize
+
+      var removeListener
+      function customStyle() {
+        if (Cesium.defined(removeListener)) {
+          removeListener()
+          removeListener = undefined
+        } else {
+          removeListener = dataSource.clustering.clusterEvent.addEventListener(function (clusteredEntities, cluster) {
+            if (!cluster) return
+            cluster.label.show = false
+            cluster.billboard.show = true
+            cluster.billboard.id = cluster.label.id
+            cluster.billboard.verticalOrigin = Cesium.VerticalOrigin.BOTTOM
+
+            if (clusteredEntities.length >= 100) {
+              cluster.billboard.image = that.getDrawCanvas(clusteredEntities.length, 1)
+            } else if (clusteredEntities.length >= 50) {
+              cluster.billboard.image = that.getDrawCanvas(clusteredEntities.length, 2)
+            } else if (clusteredEntities.length >= 10) {
+              cluster.billboard.image = that.getDrawCanvas(clusteredEntities.length, 3)
+            } else {
+              var singleDigit = new Array(8)
+              for (var i = 0; i < singleDigit.length; ++i) {
+                singleDigit[i] = that.getDrawCanvas(i + 2, 4)
+              }
+              cluster.billboard.image = singleDigit[clusteredEntities.length - 2]
+            }
+          })
+        }
+        // force a re-cluster with the new styling
+        var pixelRange = dataSource.clustering.pixelRange
+        dataSource.clustering.pixelRange = 0
+        dataSource.clustering.pixelRange = pixelRange
+      }
+      // start with custom style
+      customStyle()
+      var handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)
+      handler.setInputAction(function (movement) {
+        var pickedLabel = that.viewer.scene.pick(movement.position)
+        if (Cesium.defined(pickedLabel)) {
+          var ids = pickedLabel.id
+          if (Array.isArray(ids)) {
+            for (var i = 0; i < ids.length; ++i) {
+              ids[i].billboard.color = Cesium.Color.RED
+            }
+          }
+        }
+      }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
+    })
+  }
+  getDrawCanvas(text, level) {
+    var canvas = document.createElement('canvas')
+    var ctx = canvas.getContext('2d')
+    canvas.height = 100
+    canvas.width = 100
+    switch (level) {
+      case 1:
+        ctx.beginPath()
+        var grad = ctx.createRadialGradient(50, 50, 0, 50, 50, 50)
+        grad.addColorStop(0.8, 'rgba(159,33,200,0.8)')
+        grad.addColorStop(1, 'rgba(159,33,200,0.4)')
+        ctx.fillStyle = grad
+        ctx.arc(50, 50, 50, 0, 2 * Math.PI, true)
+        ctx.fill()
+        //加入字体
+        ctx.font = '30px bold 楷体'
+        ctx.fillStyle = 'white'
+        ctx.fillText(text, (canvas.width - ctx.measureText(text).width) / 2, canvas.height - 40)
+        break
+      case 2:
+        ctx.beginPath()
+        var grad = ctx.createRadialGradient(45, 45, 0, 45, 45, 45)
+        grad.addColorStop(0.8, 'rgba(44,72,240,0.8)')
+        grad.addColorStop(1, 'rgba(44,72,240,0.4)')
+        ctx.fillStyle = grad
+        ctx.arc(45, 45, 45, 0, 2 * Math.PI, true)
+        ctx.fill()
+        //
+        ctx.font = '30px bold 楷体'
+        ctx.fillStyle = 'white'
+        ctx.fillText(text, (canvas.width - ctx.measureText(text).width) / 2.5, canvas.height - 40)
+        break
+      case 3:
+        ctx.beginPath()
+        var grad = ctx.createRadialGradient(40, 40, 0, 40, 40, 40)
+        grad.addColorStop(0.8, 'rgba(214,116,10,0.8)')
+        grad.addColorStop(1, 'rgba(214,116,10,0.4)')
+        ctx.fillStyle = grad
+        ctx.arc(40, 40, 40, 0, 2 * Math.PI, true)
+        ctx.fill()
+        //
+        ctx.font = '30px bold 楷体'
+        ctx.fillStyle = 'white'
+        ctx.fillText(text, (canvas.width - ctx.measureText(text).width) / 3, canvas.height - 50)
+        break
+      case 4:
+        ctx.beginPath()
+        var grad = ctx.createRadialGradient(30, 30, 0, 30, 30, 30)
+        grad.addColorStop(0.8, 'rgba(2,138,63,0.8)')
+        grad.addColorStop(1, 'rgba(2,138,63,0.4)')
+        ctx.fillStyle = grad
+        ctx.arc(30, 30, 30, 0, 2 * Math.PI, true)
+        ctx.fill()
+        //
+        ctx.font = '30px bold 楷体'
+        ctx.fillStyle = 'white'
+        ctx.fillText(text, (canvas.width - ctx.measureText(text).width) / 4, canvas.height - 60)
+        break
+      case 5:
+        ctx.beginPath()
+        var grad = ctx.createRadialGradient(50, 50, 0, 50, 50, 50)
+        grad.addColorStop(0.8, 'rgba(2,138,63,0.8)')
+        grad.addColorStop(1, 'rgba(2,138,63,0.4)')
+        ctx.fillStyle = grad
+        ctx.arc(50, 50, 50, 0, 2 * Math.PI, true)
+        ctx.fill()
+        //
+        ctx.font = '50px bold 楷体'
+        ctx.fillStyle = 'white'
+        ctx.fillText(text, (canvas.width - ctx.measureText(text).width) / 2, canvas.height - 30)
+        break
+    }
+    return canvas
+  }
   //清除进度信息
   clearSpeedInfos() {
     this.viewer.scene.layers.releaseSelection()
     this.removeLabels()
     this.clearPrimitives()
+    this.clearClusterDataSource()
   }
   //该方法用于清除entity label
   removeLabels() {
@@ -578,6 +846,13 @@ export default class ProjectPipeSpeedInfoCheck extends Vue {
       if (isDel) gPrimitiveCollection = null
     }
   }
+  //清除聚合数据源
+  clearClusterDataSource() {
+    if (pointDataSource) {
+      this.viewer.dataSources.remove(pointDataSource)
+      pointDataSource = null
+    }
+  }
   close() {
     this.$store.state.bigScreen.isShowPipeSpeedInfoCheck = false
     if (this.pipeInfo) {