zhaobao 2 년 전
부모
커밋
126db9bd9e
4개의 변경된 파일30개의 추가작업 그리고 6개의 파일을 삭제
  1. 7 1
      src/views/particulars/check.vue
  2. 6 0
      src/views/particulars/goaf_info.vue
  3. 11 5
      src/views/particulars/sensor.vue
  4. 6 0
      src/views/particulars/video.vue

+ 7 - 1
src/views/particulars/check.vue

@@ -280,6 +280,7 @@ import {getTime} from '@/utils'
             let goafNames = this.deeepClone(this.goafNames)
             if (type === 1) {
                 goafOrebodys = goafs.filter(item => item.goafOrebelt === this.conditions.goafOrebelt)
+                goafOrebodys = this.unique(goafOrebodys, 'goafOrebody')
                 this.goafOrebodys = goafOrebodys
                 this.goafOreheights = []
                 this.goafNames = []
@@ -289,6 +290,7 @@ import {getTime} from '@/utils'
                 this.conditions.goafId = ''
             } else if (type === 2) {
                 goafOreheights = goafs.filter(item => (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+                goafOreheights = this.unique(goafOrebodys, 'goafOreheight')
                 this.goafOreheights = goafOreheights
                 this.goafNames = []
                 this.conditions.goafOreheight = ''
@@ -307,7 +309,11 @@ import {getTime} from '@/utils'
                 }
             }
             this.$forceUpdate()
-        },        
+        },  
+        unique(arr = [], name = 'name') {
+            const res = new Map()
+            return arr.filter((item) => !res.has(item[name]) && res.set(item[name], 1))
+        },         
         deeepClone(params) {
             return JSON.parse(JSON.stringify(params))
         } 

+ 6 - 0
src/views/particulars/goaf_info.vue

@@ -163,6 +163,7 @@ import { NumConvertLM ,parseTime} from '@/utils'
             let goafNames = this.deeepClone(this.goafNames)
             if (type === 1) {
                 goafOrebodys = goafs.filter(item => item.goafOrebelt === this.conditions.goafOrebelt)
+                goafOrebodys = this.unique(goafOrebodys, 'goafOrebody')
                 this.goafOrebodys = goafOrebodys
                 this.goafOreheights = []
                 this.goafNames = []
@@ -172,6 +173,7 @@ import { NumConvertLM ,parseTime} from '@/utils'
                 this.conditions.goafId = ''
             } else if (type === 2) {
                 goafOreheights = goafs.filter(item => (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+                goafOreheights = this.unique(goafOrebodys, 'goafOreheight')
                 this.goafOreheights = goafOreheights
                 this.goafNames = []
                 this.conditions.goafOreheight = ''
@@ -190,6 +192,10 @@ import { NumConvertLM ,parseTime} from '@/utils'
                 }
             }
             this.$forceUpdate()
+        },  
+        unique(arr = [], name = 'name') {
+            const res = new Map()
+            return arr.filter((item) => !res.has(item[name]) && res.set(item[name], 1))
         },        
         deeepClone(params) {
             return JSON.parse(JSON.stringify(params))

+ 11 - 5
src/views/particulars/sensor.vue

@@ -235,7 +235,8 @@ import { NumConvertLM ,getTime} from '@/utils'
             getSensorByPage(this.conditions).then((resp) => {
                 this.listLoading = false
                 const {data, total } = resp
-                this.dataList = data
+                let tab=this.items.filter(item=>this.activeId===item.id)[0]
+                this.dataList = this.activeId==='1'?data:data.filter(item=>item.goafDevTypename===tab.name)
                 this.total = total
             })
         },
@@ -243,11 +244,10 @@ import { NumConvertLM ,getTime} from '@/utils'
             this.activeId=item.id
             if(item.id==='5'){
                 this.$router.push('/particulars/particulars-video')
+            }else{
+                this.init()
             }
         },
-        changeTab(item){
-            this.activetab=item.id
-        },
         searchSubmit(){
             this.getData()
         },
@@ -287,6 +287,7 @@ import { NumConvertLM ,getTime} from '@/utils'
             let goafNames = this.deeepClone(this.goafNames)
             if (type === 1) {
                 goafOrebodys = goafs.filter(item => item.goafOrebelt === this.conditions.goafOrebelt)
+                goafOrebodys = this.unique(goafOrebodys, 'goafOrebody')
                 this.goafOrebodys = goafOrebodys
                 this.goafOreheights = []
                 this.goafNames = []
@@ -296,6 +297,7 @@ import { NumConvertLM ,getTime} from '@/utils'
                 this.conditions.goafId = ''
             } else if (type === 2) {
                 goafOreheights = goafs.filter(item => (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+                goafOreheights = this.unique(goafOrebodys, 'goafOreheight')
                 this.goafOreheights = goafOreheights
                 this.goafNames = []
                 this.conditions.goafOreheight = ''
@@ -314,7 +316,11 @@ import { NumConvertLM ,getTime} from '@/utils'
                 }
             }
             this.$forceUpdate()
-        },        
+        },  
+        unique(arr = [], name = 'name') {
+            const res = new Map()
+            return arr.filter((item) => !res.has(item[name]) && res.set(item[name], 1))
+        },             
         deeepClone(params) {
             return JSON.parse(JSON.stringify(params))
         }  

+ 6 - 0
src/views/particulars/video.vue

@@ -136,6 +136,7 @@ import {  getGoafBaseInfo } from '@/api/goaf/info'
             let goafNames = this.deeepClone(this.goafNames)
             if (type === 1) {
                 goafOrebodys = goafs.filter(item => item.goafOrebelt === this.conditions.goafOrebelt)
+                goafOrebodys = this.unique(goafOrebodys, 'goafOrebody')
                 this.goafOrebodys = goafOrebodys
                 this.goafOreheights = []
                 this.goafNames = []
@@ -145,6 +146,7 @@ import {  getGoafBaseInfo } from '@/api/goaf/info'
                 this.conditions.goafId = ''
             } else if (type === 2) {
                 goafOreheights = goafs.filter(item => (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+                goafOreheights = this.unique(goafOrebodys, 'goafOreheight')
                 this.goafOreheights = goafOreheights
                 this.goafNames = []
                 this.conditions.goafOreheight = ''
@@ -163,6 +165,10 @@ import {  getGoafBaseInfo } from '@/api/goaf/info'
                 }
             }
             this.$forceUpdate()
+        },  
+        unique(arr = [], name = 'name') {
+            const res = new Map()
+            return arr.filter((item) => !res.has(item[name]) && res.set(item[name], 1))
         },        
         deeepClone(params) {
             return JSON.parse(JSON.stringify(params))