Browse Source

- 排水检测

yj 3 years ago
parent
commit
f80233f27d

+ 2 - 2
public/config.js

@@ -38,8 +38,8 @@ export const appconfig = {
 export function setParams (xzq) {
   console.log('设置坐标')
   const parmas = { 
-    '宜昌': { proj: 'proj46', center: { "lon": "111.291353", "lat": "30.705687", "height": "50159.21860055598" } },
-    '岳阳': { proj: 'proj47', center: { "lon": "113.17326715436977", "lat": "29.37027846440258", "height": "50159.21860055598" } },
+    '宜昌': { proj: 'proj46', center: { "lon": "111.291353", "lat": "30.705687", "height": "30159.21860055598" } },
+    '岳阳': { proj: 'proj47', center: { "lon": "113.17326715436977", "lat": "29.37027846440258", "height": "30159.21860055598" } },
   }
   let { proj, center } = parmas[xzq]
   appconfig.currCenter = center

+ 37 - 44
src/views/pipelineDefect/analysis/defectAccessStatis/widget.vue

@@ -39,7 +39,8 @@
             v-model="searchValue.startPoint"
             clearable
             style="margin-right: 10px"
-          ></el-input>
+          >
+          </el-input>
           <div class="title">终止井号:</div>
           <el-input
             size="small"
@@ -47,28 +48,20 @@
             v-model="searchValue.endPoint"
             clearable
             style="margin-right: 10px"
-          ></el-input>
+          >
+          </el-input>
           <div class="title">缺陷类型:</div>
           <el-select size="small" clearable v-model="searchValue.defectType" placeholder="选择缺陷类型">
-            <el-option v-for="item in types" :key="item" :label="item" :value="item"></el-option>
+            <el-option v-for="item in types" :key="item" :label="item" :value="item">
+            </el-option>
           </el-select>
 
           <div class="title">类型名称:</div>
           <el-select size="small" clearable v-model="searchValue.defectName" placeholder="选择类型名称">
-            <el-option
-              v-for="item in defectTypes"
-              :key="item.name"
-              :label="item.name"
-              :value="item.name"
-            ></el-option>
+            <el-option v-for="(item, i) in defectTypes" :key="item.name + i" :label="item.name" :value="item.name"> </el-option>
           </el-select>
-          <el-button
-            class="serch-btn"
-            style="margin-left: 26px"
-            type="primary"
-            @click="searchApi"
-          >查询</el-button>
-          <el-button class="serch-btn" type="primary" @click="getPdf('管道缺陷评价统计', 'defecteva')">导出</el-button>
+          <el-button class="serch-btn" style="margin-left: 26px" type="primary" @click="searchApi"> 查询 </el-button>
+          <el-button class="serch-btn" type="primary" @click="getPdf('管道缺陷评价统计', 'defecteva')"> 导出 </el-button>
         </div>
         <div class="right-btn"></div>
       </div>
@@ -86,7 +79,7 @@
 <script>
 // 引入发布的组件
 import summaryForm from '../../components/summaryForm.vue'
-import { getPipeDefectsTypeCountMap } from '../../api/pipelineDefect'
+import { getPipeDefectsTypeCountMap } from '@/api/pipelineManage'
 // 引入基本模板
 let echarts = require('echarts/lib/echarts')
 // 引入饼状图组件
@@ -194,21 +187,15 @@ export default {
     }
   },
   mounted() {
+    this.setTypes()
     this.getData().then(res => {
       if(res.code === 1) {
         let data = res.result.filter(d => d.defectCode !== 'ZC')
           this.setData(data)
-          this.setTypes(data)
           this.isNull = data.length === 0
       } else this.$message.error('程序出错')
     })
   },
-  watch: {
-    'searchValue.defectType': function (nv, ov) {
-      this.searchValue.defectName = ''
-      this.defectTypes = this.defectTypesData.filter(item => item.type && item.type.includes(nv))
-    }
-  },
   computed: {
     returnTabel() {
       return {
@@ -218,25 +205,21 @@ export default {
       }
     }
   },
+  watch: {
+    'searchValue.defectType': function (nv, ov) {
+      this.searchValue.defectName = ''
+      this.setTypes(nv)
+    }
+  },
   methods: {
-    setTypes (data = []) {
-      let map = new Map()
-      map.set('结构性缺陷', [])
-      map.set('功能性缺陷', [])
-      data.forEach(v => {
-        let type = v.defectType
-        if (!type) {
-          if (this.typeArr.s.includes(v.defectCode)) { type = '结构性缺陷' }
-          if (this.typeArr.f.includes(v.defectCode)) { type = '功能性缺陷' }
-        }
-        if (!map.get(type).includes(v.defectName)) {
-          map.get(type).push(v.defectName)
-        }
+    setTypes (type = '') {
+      let sDefectStype = this.defectQuantityStatisticsA.map(i => {
+        return { name: i.title.split(')')[1], type: '结构性缺陷' }
       })
-      map.forEach((value, key) => {
-        value.forEach(name => this.defectTypesData.push({ type: key, name }))
+      let fDefectStype = this.defectQuantityStatisticsB.map(i => {
+        return { name: i.title.split(')')[1], type: '功能性缺陷' }
       })
-      this.defectTypes = [...this.defectTypesData]
+      this.defectTypes = [...sDefectStype, ...fDefectStype].filter(d => d.type.includes(type))
     },
     setData (data = []) {
         this.defectQuantityStatisticsA.forEach(item => {
@@ -330,7 +313,7 @@ export default {
           if (this.typeArr.f.includes(defect.defectCode)) { content[1].value += defect.defectNum }
         }
       })
-      this.contentEchatrs = content
+      this.contentEchatrs = content.filter(i => i.value !== 0)
 
       // 中
       let echartsData = new Map()
@@ -345,6 +328,8 @@ export default {
         let find = this.allArr.find(i => i.Lname.includes(key))
         if (find) { find.value = value }
       })
+      //
+      this.allArr = this.allArr.filter(i => i.value !== 0)
       // 外
 
       let echartsDataArr = data.map((v) => {
@@ -386,7 +371,13 @@ export default {
     },
     // 搜索
     searchApi() {
-      this.getData(this.searchValue)
+      this.getData(this.searchValue).then(res => {
+      if(res.code === 1) {
+        let data = res.result.filter(d => d.defectCode !== 'ZC')
+          this.setData(data)
+          this.isNull = data.length === 0
+      } else this.$message.error('程序出错')
+    })
     },
     getData(params) {
       this.defectSumObj = { oneSum: 0, twoSum: 0, threeSum: 0, fourSum: 0, total: 0 }
@@ -409,6 +400,7 @@ export default {
       // 基于准备好的dom,初始化echarts实例
       let myChart = echarts.init(document.getElementById('mainE'))
       // 绘制图表
+      let position = this.contentEchatrs.length === 1 ? 'center' : 'inner'
       myChart.setOption(
         {
           tooltip: {
@@ -428,8 +420,9 @@ export default {
               selectedMode: 'single',
               radius: [0, '25%'],
               label: {
-                position: 'inner',
-                fontSize: 12
+                position,
+                fontSize: 12,
+                color: '#fff'
               },
               labelLine: {
                 show: false

+ 3 - 3
src/views/pipelineDefect/common/graphic.ts

@@ -68,7 +68,7 @@ export default class GraphicUtil {
         return new Cesium.Entity({
             corridor: {
                 positions,
-                width: 1.5,
+                width: 3.5,
                 material: color
             }
         })
@@ -79,8 +79,8 @@ export default class GraphicUtil {
             position,
             billboard: { //图标
                 image: img || testImg,
-                width: 16,
-                height: 16,
+                width: 20,
+                height: 20,
                 heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
                 rotation: 0,
                 // sizeInMeters: true

+ 5 - 2
src/views/pipelineDefect/manage/resmap/widget.vue

@@ -685,8 +685,6 @@ export default {
       this.$nextTick(() => {
         this.$store.dispatch('map/changeMethod', info)
       })
-
-      this.openPromptBox('109YS322~109YS327', '')
     },
     // 打开弹窗
     openPromptBox (id, type) {
@@ -699,12 +697,14 @@ export default {
             if (type) {
                 let pEntities = this.getDataSource(this.sSName).entities.values
                 findFeas = pEntities.filter(e => e[this.propertyName][idText] === id).map(i => i[this.propertyName])
+                if (findFeas.length === 0) { return this.$message.error('无位置信息') }
                 let features = this.getLightFeatures(findFeas)
                 center = this.cesiumUitl.getCenterFormFeas(features.map(f => f.geometryInstances.id[this.propertyName].coors))
                 features.forEach(f => this.lightPrimitiveCollection.add(f))
             } else {
                 let dEntities = this.getSource(this.dSName).entities.values
                 findFeas = dEntities.filter(e => e[this.propertyName][idText] === id).map(i => i[this.propertyName])
+                if (findFeas.length === 0) { return this.$message.error('无位置信息') }
                 let { x, y } = JSON.parse(findFeas[0]['geometry'])
                 let [lon, lat] = this.projUtil.transform([x, y], this.currentDataProjName, 'proj84')
                 center = [lon, lat]
@@ -722,6 +722,9 @@ export default {
                 this.$message.error('该点无位置信息');
             }
     },
+        getSource(name) {
+            return this.viewer.dataSources.getByName(name)[0]
+        },
         // 获取高亮的要素
         getLightFeatures(data) {
             let that = this

+ 8 - 6
src/views/pipelineDefect/mixin/map.ts

@@ -47,7 +47,7 @@ export const mapMixin = {
             if (psource && dsource && [...dsource.entities.values, ...psource.entities.values].length !== 0) {
                 this.setPipeAndDefectVisible()
             } else {
-                this.$store.dispatch('map/mapLaoding', true)
+                // this.$store.dispatch('map/mapLaoding', true)
                 getDefectData().then(res => {
                     console.log('获取数据')
                     let data = res.result
@@ -59,7 +59,7 @@ export const mapMixin = {
                         this.addDefects(pipeDefectFeatures)
                         this.setPipeAndDefectVisible()
                     }
-                    this.$store.dispatch('map/mapLaoding', false)
+                    // this.$store.dispatch('map/mapLaoding', false)
                 })
             }
         },
@@ -238,12 +238,14 @@ export const mapMixin = {
             if (type) {
                 let pEntities = this.getSource(this.pSname).entities.values
                 findFeas = pEntities.filter(e => e[this.propertyName][idText] === id).map(i => i[this.propertyName])
+                if (findFeas.length === 0) { return this.$message.error('无位置信息') }
                 let features = this.getLightFeatures(findFeas)
                 center = this.cesiumUitl.getCenterFormFeas(features.map(f => f.geometryInstances.id[this.propertyName].coors))
                 features.forEach(f => this.lightPrimitiveCollection.add(f))
             } else {
                 let dEntities = this.getSource(this.dSname).entities.values
                 findFeas = dEntities.filter(e => e[this.propertyName][idText] === id).map(i => i[this.propertyName])
+                if (findFeas.length === 0) { return this.$message.error('无位置信息') }
                 let { x, y } = JSON.parse(findFeas[0]['geometry'])
                 let [lon, lat] = this.projUtil.transform([x, y], this.currentDataProjName, 'proj84')
                 center = [lon, lat]
@@ -328,9 +330,9 @@ export const mapMixin = {
         // this.setSourceVisible(this.dSname, false)
     },
     watch: {
-        // '$store.state.app.activeSideItem': function(n, o) {
-        //     if (n === '工程管理') { this.$store.dispatch('map/mapLaoding', false) }
-        //     this.setPipeAndDefectVisible()
-        // }
+        '$store.state.app.activeSideItem': function(n, o) {
+            if (n === '工程管理') { this.$store.dispatch('map/mapLaoding', false) }
+            this.setPipeAndDefectVisible()
+        }
     }
 }