zhaobao 2 anni fa
parent
commit
6143cf7c8e

+ 1 - 1
src/layout/components/Navbar.vue

@@ -156,7 +156,7 @@ export default {
     sideTabChange(index, item) {
       const token = getToken()
       if (item.href) {
-        const bigscreen = process.env.NODE_ENV === 'development' ? 'http://192.168.3.250:8080/#/' : 'http://113.141.93.143:1689/#/'
+        const bigscreen = process.env.NODE_ENV === 'development' ? 'http://192.168.3.16:8080/#/' : 'http://113.141.93.143:1689/#/'
         window.open(`${bigscreen}?token=${token}`)
         return
       }

+ 0 - 1
src/settings.js

@@ -40,7 +40,6 @@ module.exports = {
   devServerUrl: 'http://113.141.93.143:1688', // 开发环境
   // devServerUrl: 'http://192.168.3.5:1688', // 开发环境 qu
   // devServerUrl: 'http://192.168.3.201:8080/', // 开发环境  test
-  // mqttUrl: 'ws://1.15.92.205:8083/mqtt', // mqtt地址
   mqttUrl: 'ws://113.141.93.143:8894/mqtt', // mqtt地址
   /**
   * websocket 地址

+ 16 - 15
src/views/goaf/sensor/CameraModel.vue

@@ -248,37 +248,37 @@ export default {
       })
     },
     changeArea(type) {
-      const goafs = this.deeepClone(this.goafList)
+      const goafs = this.deeepClone(this.goaf)
       let goafOrebodys = this.deeepClone(this.goafOrebodys)
       let goafOreheights = this.deeepClone(this.goafOreheights)
       let goafNames = this.deeepClone(this.goafNames)
       if (type === 1) {
-        goafOrebodys = goafs.filter(item => item.goafOrebelt === this.conditions.goafOrebelt)
+        goafOrebodys = goafs.filter(item => item.goafOrebelt === this.formData.goafOrebelt)
         goafOrebodys = this.unique(goafOrebodys, 'goafOrebody')
         this.goafOrebodys = goafOrebodys
         this.goafOreheights = []
         this.goafNames = []
-        this.conditions.goafOrebody = ''
-        this.conditions.goafOreheight = ''
-        this.conditions.goafName = ''
-        this.conditions.goafId = ''
+        this.formData.goafOrebody = ''
+        this.formData.goafOreheight = ''
+        this.formData.goafName = ''
+        this.formData.goafId = ''
       } else if (type === 2) {
-        goafOreheights = goafs.filter(item => (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+        goafOreheights = goafs.filter(item => (item.goafOrebody === this.formData.goafOrebody) && (item.goafOrebelt === this.formData.goafOrebelt))
         goafOreheights = this.unique(goafOrebodys, 'goafOreheight')
         this.goafOreheights = goafOreheights
         this.goafNames = []
-        this.conditions.goafOreheight = ''
-        this.conditions.goafName = ''
-        this.conditions.goafId = ''
+        this.formData.goafOreheight = ''
+        this.formData.goafName = ''
+        this.formData.goafId = ''
       } else if (type === 3) {
-        goafNames = goafs.filter(item => (item.goafOreheight === this.conditions.goafOreheight) && (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+        goafNames = goafs.filter(item => (item.goafOreheight === this.formData.goafOreheight) && (item.goafOrebody === this.formData.goafOrebody) && (item.goafOrebelt === this.formData.goafOrebelt))
         this.goafNames = goafNames
-        this.conditions.goafName = ''
-        this.conditions.goafId = ''
+        this.formData.goafName = ''
+        this.formData.goafId = ''
       } else {
         for (let i = 0; i < goafNames.length; i++) {
-          if (this.conditions.goafId === goafNames[i].goafId) {
-            this.conditions.goafName = goafNames[i].goafName
+          if (this.formData.goafId === goafNames[i].goafId) {
+            this.formData.goafName = goafNames[i].goafName
           }
         }
       }
@@ -290,6 +290,7 @@ export default {
       this.actionType = 'ADD'
       this.title = '新增摄像头配置'
       this.dialogVisible = true
+      this.formData.goafDevTypeId = this.sensorCats[0]?.sensorTypeId
     },
 
     // Show Edit Dialog

+ 8 - 5
src/views/goaf/sensor/camera.vue

@@ -43,7 +43,7 @@
   </div>
 </template>
 <script>
-import { getSensorByPage, delSensor } from '@/api/goaf/sensor'
+import { getSensor, delSensor } from '@/api/goaf/sensor'
 import { Pagination } from '@/components'
 import { NumConvertLM } from '@/utils'
 import CameraModel from './CameraModel.vue'
@@ -69,12 +69,15 @@ export default {
     NumConvertLM,
     getData() {
       this.listLoading = true
-      getSensorByPage(this.conditions).then((resp) => {
+      getSensor(this.conditions).then((resp) => {
         this.listLoading = false
-        const { code, msg, data, total } = resp
+        const { code, msg, data } = resp
         if (code === 0) {
-          this.dataList = data
-          this.total = total
+          const start = (this.conditions.page - 1) * this.conditions.limit
+          const end = this.conditions.page * this.conditions.limit
+          const dataList = data.filter((item) => item.goafDevTypename.includes('摄像头'))
+          this.dataList = dataList.filter((item, index) => index >= start && index < end)
+          this.total = dataList.length
         } else {
           this.$message.error(msg)
         }

+ 8 - 5
src/views/goaf/sensor/index.vue

@@ -45,7 +45,7 @@
 </template>
 
 <script>
-import { getSensorByPage, delSensor } from '@/api/goaf/sensor'
+import { delSensor, getSensor } from '@/api/goaf/sensor'
 import { Pagination } from '@/components'
 import { NumConvertLM } from '@/utils'
 import sensorModel from './Model'
@@ -71,12 +71,15 @@ export default {
     NumConvertLM,
     getData() {
       this.listLoading = true
-      getSensorByPage(this.conditions).then((resp) => {
+      getSensor(this.conditions).then((resp) => {
         this.listLoading = false
-        const { code, msg, data, total } = resp
+        const { code, msg, data } = resp
         if (code === 0) {
-          this.dataList = data
-          this.total = total
+          const start = (this.conditions.page - 1) * this.conditions.limit
+          const end = this.conditions.page * this.conditions.limit
+          const dataList = data.filter((item) => item.goafDevTypename.includes('传感器'))
+          this.dataList = dataList.filter((item, index) => index >= start && index < end)
+          this.total = dataList.length
         } else {
           this.$message.error(msg)
         }