diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index e5dfdb4..21f93d6 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -45,7 +45,7 @@
geocoder.getAddress(lnglat, (status: any, result: any) => {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
- console.log(result.regeocode.formattedAddress)
+ // console.log(result.regeocode.formattedAddress)
position = result.regeocode.formattedAddress
resultFun(position)
}
@@ -103,7 +103,7 @@
plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap1: any) => {
- console.log($props.center, '$props.center')
+ // console.log($props.center, '$props.center')
console.log($props.center && $props.center?.length === 2 && !isNaN($props.center[0]) && !isNaN($props.center[1]) ? $props.center : [116.397428, 39.90923])
AMap.value = AMap1
// 初始化地图
@@ -161,7 +161,7 @@
const flag = '00000000'
const zz = c
const z = `L${String(zz).length === 1 ? `0${zz}` : zz}`
- console.log(zz, 'zz')
+ // console.log(zz, 'zz')
const xx = a.toString(16)
const x = `C${flag.substring(0, 8 - xx.length)}${xx}`
const yy = b.toString(16)
@@ -452,7 +452,7 @@
...data.style,
})
polyline.on('click', (e) => {
- console.log('点击了线')
+ // console.log('点击了线')
$emits('lineClick', { event: e, map: map.value, data, polyline })
})
// console.log(polyline, 'polyline')
@@ -532,7 +532,7 @@
const MarkerAllCluster = ref([]) // 点聚合数组
const cluster = ref()
// 添加点聚合
-const addCluster = (points) => {
+const addCluster = (points,styleList) => {
// console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points')
var count = points.length
var _renderClusterMarker = function (context) {
@@ -563,8 +563,7 @@
}
const _renderMarker = (context: any) => {
const data = context.data[0]
- // console.log(data, 'data')
- const style = [
+ let style = [
{
url: `${publicPath}/image/well/well-normal.png`, // 图标地址
},
@@ -578,6 +577,9 @@
url: `${publicPath}/image/well/well-will.png`, // 图标地址
},
]
+ if(styleList) {
+ style = styleList
+ }
const markerHtml = `
`
var offset = new AMap.value.Pixel(-9, -9)
context.marker.setContent(markerHtml)
@@ -630,7 +632,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
@@ -644,7 +646,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index e5dfdb4..21f93d6 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -45,7 +45,7 @@
geocoder.getAddress(lnglat, (status: any, result: any) => {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
- console.log(result.regeocode.formattedAddress)
+ // console.log(result.regeocode.formattedAddress)
position = result.regeocode.formattedAddress
resultFun(position)
}
@@ -103,7 +103,7 @@
plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap1: any) => {
- console.log($props.center, '$props.center')
+ // console.log($props.center, '$props.center')
console.log($props.center && $props.center?.length === 2 && !isNaN($props.center[0]) && !isNaN($props.center[1]) ? $props.center : [116.397428, 39.90923])
AMap.value = AMap1
// 初始化地图
@@ -161,7 +161,7 @@
const flag = '00000000'
const zz = c
const z = `L${String(zz).length === 1 ? `0${zz}` : zz}`
- console.log(zz, 'zz')
+ // console.log(zz, 'zz')
const xx = a.toString(16)
const x = `C${flag.substring(0, 8 - xx.length)}${xx}`
const yy = b.toString(16)
@@ -452,7 +452,7 @@
...data.style,
})
polyline.on('click', (e) => {
- console.log('点击了线')
+ // console.log('点击了线')
$emits('lineClick', { event: e, map: map.value, data, polyline })
})
// console.log(polyline, 'polyline')
@@ -532,7 +532,7 @@
const MarkerAllCluster = ref([]) // 点聚合数组
const cluster = ref()
// 添加点聚合
-const addCluster = (points) => {
+const addCluster = (points,styleList) => {
// console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points')
var count = points.length
var _renderClusterMarker = function (context) {
@@ -563,8 +563,7 @@
}
const _renderMarker = (context: any) => {
const data = context.data[0]
- // console.log(data, 'data')
- const style = [
+ let style = [
{
url: `${publicPath}/image/well/well-normal.png`, // 图标地址
},
@@ -578,6 +577,9 @@
url: `${publicPath}/image/well/well-will.png`, // 图标地址
},
]
+ if(styleList) {
+ style = styleList
+ }
const markerHtml = `
`
var offset = new AMap.value.Pixel(-9, -9)
context.marker.setContent(markerHtml)
@@ -630,7 +632,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
@@ -644,7 +646,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue
index d85779c..c748666 100644
--- a/src/layouts/components/Tools/alarmDialog.vue
+++ b/src/layouts/components/Tools/alarmDialog.vue
@@ -1,4 +1,5 @@
-
+ :close-on-click-modal="false">
{{ info.alarmType }}
-
+
报警类型
{{ info.alarmType }}
-
+
设备类型
@@ -82,13 +88,13 @@
-
+
闸井位号
{{ info.tagNumber }}
-
+
闸井名称
@@ -96,22 +102,22 @@
-
+
报警等级
{{ info.alarmLevel }}
-
- 报警值
+
+
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index e5dfdb4..21f93d6 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -45,7 +45,7 @@
geocoder.getAddress(lnglat, (status: any, result: any) => {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
- console.log(result.regeocode.formattedAddress)
+ // console.log(result.regeocode.formattedAddress)
position = result.regeocode.formattedAddress
resultFun(position)
}
@@ -103,7 +103,7 @@
plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap1: any) => {
- console.log($props.center, '$props.center')
+ // console.log($props.center, '$props.center')
console.log($props.center && $props.center?.length === 2 && !isNaN($props.center[0]) && !isNaN($props.center[1]) ? $props.center : [116.397428, 39.90923])
AMap.value = AMap1
// 初始化地图
@@ -161,7 +161,7 @@
const flag = '00000000'
const zz = c
const z = `L${String(zz).length === 1 ? `0${zz}` : zz}`
- console.log(zz, 'zz')
+ // console.log(zz, 'zz')
const xx = a.toString(16)
const x = `C${flag.substring(0, 8 - xx.length)}${xx}`
const yy = b.toString(16)
@@ -452,7 +452,7 @@
...data.style,
})
polyline.on('click', (e) => {
- console.log('点击了线')
+ // console.log('点击了线')
$emits('lineClick', { event: e, map: map.value, data, polyline })
})
// console.log(polyline, 'polyline')
@@ -532,7 +532,7 @@
const MarkerAllCluster = ref([]) // 点聚合数组
const cluster = ref()
// 添加点聚合
-const addCluster = (points) => {
+const addCluster = (points,styleList) => {
// console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points')
var count = points.length
var _renderClusterMarker = function (context) {
@@ -563,8 +563,7 @@
}
const _renderMarker = (context: any) => {
const data = context.data[0]
- // console.log(data, 'data')
- const style = [
+ let style = [
{
url: `${publicPath}/image/well/well-normal.png`, // 图标地址
},
@@ -578,6 +577,9 @@
url: `${publicPath}/image/well/well-will.png`, // 图标地址
},
]
+ if(styleList) {
+ style = styleList
+ }
const markerHtml = `
`
var offset = new AMap.value.Pixel(-9, -9)
context.marker.setContent(markerHtml)
@@ -630,7 +632,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
@@ -644,7 +646,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue
index d85779c..c748666 100644
--- a/src/layouts/components/Tools/alarmDialog.vue
+++ b/src/layouts/components/Tools/alarmDialog.vue
@@ -1,4 +1,5 @@
-
+ :close-on-click-modal="false">
{{ info.alarmType }}
-
+
报警类型
{{ info.alarmType }}
-
+
设备类型
@@ -82,13 +88,13 @@
-
+
闸井位号
{{ info.tagNumber }}
-
+
闸井名称
@@ -96,22 +102,22 @@
-
+
报警等级
{{ info.alarmLevel }}
-
- 报警值
+
+
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index e5dfdb4..21f93d6 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -45,7 +45,7 @@
geocoder.getAddress(lnglat, (status: any, result: any) => {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
- console.log(result.regeocode.formattedAddress)
+ // console.log(result.regeocode.formattedAddress)
position = result.regeocode.formattedAddress
resultFun(position)
}
@@ -103,7 +103,7 @@
plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap1: any) => {
- console.log($props.center, '$props.center')
+ // console.log($props.center, '$props.center')
console.log($props.center && $props.center?.length === 2 && !isNaN($props.center[0]) && !isNaN($props.center[1]) ? $props.center : [116.397428, 39.90923])
AMap.value = AMap1
// 初始化地图
@@ -161,7 +161,7 @@
const flag = '00000000'
const zz = c
const z = `L${String(zz).length === 1 ? `0${zz}` : zz}`
- console.log(zz, 'zz')
+ // console.log(zz, 'zz')
const xx = a.toString(16)
const x = `C${flag.substring(0, 8 - xx.length)}${xx}`
const yy = b.toString(16)
@@ -452,7 +452,7 @@
...data.style,
})
polyline.on('click', (e) => {
- console.log('点击了线')
+ // console.log('点击了线')
$emits('lineClick', { event: e, map: map.value, data, polyline })
})
// console.log(polyline, 'polyline')
@@ -532,7 +532,7 @@
const MarkerAllCluster = ref([]) // 点聚合数组
const cluster = ref()
// 添加点聚合
-const addCluster = (points) => {
+const addCluster = (points,styleList) => {
// console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points')
var count = points.length
var _renderClusterMarker = function (context) {
@@ -563,8 +563,7 @@
}
const _renderMarker = (context: any) => {
const data = context.data[0]
- // console.log(data, 'data')
- const style = [
+ let style = [
{
url: `${publicPath}/image/well/well-normal.png`, // 图标地址
},
@@ -578,6 +577,9 @@
url: `${publicPath}/image/well/well-will.png`, // 图标地址
},
]
+ if(styleList) {
+ style = styleList
+ }
const markerHtml = `
`
var offset = new AMap.value.Pixel(-9, -9)
context.marker.setContent(markerHtml)
@@ -630,7 +632,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
@@ -644,7 +646,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue
index d85779c..c748666 100644
--- a/src/layouts/components/Tools/alarmDialog.vue
+++ b/src/layouts/components/Tools/alarmDialog.vue
@@ -1,4 +1,5 @@
-
+ :close-on-click-modal="false">
{{ info.alarmType }}
-
+
报警类型
{{ info.alarmType }}
-
+
设备类型
@@ -82,13 +88,13 @@
-
+
闸井位号
{{ info.tagNumber }}
-
+
闸井名称
@@ -96,22 +102,22 @@
-
+
报警等级
{{ info.alarmLevel }}
-
- 报警值
+
+
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
diff --git a/src/views/home/alarm/current/components/monitorDataDialog.vue b/src/views/home/alarm/current/components/monitorDataDialog.vue
index 9b689c9..666fe82 100644
--- a/src/views/home/alarm/current/components/monitorDataDialog.vue
+++ b/src/views/home/alarm/current/components/monitorDataDialog.vue
@@ -8,6 +8,7 @@
import dayjs from 'dayjs'
import { getMonitorData } from '@/api/home/pipeline/pipeline'
import { exportExcel } from '@/utils/exportXlsx'
+import { handlerSignalStrength } from '@/views/home/device/device/components/handlerData'
const emits = defineEmits(['refresh'])
const dialogFormVisible = ref(false) // 对话框是否显示
const info = ref()
@@ -21,11 +22,12 @@
// 列表展示列
const columns = ref([
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
- { text: '信号强度', value: 'pci', align: 'center', width: 90 },
- { text: '电量(%)', value: 'cell', align: 'center', width: 90 },
- { text: '采集时间', value: 'uptime', align: 'center' },
- { text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ { text: '信号强度', value: 'rsrp', align: 'center', width: 85 },
+ { text: '信号质量', value: 'rsrpName', align: 'center', width: 85 },
+ { text: '电量(%)', value: 'cell', align: 'center', width: 80 },
+ { text: '采集时间', value: 'uptime', align: 'center' },
+ { text: '上传时间', value: 'logtime', align: 'center' },
+ // { text: '设备状态', value: 'status', align: 'center', width: 85, isCustom: true },
])
const listQuery = ref({
upBegTime: '',
@@ -59,9 +61,8 @@
loadingTable.value = true
listQuery.value.typeName = info.value.devTypeName
listQuery.value.devcode = info.value.devcode
- getMonitorData(listQuery.value)
- .then((res) => {
- list.value = res.data.filter((item: any) => !item.alarmRuleValue)
+ getMonitorData(listQuery.value).then((res) => {
+ list.value = res.data.filter((item: any) => !item.alarmRuleValue).map((item: any) => ({...item, rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''}))
// 设置设备状态和燃气浓度标红
const threshold = res.data.filter((item: any) => item.alarmRuleValue)[0]
// console.log(threshold.alarmRuleValue, '阈值')
@@ -214,7 +215,7 @@
-
+
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index e5dfdb4..21f93d6 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -45,7 +45,7 @@
geocoder.getAddress(lnglat, (status: any, result: any) => {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
- console.log(result.regeocode.formattedAddress)
+ // console.log(result.regeocode.formattedAddress)
position = result.regeocode.formattedAddress
resultFun(position)
}
@@ -103,7 +103,7 @@
plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap1: any) => {
- console.log($props.center, '$props.center')
+ // console.log($props.center, '$props.center')
console.log($props.center && $props.center?.length === 2 && !isNaN($props.center[0]) && !isNaN($props.center[1]) ? $props.center : [116.397428, 39.90923])
AMap.value = AMap1
// 初始化地图
@@ -161,7 +161,7 @@
const flag = '00000000'
const zz = c
const z = `L${String(zz).length === 1 ? `0${zz}` : zz}`
- console.log(zz, 'zz')
+ // console.log(zz, 'zz')
const xx = a.toString(16)
const x = `C${flag.substring(0, 8 - xx.length)}${xx}`
const yy = b.toString(16)
@@ -452,7 +452,7 @@
...data.style,
})
polyline.on('click', (e) => {
- console.log('点击了线')
+ // console.log('点击了线')
$emits('lineClick', { event: e, map: map.value, data, polyline })
})
// console.log(polyline, 'polyline')
@@ -532,7 +532,7 @@
const MarkerAllCluster = ref([]) // 点聚合数组
const cluster = ref()
// 添加点聚合
-const addCluster = (points) => {
+const addCluster = (points,styleList) => {
// console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points')
var count = points.length
var _renderClusterMarker = function (context) {
@@ -563,8 +563,7 @@
}
const _renderMarker = (context: any) => {
const data = context.data[0]
- // console.log(data, 'data')
- const style = [
+ let style = [
{
url: `${publicPath}/image/well/well-normal.png`, // 图标地址
},
@@ -578,6 +577,9 @@
url: `${publicPath}/image/well/well-will.png`, // 图标地址
},
]
+ if(styleList) {
+ style = styleList
+ }
const markerHtml = `
`
var offset = new AMap.value.Pixel(-9, -9)
context.marker.setContent(markerHtml)
@@ -630,7 +632,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
@@ -644,7 +646,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue
index d85779c..c748666 100644
--- a/src/layouts/components/Tools/alarmDialog.vue
+++ b/src/layouts/components/Tools/alarmDialog.vue
@@ -1,4 +1,5 @@
-
+ :close-on-click-modal="false">
{{ info.alarmType }}
-
+
报警类型
{{ info.alarmType }}
-
+
设备类型
@@ -82,13 +88,13 @@
-
+
闸井位号
{{ info.tagNumber }}
-
+
闸井名称
@@ -96,22 +102,22 @@
-
+
报警等级
{{ info.alarmLevel }}
-
- 报警值
+
+
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
diff --git a/src/views/home/alarm/current/components/monitorDataDialog.vue b/src/views/home/alarm/current/components/monitorDataDialog.vue
index 9b689c9..666fe82 100644
--- a/src/views/home/alarm/current/components/monitorDataDialog.vue
+++ b/src/views/home/alarm/current/components/monitorDataDialog.vue
@@ -8,6 +8,7 @@
import dayjs from 'dayjs'
import { getMonitorData } from '@/api/home/pipeline/pipeline'
import { exportExcel } from '@/utils/exportXlsx'
+import { handlerSignalStrength } from '@/views/home/device/device/components/handlerData'
const emits = defineEmits(['refresh'])
const dialogFormVisible = ref(false) // 对话框是否显示
const info = ref()
@@ -21,11 +22,12 @@
// 列表展示列
const columns = ref([
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
- { text: '信号强度', value: 'pci', align: 'center', width: 90 },
- { text: '电量(%)', value: 'cell', align: 'center', width: 90 },
- { text: '采集时间', value: 'uptime', align: 'center' },
- { text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ { text: '信号强度', value: 'rsrp', align: 'center', width: 85 },
+ { text: '信号质量', value: 'rsrpName', align: 'center', width: 85 },
+ { text: '电量(%)', value: 'cell', align: 'center', width: 80 },
+ { text: '采集时间', value: 'uptime', align: 'center' },
+ { text: '上传时间', value: 'logtime', align: 'center' },
+ // { text: '设备状态', value: 'status', align: 'center', width: 85, isCustom: true },
])
const listQuery = ref({
upBegTime: '',
@@ -59,9 +61,8 @@
loadingTable.value = true
listQuery.value.typeName = info.value.devTypeName
listQuery.value.devcode = info.value.devcode
- getMonitorData(listQuery.value)
- .then((res) => {
- list.value = res.data.filter((item: any) => !item.alarmRuleValue)
+ getMonitorData(listQuery.value).then((res) => {
+ list.value = res.data.filter((item: any) => !item.alarmRuleValue).map((item: any) => ({...item, rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''}))
// 设置设备状态和燃气浓度标红
const threshold = res.data.filter((item: any) => item.alarmRuleValue)[0]
// console.log(threshold.alarmRuleValue, '阈值')
@@ -214,7 +215,7 @@
-
+
diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue
index 644e9d0..cc197cb 100644
--- a/src/views/home/alarm/current/index.vue
+++ b/src/views/home/alarm/current/index.vue
@@ -21,6 +21,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { getWellListPage } from '@/api/home/well/well'
import { getPipelineListPage } from '@/api/home/pipeline/pipeline'
+import { alarmValue } from './components/dict'
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
const alarmLevelList = ref<{ id: string; name: string; value: string }[]>([]) // 报警等级
@@ -113,31 +114,31 @@
list1.value = res.data.rows.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
})).map((item: any) => ({
...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : item.alarmContent
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
loadingTable.value = false
// // 查询设备类型和厂商
- list1.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- item.watchObject = res.data.rows[0].watchObject
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
@@ -234,7 +235,28 @@
list1.value = data.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
+ // // 查询设备类型和厂商
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
setTimeout(() => {
detail(data[0])
})
@@ -287,7 +309,7 @@
})
setTimeout(() => {
watchMapWidth()
- console.log('开始监听')
+ // console.log('开始监听')
})
}
else {
@@ -313,14 +335,15 @@
window.addEventListener('resize', () => { })
})
// 监听地图宽度
+const observer = ref()
const watchMapWidth = () => {
// 创建一个ResizeObserver实例
- const observer = new ResizeObserver((entries: any) => {
+ observer.value = new ResizeObserver((entries: any) => {
for (const entry of entries) {
// 获取div元素的新高度
const newWidth = entry.contentRect.width
// 执行相应的操作,比如更新UI或调用其他函数
- console.log(`元素新宽度为:${newWidth}`)
+ // console.log(`元素新宽度为:${newWidth}`)
// if (newHeight < 350) {
// tableHeight.value = window.innerHeight - 60 - 50 - 10 - 350 - 98 - 10 - 52 - 10 + (350 - newHeight)
// }
@@ -342,7 +365,7 @@
})
// 监听目标div元素的宽度变化
const targetDiv = document.getElementById('container-table') as Element
- observer.observe(targetDiv)
+ observer.value.observe(targetDiv)
}
// 查看报警
const mapRef = ref()
@@ -397,7 +420,7 @@
else {
let timer = null
timer = setInterval(() => {
- console.log('定时器')
+ // console.log('定时器')
if (mapRef.value?.completeFlag) {
draw()
clearInterval(timer)
@@ -408,7 +431,6 @@
}, 500)
}
// 双击列表行数据
-
const rowClick = (data: any) => {
detail(data)
}
@@ -416,7 +438,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -424,7 +446,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -452,7 +474,7 @@
// 多选
const multipleTable = ref([])
const handleSelectionChange = (val: any) => {
- console.log(val, '多选数据')
+ // console.log(val, '多选数据')
multipleTable.value = val
}
// 导出列表
@@ -489,8 +511,11 @@
).then(() => {
batchDelete(multipleTable.value.map((item: any) => item.id)).then(() => {
ElMessage.success('操作成功')
+ // 清空多选
multipleTable.value = []
+ tableRef.value.clearMulti()
fetchData()
+
})
})
}
@@ -524,16 +549,17 @@
}
const routerTo = (watchObjectName: string, row: any) => {
const watchObject = {
- '闸井': 'WellMonitorDetail',
- '场站': 'StationMonitorDetail',
- '管线': 'PipelineMonitorDetail',
+ 1: 'WellMonitorDetail',
+ 2: 'StationMonitorDetail',
+ 3: 'PipelineMonitorDetail',
} as { [key: string]: string }
// 判断是否有菜单权限
const watchObjectAuth = {
- '闸井': '/well',
- '场站': '/station/monitor',
- '管线': '/pipeline',
+ 1: '/well',
+ 2: '/station/monitor',
+ 3: '/pipeline',
} as { [key: string]: string }
+ // console.log(watchObjectAuth[watchObjectName])
if (!proxy.hasPerm(watchObjectAuth[watchObjectName])) {
ElMessage.warning('没有对应权限菜单')
return
@@ -553,20 +579,20 @@
})
}
// 先找闸井或者管线或者场站
- if (row.watchObject === '闸井') {
+ if (row.watchObject === '1') {
getWellListPage({ offset: 1, limit: 1, tagNumber: row.ledgerNumber, ledgerCode: row.ledgerCode }).then(res => {
if (res.data.rows.length) {
- routerTo('闸井', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('1', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
}
})
}
- else if (row.watchObject === '管线') {
+ else if (row.watchObject === '3') {
getPipelineListPage({ offset: 1, limit: 1, devCode: row.devcode, pipeCode: row.ledgerCode, tagNumber: row.ledgerNumber }).then(res => {
if (res.data.rows.length) {
- routerTo('管线', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('3', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
@@ -579,21 +605,23 @@
onBeforeRouteLeave((to: any) => {
keepSearchParams(to.path, 'CurrentAlarm')
cache.value = tableFlag.value
+ // 销毁ResizeObserver实例
+ observer.value.disconnect()
})
onActivated(() => {
- console.log('需要还原页面')
+ // console.log('需要还原页面')
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
- console.log('需要重新获取列表')
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
+ // console.log('需要重新获取列表')
fetchData()
}
- if(cache.value === 'map') {
- console.log('重置地图')
+ if (cache.value === 'map') {
+ // console.log('重置地图')
tableFlag.value = 'normal'
setTimeout(() => {
switchMode('map')
- if(cacheRow.value.id) {
+ if (cacheRow.value.id) {
detail(cacheRow.value)
}
})
@@ -721,8 +749,8 @@
-
{{ scope.row[column.value] }}
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index e5dfdb4..21f93d6 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -45,7 +45,7 @@
geocoder.getAddress(lnglat, (status: any, result: any) => {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
- console.log(result.regeocode.formattedAddress)
+ // console.log(result.regeocode.formattedAddress)
position = result.regeocode.formattedAddress
resultFun(position)
}
@@ -103,7 +103,7 @@
plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap1: any) => {
- console.log($props.center, '$props.center')
+ // console.log($props.center, '$props.center')
console.log($props.center && $props.center?.length === 2 && !isNaN($props.center[0]) && !isNaN($props.center[1]) ? $props.center : [116.397428, 39.90923])
AMap.value = AMap1
// 初始化地图
@@ -161,7 +161,7 @@
const flag = '00000000'
const zz = c
const z = `L${String(zz).length === 1 ? `0${zz}` : zz}`
- console.log(zz, 'zz')
+ // console.log(zz, 'zz')
const xx = a.toString(16)
const x = `C${flag.substring(0, 8 - xx.length)}${xx}`
const yy = b.toString(16)
@@ -452,7 +452,7 @@
...data.style,
})
polyline.on('click', (e) => {
- console.log('点击了线')
+ // console.log('点击了线')
$emits('lineClick', { event: e, map: map.value, data, polyline })
})
// console.log(polyline, 'polyline')
@@ -532,7 +532,7 @@
const MarkerAllCluster = ref([]) // 点聚合数组
const cluster = ref()
// 添加点聚合
-const addCluster = (points) => {
+const addCluster = (points,styleList) => {
// console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points')
var count = points.length
var _renderClusterMarker = function (context) {
@@ -563,8 +563,7 @@
}
const _renderMarker = (context: any) => {
const data = context.data[0]
- // console.log(data, 'data')
- const style = [
+ let style = [
{
url: `${publicPath}/image/well/well-normal.png`, // 图标地址
},
@@ -578,6 +577,9 @@
url: `${publicPath}/image/well/well-will.png`, // 图标地址
},
]
+ if(styleList) {
+ style = styleList
+ }
const markerHtml = `
`
var offset = new AMap.value.Pixel(-9, -9)
context.marker.setContent(markerHtml)
@@ -630,7 +632,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
@@ -644,7 +646,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue
index d85779c..c748666 100644
--- a/src/layouts/components/Tools/alarmDialog.vue
+++ b/src/layouts/components/Tools/alarmDialog.vue
@@ -1,4 +1,5 @@
-
+ :close-on-click-modal="false">
{{ info.alarmType }}
-
+
报警类型
{{ info.alarmType }}
-
+
设备类型
@@ -82,13 +88,13 @@
-
+
闸井位号
{{ info.tagNumber }}
-
+
闸井名称
@@ -96,22 +102,22 @@
-
+
报警等级
{{ info.alarmLevel }}
-
- 报警值
+
+
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
diff --git a/src/views/home/alarm/current/components/monitorDataDialog.vue b/src/views/home/alarm/current/components/monitorDataDialog.vue
index 9b689c9..666fe82 100644
--- a/src/views/home/alarm/current/components/monitorDataDialog.vue
+++ b/src/views/home/alarm/current/components/monitorDataDialog.vue
@@ -8,6 +8,7 @@
import dayjs from 'dayjs'
import { getMonitorData } from '@/api/home/pipeline/pipeline'
import { exportExcel } from '@/utils/exportXlsx'
+import { handlerSignalStrength } from '@/views/home/device/device/components/handlerData'
const emits = defineEmits(['refresh'])
const dialogFormVisible = ref(false) // 对话框是否显示
const info = ref()
@@ -21,11 +22,12 @@
// 列表展示列
const columns = ref([
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
- { text: '信号强度', value: 'pci', align: 'center', width: 90 },
- { text: '电量(%)', value: 'cell', align: 'center', width: 90 },
- { text: '采集时间', value: 'uptime', align: 'center' },
- { text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ { text: '信号强度', value: 'rsrp', align: 'center', width: 85 },
+ { text: '信号质量', value: 'rsrpName', align: 'center', width: 85 },
+ { text: '电量(%)', value: 'cell', align: 'center', width: 80 },
+ { text: '采集时间', value: 'uptime', align: 'center' },
+ { text: '上传时间', value: 'logtime', align: 'center' },
+ // { text: '设备状态', value: 'status', align: 'center', width: 85, isCustom: true },
])
const listQuery = ref({
upBegTime: '',
@@ -59,9 +61,8 @@
loadingTable.value = true
listQuery.value.typeName = info.value.devTypeName
listQuery.value.devcode = info.value.devcode
- getMonitorData(listQuery.value)
- .then((res) => {
- list.value = res.data.filter((item: any) => !item.alarmRuleValue)
+ getMonitorData(listQuery.value).then((res) => {
+ list.value = res.data.filter((item: any) => !item.alarmRuleValue).map((item: any) => ({...item, rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''}))
// 设置设备状态和燃气浓度标红
const threshold = res.data.filter((item: any) => item.alarmRuleValue)[0]
// console.log(threshold.alarmRuleValue, '阈值')
@@ -214,7 +215,7 @@
-
+
diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue
index 644e9d0..cc197cb 100644
--- a/src/views/home/alarm/current/index.vue
+++ b/src/views/home/alarm/current/index.vue
@@ -21,6 +21,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { getWellListPage } from '@/api/home/well/well'
import { getPipelineListPage } from '@/api/home/pipeline/pipeline'
+import { alarmValue } from './components/dict'
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
const alarmLevelList = ref<{ id: string; name: string; value: string }[]>([]) // 报警等级
@@ -113,31 +114,31 @@
list1.value = res.data.rows.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
})).map((item: any) => ({
...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : item.alarmContent
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
loadingTable.value = false
// // 查询设备类型和厂商
- list1.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- item.watchObject = res.data.rows[0].watchObject
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
@@ -234,7 +235,28 @@
list1.value = data.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
+ // // 查询设备类型和厂商
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
setTimeout(() => {
detail(data[0])
})
@@ -287,7 +309,7 @@
})
setTimeout(() => {
watchMapWidth()
- console.log('开始监听')
+ // console.log('开始监听')
})
}
else {
@@ -313,14 +335,15 @@
window.addEventListener('resize', () => { })
})
// 监听地图宽度
+const observer = ref()
const watchMapWidth = () => {
// 创建一个ResizeObserver实例
- const observer = new ResizeObserver((entries: any) => {
+ observer.value = new ResizeObserver((entries: any) => {
for (const entry of entries) {
// 获取div元素的新高度
const newWidth = entry.contentRect.width
// 执行相应的操作,比如更新UI或调用其他函数
- console.log(`元素新宽度为:${newWidth}`)
+ // console.log(`元素新宽度为:${newWidth}`)
// if (newHeight < 350) {
// tableHeight.value = window.innerHeight - 60 - 50 - 10 - 350 - 98 - 10 - 52 - 10 + (350 - newHeight)
// }
@@ -342,7 +365,7 @@
})
// 监听目标div元素的宽度变化
const targetDiv = document.getElementById('container-table') as Element
- observer.observe(targetDiv)
+ observer.value.observe(targetDiv)
}
// 查看报警
const mapRef = ref()
@@ -397,7 +420,7 @@
else {
let timer = null
timer = setInterval(() => {
- console.log('定时器')
+ // console.log('定时器')
if (mapRef.value?.completeFlag) {
draw()
clearInterval(timer)
@@ -408,7 +431,6 @@
}, 500)
}
// 双击列表行数据
-
const rowClick = (data: any) => {
detail(data)
}
@@ -416,7 +438,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -424,7 +446,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -452,7 +474,7 @@
// 多选
const multipleTable = ref([])
const handleSelectionChange = (val: any) => {
- console.log(val, '多选数据')
+ // console.log(val, '多选数据')
multipleTable.value = val
}
// 导出列表
@@ -489,8 +511,11 @@
).then(() => {
batchDelete(multipleTable.value.map((item: any) => item.id)).then(() => {
ElMessage.success('操作成功')
+ // 清空多选
multipleTable.value = []
+ tableRef.value.clearMulti()
fetchData()
+
})
})
}
@@ -524,16 +549,17 @@
}
const routerTo = (watchObjectName: string, row: any) => {
const watchObject = {
- '闸井': 'WellMonitorDetail',
- '场站': 'StationMonitorDetail',
- '管线': 'PipelineMonitorDetail',
+ 1: 'WellMonitorDetail',
+ 2: 'StationMonitorDetail',
+ 3: 'PipelineMonitorDetail',
} as { [key: string]: string }
// 判断是否有菜单权限
const watchObjectAuth = {
- '闸井': '/well',
- '场站': '/station/monitor',
- '管线': '/pipeline',
+ 1: '/well',
+ 2: '/station/monitor',
+ 3: '/pipeline',
} as { [key: string]: string }
+ // console.log(watchObjectAuth[watchObjectName])
if (!proxy.hasPerm(watchObjectAuth[watchObjectName])) {
ElMessage.warning('没有对应权限菜单')
return
@@ -553,20 +579,20 @@
})
}
// 先找闸井或者管线或者场站
- if (row.watchObject === '闸井') {
+ if (row.watchObject === '1') {
getWellListPage({ offset: 1, limit: 1, tagNumber: row.ledgerNumber, ledgerCode: row.ledgerCode }).then(res => {
if (res.data.rows.length) {
- routerTo('闸井', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('1', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
}
})
}
- else if (row.watchObject === '管线') {
+ else if (row.watchObject === '3') {
getPipelineListPage({ offset: 1, limit: 1, devCode: row.devcode, pipeCode: row.ledgerCode, tagNumber: row.ledgerNumber }).then(res => {
if (res.data.rows.length) {
- routerTo('管线', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('3', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
@@ -579,21 +605,23 @@
onBeforeRouteLeave((to: any) => {
keepSearchParams(to.path, 'CurrentAlarm')
cache.value = tableFlag.value
+ // 销毁ResizeObserver实例
+ observer.value.disconnect()
})
onActivated(() => {
- console.log('需要还原页面')
+ // console.log('需要还原页面')
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
- console.log('需要重新获取列表')
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
+ // console.log('需要重新获取列表')
fetchData()
}
- if(cache.value === 'map') {
- console.log('重置地图')
+ if (cache.value === 'map') {
+ // console.log('重置地图')
tableFlag.value = 'normal'
setTimeout(() => {
switchMode('map')
- if(cacheRow.value.id) {
+ if (cacheRow.value.id) {
detail(cacheRow.value)
}
})
@@ -721,8 +749,8 @@
-
{{ scope.row[column.value] }}
diff --git a/src/views/home/alarm/history/index.vue b/src/views/home/alarm/history/index.vue
index cf27337..ba700c3 100644
--- a/src/views/home/alarm/history/index.vue
+++ b/src/views/home/alarm/history/index.vue
@@ -16,6 +16,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { keepSearchParams } from '@/utils/keepQuery'
import { getDateDiff } from '@/utils/dayjs'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
const $route = useRoute()
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
@@ -40,7 +41,7 @@
const columns = ref([
{ text: '报警类别', value: 'alarmCategory', align: 'center', width: '110' },
{ text: '报警类型', value: 'alarmType', align: 'center', width: '140' },
- { text: '报警原因', value: 'alarmContent', align: 'center' },
+ { text: '报警原因', value: 'alarmReason', align: 'center' },
{ text: '报警等级', value: 'alarmLevelName', align: 'center', width: '90' },
{ text: '位置', value: 'position', align: 'center' },
{ text: '设备编号', value: 'devcode', align: 'center', width: '130', isCustom: true },
@@ -95,32 +96,36 @@
list.value = res.data.rows.map((item: any) => ({
...item,
cancelDuration: item.alarmTime && item.cancelTime ? getDateDiff(item.alarmTime, item.cancelTime) : '' ,
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
+ }))
+ .map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategory.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
total.value = res.data.total
loadingTable.value = false
// 查询设备类型和厂商
- list.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
}
-// 重置查询条件f
+// 重置查询条件
const reset = () => {
datetimerange.value = []
listQuery.value = {
@@ -207,7 +212,6 @@
const data = JSON.parse($route.query.row as string)
if ($route.query.type === 'localAnalyse') {
// 从异常位置分析跳转过来
- console.log(data, '123')
datetimerange.value = [data.begTime, data.endTime]
listQuery.value.position = data.position
}
@@ -223,7 +227,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -231,7 +235,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -258,8 +262,8 @@
})
onActivated(() => {
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
console.log('需要重新获取列表')
fetchData()
}
@@ -341,8 +345,8 @@
-
+
{{ scope.row[column.value] }}
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index e5dfdb4..21f93d6 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -45,7 +45,7 @@
geocoder.getAddress(lnglat, (status: any, result: any) => {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
- console.log(result.regeocode.formattedAddress)
+ // console.log(result.regeocode.formattedAddress)
position = result.regeocode.formattedAddress
resultFun(position)
}
@@ -103,7 +103,7 @@
plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap1: any) => {
- console.log($props.center, '$props.center')
+ // console.log($props.center, '$props.center')
console.log($props.center && $props.center?.length === 2 && !isNaN($props.center[0]) && !isNaN($props.center[1]) ? $props.center : [116.397428, 39.90923])
AMap.value = AMap1
// 初始化地图
@@ -161,7 +161,7 @@
const flag = '00000000'
const zz = c
const z = `L${String(zz).length === 1 ? `0${zz}` : zz}`
- console.log(zz, 'zz')
+ // console.log(zz, 'zz')
const xx = a.toString(16)
const x = `C${flag.substring(0, 8 - xx.length)}${xx}`
const yy = b.toString(16)
@@ -452,7 +452,7 @@
...data.style,
})
polyline.on('click', (e) => {
- console.log('点击了线')
+ // console.log('点击了线')
$emits('lineClick', { event: e, map: map.value, data, polyline })
})
// console.log(polyline, 'polyline')
@@ -532,7 +532,7 @@
const MarkerAllCluster = ref([]) // 点聚合数组
const cluster = ref()
// 添加点聚合
-const addCluster = (points) => {
+const addCluster = (points,styleList) => {
// console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points')
var count = points.length
var _renderClusterMarker = function (context) {
@@ -563,8 +563,7 @@
}
const _renderMarker = (context: any) => {
const data = context.data[0]
- // console.log(data, 'data')
- const style = [
+ let style = [
{
url: `${publicPath}/image/well/well-normal.png`, // 图标地址
},
@@ -578,6 +577,9 @@
url: `${publicPath}/image/well/well-will.png`, // 图标地址
},
]
+ if(styleList) {
+ style = styleList
+ }
const markerHtml = `
`
var offset = new AMap.value.Pixel(-9, -9)
context.marker.setContent(markerHtml)
@@ -630,7 +632,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
@@ -644,7 +646,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue
index d85779c..c748666 100644
--- a/src/layouts/components/Tools/alarmDialog.vue
+++ b/src/layouts/components/Tools/alarmDialog.vue
@@ -1,4 +1,5 @@
-
+ :close-on-click-modal="false">
{{ info.alarmType }}
-
+
报警类型
{{ info.alarmType }}
-
+
设备类型
@@ -82,13 +88,13 @@
-
+
闸井位号
{{ info.tagNumber }}
-
+
闸井名称
@@ -96,22 +102,22 @@
-
+
报警等级
{{ info.alarmLevel }}
-
- 报警值
+
+
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
diff --git a/src/views/home/alarm/current/components/monitorDataDialog.vue b/src/views/home/alarm/current/components/monitorDataDialog.vue
index 9b689c9..666fe82 100644
--- a/src/views/home/alarm/current/components/monitorDataDialog.vue
+++ b/src/views/home/alarm/current/components/monitorDataDialog.vue
@@ -8,6 +8,7 @@
import dayjs from 'dayjs'
import { getMonitorData } from '@/api/home/pipeline/pipeline'
import { exportExcel } from '@/utils/exportXlsx'
+import { handlerSignalStrength } from '@/views/home/device/device/components/handlerData'
const emits = defineEmits(['refresh'])
const dialogFormVisible = ref(false) // 对话框是否显示
const info = ref()
@@ -21,11 +22,12 @@
// 列表展示列
const columns = ref([
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
- { text: '信号强度', value: 'pci', align: 'center', width: 90 },
- { text: '电量(%)', value: 'cell', align: 'center', width: 90 },
- { text: '采集时间', value: 'uptime', align: 'center' },
- { text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ { text: '信号强度', value: 'rsrp', align: 'center', width: 85 },
+ { text: '信号质量', value: 'rsrpName', align: 'center', width: 85 },
+ { text: '电量(%)', value: 'cell', align: 'center', width: 80 },
+ { text: '采集时间', value: 'uptime', align: 'center' },
+ { text: '上传时间', value: 'logtime', align: 'center' },
+ // { text: '设备状态', value: 'status', align: 'center', width: 85, isCustom: true },
])
const listQuery = ref({
upBegTime: '',
@@ -59,9 +61,8 @@
loadingTable.value = true
listQuery.value.typeName = info.value.devTypeName
listQuery.value.devcode = info.value.devcode
- getMonitorData(listQuery.value)
- .then((res) => {
- list.value = res.data.filter((item: any) => !item.alarmRuleValue)
+ getMonitorData(listQuery.value).then((res) => {
+ list.value = res.data.filter((item: any) => !item.alarmRuleValue).map((item: any) => ({...item, rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''}))
// 设置设备状态和燃气浓度标红
const threshold = res.data.filter((item: any) => item.alarmRuleValue)[0]
// console.log(threshold.alarmRuleValue, '阈值')
@@ -214,7 +215,7 @@
-
+
diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue
index 644e9d0..cc197cb 100644
--- a/src/views/home/alarm/current/index.vue
+++ b/src/views/home/alarm/current/index.vue
@@ -21,6 +21,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { getWellListPage } from '@/api/home/well/well'
import { getPipelineListPage } from '@/api/home/pipeline/pipeline'
+import { alarmValue } from './components/dict'
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
const alarmLevelList = ref<{ id: string; name: string; value: string }[]>([]) // 报警等级
@@ -113,31 +114,31 @@
list1.value = res.data.rows.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
})).map((item: any) => ({
...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : item.alarmContent
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
loadingTable.value = false
// // 查询设备类型和厂商
- list1.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- item.watchObject = res.data.rows[0].watchObject
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
@@ -234,7 +235,28 @@
list1.value = data.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
+ // // 查询设备类型和厂商
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
setTimeout(() => {
detail(data[0])
})
@@ -287,7 +309,7 @@
})
setTimeout(() => {
watchMapWidth()
- console.log('开始监听')
+ // console.log('开始监听')
})
}
else {
@@ -313,14 +335,15 @@
window.addEventListener('resize', () => { })
})
// 监听地图宽度
+const observer = ref()
const watchMapWidth = () => {
// 创建一个ResizeObserver实例
- const observer = new ResizeObserver((entries: any) => {
+ observer.value = new ResizeObserver((entries: any) => {
for (const entry of entries) {
// 获取div元素的新高度
const newWidth = entry.contentRect.width
// 执行相应的操作,比如更新UI或调用其他函数
- console.log(`元素新宽度为:${newWidth}`)
+ // console.log(`元素新宽度为:${newWidth}`)
// if (newHeight < 350) {
// tableHeight.value = window.innerHeight - 60 - 50 - 10 - 350 - 98 - 10 - 52 - 10 + (350 - newHeight)
// }
@@ -342,7 +365,7 @@
})
// 监听目标div元素的宽度变化
const targetDiv = document.getElementById('container-table') as Element
- observer.observe(targetDiv)
+ observer.value.observe(targetDiv)
}
// 查看报警
const mapRef = ref()
@@ -397,7 +420,7 @@
else {
let timer = null
timer = setInterval(() => {
- console.log('定时器')
+ // console.log('定时器')
if (mapRef.value?.completeFlag) {
draw()
clearInterval(timer)
@@ -408,7 +431,6 @@
}, 500)
}
// 双击列表行数据
-
const rowClick = (data: any) => {
detail(data)
}
@@ -416,7 +438,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -424,7 +446,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -452,7 +474,7 @@
// 多选
const multipleTable = ref([])
const handleSelectionChange = (val: any) => {
- console.log(val, '多选数据')
+ // console.log(val, '多选数据')
multipleTable.value = val
}
// 导出列表
@@ -489,8 +511,11 @@
).then(() => {
batchDelete(multipleTable.value.map((item: any) => item.id)).then(() => {
ElMessage.success('操作成功')
+ // 清空多选
multipleTable.value = []
+ tableRef.value.clearMulti()
fetchData()
+
})
})
}
@@ -524,16 +549,17 @@
}
const routerTo = (watchObjectName: string, row: any) => {
const watchObject = {
- '闸井': 'WellMonitorDetail',
- '场站': 'StationMonitorDetail',
- '管线': 'PipelineMonitorDetail',
+ 1: 'WellMonitorDetail',
+ 2: 'StationMonitorDetail',
+ 3: 'PipelineMonitorDetail',
} as { [key: string]: string }
// 判断是否有菜单权限
const watchObjectAuth = {
- '闸井': '/well',
- '场站': '/station/monitor',
- '管线': '/pipeline',
+ 1: '/well',
+ 2: '/station/monitor',
+ 3: '/pipeline',
} as { [key: string]: string }
+ // console.log(watchObjectAuth[watchObjectName])
if (!proxy.hasPerm(watchObjectAuth[watchObjectName])) {
ElMessage.warning('没有对应权限菜单')
return
@@ -553,20 +579,20 @@
})
}
// 先找闸井或者管线或者场站
- if (row.watchObject === '闸井') {
+ if (row.watchObject === '1') {
getWellListPage({ offset: 1, limit: 1, tagNumber: row.ledgerNumber, ledgerCode: row.ledgerCode }).then(res => {
if (res.data.rows.length) {
- routerTo('闸井', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('1', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
}
})
}
- else if (row.watchObject === '管线') {
+ else if (row.watchObject === '3') {
getPipelineListPage({ offset: 1, limit: 1, devCode: row.devcode, pipeCode: row.ledgerCode, tagNumber: row.ledgerNumber }).then(res => {
if (res.data.rows.length) {
- routerTo('管线', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('3', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
@@ -579,21 +605,23 @@
onBeforeRouteLeave((to: any) => {
keepSearchParams(to.path, 'CurrentAlarm')
cache.value = tableFlag.value
+ // 销毁ResizeObserver实例
+ observer.value.disconnect()
})
onActivated(() => {
- console.log('需要还原页面')
+ // console.log('需要还原页面')
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
- console.log('需要重新获取列表')
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
+ // console.log('需要重新获取列表')
fetchData()
}
- if(cache.value === 'map') {
- console.log('重置地图')
+ if (cache.value === 'map') {
+ // console.log('重置地图')
tableFlag.value = 'normal'
setTimeout(() => {
switchMode('map')
- if(cacheRow.value.id) {
+ if (cacheRow.value.id) {
detail(cacheRow.value)
}
})
@@ -721,8 +749,8 @@
-
{{ scope.row[column.value] }}
diff --git a/src/views/home/alarm/history/index.vue b/src/views/home/alarm/history/index.vue
index cf27337..ba700c3 100644
--- a/src/views/home/alarm/history/index.vue
+++ b/src/views/home/alarm/history/index.vue
@@ -16,6 +16,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { keepSearchParams } from '@/utils/keepQuery'
import { getDateDiff } from '@/utils/dayjs'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
const $route = useRoute()
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
@@ -40,7 +41,7 @@
const columns = ref([
{ text: '报警类别', value: 'alarmCategory', align: 'center', width: '110' },
{ text: '报警类型', value: 'alarmType', align: 'center', width: '140' },
- { text: '报警原因', value: 'alarmContent', align: 'center' },
+ { text: '报警原因', value: 'alarmReason', align: 'center' },
{ text: '报警等级', value: 'alarmLevelName', align: 'center', width: '90' },
{ text: '位置', value: 'position', align: 'center' },
{ text: '设备编号', value: 'devcode', align: 'center', width: '130', isCustom: true },
@@ -95,32 +96,36 @@
list.value = res.data.rows.map((item: any) => ({
...item,
cancelDuration: item.alarmTime && item.cancelTime ? getDateDiff(item.alarmTime, item.cancelTime) : '' ,
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
+ }))
+ .map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategory.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
total.value = res.data.total
loadingTable.value = false
// 查询设备类型和厂商
- list.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
}
-// 重置查询条件f
+// 重置查询条件
const reset = () => {
datetimerange.value = []
listQuery.value = {
@@ -207,7 +212,6 @@
const data = JSON.parse($route.query.row as string)
if ($route.query.type === 'localAnalyse') {
// 从异常位置分析跳转过来
- console.log(data, '123')
datetimerange.value = [data.begTime, data.endTime]
listQuery.value.position = data.position
}
@@ -223,7 +227,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -231,7 +235,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -258,8 +262,8 @@
})
onActivated(() => {
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
console.log('需要重新获取列表')
fetchData()
}
@@ -341,8 +345,8 @@
-
+
{{ scope.row[column.value] }}
diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue
index 517b906..2f28a39 100644
--- a/src/views/home/dashboard/index.vue
+++ b/src/views/home/dashboard/index.vue
@@ -154,6 +154,7 @@
messageLoading.value = true
getMessage().then((res) => {
messageData.value = res.data.rows
+ console.log(messageData.value, '消息通知')
messageLoading.value = false
}).catch(() => {
messageLoading.value = false
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index e5dfdb4..21f93d6 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -45,7 +45,7 @@
geocoder.getAddress(lnglat, (status: any, result: any) => {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
- console.log(result.regeocode.formattedAddress)
+ // console.log(result.regeocode.formattedAddress)
position = result.regeocode.formattedAddress
resultFun(position)
}
@@ -103,7 +103,7 @@
plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap1: any) => {
- console.log($props.center, '$props.center')
+ // console.log($props.center, '$props.center')
console.log($props.center && $props.center?.length === 2 && !isNaN($props.center[0]) && !isNaN($props.center[1]) ? $props.center : [116.397428, 39.90923])
AMap.value = AMap1
// 初始化地图
@@ -161,7 +161,7 @@
const flag = '00000000'
const zz = c
const z = `L${String(zz).length === 1 ? `0${zz}` : zz}`
- console.log(zz, 'zz')
+ // console.log(zz, 'zz')
const xx = a.toString(16)
const x = `C${flag.substring(0, 8 - xx.length)}${xx}`
const yy = b.toString(16)
@@ -452,7 +452,7 @@
...data.style,
})
polyline.on('click', (e) => {
- console.log('点击了线')
+ // console.log('点击了线')
$emits('lineClick', { event: e, map: map.value, data, polyline })
})
// console.log(polyline, 'polyline')
@@ -532,7 +532,7 @@
const MarkerAllCluster = ref([]) // 点聚合数组
const cluster = ref()
// 添加点聚合
-const addCluster = (points) => {
+const addCluster = (points,styleList) => {
// console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points')
var count = points.length
var _renderClusterMarker = function (context) {
@@ -563,8 +563,7 @@
}
const _renderMarker = (context: any) => {
const data = context.data[0]
- // console.log(data, 'data')
- const style = [
+ let style = [
{
url: `${publicPath}/image/well/well-normal.png`, // 图标地址
},
@@ -578,6 +577,9 @@
url: `${publicPath}/image/well/well-will.png`, // 图标地址
},
]
+ if(styleList) {
+ style = styleList
+ }
const markerHtml = `
`
var offset = new AMap.value.Pixel(-9, -9)
context.marker.setContent(markerHtml)
@@ -630,7 +632,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
@@ -644,7 +646,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue
index d85779c..c748666 100644
--- a/src/layouts/components/Tools/alarmDialog.vue
+++ b/src/layouts/components/Tools/alarmDialog.vue
@@ -1,4 +1,5 @@
-
+ :close-on-click-modal="false">
{{ info.alarmType }}
-
+
报警类型
{{ info.alarmType }}
-
+
设备类型
@@ -82,13 +88,13 @@
-
+
闸井位号
{{ info.tagNumber }}
-
+
闸井名称
@@ -96,22 +102,22 @@
-
+
报警等级
{{ info.alarmLevel }}
-
- 报警值
+
+
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
diff --git a/src/views/home/alarm/current/components/monitorDataDialog.vue b/src/views/home/alarm/current/components/monitorDataDialog.vue
index 9b689c9..666fe82 100644
--- a/src/views/home/alarm/current/components/monitorDataDialog.vue
+++ b/src/views/home/alarm/current/components/monitorDataDialog.vue
@@ -8,6 +8,7 @@
import dayjs from 'dayjs'
import { getMonitorData } from '@/api/home/pipeline/pipeline'
import { exportExcel } from '@/utils/exportXlsx'
+import { handlerSignalStrength } from '@/views/home/device/device/components/handlerData'
const emits = defineEmits(['refresh'])
const dialogFormVisible = ref(false) // 对话框是否显示
const info = ref()
@@ -21,11 +22,12 @@
// 列表展示列
const columns = ref([
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
- { text: '信号强度', value: 'pci', align: 'center', width: 90 },
- { text: '电量(%)', value: 'cell', align: 'center', width: 90 },
- { text: '采集时间', value: 'uptime', align: 'center' },
- { text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ { text: '信号强度', value: 'rsrp', align: 'center', width: 85 },
+ { text: '信号质量', value: 'rsrpName', align: 'center', width: 85 },
+ { text: '电量(%)', value: 'cell', align: 'center', width: 80 },
+ { text: '采集时间', value: 'uptime', align: 'center' },
+ { text: '上传时间', value: 'logtime', align: 'center' },
+ // { text: '设备状态', value: 'status', align: 'center', width: 85, isCustom: true },
])
const listQuery = ref({
upBegTime: '',
@@ -59,9 +61,8 @@
loadingTable.value = true
listQuery.value.typeName = info.value.devTypeName
listQuery.value.devcode = info.value.devcode
- getMonitorData(listQuery.value)
- .then((res) => {
- list.value = res.data.filter((item: any) => !item.alarmRuleValue)
+ getMonitorData(listQuery.value).then((res) => {
+ list.value = res.data.filter((item: any) => !item.alarmRuleValue).map((item: any) => ({...item, rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''}))
// 设置设备状态和燃气浓度标红
const threshold = res.data.filter((item: any) => item.alarmRuleValue)[0]
// console.log(threshold.alarmRuleValue, '阈值')
@@ -214,7 +215,7 @@
-
+
diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue
index 644e9d0..cc197cb 100644
--- a/src/views/home/alarm/current/index.vue
+++ b/src/views/home/alarm/current/index.vue
@@ -21,6 +21,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { getWellListPage } from '@/api/home/well/well'
import { getPipelineListPage } from '@/api/home/pipeline/pipeline'
+import { alarmValue } from './components/dict'
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
const alarmLevelList = ref<{ id: string; name: string; value: string }[]>([]) // 报警等级
@@ -113,31 +114,31 @@
list1.value = res.data.rows.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
})).map((item: any) => ({
...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : item.alarmContent
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
loadingTable.value = false
// // 查询设备类型和厂商
- list1.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- item.watchObject = res.data.rows[0].watchObject
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
@@ -234,7 +235,28 @@
list1.value = data.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
+ // // 查询设备类型和厂商
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
setTimeout(() => {
detail(data[0])
})
@@ -287,7 +309,7 @@
})
setTimeout(() => {
watchMapWidth()
- console.log('开始监听')
+ // console.log('开始监听')
})
}
else {
@@ -313,14 +335,15 @@
window.addEventListener('resize', () => { })
})
// 监听地图宽度
+const observer = ref()
const watchMapWidth = () => {
// 创建一个ResizeObserver实例
- const observer = new ResizeObserver((entries: any) => {
+ observer.value = new ResizeObserver((entries: any) => {
for (const entry of entries) {
// 获取div元素的新高度
const newWidth = entry.contentRect.width
// 执行相应的操作,比如更新UI或调用其他函数
- console.log(`元素新宽度为:${newWidth}`)
+ // console.log(`元素新宽度为:${newWidth}`)
// if (newHeight < 350) {
// tableHeight.value = window.innerHeight - 60 - 50 - 10 - 350 - 98 - 10 - 52 - 10 + (350 - newHeight)
// }
@@ -342,7 +365,7 @@
})
// 监听目标div元素的宽度变化
const targetDiv = document.getElementById('container-table') as Element
- observer.observe(targetDiv)
+ observer.value.observe(targetDiv)
}
// 查看报警
const mapRef = ref()
@@ -397,7 +420,7 @@
else {
let timer = null
timer = setInterval(() => {
- console.log('定时器')
+ // console.log('定时器')
if (mapRef.value?.completeFlag) {
draw()
clearInterval(timer)
@@ -408,7 +431,6 @@
}, 500)
}
// 双击列表行数据
-
const rowClick = (data: any) => {
detail(data)
}
@@ -416,7 +438,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -424,7 +446,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -452,7 +474,7 @@
// 多选
const multipleTable = ref([])
const handleSelectionChange = (val: any) => {
- console.log(val, '多选数据')
+ // console.log(val, '多选数据')
multipleTable.value = val
}
// 导出列表
@@ -489,8 +511,11 @@
).then(() => {
batchDelete(multipleTable.value.map((item: any) => item.id)).then(() => {
ElMessage.success('操作成功')
+ // 清空多选
multipleTable.value = []
+ tableRef.value.clearMulti()
fetchData()
+
})
})
}
@@ -524,16 +549,17 @@
}
const routerTo = (watchObjectName: string, row: any) => {
const watchObject = {
- '闸井': 'WellMonitorDetail',
- '场站': 'StationMonitorDetail',
- '管线': 'PipelineMonitorDetail',
+ 1: 'WellMonitorDetail',
+ 2: 'StationMonitorDetail',
+ 3: 'PipelineMonitorDetail',
} as { [key: string]: string }
// 判断是否有菜单权限
const watchObjectAuth = {
- '闸井': '/well',
- '场站': '/station/monitor',
- '管线': '/pipeline',
+ 1: '/well',
+ 2: '/station/monitor',
+ 3: '/pipeline',
} as { [key: string]: string }
+ // console.log(watchObjectAuth[watchObjectName])
if (!proxy.hasPerm(watchObjectAuth[watchObjectName])) {
ElMessage.warning('没有对应权限菜单')
return
@@ -553,20 +579,20 @@
})
}
// 先找闸井或者管线或者场站
- if (row.watchObject === '闸井') {
+ if (row.watchObject === '1') {
getWellListPage({ offset: 1, limit: 1, tagNumber: row.ledgerNumber, ledgerCode: row.ledgerCode }).then(res => {
if (res.data.rows.length) {
- routerTo('闸井', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('1', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
}
})
}
- else if (row.watchObject === '管线') {
+ else if (row.watchObject === '3') {
getPipelineListPage({ offset: 1, limit: 1, devCode: row.devcode, pipeCode: row.ledgerCode, tagNumber: row.ledgerNumber }).then(res => {
if (res.data.rows.length) {
- routerTo('管线', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('3', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
@@ -579,21 +605,23 @@
onBeforeRouteLeave((to: any) => {
keepSearchParams(to.path, 'CurrentAlarm')
cache.value = tableFlag.value
+ // 销毁ResizeObserver实例
+ observer.value.disconnect()
})
onActivated(() => {
- console.log('需要还原页面')
+ // console.log('需要还原页面')
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
- console.log('需要重新获取列表')
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
+ // console.log('需要重新获取列表')
fetchData()
}
- if(cache.value === 'map') {
- console.log('重置地图')
+ if (cache.value === 'map') {
+ // console.log('重置地图')
tableFlag.value = 'normal'
setTimeout(() => {
switchMode('map')
- if(cacheRow.value.id) {
+ if (cacheRow.value.id) {
detail(cacheRow.value)
}
})
@@ -721,8 +749,8 @@
-
{{ scope.row[column.value] }}
diff --git a/src/views/home/alarm/history/index.vue b/src/views/home/alarm/history/index.vue
index cf27337..ba700c3 100644
--- a/src/views/home/alarm/history/index.vue
+++ b/src/views/home/alarm/history/index.vue
@@ -16,6 +16,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { keepSearchParams } from '@/utils/keepQuery'
import { getDateDiff } from '@/utils/dayjs'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
const $route = useRoute()
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
@@ -40,7 +41,7 @@
const columns = ref([
{ text: '报警类别', value: 'alarmCategory', align: 'center', width: '110' },
{ text: '报警类型', value: 'alarmType', align: 'center', width: '140' },
- { text: '报警原因', value: 'alarmContent', align: 'center' },
+ { text: '报警原因', value: 'alarmReason', align: 'center' },
{ text: '报警等级', value: 'alarmLevelName', align: 'center', width: '90' },
{ text: '位置', value: 'position', align: 'center' },
{ text: '设备编号', value: 'devcode', align: 'center', width: '130', isCustom: true },
@@ -95,32 +96,36 @@
list.value = res.data.rows.map((item: any) => ({
...item,
cancelDuration: item.alarmTime && item.cancelTime ? getDateDiff(item.alarmTime, item.cancelTime) : '' ,
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
+ }))
+ .map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategory.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
total.value = res.data.total
loadingTable.value = false
// 查询设备类型和厂商
- list.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
}
-// 重置查询条件f
+// 重置查询条件
const reset = () => {
datetimerange.value = []
listQuery.value = {
@@ -207,7 +212,6 @@
const data = JSON.parse($route.query.row as string)
if ($route.query.type === 'localAnalyse') {
// 从异常位置分析跳转过来
- console.log(data, '123')
datetimerange.value = [data.begTime, data.endTime]
listQuery.value.position = data.position
}
@@ -223,7 +227,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -231,7 +235,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -258,8 +262,8 @@
})
onActivated(() => {
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
console.log('需要重新获取列表')
fetchData()
}
@@ -341,8 +345,8 @@
-
+
{{ scope.row[column.value] }}
diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue
index 517b906..2f28a39 100644
--- a/src/views/home/dashboard/index.vue
+++ b/src/views/home/dashboard/index.vue
@@ -154,6 +154,7 @@
messageLoading.value = true
getMessage().then((res) => {
messageData.value = res.data.rows
+ console.log(messageData.value, '消息通知')
messageLoading.value = false
}).catch(() => {
messageLoading.value = false
diff --git a/src/views/home/device/device/components/dataSearch.vue b/src/views/home/device/device/components/dataSearch.vue
index 2bef320..612d68d 100644
--- a/src/views/home/device/device/components/dataSearch.vue
+++ b/src/views/home/device/device/components/dataSearch.vue
@@ -11,7 +11,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { exportFile } from '@/utils/exportUtils'
import { toHumpObject } from '@/utils/String'
-import { handlerListData } from './handlerData'
+import { handlerListData, handlerSignalStrength } from './handlerData'
const $route = useRoute()
const listQuery = ref({
devcode: '',
@@ -75,10 +75,11 @@
{ text: '设备编号', value: 'devcode', align: 'center' },
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
{ text: '电量(%)', value: 'cell', align: 'center' },
- { text: '信号强度', value: 'pci', align: 'center' },
+ { text: '信号强度', value: 'rsrp', align: 'center' },
+ { text: '信号质量', value: 'rsrpName', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵
const columns2 = ref([
@@ -87,7 +88,7 @@
{ text: '电池电压(mV)', value: 'vbat', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵-百瑞生
const columns2BRS = ref([
@@ -99,7 +100,7 @@
{ text: '信号质量', value: 'sig', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵-麦哈克
const columns2MHK = ref([
@@ -110,7 +111,7 @@
{ text: '信号质量', value: 'rsrp', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 智能警示桩
const columns3 = ref([
@@ -251,21 +252,21 @@
}
getDataSearch(listQuery.value).then((res) => {
list.value = res.data.map((item: any) => toHumpObject(item))
- if (listQuery.value.typeName === '智能警示桩') {
- const dict = {
- 0: '正常',
- 1: '报警'
- } as { [key: string]: string }
- list.value = list.value.map((item: any) => ({
- ...item,
- pipeInclineAlarm: item.pipeInclineAlarm === '1' || item.pipeInclineAlarm === '0' ? dict[item.pipeInclineAlarm] : item.pipeInclineAlarm,
- pipeBreakAlarm: item.pipeBreakAlarm === '1' || item.pipeBreakAlarm === '0' ? dict[item.pipeBreakAlarm] : item.pipeBreakAlarm,
- leftOffLineAlarm: item.leftOffLineAlarm === '1' || item.leftOffLineAlarm === '0' ? dict[item.leftOffLineAlarm] : item.leftOffLineAlarm,
- leftVibrateAlarm: item.leftVibrateAlarm === '1' || item.leftVibrateAlarm === '0' ? dict[item.leftVibrateAlarm] : item.leftVibrateAlarm,
- rightOffLineAlarm: item.rightOffLineAlarm === '1' || item.rightOffLineAlarm === '0' ? dict[item.rightOffLineAlarm] : item.rightOffLineAlarm,
- rightVibrateAlarm: item.rightVibrateAlarm === '1' || item.rightVibrateAlarm === '0' ? dict[item.rightVibrateAlarm] : item.rightVibrateAlarm,
- }))
- }
+ // if (listQuery.value.typeName === '智能警示桩') {
+ // const dict = {
+ // 0: '正常',
+ // 1: '报警'
+ // } as { [key: string]: string }
+ // list.value = list.value.map((item: any) => ({
+ // ...item,
+ // pipeInclineAlarm: item.pipeInclineAlarm === '1' || item.pipeInclineAlarm === '0' ? dict[item.pipeInclineAlarm] : item.pipeInclineAlarm,
+ // pipeBreakAlarm: item.pipeBreakAlarm === '1' || item.pipeBreakAlarm === '0' ? dict[item.pipeBreakAlarm] : item.pipeBreakAlarm,
+ // leftOffLineAlarm: item.leftOffLineAlarm === '1' || item.leftOffLineAlarm === '0' ? dict[item.leftOffLineAlarm] : item.leftOffLineAlarm,
+ // leftVibrateAlarm: item.leftVibrateAlarm === '1' || item.leftVibrateAlarm === '0' ? dict[item.leftVibrateAlarm] : item.leftVibrateAlarm,
+ // rightOffLineAlarm: item.rightOffLineAlarm === '1' || item.rightOffLineAlarm === '0' ? dict[item.rightOffLineAlarm] : item.rightOffLineAlarm,
+ // rightVibrateAlarm: item.rightVibrateAlarm === '1' || item.rightVibrateAlarm === '0' ? dict[item.rightVibrateAlarm] : item.rightVibrateAlarm,
+ // }))
+ // }
if (listQuery.value.typeName === '智能警示桩') {
const dict = {
0: '正常',
@@ -285,7 +286,8 @@
if (!listQuery.value.typeName || listQuery.value.typeName.includes('燃气智能监测终端')) {
list.value = list.value.map((item: any) => ({
...item,
- status: handlerthresholdFun(item.strength, handlerthreshold.value.map((item: any) => item.alarmThreshold))
+ status: handlerthresholdFun(item.strength, handlerthreshold.value.map((item: any) => item.alarmThreshold)),
+ rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''
}))
chartData.value = [
{
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index e5dfdb4..21f93d6 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -45,7 +45,7 @@
geocoder.getAddress(lnglat, (status: any, result: any) => {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
- console.log(result.regeocode.formattedAddress)
+ // console.log(result.regeocode.formattedAddress)
position = result.regeocode.formattedAddress
resultFun(position)
}
@@ -103,7 +103,7 @@
plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap1: any) => {
- console.log($props.center, '$props.center')
+ // console.log($props.center, '$props.center')
console.log($props.center && $props.center?.length === 2 && !isNaN($props.center[0]) && !isNaN($props.center[1]) ? $props.center : [116.397428, 39.90923])
AMap.value = AMap1
// 初始化地图
@@ -161,7 +161,7 @@
const flag = '00000000'
const zz = c
const z = `L${String(zz).length === 1 ? `0${zz}` : zz}`
- console.log(zz, 'zz')
+ // console.log(zz, 'zz')
const xx = a.toString(16)
const x = `C${flag.substring(0, 8 - xx.length)}${xx}`
const yy = b.toString(16)
@@ -452,7 +452,7 @@
...data.style,
})
polyline.on('click', (e) => {
- console.log('点击了线')
+ // console.log('点击了线')
$emits('lineClick', { event: e, map: map.value, data, polyline })
})
// console.log(polyline, 'polyline')
@@ -532,7 +532,7 @@
const MarkerAllCluster = ref([]) // 点聚合数组
const cluster = ref()
// 添加点聚合
-const addCluster = (points) => {
+const addCluster = (points,styleList) => {
// console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points')
var count = points.length
var _renderClusterMarker = function (context) {
@@ -563,8 +563,7 @@
}
const _renderMarker = (context: any) => {
const data = context.data[0]
- // console.log(data, 'data')
- const style = [
+ let style = [
{
url: `${publicPath}/image/well/well-normal.png`, // 图标地址
},
@@ -578,6 +577,9 @@
url: `${publicPath}/image/well/well-will.png`, // 图标地址
},
]
+ if(styleList) {
+ style = styleList
+ }
const markerHtml = `
`
var offset = new AMap.value.Pixel(-9, -9)
context.marker.setContent(markerHtml)
@@ -630,7 +632,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
@@ -644,7 +646,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue
index d85779c..c748666 100644
--- a/src/layouts/components/Tools/alarmDialog.vue
+++ b/src/layouts/components/Tools/alarmDialog.vue
@@ -1,4 +1,5 @@
-
+ :close-on-click-modal="false">
{{ info.alarmType }}
-
+
报警类型
{{ info.alarmType }}
-
+
设备类型
@@ -82,13 +88,13 @@
-
+
闸井位号
{{ info.tagNumber }}
-
+
闸井名称
@@ -96,22 +102,22 @@
-
+
报警等级
{{ info.alarmLevel }}
-
- 报警值
+
+
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
diff --git a/src/views/home/alarm/current/components/monitorDataDialog.vue b/src/views/home/alarm/current/components/monitorDataDialog.vue
index 9b689c9..666fe82 100644
--- a/src/views/home/alarm/current/components/monitorDataDialog.vue
+++ b/src/views/home/alarm/current/components/monitorDataDialog.vue
@@ -8,6 +8,7 @@
import dayjs from 'dayjs'
import { getMonitorData } from '@/api/home/pipeline/pipeline'
import { exportExcel } from '@/utils/exportXlsx'
+import { handlerSignalStrength } from '@/views/home/device/device/components/handlerData'
const emits = defineEmits(['refresh'])
const dialogFormVisible = ref(false) // 对话框是否显示
const info = ref()
@@ -21,11 +22,12 @@
// 列表展示列
const columns = ref([
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
- { text: '信号强度', value: 'pci', align: 'center', width: 90 },
- { text: '电量(%)', value: 'cell', align: 'center', width: 90 },
- { text: '采集时间', value: 'uptime', align: 'center' },
- { text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ { text: '信号强度', value: 'rsrp', align: 'center', width: 85 },
+ { text: '信号质量', value: 'rsrpName', align: 'center', width: 85 },
+ { text: '电量(%)', value: 'cell', align: 'center', width: 80 },
+ { text: '采集时间', value: 'uptime', align: 'center' },
+ { text: '上传时间', value: 'logtime', align: 'center' },
+ // { text: '设备状态', value: 'status', align: 'center', width: 85, isCustom: true },
])
const listQuery = ref({
upBegTime: '',
@@ -59,9 +61,8 @@
loadingTable.value = true
listQuery.value.typeName = info.value.devTypeName
listQuery.value.devcode = info.value.devcode
- getMonitorData(listQuery.value)
- .then((res) => {
- list.value = res.data.filter((item: any) => !item.alarmRuleValue)
+ getMonitorData(listQuery.value).then((res) => {
+ list.value = res.data.filter((item: any) => !item.alarmRuleValue).map((item: any) => ({...item, rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''}))
// 设置设备状态和燃气浓度标红
const threshold = res.data.filter((item: any) => item.alarmRuleValue)[0]
// console.log(threshold.alarmRuleValue, '阈值')
@@ -214,7 +215,7 @@
-
+
diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue
index 644e9d0..cc197cb 100644
--- a/src/views/home/alarm/current/index.vue
+++ b/src/views/home/alarm/current/index.vue
@@ -21,6 +21,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { getWellListPage } from '@/api/home/well/well'
import { getPipelineListPage } from '@/api/home/pipeline/pipeline'
+import { alarmValue } from './components/dict'
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
const alarmLevelList = ref<{ id: string; name: string; value: string }[]>([]) // 报警等级
@@ -113,31 +114,31 @@
list1.value = res.data.rows.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
})).map((item: any) => ({
...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : item.alarmContent
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
loadingTable.value = false
// // 查询设备类型和厂商
- list1.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- item.watchObject = res.data.rows[0].watchObject
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
@@ -234,7 +235,28 @@
list1.value = data.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
+ // // 查询设备类型和厂商
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
setTimeout(() => {
detail(data[0])
})
@@ -287,7 +309,7 @@
})
setTimeout(() => {
watchMapWidth()
- console.log('开始监听')
+ // console.log('开始监听')
})
}
else {
@@ -313,14 +335,15 @@
window.addEventListener('resize', () => { })
})
// 监听地图宽度
+const observer = ref()
const watchMapWidth = () => {
// 创建一个ResizeObserver实例
- const observer = new ResizeObserver((entries: any) => {
+ observer.value = new ResizeObserver((entries: any) => {
for (const entry of entries) {
// 获取div元素的新高度
const newWidth = entry.contentRect.width
// 执行相应的操作,比如更新UI或调用其他函数
- console.log(`元素新宽度为:${newWidth}`)
+ // console.log(`元素新宽度为:${newWidth}`)
// if (newHeight < 350) {
// tableHeight.value = window.innerHeight - 60 - 50 - 10 - 350 - 98 - 10 - 52 - 10 + (350 - newHeight)
// }
@@ -342,7 +365,7 @@
})
// 监听目标div元素的宽度变化
const targetDiv = document.getElementById('container-table') as Element
- observer.observe(targetDiv)
+ observer.value.observe(targetDiv)
}
// 查看报警
const mapRef = ref()
@@ -397,7 +420,7 @@
else {
let timer = null
timer = setInterval(() => {
- console.log('定时器')
+ // console.log('定时器')
if (mapRef.value?.completeFlag) {
draw()
clearInterval(timer)
@@ -408,7 +431,6 @@
}, 500)
}
// 双击列表行数据
-
const rowClick = (data: any) => {
detail(data)
}
@@ -416,7 +438,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -424,7 +446,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -452,7 +474,7 @@
// 多选
const multipleTable = ref([])
const handleSelectionChange = (val: any) => {
- console.log(val, '多选数据')
+ // console.log(val, '多选数据')
multipleTable.value = val
}
// 导出列表
@@ -489,8 +511,11 @@
).then(() => {
batchDelete(multipleTable.value.map((item: any) => item.id)).then(() => {
ElMessage.success('操作成功')
+ // 清空多选
multipleTable.value = []
+ tableRef.value.clearMulti()
fetchData()
+
})
})
}
@@ -524,16 +549,17 @@
}
const routerTo = (watchObjectName: string, row: any) => {
const watchObject = {
- '闸井': 'WellMonitorDetail',
- '场站': 'StationMonitorDetail',
- '管线': 'PipelineMonitorDetail',
+ 1: 'WellMonitorDetail',
+ 2: 'StationMonitorDetail',
+ 3: 'PipelineMonitorDetail',
} as { [key: string]: string }
// 判断是否有菜单权限
const watchObjectAuth = {
- '闸井': '/well',
- '场站': '/station/monitor',
- '管线': '/pipeline',
+ 1: '/well',
+ 2: '/station/monitor',
+ 3: '/pipeline',
} as { [key: string]: string }
+ // console.log(watchObjectAuth[watchObjectName])
if (!proxy.hasPerm(watchObjectAuth[watchObjectName])) {
ElMessage.warning('没有对应权限菜单')
return
@@ -553,20 +579,20 @@
})
}
// 先找闸井或者管线或者场站
- if (row.watchObject === '闸井') {
+ if (row.watchObject === '1') {
getWellListPage({ offset: 1, limit: 1, tagNumber: row.ledgerNumber, ledgerCode: row.ledgerCode }).then(res => {
if (res.data.rows.length) {
- routerTo('闸井', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('1', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
}
})
}
- else if (row.watchObject === '管线') {
+ else if (row.watchObject === '3') {
getPipelineListPage({ offset: 1, limit: 1, devCode: row.devcode, pipeCode: row.ledgerCode, tagNumber: row.ledgerNumber }).then(res => {
if (res.data.rows.length) {
- routerTo('管线', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('3', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
@@ -579,21 +605,23 @@
onBeforeRouteLeave((to: any) => {
keepSearchParams(to.path, 'CurrentAlarm')
cache.value = tableFlag.value
+ // 销毁ResizeObserver实例
+ observer.value.disconnect()
})
onActivated(() => {
- console.log('需要还原页面')
+ // console.log('需要还原页面')
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
- console.log('需要重新获取列表')
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
+ // console.log('需要重新获取列表')
fetchData()
}
- if(cache.value === 'map') {
- console.log('重置地图')
+ if (cache.value === 'map') {
+ // console.log('重置地图')
tableFlag.value = 'normal'
setTimeout(() => {
switchMode('map')
- if(cacheRow.value.id) {
+ if (cacheRow.value.id) {
detail(cacheRow.value)
}
})
@@ -721,8 +749,8 @@
-
{{ scope.row[column.value] }}
diff --git a/src/views/home/alarm/history/index.vue b/src/views/home/alarm/history/index.vue
index cf27337..ba700c3 100644
--- a/src/views/home/alarm/history/index.vue
+++ b/src/views/home/alarm/history/index.vue
@@ -16,6 +16,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { keepSearchParams } from '@/utils/keepQuery'
import { getDateDiff } from '@/utils/dayjs'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
const $route = useRoute()
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
@@ -40,7 +41,7 @@
const columns = ref([
{ text: '报警类别', value: 'alarmCategory', align: 'center', width: '110' },
{ text: '报警类型', value: 'alarmType', align: 'center', width: '140' },
- { text: '报警原因', value: 'alarmContent', align: 'center' },
+ { text: '报警原因', value: 'alarmReason', align: 'center' },
{ text: '报警等级', value: 'alarmLevelName', align: 'center', width: '90' },
{ text: '位置', value: 'position', align: 'center' },
{ text: '设备编号', value: 'devcode', align: 'center', width: '130', isCustom: true },
@@ -95,32 +96,36 @@
list.value = res.data.rows.map((item: any) => ({
...item,
cancelDuration: item.alarmTime && item.cancelTime ? getDateDiff(item.alarmTime, item.cancelTime) : '' ,
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
+ }))
+ .map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategory.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
total.value = res.data.total
loadingTable.value = false
// 查询设备类型和厂商
- list.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
}
-// 重置查询条件f
+// 重置查询条件
const reset = () => {
datetimerange.value = []
listQuery.value = {
@@ -207,7 +212,6 @@
const data = JSON.parse($route.query.row as string)
if ($route.query.type === 'localAnalyse') {
// 从异常位置分析跳转过来
- console.log(data, '123')
datetimerange.value = [data.begTime, data.endTime]
listQuery.value.position = data.position
}
@@ -223,7 +227,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -231,7 +235,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -258,8 +262,8 @@
})
onActivated(() => {
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
console.log('需要重新获取列表')
fetchData()
}
@@ -341,8 +345,8 @@
-
+
{{ scope.row[column.value] }}
diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue
index 517b906..2f28a39 100644
--- a/src/views/home/dashboard/index.vue
+++ b/src/views/home/dashboard/index.vue
@@ -154,6 +154,7 @@
messageLoading.value = true
getMessage().then((res) => {
messageData.value = res.data.rows
+ console.log(messageData.value, '消息通知')
messageLoading.value = false
}).catch(() => {
messageLoading.value = false
diff --git a/src/views/home/device/device/components/dataSearch.vue b/src/views/home/device/device/components/dataSearch.vue
index 2bef320..612d68d 100644
--- a/src/views/home/device/device/components/dataSearch.vue
+++ b/src/views/home/device/device/components/dataSearch.vue
@@ -11,7 +11,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { exportFile } from '@/utils/exportUtils'
import { toHumpObject } from '@/utils/String'
-import { handlerListData } from './handlerData'
+import { handlerListData, handlerSignalStrength } from './handlerData'
const $route = useRoute()
const listQuery = ref({
devcode: '',
@@ -75,10 +75,11 @@
{ text: '设备编号', value: 'devcode', align: 'center' },
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
{ text: '电量(%)', value: 'cell', align: 'center' },
- { text: '信号强度', value: 'pci', align: 'center' },
+ { text: '信号强度', value: 'rsrp', align: 'center' },
+ { text: '信号质量', value: 'rsrpName', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵
const columns2 = ref([
@@ -87,7 +88,7 @@
{ text: '电池电压(mV)', value: 'vbat', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵-百瑞生
const columns2BRS = ref([
@@ -99,7 +100,7 @@
{ text: '信号质量', value: 'sig', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵-麦哈克
const columns2MHK = ref([
@@ -110,7 +111,7 @@
{ text: '信号质量', value: 'rsrp', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 智能警示桩
const columns3 = ref([
@@ -251,21 +252,21 @@
}
getDataSearch(listQuery.value).then((res) => {
list.value = res.data.map((item: any) => toHumpObject(item))
- if (listQuery.value.typeName === '智能警示桩') {
- const dict = {
- 0: '正常',
- 1: '报警'
- } as { [key: string]: string }
- list.value = list.value.map((item: any) => ({
- ...item,
- pipeInclineAlarm: item.pipeInclineAlarm === '1' || item.pipeInclineAlarm === '0' ? dict[item.pipeInclineAlarm] : item.pipeInclineAlarm,
- pipeBreakAlarm: item.pipeBreakAlarm === '1' || item.pipeBreakAlarm === '0' ? dict[item.pipeBreakAlarm] : item.pipeBreakAlarm,
- leftOffLineAlarm: item.leftOffLineAlarm === '1' || item.leftOffLineAlarm === '0' ? dict[item.leftOffLineAlarm] : item.leftOffLineAlarm,
- leftVibrateAlarm: item.leftVibrateAlarm === '1' || item.leftVibrateAlarm === '0' ? dict[item.leftVibrateAlarm] : item.leftVibrateAlarm,
- rightOffLineAlarm: item.rightOffLineAlarm === '1' || item.rightOffLineAlarm === '0' ? dict[item.rightOffLineAlarm] : item.rightOffLineAlarm,
- rightVibrateAlarm: item.rightVibrateAlarm === '1' || item.rightVibrateAlarm === '0' ? dict[item.rightVibrateAlarm] : item.rightVibrateAlarm,
- }))
- }
+ // if (listQuery.value.typeName === '智能警示桩') {
+ // const dict = {
+ // 0: '正常',
+ // 1: '报警'
+ // } as { [key: string]: string }
+ // list.value = list.value.map((item: any) => ({
+ // ...item,
+ // pipeInclineAlarm: item.pipeInclineAlarm === '1' || item.pipeInclineAlarm === '0' ? dict[item.pipeInclineAlarm] : item.pipeInclineAlarm,
+ // pipeBreakAlarm: item.pipeBreakAlarm === '1' || item.pipeBreakAlarm === '0' ? dict[item.pipeBreakAlarm] : item.pipeBreakAlarm,
+ // leftOffLineAlarm: item.leftOffLineAlarm === '1' || item.leftOffLineAlarm === '0' ? dict[item.leftOffLineAlarm] : item.leftOffLineAlarm,
+ // leftVibrateAlarm: item.leftVibrateAlarm === '1' || item.leftVibrateAlarm === '0' ? dict[item.leftVibrateAlarm] : item.leftVibrateAlarm,
+ // rightOffLineAlarm: item.rightOffLineAlarm === '1' || item.rightOffLineAlarm === '0' ? dict[item.rightOffLineAlarm] : item.rightOffLineAlarm,
+ // rightVibrateAlarm: item.rightVibrateAlarm === '1' || item.rightVibrateAlarm === '0' ? dict[item.rightVibrateAlarm] : item.rightVibrateAlarm,
+ // }))
+ // }
if (listQuery.value.typeName === '智能警示桩') {
const dict = {
0: '正常',
@@ -285,7 +286,8 @@
if (!listQuery.value.typeName || listQuery.value.typeName.includes('燃气智能监测终端')) {
list.value = list.value.map((item: any) => ({
...item,
- status: handlerthresholdFun(item.strength, handlerthreshold.value.map((item: any) => item.alarmThreshold))
+ status: handlerthresholdFun(item.strength, handlerthreshold.value.map((item: any) => item.alarmThreshold)),
+ rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''
}))
chartData.value = [
{
diff --git a/src/views/home/device/device/components/handlerData.ts b/src/views/home/device/device/components/handlerData.ts
index e09c666..3cbc926 100644
--- a/src/views/home/device/device/components/handlerData.ts
+++ b/src/views/home/device/device/components/handlerData.ts
@@ -1,11 +1,43 @@
+
+// 处理信号强度
+export const handlerSignalStrength = (rsrp: number) => {
+ 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
+ }
+ return rsrpDict(rsrp)
+}
// 处理百瑞生和麦哈克数据
export const handlerListData = (manufactureName: string, list: any[], fun: Function) => {
// 百瑞生
if (manufactureName.includes('百瑞生')) {
- // console.log(list.value, '百瑞生')
const ssStateDict = {
0: '正常',
- 1: '通讯异常'
+ 39: '通讯异常'
} as { [key: string]: string }
const sigDict = {
1: '信号弱',
@@ -14,9 +46,9 @@
} as { [key: string]: string }
list = list.map((item: any) => ({
...item,
- ssState: ssStateDict[item.ssState] ? ssStateDict[item.ssState] : '', //传感器状态
+ ssState: ssStateDict[item.ssState] ? ssStateDict[item.ssState] : '', // 传感器状态
sig: sigDict[item.sig] ? sigDict[item.sig] : '', // 信号强度
- temp: item.temp ? Number(item.temp) / 100 : '' // 温度 扩大100倍传输
+ temp: item.temp ? Number(item.temp) : '' // 温度
}))
fun(list)
}
@@ -27,38 +59,11 @@
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)) : '', // 接收信号参考质量
+ rsrp: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : '', // 接收信号参考质量
}))
fun(list)
}
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index e5dfdb4..21f93d6 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -45,7 +45,7 @@
geocoder.getAddress(lnglat, (status: any, result: any) => {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
- console.log(result.regeocode.formattedAddress)
+ // console.log(result.regeocode.formattedAddress)
position = result.regeocode.formattedAddress
resultFun(position)
}
@@ -103,7 +103,7 @@
plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap1: any) => {
- console.log($props.center, '$props.center')
+ // console.log($props.center, '$props.center')
console.log($props.center && $props.center?.length === 2 && !isNaN($props.center[0]) && !isNaN($props.center[1]) ? $props.center : [116.397428, 39.90923])
AMap.value = AMap1
// 初始化地图
@@ -161,7 +161,7 @@
const flag = '00000000'
const zz = c
const z = `L${String(zz).length === 1 ? `0${zz}` : zz}`
- console.log(zz, 'zz')
+ // console.log(zz, 'zz')
const xx = a.toString(16)
const x = `C${flag.substring(0, 8 - xx.length)}${xx}`
const yy = b.toString(16)
@@ -452,7 +452,7 @@
...data.style,
})
polyline.on('click', (e) => {
- console.log('点击了线')
+ // console.log('点击了线')
$emits('lineClick', { event: e, map: map.value, data, polyline })
})
// console.log(polyline, 'polyline')
@@ -532,7 +532,7 @@
const MarkerAllCluster = ref([]) // 点聚合数组
const cluster = ref()
// 添加点聚合
-const addCluster = (points) => {
+const addCluster = (points,styleList) => {
// console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points')
var count = points.length
var _renderClusterMarker = function (context) {
@@ -563,8 +563,7 @@
}
const _renderMarker = (context: any) => {
const data = context.data[0]
- // console.log(data, 'data')
- const style = [
+ let style = [
{
url: `${publicPath}/image/well/well-normal.png`, // 图标地址
},
@@ -578,6 +577,9 @@
url: `${publicPath}/image/well/well-will.png`, // 图标地址
},
]
+ if(styleList) {
+ style = styleList
+ }
const markerHtml = `
`
var offset = new AMap.value.Pixel(-9, -9)
context.marker.setContent(markerHtml)
@@ -630,7 +632,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
@@ -644,7 +646,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue
index d85779c..c748666 100644
--- a/src/layouts/components/Tools/alarmDialog.vue
+++ b/src/layouts/components/Tools/alarmDialog.vue
@@ -1,4 +1,5 @@
-
+ :close-on-click-modal="false">
{{ info.alarmType }}
-
+
报警类型
{{ info.alarmType }}
-
+
设备类型
@@ -82,13 +88,13 @@
-
+
闸井位号
{{ info.tagNumber }}
-
+
闸井名称
@@ -96,22 +102,22 @@
-
+
报警等级
{{ info.alarmLevel }}
-
- 报警值
+
+
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
diff --git a/src/views/home/alarm/current/components/monitorDataDialog.vue b/src/views/home/alarm/current/components/monitorDataDialog.vue
index 9b689c9..666fe82 100644
--- a/src/views/home/alarm/current/components/monitorDataDialog.vue
+++ b/src/views/home/alarm/current/components/monitorDataDialog.vue
@@ -8,6 +8,7 @@
import dayjs from 'dayjs'
import { getMonitorData } from '@/api/home/pipeline/pipeline'
import { exportExcel } from '@/utils/exportXlsx'
+import { handlerSignalStrength } from '@/views/home/device/device/components/handlerData'
const emits = defineEmits(['refresh'])
const dialogFormVisible = ref(false) // 对话框是否显示
const info = ref()
@@ -21,11 +22,12 @@
// 列表展示列
const columns = ref([
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
- { text: '信号强度', value: 'pci', align: 'center', width: 90 },
- { text: '电量(%)', value: 'cell', align: 'center', width: 90 },
- { text: '采集时间', value: 'uptime', align: 'center' },
- { text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ { text: '信号强度', value: 'rsrp', align: 'center', width: 85 },
+ { text: '信号质量', value: 'rsrpName', align: 'center', width: 85 },
+ { text: '电量(%)', value: 'cell', align: 'center', width: 80 },
+ { text: '采集时间', value: 'uptime', align: 'center' },
+ { text: '上传时间', value: 'logtime', align: 'center' },
+ // { text: '设备状态', value: 'status', align: 'center', width: 85, isCustom: true },
])
const listQuery = ref({
upBegTime: '',
@@ -59,9 +61,8 @@
loadingTable.value = true
listQuery.value.typeName = info.value.devTypeName
listQuery.value.devcode = info.value.devcode
- getMonitorData(listQuery.value)
- .then((res) => {
- list.value = res.data.filter((item: any) => !item.alarmRuleValue)
+ getMonitorData(listQuery.value).then((res) => {
+ list.value = res.data.filter((item: any) => !item.alarmRuleValue).map((item: any) => ({...item, rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''}))
// 设置设备状态和燃气浓度标红
const threshold = res.data.filter((item: any) => item.alarmRuleValue)[0]
// console.log(threshold.alarmRuleValue, '阈值')
@@ -214,7 +215,7 @@
-
+
diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue
index 644e9d0..cc197cb 100644
--- a/src/views/home/alarm/current/index.vue
+++ b/src/views/home/alarm/current/index.vue
@@ -21,6 +21,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { getWellListPage } from '@/api/home/well/well'
import { getPipelineListPage } from '@/api/home/pipeline/pipeline'
+import { alarmValue } from './components/dict'
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
const alarmLevelList = ref<{ id: string; name: string; value: string }[]>([]) // 报警等级
@@ -113,31 +114,31 @@
list1.value = res.data.rows.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
})).map((item: any) => ({
...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : item.alarmContent
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
loadingTable.value = false
// // 查询设备类型和厂商
- list1.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- item.watchObject = res.data.rows[0].watchObject
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
@@ -234,7 +235,28 @@
list1.value = data.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
+ // // 查询设备类型和厂商
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
setTimeout(() => {
detail(data[0])
})
@@ -287,7 +309,7 @@
})
setTimeout(() => {
watchMapWidth()
- console.log('开始监听')
+ // console.log('开始监听')
})
}
else {
@@ -313,14 +335,15 @@
window.addEventListener('resize', () => { })
})
// 监听地图宽度
+const observer = ref()
const watchMapWidth = () => {
// 创建一个ResizeObserver实例
- const observer = new ResizeObserver((entries: any) => {
+ observer.value = new ResizeObserver((entries: any) => {
for (const entry of entries) {
// 获取div元素的新高度
const newWidth = entry.contentRect.width
// 执行相应的操作,比如更新UI或调用其他函数
- console.log(`元素新宽度为:${newWidth}`)
+ // console.log(`元素新宽度为:${newWidth}`)
// if (newHeight < 350) {
// tableHeight.value = window.innerHeight - 60 - 50 - 10 - 350 - 98 - 10 - 52 - 10 + (350 - newHeight)
// }
@@ -342,7 +365,7 @@
})
// 监听目标div元素的宽度变化
const targetDiv = document.getElementById('container-table') as Element
- observer.observe(targetDiv)
+ observer.value.observe(targetDiv)
}
// 查看报警
const mapRef = ref()
@@ -397,7 +420,7 @@
else {
let timer = null
timer = setInterval(() => {
- console.log('定时器')
+ // console.log('定时器')
if (mapRef.value?.completeFlag) {
draw()
clearInterval(timer)
@@ -408,7 +431,6 @@
}, 500)
}
// 双击列表行数据
-
const rowClick = (data: any) => {
detail(data)
}
@@ -416,7 +438,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -424,7 +446,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -452,7 +474,7 @@
// 多选
const multipleTable = ref([])
const handleSelectionChange = (val: any) => {
- console.log(val, '多选数据')
+ // console.log(val, '多选数据')
multipleTable.value = val
}
// 导出列表
@@ -489,8 +511,11 @@
).then(() => {
batchDelete(multipleTable.value.map((item: any) => item.id)).then(() => {
ElMessage.success('操作成功')
+ // 清空多选
multipleTable.value = []
+ tableRef.value.clearMulti()
fetchData()
+
})
})
}
@@ -524,16 +549,17 @@
}
const routerTo = (watchObjectName: string, row: any) => {
const watchObject = {
- '闸井': 'WellMonitorDetail',
- '场站': 'StationMonitorDetail',
- '管线': 'PipelineMonitorDetail',
+ 1: 'WellMonitorDetail',
+ 2: 'StationMonitorDetail',
+ 3: 'PipelineMonitorDetail',
} as { [key: string]: string }
// 判断是否有菜单权限
const watchObjectAuth = {
- '闸井': '/well',
- '场站': '/station/monitor',
- '管线': '/pipeline',
+ 1: '/well',
+ 2: '/station/monitor',
+ 3: '/pipeline',
} as { [key: string]: string }
+ // console.log(watchObjectAuth[watchObjectName])
if (!proxy.hasPerm(watchObjectAuth[watchObjectName])) {
ElMessage.warning('没有对应权限菜单')
return
@@ -553,20 +579,20 @@
})
}
// 先找闸井或者管线或者场站
- if (row.watchObject === '闸井') {
+ if (row.watchObject === '1') {
getWellListPage({ offset: 1, limit: 1, tagNumber: row.ledgerNumber, ledgerCode: row.ledgerCode }).then(res => {
if (res.data.rows.length) {
- routerTo('闸井', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('1', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
}
})
}
- else if (row.watchObject === '管线') {
+ else if (row.watchObject === '3') {
getPipelineListPage({ offset: 1, limit: 1, devCode: row.devcode, pipeCode: row.ledgerCode, tagNumber: row.ledgerNumber }).then(res => {
if (res.data.rows.length) {
- routerTo('管线', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('3', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
@@ -579,21 +605,23 @@
onBeforeRouteLeave((to: any) => {
keepSearchParams(to.path, 'CurrentAlarm')
cache.value = tableFlag.value
+ // 销毁ResizeObserver实例
+ observer.value.disconnect()
})
onActivated(() => {
- console.log('需要还原页面')
+ // console.log('需要还原页面')
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
- console.log('需要重新获取列表')
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
+ // console.log('需要重新获取列表')
fetchData()
}
- if(cache.value === 'map') {
- console.log('重置地图')
+ if (cache.value === 'map') {
+ // console.log('重置地图')
tableFlag.value = 'normal'
setTimeout(() => {
switchMode('map')
- if(cacheRow.value.id) {
+ if (cacheRow.value.id) {
detail(cacheRow.value)
}
})
@@ -721,8 +749,8 @@
-
{{ scope.row[column.value] }}
diff --git a/src/views/home/alarm/history/index.vue b/src/views/home/alarm/history/index.vue
index cf27337..ba700c3 100644
--- a/src/views/home/alarm/history/index.vue
+++ b/src/views/home/alarm/history/index.vue
@@ -16,6 +16,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { keepSearchParams } from '@/utils/keepQuery'
import { getDateDiff } from '@/utils/dayjs'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
const $route = useRoute()
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
@@ -40,7 +41,7 @@
const columns = ref([
{ text: '报警类别', value: 'alarmCategory', align: 'center', width: '110' },
{ text: '报警类型', value: 'alarmType', align: 'center', width: '140' },
- { text: '报警原因', value: 'alarmContent', align: 'center' },
+ { text: '报警原因', value: 'alarmReason', align: 'center' },
{ text: '报警等级', value: 'alarmLevelName', align: 'center', width: '90' },
{ text: '位置', value: 'position', align: 'center' },
{ text: '设备编号', value: 'devcode', align: 'center', width: '130', isCustom: true },
@@ -95,32 +96,36 @@
list.value = res.data.rows.map((item: any) => ({
...item,
cancelDuration: item.alarmTime && item.cancelTime ? getDateDiff(item.alarmTime, item.cancelTime) : '' ,
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
+ }))
+ .map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategory.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
total.value = res.data.total
loadingTable.value = false
// 查询设备类型和厂商
- list.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
}
-// 重置查询条件f
+// 重置查询条件
const reset = () => {
datetimerange.value = []
listQuery.value = {
@@ -207,7 +212,6 @@
const data = JSON.parse($route.query.row as string)
if ($route.query.type === 'localAnalyse') {
// 从异常位置分析跳转过来
- console.log(data, '123')
datetimerange.value = [data.begTime, data.endTime]
listQuery.value.position = data.position
}
@@ -223,7 +227,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -231,7 +235,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -258,8 +262,8 @@
})
onActivated(() => {
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
console.log('需要重新获取列表')
fetchData()
}
@@ -341,8 +345,8 @@
-
+
{{ scope.row[column.value] }}
diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue
index 517b906..2f28a39 100644
--- a/src/views/home/dashboard/index.vue
+++ b/src/views/home/dashboard/index.vue
@@ -154,6 +154,7 @@
messageLoading.value = true
getMessage().then((res) => {
messageData.value = res.data.rows
+ console.log(messageData.value, '消息通知')
messageLoading.value = false
}).catch(() => {
messageLoading.value = false
diff --git a/src/views/home/device/device/components/dataSearch.vue b/src/views/home/device/device/components/dataSearch.vue
index 2bef320..612d68d 100644
--- a/src/views/home/device/device/components/dataSearch.vue
+++ b/src/views/home/device/device/components/dataSearch.vue
@@ -11,7 +11,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { exportFile } from '@/utils/exportUtils'
import { toHumpObject } from '@/utils/String'
-import { handlerListData } from './handlerData'
+import { handlerListData, handlerSignalStrength } from './handlerData'
const $route = useRoute()
const listQuery = ref({
devcode: '',
@@ -75,10 +75,11 @@
{ text: '设备编号', value: 'devcode', align: 'center' },
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
{ text: '电量(%)', value: 'cell', align: 'center' },
- { text: '信号强度', value: 'pci', align: 'center' },
+ { text: '信号强度', value: 'rsrp', align: 'center' },
+ { text: '信号质量', value: 'rsrpName', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵
const columns2 = ref([
@@ -87,7 +88,7 @@
{ text: '电池电压(mV)', value: 'vbat', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵-百瑞生
const columns2BRS = ref([
@@ -99,7 +100,7 @@
{ text: '信号质量', value: 'sig', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵-麦哈克
const columns2MHK = ref([
@@ -110,7 +111,7 @@
{ text: '信号质量', value: 'rsrp', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 智能警示桩
const columns3 = ref([
@@ -251,21 +252,21 @@
}
getDataSearch(listQuery.value).then((res) => {
list.value = res.data.map((item: any) => toHumpObject(item))
- if (listQuery.value.typeName === '智能警示桩') {
- const dict = {
- 0: '正常',
- 1: '报警'
- } as { [key: string]: string }
- list.value = list.value.map((item: any) => ({
- ...item,
- pipeInclineAlarm: item.pipeInclineAlarm === '1' || item.pipeInclineAlarm === '0' ? dict[item.pipeInclineAlarm] : item.pipeInclineAlarm,
- pipeBreakAlarm: item.pipeBreakAlarm === '1' || item.pipeBreakAlarm === '0' ? dict[item.pipeBreakAlarm] : item.pipeBreakAlarm,
- leftOffLineAlarm: item.leftOffLineAlarm === '1' || item.leftOffLineAlarm === '0' ? dict[item.leftOffLineAlarm] : item.leftOffLineAlarm,
- leftVibrateAlarm: item.leftVibrateAlarm === '1' || item.leftVibrateAlarm === '0' ? dict[item.leftVibrateAlarm] : item.leftVibrateAlarm,
- rightOffLineAlarm: item.rightOffLineAlarm === '1' || item.rightOffLineAlarm === '0' ? dict[item.rightOffLineAlarm] : item.rightOffLineAlarm,
- rightVibrateAlarm: item.rightVibrateAlarm === '1' || item.rightVibrateAlarm === '0' ? dict[item.rightVibrateAlarm] : item.rightVibrateAlarm,
- }))
- }
+ // if (listQuery.value.typeName === '智能警示桩') {
+ // const dict = {
+ // 0: '正常',
+ // 1: '报警'
+ // } as { [key: string]: string }
+ // list.value = list.value.map((item: any) => ({
+ // ...item,
+ // pipeInclineAlarm: item.pipeInclineAlarm === '1' || item.pipeInclineAlarm === '0' ? dict[item.pipeInclineAlarm] : item.pipeInclineAlarm,
+ // pipeBreakAlarm: item.pipeBreakAlarm === '1' || item.pipeBreakAlarm === '0' ? dict[item.pipeBreakAlarm] : item.pipeBreakAlarm,
+ // leftOffLineAlarm: item.leftOffLineAlarm === '1' || item.leftOffLineAlarm === '0' ? dict[item.leftOffLineAlarm] : item.leftOffLineAlarm,
+ // leftVibrateAlarm: item.leftVibrateAlarm === '1' || item.leftVibrateAlarm === '0' ? dict[item.leftVibrateAlarm] : item.leftVibrateAlarm,
+ // rightOffLineAlarm: item.rightOffLineAlarm === '1' || item.rightOffLineAlarm === '0' ? dict[item.rightOffLineAlarm] : item.rightOffLineAlarm,
+ // rightVibrateAlarm: item.rightVibrateAlarm === '1' || item.rightVibrateAlarm === '0' ? dict[item.rightVibrateAlarm] : item.rightVibrateAlarm,
+ // }))
+ // }
if (listQuery.value.typeName === '智能警示桩') {
const dict = {
0: '正常',
@@ -285,7 +286,8 @@
if (!listQuery.value.typeName || listQuery.value.typeName.includes('燃气智能监测终端')) {
list.value = list.value.map((item: any) => ({
...item,
- status: handlerthresholdFun(item.strength, handlerthreshold.value.map((item: any) => item.alarmThreshold))
+ status: handlerthresholdFun(item.strength, handlerthreshold.value.map((item: any) => item.alarmThreshold)),
+ rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''
}))
chartData.value = [
{
diff --git a/src/views/home/device/device/components/handlerData.ts b/src/views/home/device/device/components/handlerData.ts
index e09c666..3cbc926 100644
--- a/src/views/home/device/device/components/handlerData.ts
+++ b/src/views/home/device/device/components/handlerData.ts
@@ -1,11 +1,43 @@
+
+// 处理信号强度
+export const handlerSignalStrength = (rsrp: number) => {
+ 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
+ }
+ return rsrpDict(rsrp)
+}
// 处理百瑞生和麦哈克数据
export const handlerListData = (manufactureName: string, list: any[], fun: Function) => {
// 百瑞生
if (manufactureName.includes('百瑞生')) {
- // console.log(list.value, '百瑞生')
const ssStateDict = {
0: '正常',
- 1: '通讯异常'
+ 39: '通讯异常'
} as { [key: string]: string }
const sigDict = {
1: '信号弱',
@@ -14,9 +46,9 @@
} as { [key: string]: string }
list = list.map((item: any) => ({
...item,
- ssState: ssStateDict[item.ssState] ? ssStateDict[item.ssState] : '', //传感器状态
+ ssState: ssStateDict[item.ssState] ? ssStateDict[item.ssState] : '', // 传感器状态
sig: sigDict[item.sig] ? sigDict[item.sig] : '', // 信号强度
- temp: item.temp ? Number(item.temp) / 100 : '' // 温度 扩大100倍传输
+ temp: item.temp ? Number(item.temp) : '' // 温度
}))
fun(list)
}
@@ -27,38 +59,11 @@
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)) : '', // 接收信号参考质量
+ rsrp: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : '', // 接收信号参考质量
}))
fun(list)
}
diff --git a/src/views/home/device/device/components/localtionForPieple.vue b/src/views/home/device/device/components/localtionForPieple.vue
index f8c504d..f42d999 100644
--- a/src/views/home/device/device/components/localtionForPieple.vue
+++ b/src/views/home/device/device/components/localtionForPieple.vue
@@ -10,6 +10,7 @@
import { addPosition, editPosition, getPositionListPage } from '@/api/home/device/device'
import { getPiePleListPage } from '@/api/home/ledger/pipeline'
import AMap from '@/components/map/index.vue'
+// import { getDictByCode } from '@/api/system/dict'
import { getLocation } from '@/utils/getLocation'
const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 对话框是否显示
@@ -27,6 +28,7 @@
position: '', // 详细位置
deptid: '', // 管理单位
pipeCode: '', // 关联管线
+ locationCategory: '',
}) // 表单
const rules: FormRules = {
tagNumber: [{ required: true, message: '安装位号不能为空', trigger: ['blur', 'change'] }],
@@ -309,7 +311,8 @@
position: dataForm.value.position,
tagNumber: dataForm.value.tagNumber,
id: data.id,
- type: '3'
+ type: '3',
+ locationCategory: dataForm.value.locationCategory
}).then(res => {
ElMessage.success('编辑点位成功')
emits('confirm', result, 'single')
@@ -332,7 +335,8 @@
pipeCode: dataForm.value.pipeCode,
position: dataForm.value.position,
tagNumber: dataForm.value.tagNumber,
- type: '3'
+ type: '3',
+ locationCategory: dataForm.value.locationCategory
}).then((res) => {
if (res.code === 200) {
ElMessage.success('新建点位成功')
@@ -377,6 +381,7 @@
}
const pipeList = ref<{ id: string; name: string; value: string }[]>([]) // 管线列表
+const locationTypeList = ref<{ id: string; name: string; value: string }[]>([])
// 获取字典
const fetchDict = () => {
getPiePleListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -386,6 +391,9 @@
value: item.pipeCode,
}))
})
+ getDictByCode('locationType').then((res) => {
+ locationTypeList.value = res.data
+ })
}
fetchDict()
@@ -396,20 +404,27 @@
-
+
-
+
+
+
+
+
+
+
+
-
+
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index e5dfdb4..21f93d6 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -45,7 +45,7 @@
geocoder.getAddress(lnglat, (status: any, result: any) => {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
- console.log(result.regeocode.formattedAddress)
+ // console.log(result.regeocode.formattedAddress)
position = result.regeocode.formattedAddress
resultFun(position)
}
@@ -103,7 +103,7 @@
plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap1: any) => {
- console.log($props.center, '$props.center')
+ // console.log($props.center, '$props.center')
console.log($props.center && $props.center?.length === 2 && !isNaN($props.center[0]) && !isNaN($props.center[1]) ? $props.center : [116.397428, 39.90923])
AMap.value = AMap1
// 初始化地图
@@ -161,7 +161,7 @@
const flag = '00000000'
const zz = c
const z = `L${String(zz).length === 1 ? `0${zz}` : zz}`
- console.log(zz, 'zz')
+ // console.log(zz, 'zz')
const xx = a.toString(16)
const x = `C${flag.substring(0, 8 - xx.length)}${xx}`
const yy = b.toString(16)
@@ -452,7 +452,7 @@
...data.style,
})
polyline.on('click', (e) => {
- console.log('点击了线')
+ // console.log('点击了线')
$emits('lineClick', { event: e, map: map.value, data, polyline })
})
// console.log(polyline, 'polyline')
@@ -532,7 +532,7 @@
const MarkerAllCluster = ref([]) // 点聚合数组
const cluster = ref()
// 添加点聚合
-const addCluster = (points) => {
+const addCluster = (points,styleList) => {
// console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points')
var count = points.length
var _renderClusterMarker = function (context) {
@@ -563,8 +563,7 @@
}
const _renderMarker = (context: any) => {
const data = context.data[0]
- // console.log(data, 'data')
- const style = [
+ let style = [
{
url: `${publicPath}/image/well/well-normal.png`, // 图标地址
},
@@ -578,6 +577,9 @@
url: `${publicPath}/image/well/well-will.png`, // 图标地址
},
]
+ if(styleList) {
+ style = styleList
+ }
const markerHtml = `
`
var offset = new AMap.value.Pixel(-9, -9)
context.marker.setContent(markerHtml)
@@ -630,7 +632,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
@@ -644,7 +646,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue
index d85779c..c748666 100644
--- a/src/layouts/components/Tools/alarmDialog.vue
+++ b/src/layouts/components/Tools/alarmDialog.vue
@@ -1,4 +1,5 @@
-
+ :close-on-click-modal="false">
{{ info.alarmType }}
-
+
报警类型
{{ info.alarmType }}
-
+
设备类型
@@ -82,13 +88,13 @@
-
+
闸井位号
{{ info.tagNumber }}
-
+
闸井名称
@@ -96,22 +102,22 @@
-
+
报警等级
{{ info.alarmLevel }}
-
- 报警值
+
+
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
diff --git a/src/views/home/alarm/current/components/monitorDataDialog.vue b/src/views/home/alarm/current/components/monitorDataDialog.vue
index 9b689c9..666fe82 100644
--- a/src/views/home/alarm/current/components/monitorDataDialog.vue
+++ b/src/views/home/alarm/current/components/monitorDataDialog.vue
@@ -8,6 +8,7 @@
import dayjs from 'dayjs'
import { getMonitorData } from '@/api/home/pipeline/pipeline'
import { exportExcel } from '@/utils/exportXlsx'
+import { handlerSignalStrength } from '@/views/home/device/device/components/handlerData'
const emits = defineEmits(['refresh'])
const dialogFormVisible = ref(false) // 对话框是否显示
const info = ref()
@@ -21,11 +22,12 @@
// 列表展示列
const columns = ref([
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
- { text: '信号强度', value: 'pci', align: 'center', width: 90 },
- { text: '电量(%)', value: 'cell', align: 'center', width: 90 },
- { text: '采集时间', value: 'uptime', align: 'center' },
- { text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ { text: '信号强度', value: 'rsrp', align: 'center', width: 85 },
+ { text: '信号质量', value: 'rsrpName', align: 'center', width: 85 },
+ { text: '电量(%)', value: 'cell', align: 'center', width: 80 },
+ { text: '采集时间', value: 'uptime', align: 'center' },
+ { text: '上传时间', value: 'logtime', align: 'center' },
+ // { text: '设备状态', value: 'status', align: 'center', width: 85, isCustom: true },
])
const listQuery = ref({
upBegTime: '',
@@ -59,9 +61,8 @@
loadingTable.value = true
listQuery.value.typeName = info.value.devTypeName
listQuery.value.devcode = info.value.devcode
- getMonitorData(listQuery.value)
- .then((res) => {
- list.value = res.data.filter((item: any) => !item.alarmRuleValue)
+ getMonitorData(listQuery.value).then((res) => {
+ list.value = res.data.filter((item: any) => !item.alarmRuleValue).map((item: any) => ({...item, rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''}))
// 设置设备状态和燃气浓度标红
const threshold = res.data.filter((item: any) => item.alarmRuleValue)[0]
// console.log(threshold.alarmRuleValue, '阈值')
@@ -214,7 +215,7 @@
-
+
diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue
index 644e9d0..cc197cb 100644
--- a/src/views/home/alarm/current/index.vue
+++ b/src/views/home/alarm/current/index.vue
@@ -21,6 +21,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { getWellListPage } from '@/api/home/well/well'
import { getPipelineListPage } from '@/api/home/pipeline/pipeline'
+import { alarmValue } from './components/dict'
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
const alarmLevelList = ref<{ id: string; name: string; value: string }[]>([]) // 报警等级
@@ -113,31 +114,31 @@
list1.value = res.data.rows.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
})).map((item: any) => ({
...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : item.alarmContent
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
loadingTable.value = false
// // 查询设备类型和厂商
- list1.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- item.watchObject = res.data.rows[0].watchObject
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
@@ -234,7 +235,28 @@
list1.value = data.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
+ // // 查询设备类型和厂商
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
setTimeout(() => {
detail(data[0])
})
@@ -287,7 +309,7 @@
})
setTimeout(() => {
watchMapWidth()
- console.log('开始监听')
+ // console.log('开始监听')
})
}
else {
@@ -313,14 +335,15 @@
window.addEventListener('resize', () => { })
})
// 监听地图宽度
+const observer = ref()
const watchMapWidth = () => {
// 创建一个ResizeObserver实例
- const observer = new ResizeObserver((entries: any) => {
+ observer.value = new ResizeObserver((entries: any) => {
for (const entry of entries) {
// 获取div元素的新高度
const newWidth = entry.contentRect.width
// 执行相应的操作,比如更新UI或调用其他函数
- console.log(`元素新宽度为:${newWidth}`)
+ // console.log(`元素新宽度为:${newWidth}`)
// if (newHeight < 350) {
// tableHeight.value = window.innerHeight - 60 - 50 - 10 - 350 - 98 - 10 - 52 - 10 + (350 - newHeight)
// }
@@ -342,7 +365,7 @@
})
// 监听目标div元素的宽度变化
const targetDiv = document.getElementById('container-table') as Element
- observer.observe(targetDiv)
+ observer.value.observe(targetDiv)
}
// 查看报警
const mapRef = ref()
@@ -397,7 +420,7 @@
else {
let timer = null
timer = setInterval(() => {
- console.log('定时器')
+ // console.log('定时器')
if (mapRef.value?.completeFlag) {
draw()
clearInterval(timer)
@@ -408,7 +431,6 @@
}, 500)
}
// 双击列表行数据
-
const rowClick = (data: any) => {
detail(data)
}
@@ -416,7 +438,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -424,7 +446,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -452,7 +474,7 @@
// 多选
const multipleTable = ref([])
const handleSelectionChange = (val: any) => {
- console.log(val, '多选数据')
+ // console.log(val, '多选数据')
multipleTable.value = val
}
// 导出列表
@@ -489,8 +511,11 @@
).then(() => {
batchDelete(multipleTable.value.map((item: any) => item.id)).then(() => {
ElMessage.success('操作成功')
+ // 清空多选
multipleTable.value = []
+ tableRef.value.clearMulti()
fetchData()
+
})
})
}
@@ -524,16 +549,17 @@
}
const routerTo = (watchObjectName: string, row: any) => {
const watchObject = {
- '闸井': 'WellMonitorDetail',
- '场站': 'StationMonitorDetail',
- '管线': 'PipelineMonitorDetail',
+ 1: 'WellMonitorDetail',
+ 2: 'StationMonitorDetail',
+ 3: 'PipelineMonitorDetail',
} as { [key: string]: string }
// 判断是否有菜单权限
const watchObjectAuth = {
- '闸井': '/well',
- '场站': '/station/monitor',
- '管线': '/pipeline',
+ 1: '/well',
+ 2: '/station/monitor',
+ 3: '/pipeline',
} as { [key: string]: string }
+ // console.log(watchObjectAuth[watchObjectName])
if (!proxy.hasPerm(watchObjectAuth[watchObjectName])) {
ElMessage.warning('没有对应权限菜单')
return
@@ -553,20 +579,20 @@
})
}
// 先找闸井或者管线或者场站
- if (row.watchObject === '闸井') {
+ if (row.watchObject === '1') {
getWellListPage({ offset: 1, limit: 1, tagNumber: row.ledgerNumber, ledgerCode: row.ledgerCode }).then(res => {
if (res.data.rows.length) {
- routerTo('闸井', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('1', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
}
})
}
- else if (row.watchObject === '管线') {
+ else if (row.watchObject === '3') {
getPipelineListPage({ offset: 1, limit: 1, devCode: row.devcode, pipeCode: row.ledgerCode, tagNumber: row.ledgerNumber }).then(res => {
if (res.data.rows.length) {
- routerTo('管线', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('3', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
@@ -579,21 +605,23 @@
onBeforeRouteLeave((to: any) => {
keepSearchParams(to.path, 'CurrentAlarm')
cache.value = tableFlag.value
+ // 销毁ResizeObserver实例
+ observer.value.disconnect()
})
onActivated(() => {
- console.log('需要还原页面')
+ // console.log('需要还原页面')
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
- console.log('需要重新获取列表')
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
+ // console.log('需要重新获取列表')
fetchData()
}
- if(cache.value === 'map') {
- console.log('重置地图')
+ if (cache.value === 'map') {
+ // console.log('重置地图')
tableFlag.value = 'normal'
setTimeout(() => {
switchMode('map')
- if(cacheRow.value.id) {
+ if (cacheRow.value.id) {
detail(cacheRow.value)
}
})
@@ -721,8 +749,8 @@
-
{{ scope.row[column.value] }}
diff --git a/src/views/home/alarm/history/index.vue b/src/views/home/alarm/history/index.vue
index cf27337..ba700c3 100644
--- a/src/views/home/alarm/history/index.vue
+++ b/src/views/home/alarm/history/index.vue
@@ -16,6 +16,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { keepSearchParams } from '@/utils/keepQuery'
import { getDateDiff } from '@/utils/dayjs'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
const $route = useRoute()
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
@@ -40,7 +41,7 @@
const columns = ref([
{ text: '报警类别', value: 'alarmCategory', align: 'center', width: '110' },
{ text: '报警类型', value: 'alarmType', align: 'center', width: '140' },
- { text: '报警原因', value: 'alarmContent', align: 'center' },
+ { text: '报警原因', value: 'alarmReason', align: 'center' },
{ text: '报警等级', value: 'alarmLevelName', align: 'center', width: '90' },
{ text: '位置', value: 'position', align: 'center' },
{ text: '设备编号', value: 'devcode', align: 'center', width: '130', isCustom: true },
@@ -95,32 +96,36 @@
list.value = res.data.rows.map((item: any) => ({
...item,
cancelDuration: item.alarmTime && item.cancelTime ? getDateDiff(item.alarmTime, item.cancelTime) : '' ,
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
+ }))
+ .map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategory.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
total.value = res.data.total
loadingTable.value = false
// 查询设备类型和厂商
- list.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
}
-// 重置查询条件f
+// 重置查询条件
const reset = () => {
datetimerange.value = []
listQuery.value = {
@@ -207,7 +212,6 @@
const data = JSON.parse($route.query.row as string)
if ($route.query.type === 'localAnalyse') {
// 从异常位置分析跳转过来
- console.log(data, '123')
datetimerange.value = [data.begTime, data.endTime]
listQuery.value.position = data.position
}
@@ -223,7 +227,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -231,7 +235,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -258,8 +262,8 @@
})
onActivated(() => {
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
console.log('需要重新获取列表')
fetchData()
}
@@ -341,8 +345,8 @@
-
+
{{ scope.row[column.value] }}
diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue
index 517b906..2f28a39 100644
--- a/src/views/home/dashboard/index.vue
+++ b/src/views/home/dashboard/index.vue
@@ -154,6 +154,7 @@
messageLoading.value = true
getMessage().then((res) => {
messageData.value = res.data.rows
+ console.log(messageData.value, '消息通知')
messageLoading.value = false
}).catch(() => {
messageLoading.value = false
diff --git a/src/views/home/device/device/components/dataSearch.vue b/src/views/home/device/device/components/dataSearch.vue
index 2bef320..612d68d 100644
--- a/src/views/home/device/device/components/dataSearch.vue
+++ b/src/views/home/device/device/components/dataSearch.vue
@@ -11,7 +11,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { exportFile } from '@/utils/exportUtils'
import { toHumpObject } from '@/utils/String'
-import { handlerListData } from './handlerData'
+import { handlerListData, handlerSignalStrength } from './handlerData'
const $route = useRoute()
const listQuery = ref({
devcode: '',
@@ -75,10 +75,11 @@
{ text: '设备编号', value: 'devcode', align: 'center' },
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
{ text: '电量(%)', value: 'cell', align: 'center' },
- { text: '信号强度', value: 'pci', align: 'center' },
+ { text: '信号强度', value: 'rsrp', align: 'center' },
+ { text: '信号质量', value: 'rsrpName', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵
const columns2 = ref([
@@ -87,7 +88,7 @@
{ text: '电池电压(mV)', value: 'vbat', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵-百瑞生
const columns2BRS = ref([
@@ -99,7 +100,7 @@
{ text: '信号质量', value: 'sig', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵-麦哈克
const columns2MHK = ref([
@@ -110,7 +111,7 @@
{ text: '信号质量', value: 'rsrp', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 智能警示桩
const columns3 = ref([
@@ -251,21 +252,21 @@
}
getDataSearch(listQuery.value).then((res) => {
list.value = res.data.map((item: any) => toHumpObject(item))
- if (listQuery.value.typeName === '智能警示桩') {
- const dict = {
- 0: '正常',
- 1: '报警'
- } as { [key: string]: string }
- list.value = list.value.map((item: any) => ({
- ...item,
- pipeInclineAlarm: item.pipeInclineAlarm === '1' || item.pipeInclineAlarm === '0' ? dict[item.pipeInclineAlarm] : item.pipeInclineAlarm,
- pipeBreakAlarm: item.pipeBreakAlarm === '1' || item.pipeBreakAlarm === '0' ? dict[item.pipeBreakAlarm] : item.pipeBreakAlarm,
- leftOffLineAlarm: item.leftOffLineAlarm === '1' || item.leftOffLineAlarm === '0' ? dict[item.leftOffLineAlarm] : item.leftOffLineAlarm,
- leftVibrateAlarm: item.leftVibrateAlarm === '1' || item.leftVibrateAlarm === '0' ? dict[item.leftVibrateAlarm] : item.leftVibrateAlarm,
- rightOffLineAlarm: item.rightOffLineAlarm === '1' || item.rightOffLineAlarm === '0' ? dict[item.rightOffLineAlarm] : item.rightOffLineAlarm,
- rightVibrateAlarm: item.rightVibrateAlarm === '1' || item.rightVibrateAlarm === '0' ? dict[item.rightVibrateAlarm] : item.rightVibrateAlarm,
- }))
- }
+ // if (listQuery.value.typeName === '智能警示桩') {
+ // const dict = {
+ // 0: '正常',
+ // 1: '报警'
+ // } as { [key: string]: string }
+ // list.value = list.value.map((item: any) => ({
+ // ...item,
+ // pipeInclineAlarm: item.pipeInclineAlarm === '1' || item.pipeInclineAlarm === '0' ? dict[item.pipeInclineAlarm] : item.pipeInclineAlarm,
+ // pipeBreakAlarm: item.pipeBreakAlarm === '1' || item.pipeBreakAlarm === '0' ? dict[item.pipeBreakAlarm] : item.pipeBreakAlarm,
+ // leftOffLineAlarm: item.leftOffLineAlarm === '1' || item.leftOffLineAlarm === '0' ? dict[item.leftOffLineAlarm] : item.leftOffLineAlarm,
+ // leftVibrateAlarm: item.leftVibrateAlarm === '1' || item.leftVibrateAlarm === '0' ? dict[item.leftVibrateAlarm] : item.leftVibrateAlarm,
+ // rightOffLineAlarm: item.rightOffLineAlarm === '1' || item.rightOffLineAlarm === '0' ? dict[item.rightOffLineAlarm] : item.rightOffLineAlarm,
+ // rightVibrateAlarm: item.rightVibrateAlarm === '1' || item.rightVibrateAlarm === '0' ? dict[item.rightVibrateAlarm] : item.rightVibrateAlarm,
+ // }))
+ // }
if (listQuery.value.typeName === '智能警示桩') {
const dict = {
0: '正常',
@@ -285,7 +286,8 @@
if (!listQuery.value.typeName || listQuery.value.typeName.includes('燃气智能监测终端')) {
list.value = list.value.map((item: any) => ({
...item,
- status: handlerthresholdFun(item.strength, handlerthreshold.value.map((item: any) => item.alarmThreshold))
+ status: handlerthresholdFun(item.strength, handlerthreshold.value.map((item: any) => item.alarmThreshold)),
+ rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''
}))
chartData.value = [
{
diff --git a/src/views/home/device/device/components/handlerData.ts b/src/views/home/device/device/components/handlerData.ts
index e09c666..3cbc926 100644
--- a/src/views/home/device/device/components/handlerData.ts
+++ b/src/views/home/device/device/components/handlerData.ts
@@ -1,11 +1,43 @@
+
+// 处理信号强度
+export const handlerSignalStrength = (rsrp: number) => {
+ 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
+ }
+ return rsrpDict(rsrp)
+}
// 处理百瑞生和麦哈克数据
export const handlerListData = (manufactureName: string, list: any[], fun: Function) => {
// 百瑞生
if (manufactureName.includes('百瑞生')) {
- // console.log(list.value, '百瑞生')
const ssStateDict = {
0: '正常',
- 1: '通讯异常'
+ 39: '通讯异常'
} as { [key: string]: string }
const sigDict = {
1: '信号弱',
@@ -14,9 +46,9 @@
} as { [key: string]: string }
list = list.map((item: any) => ({
...item,
- ssState: ssStateDict[item.ssState] ? ssStateDict[item.ssState] : '', //传感器状态
+ ssState: ssStateDict[item.ssState] ? ssStateDict[item.ssState] : '', // 传感器状态
sig: sigDict[item.sig] ? sigDict[item.sig] : '', // 信号强度
- temp: item.temp ? Number(item.temp) / 100 : '' // 温度 扩大100倍传输
+ temp: item.temp ? Number(item.temp) : '' // 温度
}))
fun(list)
}
@@ -27,38 +59,11 @@
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)) : '', // 接收信号参考质量
+ rsrp: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : '', // 接收信号参考质量
}))
fun(list)
}
diff --git a/src/views/home/device/device/components/localtionForPieple.vue b/src/views/home/device/device/components/localtionForPieple.vue
index f8c504d..f42d999 100644
--- a/src/views/home/device/device/components/localtionForPieple.vue
+++ b/src/views/home/device/device/components/localtionForPieple.vue
@@ -10,6 +10,7 @@
import { addPosition, editPosition, getPositionListPage } from '@/api/home/device/device'
import { getPiePleListPage } from '@/api/home/ledger/pipeline'
import AMap from '@/components/map/index.vue'
+// import { getDictByCode } from '@/api/system/dict'
import { getLocation } from '@/utils/getLocation'
const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 对话框是否显示
@@ -27,6 +28,7 @@
position: '', // 详细位置
deptid: '', // 管理单位
pipeCode: '', // 关联管线
+ locationCategory: '',
}) // 表单
const rules: FormRules = {
tagNumber: [{ required: true, message: '安装位号不能为空', trigger: ['blur', 'change'] }],
@@ -309,7 +311,8 @@
position: dataForm.value.position,
tagNumber: dataForm.value.tagNumber,
id: data.id,
- type: '3'
+ type: '3',
+ locationCategory: dataForm.value.locationCategory
}).then(res => {
ElMessage.success('编辑点位成功')
emits('confirm', result, 'single')
@@ -332,7 +335,8 @@
pipeCode: dataForm.value.pipeCode,
position: dataForm.value.position,
tagNumber: dataForm.value.tagNumber,
- type: '3'
+ type: '3',
+ locationCategory: dataForm.value.locationCategory
}).then((res) => {
if (res.code === 200) {
ElMessage.success('新建点位成功')
@@ -377,6 +381,7 @@
}
const pipeList = ref<{ id: string; name: string; value: string }[]>([]) // 管线列表
+const locationTypeList = ref<{ id: string; name: string; value: string }[]>([])
// 获取字典
const fetchDict = () => {
getPiePleListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -386,6 +391,9 @@
value: item.pipeCode,
}))
})
+ getDictByCode('locationType').then((res) => {
+ locationTypeList.value = res.data
+ })
}
fetchDict()
@@ -396,20 +404,27 @@
-
+
-
+
+
+
+
+
+
+
+
-
+
diff --git a/src/views/home/device/device/components/localtionForWell.vue b/src/views/home/device/device/components/localtionForWell.vue
index 97fcef6..7e7570d 100644
--- a/src/views/home/device/device/components/localtionForWell.vue
+++ b/src/views/home/device/device/components/localtionForWell.vue
@@ -27,6 +27,7 @@
position: '', // 详细位置
deptid: '', // 管理单位
ledgerName: '', // 闸井名称
+ locationCategory: ''
}) // 表单
const listQueryTemporary = ref({
tagNumber: '', // 安装位号
@@ -200,6 +201,7 @@
// 获取字典
const manageTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 管理方式
const onStateList = ref<{ id: string; name: string; value: string }[]>([]) // 使用状态
+const locationTypeList = ref<{ id: string; name: string; value: string }[]>([])
const fetchDict = () => {
// 管理方式
getDictByCode('manageType').then((res) => {
@@ -209,6 +211,9 @@
getDictByCode('onState').then((res) => {
onStateList.value = res.data
})
+ getDictByCode('locationType').then((res) => {
+ locationTypeList.value = res.data
+ })
}
fetchDict()
// 初始化对话框
@@ -228,6 +233,7 @@
position: '', // 详细位置
deptid: '', // 管理单位
ledgerName: '', // 闸井名称
+ locationCategory: '',
}
if (row.tagNumber && row.deptid) {
// 找到绑定关系
@@ -371,7 +377,8 @@
position: dataForm.value.position,
tagNumber: dataForm.value.tagNumber,
id: data.id,
- type: '1'
+ type: '1',
+ locationCategory: dataForm.value.locationCategory
}).then(res => {
ElMessage.success('编辑点位成功')
emits('confirm', result, 'single')
@@ -398,7 +405,8 @@
ledgerName: dataForm.value.ledgerName,
position: dataForm.value.position,
tagNumber: dataForm.value.tagNumber,
- type: '1'
+ type: '1',
+ locationCategory: dataForm.value.locationCategory
}).then((res => {
ElMessage.success('新建点位成功')
@@ -552,13 +560,20 @@
-
+
-
+
+
+
+
+
+
+
+
@@ -567,7 +582,7 @@
-->
-
+
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index e5dfdb4..21f93d6 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -45,7 +45,7 @@
geocoder.getAddress(lnglat, (status: any, result: any) => {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
- console.log(result.regeocode.formattedAddress)
+ // console.log(result.regeocode.formattedAddress)
position = result.regeocode.formattedAddress
resultFun(position)
}
@@ -103,7 +103,7 @@
plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap1: any) => {
- console.log($props.center, '$props.center')
+ // console.log($props.center, '$props.center')
console.log($props.center && $props.center?.length === 2 && !isNaN($props.center[0]) && !isNaN($props.center[1]) ? $props.center : [116.397428, 39.90923])
AMap.value = AMap1
// 初始化地图
@@ -161,7 +161,7 @@
const flag = '00000000'
const zz = c
const z = `L${String(zz).length === 1 ? `0${zz}` : zz}`
- console.log(zz, 'zz')
+ // console.log(zz, 'zz')
const xx = a.toString(16)
const x = `C${flag.substring(0, 8 - xx.length)}${xx}`
const yy = b.toString(16)
@@ -452,7 +452,7 @@
...data.style,
})
polyline.on('click', (e) => {
- console.log('点击了线')
+ // console.log('点击了线')
$emits('lineClick', { event: e, map: map.value, data, polyline })
})
// console.log(polyline, 'polyline')
@@ -532,7 +532,7 @@
const MarkerAllCluster = ref([]) // 点聚合数组
const cluster = ref()
// 添加点聚合
-const addCluster = (points) => {
+const addCluster = (points,styleList) => {
// console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points')
var count = points.length
var _renderClusterMarker = function (context) {
@@ -563,8 +563,7 @@
}
const _renderMarker = (context: any) => {
const data = context.data[0]
- // console.log(data, 'data')
- const style = [
+ let style = [
{
url: `${publicPath}/image/well/well-normal.png`, // 图标地址
},
@@ -578,6 +577,9 @@
url: `${publicPath}/image/well/well-will.png`, // 图标地址
},
]
+ if(styleList) {
+ style = styleList
+ }
const markerHtml = `
`
var offset = new AMap.value.Pixel(-9, -9)
context.marker.setContent(markerHtml)
@@ -630,7 +632,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
@@ -644,7 +646,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue
index d85779c..c748666 100644
--- a/src/layouts/components/Tools/alarmDialog.vue
+++ b/src/layouts/components/Tools/alarmDialog.vue
@@ -1,4 +1,5 @@
-
+ :close-on-click-modal="false">
{{ info.alarmType }}
-
+
报警类型
{{ info.alarmType }}
-
+
设备类型
@@ -82,13 +88,13 @@
-
+
闸井位号
{{ info.tagNumber }}
-
+
闸井名称
@@ -96,22 +102,22 @@
-
+
报警等级
{{ info.alarmLevel }}
-
- 报警值
+
+
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
diff --git a/src/views/home/alarm/current/components/monitorDataDialog.vue b/src/views/home/alarm/current/components/monitorDataDialog.vue
index 9b689c9..666fe82 100644
--- a/src/views/home/alarm/current/components/monitorDataDialog.vue
+++ b/src/views/home/alarm/current/components/monitorDataDialog.vue
@@ -8,6 +8,7 @@
import dayjs from 'dayjs'
import { getMonitorData } from '@/api/home/pipeline/pipeline'
import { exportExcel } from '@/utils/exportXlsx'
+import { handlerSignalStrength } from '@/views/home/device/device/components/handlerData'
const emits = defineEmits(['refresh'])
const dialogFormVisible = ref(false) // 对话框是否显示
const info = ref()
@@ -21,11 +22,12 @@
// 列表展示列
const columns = ref([
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
- { text: '信号强度', value: 'pci', align: 'center', width: 90 },
- { text: '电量(%)', value: 'cell', align: 'center', width: 90 },
- { text: '采集时间', value: 'uptime', align: 'center' },
- { text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ { text: '信号强度', value: 'rsrp', align: 'center', width: 85 },
+ { text: '信号质量', value: 'rsrpName', align: 'center', width: 85 },
+ { text: '电量(%)', value: 'cell', align: 'center', width: 80 },
+ { text: '采集时间', value: 'uptime', align: 'center' },
+ { text: '上传时间', value: 'logtime', align: 'center' },
+ // { text: '设备状态', value: 'status', align: 'center', width: 85, isCustom: true },
])
const listQuery = ref({
upBegTime: '',
@@ -59,9 +61,8 @@
loadingTable.value = true
listQuery.value.typeName = info.value.devTypeName
listQuery.value.devcode = info.value.devcode
- getMonitorData(listQuery.value)
- .then((res) => {
- list.value = res.data.filter((item: any) => !item.alarmRuleValue)
+ getMonitorData(listQuery.value).then((res) => {
+ list.value = res.data.filter((item: any) => !item.alarmRuleValue).map((item: any) => ({...item, rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''}))
// 设置设备状态和燃气浓度标红
const threshold = res.data.filter((item: any) => item.alarmRuleValue)[0]
// console.log(threshold.alarmRuleValue, '阈值')
@@ -214,7 +215,7 @@
-
+
diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue
index 644e9d0..cc197cb 100644
--- a/src/views/home/alarm/current/index.vue
+++ b/src/views/home/alarm/current/index.vue
@@ -21,6 +21,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { getWellListPage } from '@/api/home/well/well'
import { getPipelineListPage } from '@/api/home/pipeline/pipeline'
+import { alarmValue } from './components/dict'
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
const alarmLevelList = ref<{ id: string; name: string; value: string }[]>([]) // 报警等级
@@ -113,31 +114,31 @@
list1.value = res.data.rows.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
})).map((item: any) => ({
...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : item.alarmContent
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
loadingTable.value = false
// // 查询设备类型和厂商
- list1.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- item.watchObject = res.data.rows[0].watchObject
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
@@ -234,7 +235,28 @@
list1.value = data.map((item: any) => ({
...item,
alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
+ // // 查询设备类型和厂商
+ // list1.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // item.watchObject = res.data.rows[0].watchObject
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
setTimeout(() => {
detail(data[0])
})
@@ -287,7 +309,7 @@
})
setTimeout(() => {
watchMapWidth()
- console.log('开始监听')
+ // console.log('开始监听')
})
}
else {
@@ -313,14 +335,15 @@
window.addEventListener('resize', () => { })
})
// 监听地图宽度
+const observer = ref()
const watchMapWidth = () => {
// 创建一个ResizeObserver实例
- const observer = new ResizeObserver((entries: any) => {
+ observer.value = new ResizeObserver((entries: any) => {
for (const entry of entries) {
// 获取div元素的新高度
const newWidth = entry.contentRect.width
// 执行相应的操作,比如更新UI或调用其他函数
- console.log(`元素新宽度为:${newWidth}`)
+ // console.log(`元素新宽度为:${newWidth}`)
// if (newHeight < 350) {
// tableHeight.value = window.innerHeight - 60 - 50 - 10 - 350 - 98 - 10 - 52 - 10 + (350 - newHeight)
// }
@@ -342,7 +365,7 @@
})
// 监听目标div元素的宽度变化
const targetDiv = document.getElementById('container-table') as Element
- observer.observe(targetDiv)
+ observer.value.observe(targetDiv)
}
// 查看报警
const mapRef = ref()
@@ -397,7 +420,7 @@
else {
let timer = null
timer = setInterval(() => {
- console.log('定时器')
+ // console.log('定时器')
if (mapRef.value?.completeFlag) {
draw()
clearInterval(timer)
@@ -408,7 +431,6 @@
}, 500)
}
// 双击列表行数据
-
const rowClick = (data: any) => {
detail(data)
}
@@ -416,7 +438,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -424,7 +446,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -452,7 +474,7 @@
// 多选
const multipleTable = ref([])
const handleSelectionChange = (val: any) => {
- console.log(val, '多选数据')
+ // console.log(val, '多选数据')
multipleTable.value = val
}
// 导出列表
@@ -489,8 +511,11 @@
).then(() => {
batchDelete(multipleTable.value.map((item: any) => item.id)).then(() => {
ElMessage.success('操作成功')
+ // 清空多选
multipleTable.value = []
+ tableRef.value.clearMulti()
fetchData()
+
})
})
}
@@ -524,16 +549,17 @@
}
const routerTo = (watchObjectName: string, row: any) => {
const watchObject = {
- '闸井': 'WellMonitorDetail',
- '场站': 'StationMonitorDetail',
- '管线': 'PipelineMonitorDetail',
+ 1: 'WellMonitorDetail',
+ 2: 'StationMonitorDetail',
+ 3: 'PipelineMonitorDetail',
} as { [key: string]: string }
// 判断是否有菜单权限
const watchObjectAuth = {
- '闸井': '/well',
- '场站': '/station/monitor',
- '管线': '/pipeline',
+ 1: '/well',
+ 2: '/station/monitor',
+ 3: '/pipeline',
} as { [key: string]: string }
+ // console.log(watchObjectAuth[watchObjectName])
if (!proxy.hasPerm(watchObjectAuth[watchObjectName])) {
ElMessage.warning('没有对应权限菜单')
return
@@ -553,20 +579,20 @@
})
}
// 先找闸井或者管线或者场站
- if (row.watchObject === '闸井') {
+ if (row.watchObject === '1') {
getWellListPage({ offset: 1, limit: 1, tagNumber: row.ledgerNumber, ledgerCode: row.ledgerCode }).then(res => {
if (res.data.rows.length) {
- routerTo('闸井', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('1', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
}
})
}
- else if (row.watchObject === '管线') {
+ else if (row.watchObject === '3') {
getPipelineListPage({ offset: 1, limit: 1, devCode: row.devcode, pipeCode: row.ledgerCode, tagNumber: row.ledgerNumber }).then(res => {
if (res.data.rows.length) {
- routerTo('管线', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
+ routerTo('3', { ledgerId: res.data.rows[0].id, devcode: row.devcode, typeName: row.devTypeName })
}
else {
ElMessage.warning('未找到该位置信息')
@@ -579,21 +605,23 @@
onBeforeRouteLeave((to: any) => {
keepSearchParams(to.path, 'CurrentAlarm')
cache.value = tableFlag.value
+ // 销毁ResizeObserver实例
+ observer.value.disconnect()
})
onActivated(() => {
- console.log('需要还原页面')
+ // console.log('需要还原页面')
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
- console.log('需要重新获取列表')
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
+ // console.log('需要重新获取列表')
fetchData()
}
- if(cache.value === 'map') {
- console.log('重置地图')
+ if (cache.value === 'map') {
+ // console.log('重置地图')
tableFlag.value = 'normal'
setTimeout(() => {
switchMode('map')
- if(cacheRow.value.id) {
+ if (cacheRow.value.id) {
detail(cacheRow.value)
}
})
@@ -721,8 +749,8 @@
-
{{ scope.row[column.value] }}
diff --git a/src/views/home/alarm/history/index.vue b/src/views/home/alarm/history/index.vue
index cf27337..ba700c3 100644
--- a/src/views/home/alarm/history/index.vue
+++ b/src/views/home/alarm/history/index.vue
@@ -16,6 +16,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { keepSearchParams } from '@/utils/keepQuery'
import { getDateDiff } from '@/utils/dayjs'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
const $route = useRoute()
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
const alarmTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类型
@@ -40,7 +41,7 @@
const columns = ref([
{ text: '报警类别', value: 'alarmCategory', align: 'center', width: '110' },
{ text: '报警类型', value: 'alarmType', align: 'center', width: '140' },
- { text: '报警原因', value: 'alarmContent', align: 'center' },
+ { text: '报警原因', value: 'alarmReason', align: 'center' },
{ text: '报警等级', value: 'alarmLevelName', align: 'center', width: '90' },
{ text: '位置', value: 'position', align: 'center' },
{ text: '设备编号', value: 'devcode', align: 'center', width: '130', isCustom: true },
@@ -95,32 +96,36 @@
list.value = res.data.rows.map((item: any) => ({
...item,
cancelDuration: item.alarmTime && item.cancelTime ? getDateDiff(item.alarmTime, item.cancelTime) : '' ,
- showDeviceTips: false, // 展示设备编号提示
+ // showDeviceTips: false, // 展示设备编号提示
+ }))
+ .map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategory.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
}))
total.value = res.data.total
loadingTable.value = false
// 查询设备类型和厂商
- list.value.forEach((item: any) => {
- getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
- if (res.data.rows.length) {
- item.showDeviceTips = true
- item.deviceTips = {
- typeName: res.data.rows[0].deviceName || item.devTypeName,
- manufactureName: res.data.rows[0].manufactureName
- }
- }
- else {
- item.showDeviceTips = false
- item.deviceTips = {}
- }
- })
- })
+ // list.value.forEach((item: any) => {
+ // getDeviceListPage({ offset: 1, limit: 1, devCode: item.devcode }).then(res => {
+ // if (res.data.rows.length) {
+ // item.showDeviceTips = true
+ // item.deviceTips = {
+ // typeName: res.data.rows[0].deviceName || item.devTypeName,
+ // manufactureName: res.data.rows[0].manufactureName
+ // }
+ // }
+ // else {
+ // item.showDeviceTips = false
+ // item.deviceTips = {}
+ // }
+ // })
+ // })
}).catch(() => {
loadingTable.value = false
})
}
-// 重置查询条件f
+// 重置查询条件
const reset = () => {
datetimerange.value = []
listQuery.value = {
@@ -207,7 +212,6 @@
const data = JSON.parse($route.query.row as string)
if ($route.query.type === 'localAnalyse') {
// 从异常位置分析跳转过来
- console.log(data, '123')
datetimerange.value = [data.begTime, data.endTime]
listQuery.value.position = data.position
}
@@ -223,7 +227,7 @@
const fetchDict = () => {
// 报警类别
getDictByCode('alarmCategory').then((res) => {
- alarmCategoryList.value = res.data
+ alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
})
// 报警类型
getAlarmTypeListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -231,7 +235,7 @@
name: item.alarmType,
value: item.id,
id: item.id,
- })), 'name')
+ })), 'name').filter((item: any) => !item.name.includes('设备'))
})
// 报警等级
getAlarmLevelListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -258,8 +262,8 @@
})
onActivated(() => {
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
console.log('需要重新获取列表')
fetchData()
}
@@ -341,8 +345,8 @@
-
+
{{ scope.row[column.value] }}
diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue
index 517b906..2f28a39 100644
--- a/src/views/home/dashboard/index.vue
+++ b/src/views/home/dashboard/index.vue
@@ -154,6 +154,7 @@
messageLoading.value = true
getMessage().then((res) => {
messageData.value = res.data.rows
+ console.log(messageData.value, '消息通知')
messageLoading.value = false
}).catch(() => {
messageLoading.value = false
diff --git a/src/views/home/device/device/components/dataSearch.vue b/src/views/home/device/device/components/dataSearch.vue
index 2bef320..612d68d 100644
--- a/src/views/home/device/device/components/dataSearch.vue
+++ b/src/views/home/device/device/components/dataSearch.vue
@@ -11,7 +11,7 @@
import { getDeviceListPage } from '@/api/home/device/device'
import { exportFile } from '@/utils/exportUtils'
import { toHumpObject } from '@/utils/String'
-import { handlerListData } from './handlerData'
+import { handlerListData, handlerSignalStrength } from './handlerData'
const $route = useRoute()
const listQuery = ref({
devcode: '',
@@ -75,10 +75,11 @@
{ text: '设备编号', value: 'devcode', align: 'center' },
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
{ text: '电量(%)', value: 'cell', align: 'center' },
- { text: '信号强度', value: 'pci', align: 'center' },
+ { text: '信号强度', value: 'rsrp', align: 'center' },
+ { text: '信号质量', value: 'rsrpName', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵
const columns2 = ref([
@@ -87,7 +88,7 @@
{ text: '电池电压(mV)', value: 'vbat', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵-百瑞生
const columns2BRS = ref([
@@ -99,7 +100,7 @@
{ text: '信号质量', value: 'sig', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 管网哨兵-麦哈克
const columns2MHK = ref([
@@ -110,7 +111,7 @@
{ text: '信号质量', value: 'rsrp', align: 'center' },
{ text: '采集时间', value: 'uptime', align: 'center' },
{ text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ // { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
])
// 智能警示桩
const columns3 = ref([
@@ -251,21 +252,21 @@
}
getDataSearch(listQuery.value).then((res) => {
list.value = res.data.map((item: any) => toHumpObject(item))
- if (listQuery.value.typeName === '智能警示桩') {
- const dict = {
- 0: '正常',
- 1: '报警'
- } as { [key: string]: string }
- list.value = list.value.map((item: any) => ({
- ...item,
- pipeInclineAlarm: item.pipeInclineAlarm === '1' || item.pipeInclineAlarm === '0' ? dict[item.pipeInclineAlarm] : item.pipeInclineAlarm,
- pipeBreakAlarm: item.pipeBreakAlarm === '1' || item.pipeBreakAlarm === '0' ? dict[item.pipeBreakAlarm] : item.pipeBreakAlarm,
- leftOffLineAlarm: item.leftOffLineAlarm === '1' || item.leftOffLineAlarm === '0' ? dict[item.leftOffLineAlarm] : item.leftOffLineAlarm,
- leftVibrateAlarm: item.leftVibrateAlarm === '1' || item.leftVibrateAlarm === '0' ? dict[item.leftVibrateAlarm] : item.leftVibrateAlarm,
- rightOffLineAlarm: item.rightOffLineAlarm === '1' || item.rightOffLineAlarm === '0' ? dict[item.rightOffLineAlarm] : item.rightOffLineAlarm,
- rightVibrateAlarm: item.rightVibrateAlarm === '1' || item.rightVibrateAlarm === '0' ? dict[item.rightVibrateAlarm] : item.rightVibrateAlarm,
- }))
- }
+ // if (listQuery.value.typeName === '智能警示桩') {
+ // const dict = {
+ // 0: '正常',
+ // 1: '报警'
+ // } as { [key: string]: string }
+ // list.value = list.value.map((item: any) => ({
+ // ...item,
+ // pipeInclineAlarm: item.pipeInclineAlarm === '1' || item.pipeInclineAlarm === '0' ? dict[item.pipeInclineAlarm] : item.pipeInclineAlarm,
+ // pipeBreakAlarm: item.pipeBreakAlarm === '1' || item.pipeBreakAlarm === '0' ? dict[item.pipeBreakAlarm] : item.pipeBreakAlarm,
+ // leftOffLineAlarm: item.leftOffLineAlarm === '1' || item.leftOffLineAlarm === '0' ? dict[item.leftOffLineAlarm] : item.leftOffLineAlarm,
+ // leftVibrateAlarm: item.leftVibrateAlarm === '1' || item.leftVibrateAlarm === '0' ? dict[item.leftVibrateAlarm] : item.leftVibrateAlarm,
+ // rightOffLineAlarm: item.rightOffLineAlarm === '1' || item.rightOffLineAlarm === '0' ? dict[item.rightOffLineAlarm] : item.rightOffLineAlarm,
+ // rightVibrateAlarm: item.rightVibrateAlarm === '1' || item.rightVibrateAlarm === '0' ? dict[item.rightVibrateAlarm] : item.rightVibrateAlarm,
+ // }))
+ // }
if (listQuery.value.typeName === '智能警示桩') {
const dict = {
0: '正常',
@@ -285,7 +286,8 @@
if (!listQuery.value.typeName || listQuery.value.typeName.includes('燃气智能监测终端')) {
list.value = list.value.map((item: any) => ({
...item,
- status: handlerthresholdFun(item.strength, handlerthreshold.value.map((item: any) => item.alarmThreshold))
+ status: handlerthresholdFun(item.strength, handlerthreshold.value.map((item: any) => item.alarmThreshold)),
+ rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''
}))
chartData.value = [
{
diff --git a/src/views/home/device/device/components/handlerData.ts b/src/views/home/device/device/components/handlerData.ts
index e09c666..3cbc926 100644
--- a/src/views/home/device/device/components/handlerData.ts
+++ b/src/views/home/device/device/components/handlerData.ts
@@ -1,11 +1,43 @@
+
+// 处理信号强度
+export const handlerSignalStrength = (rsrp: number) => {
+ 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
+ }
+ return rsrpDict(rsrp)
+}
// 处理百瑞生和麦哈克数据
export const handlerListData = (manufactureName: string, list: any[], fun: Function) => {
// 百瑞生
if (manufactureName.includes('百瑞生')) {
- // console.log(list.value, '百瑞生')
const ssStateDict = {
0: '正常',
- 1: '通讯异常'
+ 39: '通讯异常'
} as { [key: string]: string }
const sigDict = {
1: '信号弱',
@@ -14,9 +46,9 @@
} as { [key: string]: string }
list = list.map((item: any) => ({
...item,
- ssState: ssStateDict[item.ssState] ? ssStateDict[item.ssState] : '', //传感器状态
+ ssState: ssStateDict[item.ssState] ? ssStateDict[item.ssState] : '', // 传感器状态
sig: sigDict[item.sig] ? sigDict[item.sig] : '', // 信号强度
- temp: item.temp ? Number(item.temp) / 100 : '' // 温度 扩大100倍传输
+ temp: item.temp ? Number(item.temp) : '' // 温度
}))
fun(list)
}
@@ -27,38 +59,11 @@
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)) : '', // 接收信号参考质量
+ rsrp: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : '', // 接收信号参考质量
}))
fun(list)
}
diff --git a/src/views/home/device/device/components/localtionForPieple.vue b/src/views/home/device/device/components/localtionForPieple.vue
index f8c504d..f42d999 100644
--- a/src/views/home/device/device/components/localtionForPieple.vue
+++ b/src/views/home/device/device/components/localtionForPieple.vue
@@ -10,6 +10,7 @@
import { addPosition, editPosition, getPositionListPage } from '@/api/home/device/device'
import { getPiePleListPage } from '@/api/home/ledger/pipeline'
import AMap from '@/components/map/index.vue'
+// import { getDictByCode } from '@/api/system/dict'
import { getLocation } from '@/utils/getLocation'
const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 对话框是否显示
@@ -27,6 +28,7 @@
position: '', // 详细位置
deptid: '', // 管理单位
pipeCode: '', // 关联管线
+ locationCategory: '',
}) // 表单
const rules: FormRules = {
tagNumber: [{ required: true, message: '安装位号不能为空', trigger: ['blur', 'change'] }],
@@ -309,7 +311,8 @@
position: dataForm.value.position,
tagNumber: dataForm.value.tagNumber,
id: data.id,
- type: '3'
+ type: '3',
+ locationCategory: dataForm.value.locationCategory
}).then(res => {
ElMessage.success('编辑点位成功')
emits('confirm', result, 'single')
@@ -332,7 +335,8 @@
pipeCode: dataForm.value.pipeCode,
position: dataForm.value.position,
tagNumber: dataForm.value.tagNumber,
- type: '3'
+ type: '3',
+ locationCategory: dataForm.value.locationCategory
}).then((res) => {
if (res.code === 200) {
ElMessage.success('新建点位成功')
@@ -377,6 +381,7 @@
}
const pipeList = ref<{ id: string; name: string; value: string }[]>([]) // 管线列表
+const locationTypeList = ref<{ id: string; name: string; value: string }[]>([])
// 获取字典
const fetchDict = () => {
getPiePleListPage({ offset: 1, limit: 99999 }).then((res) => {
@@ -386,6 +391,9 @@
value: item.pipeCode,
}))
})
+ getDictByCode('locationType').then((res) => {
+ locationTypeList.value = res.data
+ })
}
fetchDict()
@@ -396,20 +404,27 @@
-
+
-
+
+
+
+
+
+
+
+
-
+
diff --git a/src/views/home/device/device/components/localtionForWell.vue b/src/views/home/device/device/components/localtionForWell.vue
index 97fcef6..7e7570d 100644
--- a/src/views/home/device/device/components/localtionForWell.vue
+++ b/src/views/home/device/device/components/localtionForWell.vue
@@ -27,6 +27,7 @@
position: '', // 详细位置
deptid: '', // 管理单位
ledgerName: '', // 闸井名称
+ locationCategory: ''
}) // 表单
const listQueryTemporary = ref({
tagNumber: '', // 安装位号
@@ -200,6 +201,7 @@
// 获取字典
const manageTypeList = ref<{ id: string; name: string; value: string }[]>([]) // 管理方式
const onStateList = ref<{ id: string; name: string; value: string }[]>([]) // 使用状态
+const locationTypeList = ref<{ id: string; name: string; value: string }[]>([])
const fetchDict = () => {
// 管理方式
getDictByCode('manageType').then((res) => {
@@ -209,6 +211,9 @@
getDictByCode('onState').then((res) => {
onStateList.value = res.data
})
+ getDictByCode('locationType').then((res) => {
+ locationTypeList.value = res.data
+ })
}
fetchDict()
// 初始化对话框
@@ -228,6 +233,7 @@
position: '', // 详细位置
deptid: '', // 管理单位
ledgerName: '', // 闸井名称
+ locationCategory: '',
}
if (row.tagNumber && row.deptid) {
// 找到绑定关系
@@ -371,7 +377,8 @@
position: dataForm.value.position,
tagNumber: dataForm.value.tagNumber,
id: data.id,
- type: '1'
+ type: '1',
+ locationCategory: dataForm.value.locationCategory
}).then(res => {
ElMessage.success('编辑点位成功')
emits('confirm', result, 'single')
@@ -398,7 +405,8 @@
ledgerName: dataForm.value.ledgerName,
position: dataForm.value.position,
tagNumber: dataForm.value.tagNumber,
- type: '1'
+ type: '1',
+ locationCategory: dataForm.value.locationCategory
}).then((res => {
ElMessage.success('新建点位成功')
@@ -552,13 +560,20 @@
-
+
-
+
+
+
+
+
+
+
+
@@ -567,7 +582,7 @@
-->
-
+
diff --git a/src/views/home/device/device/index.vue b/src/views/home/device/device/index.vue
index b0b08e5..cb76ade 100644
--- a/src/views/home/device/device/index.vue
+++ b/src/views/home/device/device/index.vue
@@ -346,8 +346,8 @@
})
onActivated(() => {
// 从编辑或者新增页面回来需要重新获取列表数据
- // $router.options.history.state.forward 上一次路由地址
- if (!($router.options.history.state.forward as string || '').includes('detail')) {
+ // $router.options.history.state.back 上一次路由地址
+ if (!($router.options.history.state.back as string || '').includes('detail')) {
console.log('需要重新获取列表')
fetchData()
}
diff --git a/src/api/mobile/1 b/src/api/mobile/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/api/mobile/1
diff --git a/src/api/mobile/record.ts b/src/api/mobile/record.ts
new file mode 100644
index 0000000..42113c8
--- /dev/null
+++ b/src/api/mobile/record.ts
@@ -0,0 +1,23 @@
+/**
+ * 运维记录
+ */
+import request from '@/api/index'
+
+// 基础列表
+export function getOperationListPage(data: any) {
+ return request({
+ url: `/device/busRepairLog/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function exportOperationList(data: any) {
+ return request({
+ url: '/device/busRepairLog/batchExport',
+ method: 'get',
+ params: {
+ ...data,
+ },
+ responseType: 'blob',
+ })
+}
diff --git a/src/assets/icons/icon-temporary.svg b/src/assets/icons/icon-temporary.svg
new file mode 100644
index 0000000..6ec2646
--- /dev/null
+++ b/src/assets/icons/icon-temporary.svg
@@ -0,0 +1 @@
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 96289e9..be57c9b 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -74,10 +74,12 @@
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
+ VanBackTop: typeof import('vant/es')['BackTop']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanDialog: typeof import('vant/es')['Dialog']
+ VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index 0a381f4..c9e7d50 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -106,7 +106,7 @@
show: boolean
}
watch(() => props.data, (newVal) => {
- console.log(newVal, '表格接受的数据')
+ // console.log(newVal, '表格接受的数据')
}, {
immediate: true,
deep: true,
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index e5dfdb4..21f93d6 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -45,7 +45,7 @@
geocoder.getAddress(lnglat, (status: any, result: any) => {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
- console.log(result.regeocode.formattedAddress)
+ // console.log(result.regeocode.formattedAddress)
position = result.regeocode.formattedAddress
resultFun(position)
}
@@ -103,7 +103,7 @@
plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap1: any) => {
- console.log($props.center, '$props.center')
+ // console.log($props.center, '$props.center')
console.log($props.center && $props.center?.length === 2 && !isNaN($props.center[0]) && !isNaN($props.center[1]) ? $props.center : [116.397428, 39.90923])
AMap.value = AMap1
// 初始化地图
@@ -161,7 +161,7 @@
const flag = '00000000'
const zz = c
const z = `L${String(zz).length === 1 ? `0${zz}` : zz}`
- console.log(zz, 'zz')
+ // console.log(zz, 'zz')
const xx = a.toString(16)
const x = `C${flag.substring(0, 8 - xx.length)}${xx}`
const yy = b.toString(16)
@@ -452,7 +452,7 @@
...data.style,
})
polyline.on('click', (e) => {
- console.log('点击了线')
+ // console.log('点击了线')
$emits('lineClick', { event: e, map: map.value, data, polyline })
})
// console.log(polyline, 'polyline')
@@ -532,7 +532,7 @@
const MarkerAllCluster = ref([]) // 点聚合数组
const cluster = ref()
// 添加点聚合
-const addCluster = (points) => {
+const addCluster = (points,styleList) => {
// console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points')
var count = points.length
var _renderClusterMarker = function (context) {
@@ -563,8 +563,7 @@
}
const _renderMarker = (context: any) => {
const data = context.data[0]
- // console.log(data, 'data')
- const style = [
+ let style = [
{
url: `${publicPath}/image/well/well-normal.png`, // 图标地址
},
@@ -578,6 +577,9 @@
url: `${publicPath}/image/well/well-will.png`, // 图标地址
},
]
+ if(styleList) {
+ style = styleList
+ }
const markerHtml = `
`
var offset = new AMap.value.Pixel(-9, -9)
context.marker.setContent(markerHtml)
@@ -630,7 +632,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
@@ -644,7 +646,7 @@
xunteng.value = null
}
if (map.value) {
- console.log('销毁')
+ console.log('销毁地图')
map.value.destroy()
map.value = null
AMap.value = null
diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue
index d85779c..c748666 100644
--- a/src/layouts/components/Tools/alarmDialog.vue
+++ b/src/layouts/components/Tools/alarmDialog.vue
@@ -1,4 +1,5 @@
-
+ :close-on-click-modal="false">
{{ info.alarmType }}
-
+
报警类型
{{ info.alarmType }}
-
+
设备类型
@@ -82,13 +88,13 @@
-
+
闸井位号
{{ info.tagNumber }}
-
+
闸井名称
@@ -96,22 +102,22 @@
-
+
报警等级
{{ info.alarmLevel }}
-
- 报警值
+
+
+ {{ info.alarmType.includes('浓度') ? '报警值' : '报警原因' }}
-
+
{{ info.value }}
- {{ info.typeName.includes('燃气') || info.typeName.includes('哨兵') ? '%LEL' : '' }}
-
+
报警时间
diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue
index 26c27a5..ceb907c 100644
--- a/src/layouts/components/Tools/alarmList.vue
+++ b/src/layouts/components/Tools/alarmList.vue
@@ -5,6 +5,7 @@
import { getAlarmLevelListPage } from '@/api/home/rule/alarm'
import { fetchCacheDevice, fetchCacheWell, fetchCacheStation, fetchCacheDept, fetchCacheWell95 } from '@/utils/sessionData'
import indexDB from '@/utils/indexDB'
+import { alarmValue } from '@/views/home/alarm/current/components/dict'
// 引入音频文件
import alarmAudio from '@/assets/audio/alarm.mp3'
import otherAudio from '@/assets/audio/other.mp3'
@@ -76,8 +77,6 @@
const play = () => {
if (!localStorage.getItem('eventAudio')) {
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1')) {
- // import alarmAudio from '@/assets/audio/alarm.mp3'
- // import otherAudio from '@/assets/audio/other.mp3'
proxy.playAudio()
}
}
@@ -95,7 +94,7 @@
// isSound: '1', // 报警音效,1:开,0:关
// isSend: '1', // 报警推送,1:开,0:关
// isText: '1', // 报警短息,1:开,0:关
- // alarmType: '浓度超限',
+ // alarmType: '超限',
// tagNumber: 'NX5702',
// alarmTime: '2024-09-09',
// value: '20',
@@ -110,16 +109,17 @@
if (isLoading) {
loading.value = false
}
- getAlarmList({ offset: 1, limit: 3 }).then((res) => {
+ getAlarmList({ }).then((res) => {
messageList.value = res.data.rows.map((item: any) => ({
...item,
alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
}))
loading.value = false
if (messageList.value.length > 0 && messageList.value.some((item: any) => item.isSound === '1' && item.processStatus === '1')) {
const audio = document.getElementById('eventAudio') as HTMLAudioElement
- if (messageList.value.some((item: any) => item.alarmType.includes('断线') && item.isSound === '1' && item.processStatus === '1' )) {
+ if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) {
audio.setAttribute('src', alarmAudio)
}
else {
@@ -154,15 +154,45 @@
deep: true,
immediate: true,
})
+const timer = ref()
+const clearTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
onMounted(() => {
getAlarmLevelListPage({ offset: 1, limit: 999 }).then((res) => {
alarmLevelList.value = res.data.rows
fetchData()
socket.initWebSocket()
})
+ // 启动定时器
+ clearTimer()
+ timer.value = setInterval(() => {
+ getAlarmList({ }).then((res) => {
+ messageList.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmLevelName: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.alarmLevel || '',
+ isSound: alarmLevelList.value.filter((citem: any) => citem.id === item.alarmLevel)[0]?.isSound || '',
+ alarmReason: item.alarmType.includes('浓度') ? `${item.alarmValue}%LEL` : (alarmValue[item.alarmValue] || '其他')
+ }))
+ loading.value = false
+ // 暂停
+ if (messageList.value.length > 0 && messageList.value.every((item: any) => item.processStatus !== '1')) {
+ pause()
+ }
+ }).catch(() => {
+ loading.value = false
+ })
+ }, 1000* 40);
})
-onUnmounted(() => {
+// onUnmounted(() => {
+// socket.destroyWebSocket()
+// })
+onBeforeUnmount(() => {
socket.destroyWebSocket()
+ clearTimer()
})
// 页面关闭删除token 为的是先登录(页面产生交互)
// window.onbeforeunload = function (event: any) {
@@ -227,7 +257,7 @@
|
- {{ message.alarmContent }}
+ {{ message.alarmReason }}
diff --git a/src/views/home/alarm/current/components/monitorDataDialog.vue b/src/views/home/alarm/current/components/monitorDataDialog.vue
index 9b689c9..666fe82 100644
--- a/src/views/home/alarm/current/components/monitorDataDialog.vue
+++ b/src/views/home/alarm/current/components/monitorDataDialog.vue
@@ -8,6 +8,7 @@
import dayjs from 'dayjs'
import { getMonitorData } from '@/api/home/pipeline/pipeline'
import { exportExcel } from '@/utils/exportXlsx'
+import { handlerSignalStrength } from '@/views/home/device/device/components/handlerData'
const emits = defineEmits(['refresh'])
const dialogFormVisible = ref(false) // 对话框是否显示
const info = ref()
@@ -21,11 +22,12 @@
// 列表展示列
const columns = ref([
{ text: '燃气浓度(%LEL)', value: 'strength', align: 'center', isCustom: true },
- { text: '信号强度', value: 'pci', align: 'center', width: 90 },
- { text: '电量(%)', value: 'cell', align: 'center', width: 90 },
- { text: '采集时间', value: 'uptime', align: 'center' },
- { text: '上传时间', value: 'logtime', align: 'center' },
- { text: '设备状态', value: 'status', align: 'center', width: 90, isCustom: true },
+ { text: '信号强度', value: 'rsrp', align: 'center', width: 85 },
+ { text: '信号质量', value: 'rsrpName', align: 'center', width: 85 },
+ { text: '电量(%)', value: 'cell', align: 'center', width: 80 },
+ { text: '采集时间', value: 'uptime', align: 'center' },
+ { text: '上传时间', value: 'logtime', align: 'center' },
+ // { text: '设备状态', value: 'status', align: 'center', width: 85, isCustom: true },
])
const listQuery = ref({
upBegTime: '',
@@ -59,9 +61,8 @@
loadingTable.value = true
listQuery.value.typeName = info.value.devTypeName
listQuery.value.devcode = info.value.devcode
- getMonitorData(listQuery.value)
- .then((res) => {
- list.value = res.data.filter((item: any) => !item.alarmRuleValue)
+ getMonitorData(listQuery.value).then((res) => {
+ list.value = res.data.filter((item: any) => !item.alarmRuleValue).map((item: any) => ({...item, rsrpName: item.rsrp ? handlerSignalStrength(Number(item.rsrp)) : ''}))
// 设置设备状态和燃气浓度标红
const threshold = res.data.filter((item: any) => item.alarmRuleValue)[0]
// console.log(threshold.alarmRuleValue, '阈值')
@@ -214,7 +215,7 @@
-
+