diff --git a/src/api/home/device/count.ts b/src/api/home/device/count.ts index e06e5a9..6c969a7 100644 --- a/src/api/home/device/count.ts +++ b/src/api/home/device/count.ts @@ -46,7 +46,7 @@ // 离线设备清单 export function getOfflineDevice(data: any) { return request({ - url: '/device/statics/offLineList', + url: `/device/statics/offLineList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/home/device/count.ts b/src/api/home/device/count.ts index e06e5a9..6c969a7 100644 --- a/src/api/home/device/count.ts +++ b/src/api/home/device/count.ts @@ -46,7 +46,7 @@ // 离线设备清单 export function getOfflineDevice(data: any) { return request({ - url: '/device/statics/offLineList', + url: `/device/statics/offLineList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/home/station/video.ts b/src/api/home/station/video.ts index de3d52d..3ef12ec 100644 --- a/src/api/home/station/video.ts +++ b/src/api/home/station/video.ts @@ -23,10 +23,10 @@ return request({ url: `/ptz/getPlayBackUrl`, method: 'post', - // data, - params: { - ...data, - } + data, + // params: { + // ...data, + // } }) } @@ -35,8 +35,9 @@ return request({ url: `/ptz/controCearm`, method: 'post', - params: { - ...data, - } + data + // params: { + // ...data, + // } }) } diff --git a/src/api/home/device/count.ts b/src/api/home/device/count.ts index e06e5a9..6c969a7 100644 --- a/src/api/home/device/count.ts +++ b/src/api/home/device/count.ts @@ -46,7 +46,7 @@ // 离线设备清单 export function getOfflineDevice(data: any) { return request({ - url: '/device/statics/offLineList', + url: `/device/statics/offLineList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/home/station/video.ts b/src/api/home/station/video.ts index de3d52d..3ef12ec 100644 --- a/src/api/home/station/video.ts +++ b/src/api/home/station/video.ts @@ -23,10 +23,10 @@ return request({ url: `/ptz/getPlayBackUrl`, method: 'post', - // data, - params: { - ...data, - } + data, + // params: { + // ...data, + // } }) } @@ -35,8 +35,9 @@ return request({ url: `/ptz/controCearm`, method: 'post', - params: { - ...data, - } + data + // params: { + // ...data, + // } }) } diff --git a/src/components.d.ts b/src/components.d.ts index 347a901..96289e9 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,7 +54,6 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] - offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] @@ -75,5 +74,16 @@ SystemInfo: typeof import('./components/SystemInfo/index.vue')['default'] TableContainer: typeof import('./components/TableContainer/index.vue')['default'] Trend: typeof import('./components/Trend/index.vue')['default'] + VanCell: typeof import('vant/es')['Cell'] + VanCellGroup: typeof import('vant/es')['CellGroup'] + VanDatePicker: typeof import('vant/es')['DatePicker'] + VanDialog: typeof import('vant/es')['Dialog'] + VanField: typeof import('vant/es')['Field'] + VanForm: typeof import('vant/es')['Form'] + VanIcon: typeof import('vant/es')['Icon'] + VanPicker: typeof import('vant/es')['Picker'] + VanPickerGroup: typeof import('vant/es')['PickerGroup'] + VanPopup: typeof import('vant/es')['Popup'] + VanTextEllipsis: typeof import('vant/es')['TextEllipsis'] } } diff --git a/src/api/home/device/count.ts b/src/api/home/device/count.ts index e06e5a9..6c969a7 100644 --- a/src/api/home/device/count.ts +++ b/src/api/home/device/count.ts @@ -46,7 +46,7 @@ // 离线设备清单 export function getOfflineDevice(data: any) { return request({ - url: '/device/statics/offLineList', + url: `/device/statics/offLineList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/home/station/video.ts b/src/api/home/station/video.ts index de3d52d..3ef12ec 100644 --- a/src/api/home/station/video.ts +++ b/src/api/home/station/video.ts @@ -23,10 +23,10 @@ return request({ url: `/ptz/getPlayBackUrl`, method: 'post', - // data, - params: { - ...data, - } + data, + // params: { + // ...data, + // } }) } @@ -35,8 +35,9 @@ return request({ url: `/ptz/controCearm`, method: 'post', - params: { - ...data, - } + data + // params: { + // ...data, + // } }) } diff --git a/src/components.d.ts b/src/components.d.ts index 347a901..96289e9 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,7 +54,6 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] - offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] @@ -75,5 +74,16 @@ SystemInfo: typeof import('./components/SystemInfo/index.vue')['default'] TableContainer: typeof import('./components/TableContainer/index.vue')['default'] Trend: typeof import('./components/Trend/index.vue')['default'] + VanCell: typeof import('vant/es')['Cell'] + VanCellGroup: typeof import('vant/es')['CellGroup'] + VanDatePicker: typeof import('vant/es')['DatePicker'] + VanDialog: typeof import('vant/es')['Dialog'] + VanField: typeof import('vant/es')['Field'] + VanForm: typeof import('vant/es')['Form'] + VanIcon: typeof import('vant/es')['Icon'] + VanPicker: typeof import('vant/es')['Picker'] + VanPickerGroup: typeof import('vant/es')['PickerGroup'] + VanPopup: typeof import('vant/es')['Popup'] + VanTextEllipsis: typeof import('vant/es')['TextEllipsis'] } } diff --git a/src/components/HKplayer/errorCode.js b/src/components/HKplayer/errorCode.js index f44b864..17d2a23 100644 --- a/src/components/HKplayer/errorCode.js +++ b/src/components/HKplayer/errorCode.js @@ -11,7 +11,7 @@ '0x12f900011': '设置的音量不在1 - 100范围', '0x12f910000': 'websocket连接失败,请检查网络是否通畅,URL是否正确', '0x12f910010': '取流失败', - '0x12f910011': '流中断,电脑配置过低,程序卡主线程都可能导致流中断', + '0x12f910011': '视频中断', '0x12f910014': '没有音频数据', '0x12f910015': '未找到对应websocket,取流套接字被动关闭的报错', '0x12f910016': 'websocket不在连接状态', diff --git a/src/api/home/device/count.ts b/src/api/home/device/count.ts index e06e5a9..6c969a7 100644 --- a/src/api/home/device/count.ts +++ b/src/api/home/device/count.ts @@ -46,7 +46,7 @@ // 离线设备清单 export function getOfflineDevice(data: any) { return request({ - url: '/device/statics/offLineList', + url: `/device/statics/offLineList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/home/station/video.ts b/src/api/home/station/video.ts index de3d52d..3ef12ec 100644 --- a/src/api/home/station/video.ts +++ b/src/api/home/station/video.ts @@ -23,10 +23,10 @@ return request({ url: `/ptz/getPlayBackUrl`, method: 'post', - // data, - params: { - ...data, - } + data, + // params: { + // ...data, + // } }) } @@ -35,8 +35,9 @@ return request({ url: `/ptz/controCearm`, method: 'post', - params: { - ...data, - } + data + // params: { + // ...data, + // } }) } diff --git a/src/components.d.ts b/src/components.d.ts index 347a901..96289e9 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,7 +54,6 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] - offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] @@ -75,5 +74,16 @@ SystemInfo: typeof import('./components/SystemInfo/index.vue')['default'] TableContainer: typeof import('./components/TableContainer/index.vue')['default'] Trend: typeof import('./components/Trend/index.vue')['default'] + VanCell: typeof import('vant/es')['Cell'] + VanCellGroup: typeof import('vant/es')['CellGroup'] + VanDatePicker: typeof import('vant/es')['DatePicker'] + VanDialog: typeof import('vant/es')['Dialog'] + VanField: typeof import('vant/es')['Field'] + VanForm: typeof import('vant/es')['Form'] + VanIcon: typeof import('vant/es')['Icon'] + VanPicker: typeof import('vant/es')['Picker'] + VanPickerGroup: typeof import('vant/es')['PickerGroup'] + VanPopup: typeof import('vant/es')['Popup'] + VanTextEllipsis: typeof import('vant/es')['TextEllipsis'] } } diff --git a/src/components/HKplayer/errorCode.js b/src/components/HKplayer/errorCode.js index f44b864..17d2a23 100644 --- a/src/components/HKplayer/errorCode.js +++ b/src/components/HKplayer/errorCode.js @@ -11,7 +11,7 @@ '0x12f900011': '设置的音量不在1 - 100范围', '0x12f910000': 'websocket连接失败,请检查网络是否通畅,URL是否正确', '0x12f910010': '取流失败', - '0x12f910011': '流中断,电脑配置过低,程序卡主线程都可能导致流中断', + '0x12f910011': '视频中断', '0x12f910014': '没有音频数据', '0x12f910015': '未找到对应websocket,取流套接字被动关闭的报错', '0x12f910016': 'websocket不在连接状态', diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index b204454..bdc6bd2 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -141,6 +141,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" + video.appendChild(img) player.value .JS_Play(data.url, { playURL: data.url, mode: 0 }, 0, data.startTime, data.endTime) .then( @@ -148,6 +149,7 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') diff --git a/src/api/home/device/count.ts b/src/api/home/device/count.ts index e06e5a9..6c969a7 100644 --- a/src/api/home/device/count.ts +++ b/src/api/home/device/count.ts @@ -46,7 +46,7 @@ // 离线设备清单 export function getOfflineDevice(data: any) { return request({ - url: '/device/statics/offLineList', + url: `/device/statics/offLineList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/home/station/video.ts b/src/api/home/station/video.ts index de3d52d..3ef12ec 100644 --- a/src/api/home/station/video.ts +++ b/src/api/home/station/video.ts @@ -23,10 +23,10 @@ return request({ url: `/ptz/getPlayBackUrl`, method: 'post', - // data, - params: { - ...data, - } + data, + // params: { + // ...data, + // } }) } @@ -35,8 +35,9 @@ return request({ url: `/ptz/controCearm`, method: 'post', - params: { - ...data, - } + data + // params: { + // ...data, + // } }) } diff --git a/src/components.d.ts b/src/components.d.ts index 347a901..96289e9 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,7 +54,6 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] - offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] @@ -75,5 +74,16 @@ SystemInfo: typeof import('./components/SystemInfo/index.vue')['default'] TableContainer: typeof import('./components/TableContainer/index.vue')['default'] Trend: typeof import('./components/Trend/index.vue')['default'] + VanCell: typeof import('vant/es')['Cell'] + VanCellGroup: typeof import('vant/es')['CellGroup'] + VanDatePicker: typeof import('vant/es')['DatePicker'] + VanDialog: typeof import('vant/es')['Dialog'] + VanField: typeof import('vant/es')['Field'] + VanForm: typeof import('vant/es')['Form'] + VanIcon: typeof import('vant/es')['Icon'] + VanPicker: typeof import('vant/es')['Picker'] + VanPickerGroup: typeof import('vant/es')['PickerGroup'] + VanPopup: typeof import('vant/es')['Popup'] + VanTextEllipsis: typeof import('vant/es')['TextEllipsis'] } } diff --git a/src/components/HKplayer/errorCode.js b/src/components/HKplayer/errorCode.js index f44b864..17d2a23 100644 --- a/src/components/HKplayer/errorCode.js +++ b/src/components/HKplayer/errorCode.js @@ -11,7 +11,7 @@ '0x12f900011': '设置的音量不在1 - 100范围', '0x12f910000': 'websocket连接失败,请检查网络是否通畅,URL是否正确', '0x12f910010': '取流失败', - '0x12f910011': '流中断,电脑配置过低,程序卡主线程都可能导致流中断', + '0x12f910011': '视频中断', '0x12f910014': '没有音频数据', '0x12f910015': '未找到对应websocket,取流套接字被动关闭的报错', '0x12f910016': 'websocket不在连接状态', diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index b204454..bdc6bd2 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -141,6 +141,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" + video.appendChild(img) player.value .JS_Play(data.url, { playURL: data.url, mode: 0 }, 0, data.startTime, data.endTime) .then( @@ -148,6 +149,7 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') diff --git a/src/views/home/alarm/current/components/gasDataDialog.vue b/src/views/home/alarm/current/components/gasDataDialog.vue index b25b9cb..03e53c1 100644 --- a/src/views/home/alarm/current/components/gasDataDialog.vue +++ b/src/views/home/alarm/current/components/gasDataDialog.vue @@ -12,8 +12,10 @@ import { exportFile } from '@/utils/exportUtils' import { toHumpObject } from '@/utils/String' import { exportExcel } from '@/utils/exportXlsx' +import { handlerListData } from '@/views/home/device/device/components/handlerData' const dialogFormVisible = ref(false) // 对话框是否显示 const info = ref() +const manufactureName = ref('') const listQuery = ref({ devcode: '', typeName: '', @@ -93,9 +95,9 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '传感器状态', value: '', align: 'center' }, - { text: '温度(℃)', value: '', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '传感器状态', value: 'ssState', align: 'center' }, + { text: '温度(℃)', value: 'temp', align: 'center' }, + { text: '信号质量', value: 'sig', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -105,8 +107,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '电池状态', value: '', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '电池状态', value: 'ssState', align: 'center' }, + { text: '信号质量', value: 'rsrp', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -307,6 +309,23 @@ // .map(item => item.vbat || '0') // } ] + // 处理列表字段 + // 根据厂家判断 + if (manufactureName.value) { + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + else { + getDeviceListPage({ offset: 1, limit: 1, devCode: listQuery.value.devcode }).then(res => { + if (res.data.rows.length) { + manufactureName.value = res.data.rows[0].manufactureName + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + }) + } } else if (listQuery.value.typeName === '智能警示桩') { data.value = [ { @@ -362,13 +381,14 @@ } else if (row.devTypeName.includes('管网哨兵')) { columns.value = columns2.value // 获取设备信息 + manufactureName.value = '' getDeviceListPage({ offset: 1, limit: 1, devCode: row.devcode }).then(res => { if (res.data.rows.length) { - const manufactureName = res.data.rows[0].manufactureName - if (manufactureName.includes('百瑞生')) { + manufactureName.value = res.data.rows[0].manufactureName + if (manufactureName.value.includes('百瑞生')) { columns.value = columns2BRS.value } - else if (manufactureName.includes('麦哈克')) { + else if (manufactureName.value.includes('麦哈克')) { columns.value = columns2MHK.value } } diff --git a/src/api/home/device/count.ts b/src/api/home/device/count.ts index e06e5a9..6c969a7 100644 --- a/src/api/home/device/count.ts +++ b/src/api/home/device/count.ts @@ -46,7 +46,7 @@ // 离线设备清单 export function getOfflineDevice(data: any) { return request({ - url: '/device/statics/offLineList', + url: `/device/statics/offLineList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/home/station/video.ts b/src/api/home/station/video.ts index de3d52d..3ef12ec 100644 --- a/src/api/home/station/video.ts +++ b/src/api/home/station/video.ts @@ -23,10 +23,10 @@ return request({ url: `/ptz/getPlayBackUrl`, method: 'post', - // data, - params: { - ...data, - } + data, + // params: { + // ...data, + // } }) } @@ -35,8 +35,9 @@ return request({ url: `/ptz/controCearm`, method: 'post', - params: { - ...data, - } + data + // params: { + // ...data, + // } }) } diff --git a/src/components.d.ts b/src/components.d.ts index 347a901..96289e9 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,7 +54,6 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] - offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] @@ -75,5 +74,16 @@ SystemInfo: typeof import('./components/SystemInfo/index.vue')['default'] TableContainer: typeof import('./components/TableContainer/index.vue')['default'] Trend: typeof import('./components/Trend/index.vue')['default'] + VanCell: typeof import('vant/es')['Cell'] + VanCellGroup: typeof import('vant/es')['CellGroup'] + VanDatePicker: typeof import('vant/es')['DatePicker'] + VanDialog: typeof import('vant/es')['Dialog'] + VanField: typeof import('vant/es')['Field'] + VanForm: typeof import('vant/es')['Form'] + VanIcon: typeof import('vant/es')['Icon'] + VanPicker: typeof import('vant/es')['Picker'] + VanPickerGroup: typeof import('vant/es')['PickerGroup'] + VanPopup: typeof import('vant/es')['Popup'] + VanTextEllipsis: typeof import('vant/es')['TextEllipsis'] } } diff --git a/src/components/HKplayer/errorCode.js b/src/components/HKplayer/errorCode.js index f44b864..17d2a23 100644 --- a/src/components/HKplayer/errorCode.js +++ b/src/components/HKplayer/errorCode.js @@ -11,7 +11,7 @@ '0x12f900011': '设置的音量不在1 - 100范围', '0x12f910000': 'websocket连接失败,请检查网络是否通畅,URL是否正确', '0x12f910010': '取流失败', - '0x12f910011': '流中断,电脑配置过低,程序卡主线程都可能导致流中断', + '0x12f910011': '视频中断', '0x12f910014': '没有音频数据', '0x12f910015': '未找到对应websocket,取流套接字被动关闭的报错', '0x12f910016': 'websocket不在连接状态', diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index b204454..bdc6bd2 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -141,6 +141,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" + video.appendChild(img) player.value .JS_Play(data.url, { playURL: data.url, mode: 0 }, 0, data.startTime, data.endTime) .then( @@ -148,6 +149,7 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') diff --git a/src/views/home/alarm/current/components/gasDataDialog.vue b/src/views/home/alarm/current/components/gasDataDialog.vue index b25b9cb..03e53c1 100644 --- a/src/views/home/alarm/current/components/gasDataDialog.vue +++ b/src/views/home/alarm/current/components/gasDataDialog.vue @@ -12,8 +12,10 @@ import { exportFile } from '@/utils/exportUtils' import { toHumpObject } from '@/utils/String' import { exportExcel } from '@/utils/exportXlsx' +import { handlerListData } from '@/views/home/device/device/components/handlerData' const dialogFormVisible = ref(false) // 对话框是否显示 const info = ref() +const manufactureName = ref('') const listQuery = ref({ devcode: '', typeName: '', @@ -93,9 +95,9 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '传感器状态', value: '', align: 'center' }, - { text: '温度(℃)', value: '', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '传感器状态', value: 'ssState', align: 'center' }, + { text: '温度(℃)', value: 'temp', align: 'center' }, + { text: '信号质量', value: 'sig', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -105,8 +107,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '电池状态', value: '', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '电池状态', value: 'ssState', align: 'center' }, + { text: '信号质量', value: 'rsrp', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -307,6 +309,23 @@ // .map(item => item.vbat || '0') // } ] + // 处理列表字段 + // 根据厂家判断 + if (manufactureName.value) { + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + else { + getDeviceListPage({ offset: 1, limit: 1, devCode: listQuery.value.devcode }).then(res => { + if (res.data.rows.length) { + manufactureName.value = res.data.rows[0].manufactureName + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + }) + } } else if (listQuery.value.typeName === '智能警示桩') { data.value = [ { @@ -362,13 +381,14 @@ } else if (row.devTypeName.includes('管网哨兵')) { columns.value = columns2.value // 获取设备信息 + manufactureName.value = '' getDeviceListPage({ offset: 1, limit: 1, devCode: row.devcode }).then(res => { if (res.data.rows.length) { - const manufactureName = res.data.rows[0].manufactureName - if (manufactureName.includes('百瑞生')) { + manufactureName.value = res.data.rows[0].manufactureName + if (manufactureName.value.includes('百瑞生')) { columns.value = columns2BRS.value } - else if (manufactureName.includes('麦哈克')) { + else if (manufactureName.value.includes('麦哈克')) { columns.value = columns2MHK.value } } diff --git a/src/views/home/device/device/components/dataSearch.vue b/src/views/home/device/device/components/dataSearch.vue index 5277650..2bef320 100644 --- a/src/views/home/device/device/components/dataSearch.vue +++ b/src/views/home/device/device/components/dataSearch.vue @@ -11,6 +11,7 @@ import { getDeviceListPage } from '@/api/home/device/device' import { exportFile } from '@/utils/exportUtils' import { toHumpObject } from '@/utils/String' +import { handlerListData } from './handlerData' const $route = useRoute() const listQuery = ref({ devcode: '', @@ -45,7 +46,6 @@ } }) timerangForCollect.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] -// timerangForReport.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] const showTable = ref(true) const resizePage = () => { setTimeout(() => { @@ -94,9 +94,9 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '传感器状态', value: '', align: 'center' }, - { text: '温度(℃)', value: '', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '传感器状态', value: 'ssState', align: 'center' }, + { text: '温度(℃)', value: 'temp', align: 'center' }, + { text: '信号质量', value: 'sig', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -106,8 +106,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '电池状态', value: 'ssstate', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '电池状态', value: 'ssState', align: 'center' }, + { text: '信号质量', value: 'rsrp', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -135,6 +135,7 @@ { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, ]) +const manufactureName = ref('') const setColumn = () => { const row = JSON.parse($route.query.row as string) const deviceTypeName = row.devTypeName || deviceTypeList.value.filter((item: any) => item.id === row.deviceType || row.deviceTypeId)[0]?.typeName || '' @@ -147,6 +148,7 @@ else if (deviceTypeName.includes('管网哨兵')) { columns.value = columns2.value if (row.manufactureName) { + manufactureName.value = row.manufactureName if (row.manufactureName.includes('百瑞生')) { columns.value = columns2BRS.value } @@ -157,11 +159,12 @@ else { getDeviceListPage({ offset: 1, limit: 1, devCode: row.devcode }).then(res => { if (res.data.rows.length) { - const manufactureName = res.data.rows[0].manufactureName - if (manufactureName.includes('百瑞生')) { + // const manufactureName = res.data.rows[0].manufactureName + manufactureName.value = res.data.rows[0].manufactureName + if (manufactureName.value.includes('百瑞生')) { columns.value = columns2BRS.value } - else if (manufactureName.includes('麦哈克')) { + else if (manufactureName.value.includes('麦哈克')) { columns.value = columns2MHK.value } } @@ -322,6 +325,23 @@ } }, ] + // 处理列表字段 + // 根据厂家判断 + if (manufactureName.value) { + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + else { + getDeviceListPage({ offset: 1, limit: 1, devCode: listQuery.value.devcode }).then(res => { + if (res.data.rows.length) { + manufactureName.value = res.data.rows[0].manufactureName + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + }) + } } else if (listQuery.value.typeName === '智能警示桩') { chartData.value = [ diff --git a/src/api/home/device/count.ts b/src/api/home/device/count.ts index e06e5a9..6c969a7 100644 --- a/src/api/home/device/count.ts +++ b/src/api/home/device/count.ts @@ -46,7 +46,7 @@ // 离线设备清单 export function getOfflineDevice(data: any) { return request({ - url: '/device/statics/offLineList', + url: `/device/statics/offLineList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/home/station/video.ts b/src/api/home/station/video.ts index de3d52d..3ef12ec 100644 --- a/src/api/home/station/video.ts +++ b/src/api/home/station/video.ts @@ -23,10 +23,10 @@ return request({ url: `/ptz/getPlayBackUrl`, method: 'post', - // data, - params: { - ...data, - } + data, + // params: { + // ...data, + // } }) } @@ -35,8 +35,9 @@ return request({ url: `/ptz/controCearm`, method: 'post', - params: { - ...data, - } + data + // params: { + // ...data, + // } }) } diff --git a/src/components.d.ts b/src/components.d.ts index 347a901..96289e9 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,7 +54,6 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] - offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] @@ -75,5 +74,16 @@ SystemInfo: typeof import('./components/SystemInfo/index.vue')['default'] TableContainer: typeof import('./components/TableContainer/index.vue')['default'] Trend: typeof import('./components/Trend/index.vue')['default'] + VanCell: typeof import('vant/es')['Cell'] + VanCellGroup: typeof import('vant/es')['CellGroup'] + VanDatePicker: typeof import('vant/es')['DatePicker'] + VanDialog: typeof import('vant/es')['Dialog'] + VanField: typeof import('vant/es')['Field'] + VanForm: typeof import('vant/es')['Form'] + VanIcon: typeof import('vant/es')['Icon'] + VanPicker: typeof import('vant/es')['Picker'] + VanPickerGroup: typeof import('vant/es')['PickerGroup'] + VanPopup: typeof import('vant/es')['Popup'] + VanTextEllipsis: typeof import('vant/es')['TextEllipsis'] } } diff --git a/src/components/HKplayer/errorCode.js b/src/components/HKplayer/errorCode.js index f44b864..17d2a23 100644 --- a/src/components/HKplayer/errorCode.js +++ b/src/components/HKplayer/errorCode.js @@ -11,7 +11,7 @@ '0x12f900011': '设置的音量不在1 - 100范围', '0x12f910000': 'websocket连接失败,请检查网络是否通畅,URL是否正确', '0x12f910010': '取流失败', - '0x12f910011': '流中断,电脑配置过低,程序卡主线程都可能导致流中断', + '0x12f910011': '视频中断', '0x12f910014': '没有音频数据', '0x12f910015': '未找到对应websocket,取流套接字被动关闭的报错', '0x12f910016': 'websocket不在连接状态', diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index b204454..bdc6bd2 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -141,6 +141,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" + video.appendChild(img) player.value .JS_Play(data.url, { playURL: data.url, mode: 0 }, 0, data.startTime, data.endTime) .then( @@ -148,6 +149,7 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') diff --git a/src/views/home/alarm/current/components/gasDataDialog.vue b/src/views/home/alarm/current/components/gasDataDialog.vue index b25b9cb..03e53c1 100644 --- a/src/views/home/alarm/current/components/gasDataDialog.vue +++ b/src/views/home/alarm/current/components/gasDataDialog.vue @@ -12,8 +12,10 @@ import { exportFile } from '@/utils/exportUtils' import { toHumpObject } from '@/utils/String' import { exportExcel } from '@/utils/exportXlsx' +import { handlerListData } from '@/views/home/device/device/components/handlerData' const dialogFormVisible = ref(false) // 对话框是否显示 const info = ref() +const manufactureName = ref('') const listQuery = ref({ devcode: '', typeName: '', @@ -93,9 +95,9 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '传感器状态', value: '', align: 'center' }, - { text: '温度(℃)', value: '', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '传感器状态', value: 'ssState', align: 'center' }, + { text: '温度(℃)', value: 'temp', align: 'center' }, + { text: '信号质量', value: 'sig', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -105,8 +107,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '电池状态', value: '', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '电池状态', value: 'ssState', align: 'center' }, + { text: '信号质量', value: 'rsrp', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -307,6 +309,23 @@ // .map(item => item.vbat || '0') // } ] + // 处理列表字段 + // 根据厂家判断 + if (manufactureName.value) { + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + else { + getDeviceListPage({ offset: 1, limit: 1, devCode: listQuery.value.devcode }).then(res => { + if (res.data.rows.length) { + manufactureName.value = res.data.rows[0].manufactureName + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + }) + } } else if (listQuery.value.typeName === '智能警示桩') { data.value = [ { @@ -362,13 +381,14 @@ } else if (row.devTypeName.includes('管网哨兵')) { columns.value = columns2.value // 获取设备信息 + manufactureName.value = '' getDeviceListPage({ offset: 1, limit: 1, devCode: row.devcode }).then(res => { if (res.data.rows.length) { - const manufactureName = res.data.rows[0].manufactureName - if (manufactureName.includes('百瑞生')) { + manufactureName.value = res.data.rows[0].manufactureName + if (manufactureName.value.includes('百瑞生')) { columns.value = columns2BRS.value } - else if (manufactureName.includes('麦哈克')) { + else if (manufactureName.value.includes('麦哈克')) { columns.value = columns2MHK.value } } diff --git a/src/views/home/device/device/components/dataSearch.vue b/src/views/home/device/device/components/dataSearch.vue index 5277650..2bef320 100644 --- a/src/views/home/device/device/components/dataSearch.vue +++ b/src/views/home/device/device/components/dataSearch.vue @@ -11,6 +11,7 @@ import { getDeviceListPage } from '@/api/home/device/device' import { exportFile } from '@/utils/exportUtils' import { toHumpObject } from '@/utils/String' +import { handlerListData } from './handlerData' const $route = useRoute() const listQuery = ref({ devcode: '', @@ -45,7 +46,6 @@ } }) timerangForCollect.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] -// timerangForReport.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] const showTable = ref(true) const resizePage = () => { setTimeout(() => { @@ -94,9 +94,9 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '传感器状态', value: '', align: 'center' }, - { text: '温度(℃)', value: '', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '传感器状态', value: 'ssState', align: 'center' }, + { text: '温度(℃)', value: 'temp', align: 'center' }, + { text: '信号质量', value: 'sig', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -106,8 +106,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '电池状态', value: 'ssstate', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '电池状态', value: 'ssState', align: 'center' }, + { text: '信号质量', value: 'rsrp', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -135,6 +135,7 @@ { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, ]) +const manufactureName = ref('') const setColumn = () => { const row = JSON.parse($route.query.row as string) const deviceTypeName = row.devTypeName || deviceTypeList.value.filter((item: any) => item.id === row.deviceType || row.deviceTypeId)[0]?.typeName || '' @@ -147,6 +148,7 @@ else if (deviceTypeName.includes('管网哨兵')) { columns.value = columns2.value if (row.manufactureName) { + manufactureName.value = row.manufactureName if (row.manufactureName.includes('百瑞生')) { columns.value = columns2BRS.value } @@ -157,11 +159,12 @@ else { getDeviceListPage({ offset: 1, limit: 1, devCode: row.devcode }).then(res => { if (res.data.rows.length) { - const manufactureName = res.data.rows[0].manufactureName - if (manufactureName.includes('百瑞生')) { + // const manufactureName = res.data.rows[0].manufactureName + manufactureName.value = res.data.rows[0].manufactureName + if (manufactureName.value.includes('百瑞生')) { columns.value = columns2BRS.value } - else if (manufactureName.includes('麦哈克')) { + else if (manufactureName.value.includes('麦哈克')) { columns.value = columns2MHK.value } } @@ -322,6 +325,23 @@ } }, ] + // 处理列表字段 + // 根据厂家判断 + if (manufactureName.value) { + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + else { + getDeviceListPage({ offset: 1, limit: 1, devCode: listQuery.value.devcode }).then(res => { + if (res.data.rows.length) { + manufactureName.value = res.data.rows[0].manufactureName + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + }) + } } else if (listQuery.value.typeName === '智能警示桩') { chartData.value = [ diff --git a/src/views/home/device/device/components/handlerData.ts b/src/views/home/device/device/components/handlerData.ts new file mode 100644 index 0000000..e09c666 --- /dev/null +++ b/src/views/home/device/device/components/handlerData.ts @@ -0,0 +1,65 @@ +// 处理百瑞生和麦哈克数据 +export const handlerListData = (manufactureName: string, list: any[], fun: Function) => { + // 百瑞生 + if (manufactureName.includes('百瑞生')) { + // console.log(list.value, '百瑞生') + const ssStateDict = { + 0: '正常', + 1: '通讯异常' + } as { [key: string]: string } + const sigDict = { + 1: '信号弱', + 2: '信号中等', + 3: '信号强' + } as { [key: string]: string } + list = list.map((item: any) => ({ + ...item, + ssState: ssStateDict[item.ssState] ? ssStateDict[item.ssState] : '', //传感器状态 + sig: sigDict[item.sig] ? sigDict[item.sig] : '', // 信号强度 + temp: item.temp ? Number(item.temp) / 100 : '' // 温度 扩大100倍传输 + })) + fun(list) + } + // 麦哈克 + else if (manufactureName.includes('麦哈克')) { + const ssStateDict = { + 0: '正常', + 1: '低电告警', + 2: '关机' + } as { [key: string]: string } + const rsrpDict = (rsrp: number) => { + let result = '' + if (rsrp > -60 && rsrp <= -40) { + result = '非常好' + } + else if (rsrp > -70 && rsrp <= -60) { + result = '良好' + } + else if (rsrp > -80 && rsrp <= -70) { + result = '一般' + } + else if (rsrp > -90 && rsrp <= -80) { + result = '稍弱' + } + else if (rsrp > -100 && rsrp <= -90) { + result = '较弱' + } + else if (rsrp > -110 && rsrp <= -100) { + result = '差' + } + else if (rsrp < -110) { + result = '很差' + } + else if (rsrp > -40) { + result = '非常好' + } + return result + } + list = list.map((item: any) => ({ + ...item, + ssState: ssStateDict[item.ssState] ? ssStateDict[item.ssState] : '', //电池状态 + rsrp: item.rsrp ? rsrpDict(Number(item.rsrp)) : '', // 接收信号参考质量 + })) + fun(list) + } +} diff --git a/src/api/home/device/count.ts b/src/api/home/device/count.ts index e06e5a9..6c969a7 100644 --- a/src/api/home/device/count.ts +++ b/src/api/home/device/count.ts @@ -46,7 +46,7 @@ // 离线设备清单 export function getOfflineDevice(data: any) { return request({ - url: '/device/statics/offLineList', + url: `/device/statics/offLineList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/home/station/video.ts b/src/api/home/station/video.ts index de3d52d..3ef12ec 100644 --- a/src/api/home/station/video.ts +++ b/src/api/home/station/video.ts @@ -23,10 +23,10 @@ return request({ url: `/ptz/getPlayBackUrl`, method: 'post', - // data, - params: { - ...data, - } + data, + // params: { + // ...data, + // } }) } @@ -35,8 +35,9 @@ return request({ url: `/ptz/controCearm`, method: 'post', - params: { - ...data, - } + data + // params: { + // ...data, + // } }) } diff --git a/src/components.d.ts b/src/components.d.ts index 347a901..96289e9 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,7 +54,6 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] - offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] @@ -75,5 +74,16 @@ SystemInfo: typeof import('./components/SystemInfo/index.vue')['default'] TableContainer: typeof import('./components/TableContainer/index.vue')['default'] Trend: typeof import('./components/Trend/index.vue')['default'] + VanCell: typeof import('vant/es')['Cell'] + VanCellGroup: typeof import('vant/es')['CellGroup'] + VanDatePicker: typeof import('vant/es')['DatePicker'] + VanDialog: typeof import('vant/es')['Dialog'] + VanField: typeof import('vant/es')['Field'] + VanForm: typeof import('vant/es')['Form'] + VanIcon: typeof import('vant/es')['Icon'] + VanPicker: typeof import('vant/es')['Picker'] + VanPickerGroup: typeof import('vant/es')['PickerGroup'] + VanPopup: typeof import('vant/es')['Popup'] + VanTextEllipsis: typeof import('vant/es')['TextEllipsis'] } } diff --git a/src/components/HKplayer/errorCode.js b/src/components/HKplayer/errorCode.js index f44b864..17d2a23 100644 --- a/src/components/HKplayer/errorCode.js +++ b/src/components/HKplayer/errorCode.js @@ -11,7 +11,7 @@ '0x12f900011': '设置的音量不在1 - 100范围', '0x12f910000': 'websocket连接失败,请检查网络是否通畅,URL是否正确', '0x12f910010': '取流失败', - '0x12f910011': '流中断,电脑配置过低,程序卡主线程都可能导致流中断', + '0x12f910011': '视频中断', '0x12f910014': '没有音频数据', '0x12f910015': '未找到对应websocket,取流套接字被动关闭的报错', '0x12f910016': 'websocket不在连接状态', diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index b204454..bdc6bd2 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -141,6 +141,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" + video.appendChild(img) player.value .JS_Play(data.url, { playURL: data.url, mode: 0 }, 0, data.startTime, data.endTime) .then( @@ -148,6 +149,7 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') diff --git a/src/views/home/alarm/current/components/gasDataDialog.vue b/src/views/home/alarm/current/components/gasDataDialog.vue index b25b9cb..03e53c1 100644 --- a/src/views/home/alarm/current/components/gasDataDialog.vue +++ b/src/views/home/alarm/current/components/gasDataDialog.vue @@ -12,8 +12,10 @@ import { exportFile } from '@/utils/exportUtils' import { toHumpObject } from '@/utils/String' import { exportExcel } from '@/utils/exportXlsx' +import { handlerListData } from '@/views/home/device/device/components/handlerData' const dialogFormVisible = ref(false) // 对话框是否显示 const info = ref() +const manufactureName = ref('') const listQuery = ref({ devcode: '', typeName: '', @@ -93,9 +95,9 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '传感器状态', value: '', align: 'center' }, - { text: '温度(℃)', value: '', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '传感器状态', value: 'ssState', align: 'center' }, + { text: '温度(℃)', value: 'temp', align: 'center' }, + { text: '信号质量', value: 'sig', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -105,8 +107,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '电池状态', value: '', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '电池状态', value: 'ssState', align: 'center' }, + { text: '信号质量', value: 'rsrp', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -307,6 +309,23 @@ // .map(item => item.vbat || '0') // } ] + // 处理列表字段 + // 根据厂家判断 + if (manufactureName.value) { + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + else { + getDeviceListPage({ offset: 1, limit: 1, devCode: listQuery.value.devcode }).then(res => { + if (res.data.rows.length) { + manufactureName.value = res.data.rows[0].manufactureName + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + }) + } } else if (listQuery.value.typeName === '智能警示桩') { data.value = [ { @@ -362,13 +381,14 @@ } else if (row.devTypeName.includes('管网哨兵')) { columns.value = columns2.value // 获取设备信息 + manufactureName.value = '' getDeviceListPage({ offset: 1, limit: 1, devCode: row.devcode }).then(res => { if (res.data.rows.length) { - const manufactureName = res.data.rows[0].manufactureName - if (manufactureName.includes('百瑞生')) { + manufactureName.value = res.data.rows[0].manufactureName + if (manufactureName.value.includes('百瑞生')) { columns.value = columns2BRS.value } - else if (manufactureName.includes('麦哈克')) { + else if (manufactureName.value.includes('麦哈克')) { columns.value = columns2MHK.value } } diff --git a/src/views/home/device/device/components/dataSearch.vue b/src/views/home/device/device/components/dataSearch.vue index 5277650..2bef320 100644 --- a/src/views/home/device/device/components/dataSearch.vue +++ b/src/views/home/device/device/components/dataSearch.vue @@ -11,6 +11,7 @@ import { getDeviceListPage } from '@/api/home/device/device' import { exportFile } from '@/utils/exportUtils' import { toHumpObject } from '@/utils/String' +import { handlerListData } from './handlerData' const $route = useRoute() const listQuery = ref({ devcode: '', @@ -45,7 +46,6 @@ } }) timerangForCollect.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] -// timerangForReport.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] const showTable = ref(true) const resizePage = () => { setTimeout(() => { @@ -94,9 +94,9 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '传感器状态', value: '', align: 'center' }, - { text: '温度(℃)', value: '', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '传感器状态', value: 'ssState', align: 'center' }, + { text: '温度(℃)', value: 'temp', align: 'center' }, + { text: '信号质量', value: 'sig', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -106,8 +106,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'gasval', align: 'center', isCustom: true }, { text: '电池电压(mV)', value: 'vbat', align: 'center' }, - { text: '电池状态', value: 'ssstate', align: 'center' }, - { text: '信号质量', value: '', align: 'center' }, + { text: '电池状态', value: 'ssState', align: 'center' }, + { text: '信号质量', value: 'rsrp', align: 'center' }, { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true }, @@ -135,6 +135,7 @@ { text: '采集时间', value: 'uptime', align: 'center' }, { text: '上传时间', value: 'logtime', align: 'center' }, ]) +const manufactureName = ref('') const setColumn = () => { const row = JSON.parse($route.query.row as string) const deviceTypeName = row.devTypeName || deviceTypeList.value.filter((item: any) => item.id === row.deviceType || row.deviceTypeId)[0]?.typeName || '' @@ -147,6 +148,7 @@ else if (deviceTypeName.includes('管网哨兵')) { columns.value = columns2.value if (row.manufactureName) { + manufactureName.value = row.manufactureName if (row.manufactureName.includes('百瑞生')) { columns.value = columns2BRS.value } @@ -157,11 +159,12 @@ else { getDeviceListPage({ offset: 1, limit: 1, devCode: row.devcode }).then(res => { if (res.data.rows.length) { - const manufactureName = res.data.rows[0].manufactureName - if (manufactureName.includes('百瑞生')) { + // const manufactureName = res.data.rows[0].manufactureName + manufactureName.value = res.data.rows[0].manufactureName + if (manufactureName.value.includes('百瑞生')) { columns.value = columns2BRS.value } - else if (manufactureName.includes('麦哈克')) { + else if (manufactureName.value.includes('麦哈克')) { columns.value = columns2MHK.value } } @@ -322,6 +325,23 @@ } }, ] + // 处理列表字段 + // 根据厂家判断 + if (manufactureName.value) { + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + else { + getDeviceListPage({ offset: 1, limit: 1, devCode: listQuery.value.devcode }).then(res => { + if (res.data.rows.length) { + manufactureName.value = res.data.rows[0].manufactureName + handlerListData(manufactureName.value, list.value, (data: any) => { + list.value = data + }) + } + }) + } } else if (listQuery.value.typeName === '智能警示桩') { chartData.value = [ diff --git a/src/views/home/device/device/components/handlerData.ts b/src/views/home/device/device/components/handlerData.ts new file mode 100644 index 0000000..e09c666 --- /dev/null +++ b/src/views/home/device/device/components/handlerData.ts @@ -0,0 +1,65 @@ +// 处理百瑞生和麦哈克数据 +export const handlerListData = (manufactureName: string, list: any[], fun: Function) => { + // 百瑞生 + if (manufactureName.includes('百瑞生')) { + // console.log(list.value, '百瑞生') + const ssStateDict = { + 0: '正常', + 1: '通讯异常' + } as { [key: string]: string } + const sigDict = { + 1: '信号弱', + 2: '信号中等', + 3: '信号强' + } as { [key: string]: string } + list = list.map((item: any) => ({ + ...item, + ssState: ssStateDict[item.ssState] ? ssStateDict[item.ssState] : '', //传感器状态 + sig: sigDict[item.sig] ? sigDict[item.sig] : '', // 信号强度 + temp: item.temp ? Number(item.temp) / 100 : '' // 温度 扩大100倍传输 + })) + fun(list) + } + // 麦哈克 + else if (manufactureName.includes('麦哈克')) { + const ssStateDict = { + 0: '正常', + 1: '低电告警', + 2: '关机' + } as { [key: string]: string } + const rsrpDict = (rsrp: number) => { + let result = '' + if (rsrp > -60 && rsrp <= -40) { + result = '非常好' + } + else if (rsrp > -70 && rsrp <= -60) { + result = '良好' + } + else if (rsrp > -80 && rsrp <= -70) { + result = '一般' + } + else if (rsrp > -90 && rsrp <= -80) { + result = '稍弱' + } + else if (rsrp > -100 && rsrp <= -90) { + result = '较弱' + } + else if (rsrp > -110 && rsrp <= -100) { + result = '差' + } + else if (rsrp < -110) { + result = '很差' + } + else if (rsrp > -40) { + result = '非常好' + } + return result + } + list = list.map((item: any) => ({ + ...item, + ssState: ssStateDict[item.ssState] ? ssStateDict[item.ssState] : '', //电池状态 + rsrp: item.rsrp ? rsrpDict(Number(item.rsrp)) : '', // 接收信号参考质量 + })) + fun(list) + } +} diff --git a/src/views/home/operation/trajectory/detail.vue b/src/views/home/operation/trajectory/detail.vue index eb20d81..aa2bb3a 100644 --- a/src/views/home/operation/trajectory/detail.vue +++ b/src/views/home/operation/trajectory/detail.vue @@ -44,6 +44,26 @@ }).then((res) => { console.log(res.data) loading.value = false + if (res.data.length === 1) { + if (res.data[0].LONGITUDE_LATITUDE) { + mapRef.value.addMarker({ + position: (row.startPosition || '').split(','), + // position: [116.307719, 39.979882], + // content: '
', + label: '', + data: res.data[0] || {}, + // type: 'start', + // offsetX: -14, + // offsetY: -14, + }) + mapRef.value.map.setFitView() + } + else { + mapRef.value.removeMarker() + ElMessage.warning('轨迹信息无效') + } + return + } if (res.data.length >= 2) { res.data.unshift({ ...res.data[0], @@ -145,15 +165,14 @@ - + clearable />
- +