Browse Source

集成websocket

重置后默认刷新查询列表
设备状态列表
master
yangzongjia 2 years ago
parent
commit
cf411f5460
  1. 15
      src/api/device copy/device.js
  2. 4
      src/api/yInfo/yInfo.js
  3. 15
      src/views/baojingchaxun/baojingchaxunList.vue
  4. 54
      src/views/index.vue
  5. 2
      src/views/shebeirizhi/shebeirizhiList.vue
  6. 2
      src/views/shebeitaizhang/shebeitaizhangList.vue
  7. 5
      src/views/shebeizhuangtai/shebeizhuangtaiList.vue
  8. 2
      src/views/xiaoxi/xiaoxiList.vue
  9. 1
      src/views/zhiwujiance/zhiwujianceList.vue

15
src/api/device copy/device.js

@ -1,15 +0,0 @@
import request from '@/utils/request'
// eslint-disable-next-line no-unused-vars
import qs from 'qs'
// 获取设备列表
export function getInfoPage(data) {
return request({ url: '/yInfo/getInfoPage', method: 'GET', params: data })
}
// 单条获取设备
export function getInfoById(data) {
return request({ url: '/yInfo/getInfoById', method: 'GET', params: data })
}

4
src/api/yInfo/yInfo.js

@ -13,3 +13,7 @@ export function getInfoById(data) {
return request({ url: '/yInfo/getInfoById', method: 'GET', params: data })
}
export function getUnread(query) {
return request({ url: '/yInfo/getUnread', method: 'GET', params: data })
}

15
src/views/baojingchaxun/baojingchaxunList.vue

@ -224,19 +224,8 @@ export default {
this.listQuery.name = null
this.listQuery.startTime = null
this.listQuery.endTime = null
// this.listQuery = {
// params: {
// manufacturerName: '',
// supplierType: '',
// useOrgSid: '',
// createOrgSid: '',
// manufacturerTelePhone: '',
// contactName: ''
// },
// current: 1,
// size: 5
// }
// this.init()
this.listQuery.current = 1
this.getList()
},
//
toAdd() {

54
src/views/index.vue

@ -173,7 +173,7 @@ import * as echarts from "echarts";
import PieChartrenyuan from '@/views/echarts/components/PieChartrenyuan'
import HomeMap from '@/views/dashboard/components/HomeMap'
import { getCallPolicePage } from '@/api/callPolice/callPolice'
import { getInfoPage } from '@/api/yInfo/yInfo'
import { getInfoPage, getUnread } from '@/api/yInfo/yInfo'
import { getStatusCount } from '@/api/device/device'
import { init } from 'events';
// 1.1
@ -314,7 +314,59 @@ export default {
}
},
methods: {
toDoMessagge() {
//
// getUnread().then((response) => {
// console.log('-------------' + response.data)
// if (response.code === 20000 && response.data) {
// this.$store.dispatch('app/setSysMessageCount', response.data)
this.$store.dispatch('app/setSysMessageCount', "lllll")
// } else {
// this.$store.dispatch('app/setSysMessageCount', 0)
// }
// })
},
onConnected(frame) {
// 广
this.$stompClient.subscribe(
'/topic/subscribe',
this.responseCallback,
this.onFailed
)
//
// id
this.$stompClient.subscribe(
'/user/' + this.userId + '/queue/subscribewarn',
this.responseCallback,
this.onFailed
)
},
onFailed(frame) {
console.log('gongzuotai连接ws失败: ' + JSON.stringify(frame))
},
connectSrv() {
var headers = {}
// console.log('ws', ws)
this.connetWM(ws, headers, this.onConnected, this.onFailed)
},
onConnected(frame) {
订阅广播系统通知
this.$stompClient.subscribe(
'/topic/subscribe',
this.responseCallback,
this.onFailed
)
// id
this.$stompClient.subscribe(
'/user/' + this.userId + '/queue/subscribewarn',
this.responseCallback,
this.onFailed
)
},
init() {
// this.toDoMessagge()
// this.timer = setInterval(this.toDoMessagge, 60000)
// this.connectSrv()
getStatusCount({ deviceType: 1 }).then(res => {
this.statusDataSp = res.data
this.shipinjiankong_Chart.Data.seriesData = []

2
src/views/shebeirizhi/shebeirizhiList.vue

@ -211,6 +211,8 @@ export default {
this.listQuery.startTime = null
this.listQuery.name = null
this.listQuery.position = null
this.listQuery.current = 1
this.getList()
// this.listQuery = {
// params: {
// manufacturerName: '',

2
src/views/shebeitaizhang/shebeitaizhangList.vue

@ -431,6 +431,8 @@ export default {
this.listQuery.ckId = null
this.listQuery.type = null
this.listQuery.name = null
this.listQuery.current = 1
this.getList()
},
//
toAdd() {

5
src/views/shebeizhuangtai/shebeizhuangtaiList.vue

@ -105,7 +105,8 @@ export default {
{ title: '摄像头', id: '1' },
{ title: '电子围栏', id: '2' },
{ title: '门禁', id: '3' },
{ title: '机器人', id: '4' }
{ title: '报警主机', id: '4' },
{ title: '网络录像机', id: '5' },
],
rules: {}
}
@ -202,6 +203,8 @@ export default {
},
handleReset() {
this.listQuery.type = null
this.listQuery.current = 1
this.getList()
// this.listQuery = {
// params: {
// manufacturerName: '',

2
src/views/xiaoxi/xiaoxiList.vue

@ -280,6 +280,8 @@ export default {
},
handleReset() {
this.listQuery.content = null
this.listQuery.current = 1
this.getList()
},
//
toAdd() {

1
src/views/zhiwujiance/zhiwujianceList.vue

@ -362,6 +362,7 @@ export default {
},
handleReset() {
this.listQuery.ckId = null
this.getList()
},
//
toAdd() {

Loading…
Cancel
Save