diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@ - + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@
- + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@
- + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@
- + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/utils/String.ts b/src/utils/String.ts index a34a192..6b28042 100644 --- a/src/utils/String.ts +++ b/src/utils/String.ts @@ -44,3 +44,15 @@ // return "rgb(" + r + ", " + g + ", " + b + ")"; return [r, g, b] } + +// ji在字符串特定位置插入换行符str 字符串 interval 指定位置 比如说5 就会在 5 10 15 20 添加 +export function insertNewline(str, interval) { + let result = ''; + for (let i = 0; i < str.length; i += interval) { + result += str.slice(i, i + interval) + (i + interval < str.length ? '
' : ''); + } + if(str.length < interval) { + return str + } + return result; +} diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@
- + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/utils/String.ts b/src/utils/String.ts index a34a192..6b28042 100644 --- a/src/utils/String.ts +++ b/src/utils/String.ts @@ -44,3 +44,15 @@ // return "rgb(" + r + ", " + g + ", " + b + ")"; return [r, g, b] } + +// ji在字符串特定位置插入换行符str 字符串 interval 指定位置 比如说5 就会在 5 10 15 20 添加 +export function insertNewline(str, interval) { + let result = ''; + for (let i = 0; i < str.length; i += interval) { + result += str.slice(i, i + interval) + (i + interval < str.length ? '
' : ''); + } + if(str.length < interval) { + return str + } + return result; +} diff --git a/src/utils/download.ts b/src/utils/download.ts index d70f539..dff7277 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -17,7 +17,7 @@ * @param name 图片名称 */ export function downloadFile(file: File, name: string) { - console.log(new Blob([file]), 'new Blob([file])') + // console.log(new Blob([file]), 'new Blob([file])') const objectUrl = URL.createObjectURL(new Blob([file])) const link = document.createElement('a') link.download = name @@ -119,7 +119,7 @@ // 下载图片 const photo = ['jpg', 'jpeg', 'png'] const fileType = url.split('.')[url.split('.').length - 1] - console.log(fileType, 'fileType') + // console.log(fileType, 'fileType') if (photo.includes(fileType)) { // 图片 将服务器图片地址转化成本地地址 const image = new Image() diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@
- + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/utils/String.ts b/src/utils/String.ts index a34a192..6b28042 100644 --- a/src/utils/String.ts +++ b/src/utils/String.ts @@ -44,3 +44,15 @@ // return "rgb(" + r + ", " + g + ", " + b + ")"; return [r, g, b] } + +// ji在字符串特定位置插入换行符str 字符串 interval 指定位置 比如说5 就会在 5 10 15 20 添加 +export function insertNewline(str, interval) { + let result = ''; + for (let i = 0; i < str.length; i += interval) { + result += str.slice(i, i + interval) + (i + interval < str.length ? '
' : ''); + } + if(str.length < interval) { + return str + } + return result; +} diff --git a/src/utils/download.ts b/src/utils/download.ts index d70f539..dff7277 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -17,7 +17,7 @@ * @param name 图片名称 */ export function downloadFile(file: File, name: string) { - console.log(new Blob([file]), 'new Blob([file])') + // console.log(new Blob([file]), 'new Blob([file])') const objectUrl = URL.createObjectURL(new Blob([file])) const link = document.createElement('a') link.download = name @@ -119,7 +119,7 @@ // 下载图片 const photo = ['jpg', 'jpeg', 'png'] const fileType = url.split('.')[url.split('.').length - 1] - console.log(fileType, 'fileType') + // console.log(fileType, 'fileType') if (photo.includes(fileType)) { // 图片 将服务器图片地址转化成本地地址 const image = new Image() diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts index 82d436b..0464065 100644 --- a/src/utils/exportXlsx.ts +++ b/src/utils/exportXlsx.ts @@ -39,7 +39,7 @@ if (keyArray.length < getLength(element)) { keyArray.push(key2) } - console.log(keyArray, 'keyArray') + // console.log(keyArray, 'keyArray') } } data.push(rowDataArray) @@ -47,7 +47,7 @@ } // keyArray为英文字段表头 data.splice(0, 0, keyArray as any, params.titleArr as any) - console.log('data', data) + // console.log('data', data) const ws = XLSX.utils.aoa_to_sheet(data) const wb = XLSX.utils.book_new() // 此处隐藏英文字段表头 diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@
- + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/utils/String.ts b/src/utils/String.ts index a34a192..6b28042 100644 --- a/src/utils/String.ts +++ b/src/utils/String.ts @@ -44,3 +44,15 @@ // return "rgb(" + r + ", " + g + ", " + b + ")"; return [r, g, b] } + +// ji在字符串特定位置插入换行符str 字符串 interval 指定位置 比如说5 就会在 5 10 15 20 添加 +export function insertNewline(str, interval) { + let result = ''; + for (let i = 0; i < str.length; i += interval) { + result += str.slice(i, i + interval) + (i + interval < str.length ? '
' : ''); + } + if(str.length < interval) { + return str + } + return result; +} diff --git a/src/utils/download.ts b/src/utils/download.ts index d70f539..dff7277 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -17,7 +17,7 @@ * @param name 图片名称 */ export function downloadFile(file: File, name: string) { - console.log(new Blob([file]), 'new Blob([file])') + // console.log(new Blob([file]), 'new Blob([file])') const objectUrl = URL.createObjectURL(new Blob([file])) const link = document.createElement('a') link.download = name @@ -119,7 +119,7 @@ // 下载图片 const photo = ['jpg', 'jpeg', 'png'] const fileType = url.split('.')[url.split('.').length - 1] - console.log(fileType, 'fileType') + // console.log(fileType, 'fileType') if (photo.includes(fileType)) { // 图片 将服务器图片地址转化成本地地址 const image = new Image() diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts index 82d436b..0464065 100644 --- a/src/utils/exportXlsx.ts +++ b/src/utils/exportXlsx.ts @@ -39,7 +39,7 @@ if (keyArray.length < getLength(element)) { keyArray.push(key2) } - console.log(keyArray, 'keyArray') + // console.log(keyArray, 'keyArray') } } data.push(rowDataArray) @@ -47,7 +47,7 @@ } // keyArray为英文字段表头 data.splice(0, 0, keyArray as any, params.titleArr as any) - console.log('data', data) + // console.log('data', data) const ws = XLSX.utils.aoa_to_sheet(data) const wb = XLSX.utils.book_new() // 此处隐藏英文字段表头 diff --git a/src/utils/getLocation.ts b/src/utils/getLocation.ts index e046f94..7656bb8 100644 --- a/src/utils/getLocation.ts +++ b/src/utils/getLocation.ts @@ -20,7 +20,7 @@ return 'IE' } // 判断是否IE浏览器 } -console.log(myBrowser(), '当前浏览器') +// console.log(myBrowser(), '当前浏览器') export const getLocation = () => { const browserType = myBrowser() @@ -29,7 +29,7 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { @@ -41,7 +41,7 @@ } function errorCallback(error: any) { - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } else { @@ -49,25 +49,25 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { - console.log(position, 'position') + // console.log(position, 'position') var latitude = position.coords.latitude var longitude = position.coords.longitude - console.log(`Latitude22: ${latitude}`) - console.log(`Longitude22: ${longitude}`) + // console.log(`Latitude22: ${latitude}`) + // console.log(`Longitude22: ${longitude}`) const data = wgs84togcj02(Number(position.coords.longitude), Number(position.coords.latitude)) - console.log(`latitude: ${data[1]}`) - console.log(`longitude: ${data[0]}`) + // console.log(`latitude: ${data[1]}`) + // console.log(`longitude: ${data[0]}`) sessionStorage.setItem('latitude', data[1]) sessionStorage.setItem('longitude', data[0]) } function errorCallback(error: any) { // console.log('errorrr') - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } } diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@
- + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/utils/String.ts b/src/utils/String.ts index a34a192..6b28042 100644 --- a/src/utils/String.ts +++ b/src/utils/String.ts @@ -44,3 +44,15 @@ // return "rgb(" + r + ", " + g + ", " + b + ")"; return [r, g, b] } + +// ji在字符串特定位置插入换行符str 字符串 interval 指定位置 比如说5 就会在 5 10 15 20 添加 +export function insertNewline(str, interval) { + let result = ''; + for (let i = 0; i < str.length; i += interval) { + result += str.slice(i, i + interval) + (i + interval < str.length ? '
' : ''); + } + if(str.length < interval) { + return str + } + return result; +} diff --git a/src/utils/download.ts b/src/utils/download.ts index d70f539..dff7277 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -17,7 +17,7 @@ * @param name 图片名称 */ export function downloadFile(file: File, name: string) { - console.log(new Blob([file]), 'new Blob([file])') + // console.log(new Blob([file]), 'new Blob([file])') const objectUrl = URL.createObjectURL(new Blob([file])) const link = document.createElement('a') link.download = name @@ -119,7 +119,7 @@ // 下载图片 const photo = ['jpg', 'jpeg', 'png'] const fileType = url.split('.')[url.split('.').length - 1] - console.log(fileType, 'fileType') + // console.log(fileType, 'fileType') if (photo.includes(fileType)) { // 图片 将服务器图片地址转化成本地地址 const image = new Image() diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts index 82d436b..0464065 100644 --- a/src/utils/exportXlsx.ts +++ b/src/utils/exportXlsx.ts @@ -39,7 +39,7 @@ if (keyArray.length < getLength(element)) { keyArray.push(key2) } - console.log(keyArray, 'keyArray') + // console.log(keyArray, 'keyArray') } } data.push(rowDataArray) @@ -47,7 +47,7 @@ } // keyArray为英文字段表头 data.splice(0, 0, keyArray as any, params.titleArr as any) - console.log('data', data) + // console.log('data', data) const ws = XLSX.utils.aoa_to_sheet(data) const wb = XLSX.utils.book_new() // 此处隐藏英文字段表头 diff --git a/src/utils/getLocation.ts b/src/utils/getLocation.ts index e046f94..7656bb8 100644 --- a/src/utils/getLocation.ts +++ b/src/utils/getLocation.ts @@ -20,7 +20,7 @@ return 'IE' } // 判断是否IE浏览器 } -console.log(myBrowser(), '当前浏览器') +// console.log(myBrowser(), '当前浏览器') export const getLocation = () => { const browserType = myBrowser() @@ -29,7 +29,7 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { @@ -41,7 +41,7 @@ } function errorCallback(error: any) { - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } else { @@ -49,25 +49,25 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { - console.log(position, 'position') + // console.log(position, 'position') var latitude = position.coords.latitude var longitude = position.coords.longitude - console.log(`Latitude22: ${latitude}`) - console.log(`Longitude22: ${longitude}`) + // console.log(`Latitude22: ${latitude}`) + // console.log(`Longitude22: ${longitude}`) const data = wgs84togcj02(Number(position.coords.longitude), Number(position.coords.latitude)) - console.log(`latitude: ${data[1]}`) - console.log(`longitude: ${data[0]}`) + // console.log(`latitude: ${data[1]}`) + // console.log(`longitude: ${data[0]}`) sessionStorage.setItem('latitude', data[1]) sessionStorage.setItem('longitude', data[0]) } function errorCallback(error: any) { // console.log('errorrr') - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } } diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts index 3b77c80..694f79c 100644 --- a/src/utils/keepQuery.ts +++ b/src/utils/keepQuery.ts @@ -7,10 +7,10 @@ export function keepSearchParams(to: any, componentName: string) { if (needKeep.some((item: string) => to.includes(item))) { keepAliveStore.add(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } else { keepAliveStore.remove(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } } diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@
- + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/utils/String.ts b/src/utils/String.ts index a34a192..6b28042 100644 --- a/src/utils/String.ts +++ b/src/utils/String.ts @@ -44,3 +44,15 @@ // return "rgb(" + r + ", " + g + ", " + b + ")"; return [r, g, b] } + +// ji在字符串特定位置插入换行符str 字符串 interval 指定位置 比如说5 就会在 5 10 15 20 添加 +export function insertNewline(str, interval) { + let result = ''; + for (let i = 0; i < str.length; i += interval) { + result += str.slice(i, i + interval) + (i + interval < str.length ? '
' : ''); + } + if(str.length < interval) { + return str + } + return result; +} diff --git a/src/utils/download.ts b/src/utils/download.ts index d70f539..dff7277 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -17,7 +17,7 @@ * @param name 图片名称 */ export function downloadFile(file: File, name: string) { - console.log(new Blob([file]), 'new Blob([file])') + // console.log(new Blob([file]), 'new Blob([file])') const objectUrl = URL.createObjectURL(new Blob([file])) const link = document.createElement('a') link.download = name @@ -119,7 +119,7 @@ // 下载图片 const photo = ['jpg', 'jpeg', 'png'] const fileType = url.split('.')[url.split('.').length - 1] - console.log(fileType, 'fileType') + // console.log(fileType, 'fileType') if (photo.includes(fileType)) { // 图片 将服务器图片地址转化成本地地址 const image = new Image() diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts index 82d436b..0464065 100644 --- a/src/utils/exportXlsx.ts +++ b/src/utils/exportXlsx.ts @@ -39,7 +39,7 @@ if (keyArray.length < getLength(element)) { keyArray.push(key2) } - console.log(keyArray, 'keyArray') + // console.log(keyArray, 'keyArray') } } data.push(rowDataArray) @@ -47,7 +47,7 @@ } // keyArray为英文字段表头 data.splice(0, 0, keyArray as any, params.titleArr as any) - console.log('data', data) + // console.log('data', data) const ws = XLSX.utils.aoa_to_sheet(data) const wb = XLSX.utils.book_new() // 此处隐藏英文字段表头 diff --git a/src/utils/getLocation.ts b/src/utils/getLocation.ts index e046f94..7656bb8 100644 --- a/src/utils/getLocation.ts +++ b/src/utils/getLocation.ts @@ -20,7 +20,7 @@ return 'IE' } // 判断是否IE浏览器 } -console.log(myBrowser(), '当前浏览器') +// console.log(myBrowser(), '当前浏览器') export const getLocation = () => { const browserType = myBrowser() @@ -29,7 +29,7 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { @@ -41,7 +41,7 @@ } function errorCallback(error: any) { - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } else { @@ -49,25 +49,25 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { - console.log(position, 'position') + // console.log(position, 'position') var latitude = position.coords.latitude var longitude = position.coords.longitude - console.log(`Latitude22: ${latitude}`) - console.log(`Longitude22: ${longitude}`) + // console.log(`Latitude22: ${latitude}`) + // console.log(`Longitude22: ${longitude}`) const data = wgs84togcj02(Number(position.coords.longitude), Number(position.coords.latitude)) - console.log(`latitude: ${data[1]}`) - console.log(`longitude: ${data[0]}`) + // console.log(`latitude: ${data[1]}`) + // console.log(`longitude: ${data[0]}`) sessionStorage.setItem('latitude', data[1]) sessionStorage.setItem('longitude', data[0]) } function errorCallback(error: any) { // console.log('errorrr') - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } } diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts index 3b77c80..694f79c 100644 --- a/src/utils/keepQuery.ts +++ b/src/utils/keepQuery.ts @@ -7,10 +7,10 @@ export function keepSearchParams(to: any, componentName: string) { if (needKeep.some((item: string) => to.includes(item))) { keepAliveStore.add(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } else { keepAliveStore.remove(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } } diff --git a/src/utils/sessionData.ts b/src/utils/sessionData.ts index 07e9567..8500c1f 100644 --- a/src/utils/sessionData.ts +++ b/src/utils/sessionData.ts @@ -13,12 +13,12 @@ // 先判断indexDB中是否含有该数据 if (allData.filter((item: any) => item.name === name).length) { indexDB.update({ id: allData.filter((item: any) => item.name === name)[0].id, name: name, data: data }).then(() => { - console.log(`indexDB数据更新成功--${name}`) + // console.log(`indexDB数据更新成功--${name}`) }) } else { indexDB.add({ name: name, data: data }).then(() => { - console.log(`indexDB数据添加成功--${name}`) + // console.log(`indexDB数据添加成功--${name}`) }) } }) @@ -43,21 +43,21 @@ export const fetchCacheWell = () => { getWellList({}).then(res => { indexDBHandler('all-well-list', JSON.stringify(res.data)) - console.log(res.data, '闸井列表') + // console.log(res.data, '闸井列表') }) } // 九五示范区闸井列表 export const fetchCacheWell95 = () => { getWellList({ sfq: '1' }).then(res => { indexDBHandler('all-well-95-list', JSON.stringify(res.data)) - console.log(res.data, '九五示范区闸井列表') + // console.log(res.data, '九五示范区闸井列表') }) } // 场站列表 export const fetchCacheStation = () => { getStationList({}).then(res => { indexDBHandler('all-station-list', JSON.stringify(res.data)) - console.log(res.data, '场站列表') + // console.log(res.data, '场站列表') }) } // 管线列表 @@ -66,7 +66,7 @@ export const fetchCacheDept = () => { getDeptTreeList().then(res => { indexDBHandler('all-dept-list', JSON.stringify(res.data)) - console.log(res.data, '组织机构') + // console.log(res.data, '组织机构') }) } // 场站视频云台 diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@
- + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/utils/String.ts b/src/utils/String.ts index a34a192..6b28042 100644 --- a/src/utils/String.ts +++ b/src/utils/String.ts @@ -44,3 +44,15 @@ // return "rgb(" + r + ", " + g + ", " + b + ")"; return [r, g, b] } + +// ji在字符串特定位置插入换行符str 字符串 interval 指定位置 比如说5 就会在 5 10 15 20 添加 +export function insertNewline(str, interval) { + let result = ''; + for (let i = 0; i < str.length; i += interval) { + result += str.slice(i, i + interval) + (i + interval < str.length ? '
' : ''); + } + if(str.length < interval) { + return str + } + return result; +} diff --git a/src/utils/download.ts b/src/utils/download.ts index d70f539..dff7277 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -17,7 +17,7 @@ * @param name 图片名称 */ export function downloadFile(file: File, name: string) { - console.log(new Blob([file]), 'new Blob([file])') + // console.log(new Blob([file]), 'new Blob([file])') const objectUrl = URL.createObjectURL(new Blob([file])) const link = document.createElement('a') link.download = name @@ -119,7 +119,7 @@ // 下载图片 const photo = ['jpg', 'jpeg', 'png'] const fileType = url.split('.')[url.split('.').length - 1] - console.log(fileType, 'fileType') + // console.log(fileType, 'fileType') if (photo.includes(fileType)) { // 图片 将服务器图片地址转化成本地地址 const image = new Image() diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts index 82d436b..0464065 100644 --- a/src/utils/exportXlsx.ts +++ b/src/utils/exportXlsx.ts @@ -39,7 +39,7 @@ if (keyArray.length < getLength(element)) { keyArray.push(key2) } - console.log(keyArray, 'keyArray') + // console.log(keyArray, 'keyArray') } } data.push(rowDataArray) @@ -47,7 +47,7 @@ } // keyArray为英文字段表头 data.splice(0, 0, keyArray as any, params.titleArr as any) - console.log('data', data) + // console.log('data', data) const ws = XLSX.utils.aoa_to_sheet(data) const wb = XLSX.utils.book_new() // 此处隐藏英文字段表头 diff --git a/src/utils/getLocation.ts b/src/utils/getLocation.ts index e046f94..7656bb8 100644 --- a/src/utils/getLocation.ts +++ b/src/utils/getLocation.ts @@ -20,7 +20,7 @@ return 'IE' } // 判断是否IE浏览器 } -console.log(myBrowser(), '当前浏览器') +// console.log(myBrowser(), '当前浏览器') export const getLocation = () => { const browserType = myBrowser() @@ -29,7 +29,7 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { @@ -41,7 +41,7 @@ } function errorCallback(error: any) { - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } else { @@ -49,25 +49,25 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { - console.log(position, 'position') + // console.log(position, 'position') var latitude = position.coords.latitude var longitude = position.coords.longitude - console.log(`Latitude22: ${latitude}`) - console.log(`Longitude22: ${longitude}`) + // console.log(`Latitude22: ${latitude}`) + // console.log(`Longitude22: ${longitude}`) const data = wgs84togcj02(Number(position.coords.longitude), Number(position.coords.latitude)) - console.log(`latitude: ${data[1]}`) - console.log(`longitude: ${data[0]}`) + // console.log(`latitude: ${data[1]}`) + // console.log(`longitude: ${data[0]}`) sessionStorage.setItem('latitude', data[1]) sessionStorage.setItem('longitude', data[0]) } function errorCallback(error: any) { // console.log('errorrr') - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } } diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts index 3b77c80..694f79c 100644 --- a/src/utils/keepQuery.ts +++ b/src/utils/keepQuery.ts @@ -7,10 +7,10 @@ export function keepSearchParams(to: any, componentName: string) { if (needKeep.some((item: string) => to.includes(item))) { keepAliveStore.add(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } else { keepAliveStore.remove(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } } diff --git a/src/utils/sessionData.ts b/src/utils/sessionData.ts index 07e9567..8500c1f 100644 --- a/src/utils/sessionData.ts +++ b/src/utils/sessionData.ts @@ -13,12 +13,12 @@ // 先判断indexDB中是否含有该数据 if (allData.filter((item: any) => item.name === name).length) { indexDB.update({ id: allData.filter((item: any) => item.name === name)[0].id, name: name, data: data }).then(() => { - console.log(`indexDB数据更新成功--${name}`) + // console.log(`indexDB数据更新成功--${name}`) }) } else { indexDB.add({ name: name, data: data }).then(() => { - console.log(`indexDB数据添加成功--${name}`) + // console.log(`indexDB数据添加成功--${name}`) }) } }) @@ -43,21 +43,21 @@ export const fetchCacheWell = () => { getWellList({}).then(res => { indexDBHandler('all-well-list', JSON.stringify(res.data)) - console.log(res.data, '闸井列表') + // console.log(res.data, '闸井列表') }) } // 九五示范区闸井列表 export const fetchCacheWell95 = () => { getWellList({ sfq: '1' }).then(res => { indexDBHandler('all-well-95-list', JSON.stringify(res.data)) - console.log(res.data, '九五示范区闸井列表') + // console.log(res.data, '九五示范区闸井列表') }) } // 场站列表 export const fetchCacheStation = () => { getStationList({}).then(res => { indexDBHandler('all-station-list', JSON.stringify(res.data)) - console.log(res.data, '场站列表') + // console.log(res.data, '场站列表') }) } // 管线列表 @@ -66,7 +66,7 @@ export const fetchCacheDept = () => { getDeptTreeList().then(res => { indexDBHandler('all-dept-list', JSON.stringify(res.data)) - console.log(res.data, '组织机构') + // console.log(res.data, '组织机构') }) } // 场站视频云台 diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 6c57fb1..186eb97 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -370,7 +370,7 @@
现场确认情况: - + {{ info.confirmContent }}
处置情况: - + {{ type === 'data' ? info.processContent : info.processStatusName }}
diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@
- + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/utils/String.ts b/src/utils/String.ts index a34a192..6b28042 100644 --- a/src/utils/String.ts +++ b/src/utils/String.ts @@ -44,3 +44,15 @@ // return "rgb(" + r + ", " + g + ", " + b + ")"; return [r, g, b] } + +// ji在字符串特定位置插入换行符str 字符串 interval 指定位置 比如说5 就会在 5 10 15 20 添加 +export function insertNewline(str, interval) { + let result = ''; + for (let i = 0; i < str.length; i += interval) { + result += str.slice(i, i + interval) + (i + interval < str.length ? '
' : ''); + } + if(str.length < interval) { + return str + } + return result; +} diff --git a/src/utils/download.ts b/src/utils/download.ts index d70f539..dff7277 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -17,7 +17,7 @@ * @param name 图片名称 */ export function downloadFile(file: File, name: string) { - console.log(new Blob([file]), 'new Blob([file])') + // console.log(new Blob([file]), 'new Blob([file])') const objectUrl = URL.createObjectURL(new Blob([file])) const link = document.createElement('a') link.download = name @@ -119,7 +119,7 @@ // 下载图片 const photo = ['jpg', 'jpeg', 'png'] const fileType = url.split('.')[url.split('.').length - 1] - console.log(fileType, 'fileType') + // console.log(fileType, 'fileType') if (photo.includes(fileType)) { // 图片 将服务器图片地址转化成本地地址 const image = new Image() diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts index 82d436b..0464065 100644 --- a/src/utils/exportXlsx.ts +++ b/src/utils/exportXlsx.ts @@ -39,7 +39,7 @@ if (keyArray.length < getLength(element)) { keyArray.push(key2) } - console.log(keyArray, 'keyArray') + // console.log(keyArray, 'keyArray') } } data.push(rowDataArray) @@ -47,7 +47,7 @@ } // keyArray为英文字段表头 data.splice(0, 0, keyArray as any, params.titleArr as any) - console.log('data', data) + // console.log('data', data) const ws = XLSX.utils.aoa_to_sheet(data) const wb = XLSX.utils.book_new() // 此处隐藏英文字段表头 diff --git a/src/utils/getLocation.ts b/src/utils/getLocation.ts index e046f94..7656bb8 100644 --- a/src/utils/getLocation.ts +++ b/src/utils/getLocation.ts @@ -20,7 +20,7 @@ return 'IE' } // 判断是否IE浏览器 } -console.log(myBrowser(), '当前浏览器') +// console.log(myBrowser(), '当前浏览器') export const getLocation = () => { const browserType = myBrowser() @@ -29,7 +29,7 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { @@ -41,7 +41,7 @@ } function errorCallback(error: any) { - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } else { @@ -49,25 +49,25 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { - console.log(position, 'position') + // console.log(position, 'position') var latitude = position.coords.latitude var longitude = position.coords.longitude - console.log(`Latitude22: ${latitude}`) - console.log(`Longitude22: ${longitude}`) + // console.log(`Latitude22: ${latitude}`) + // console.log(`Longitude22: ${longitude}`) const data = wgs84togcj02(Number(position.coords.longitude), Number(position.coords.latitude)) - console.log(`latitude: ${data[1]}`) - console.log(`longitude: ${data[0]}`) + // console.log(`latitude: ${data[1]}`) + // console.log(`longitude: ${data[0]}`) sessionStorage.setItem('latitude', data[1]) sessionStorage.setItem('longitude', data[0]) } function errorCallback(error: any) { // console.log('errorrr') - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } } diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts index 3b77c80..694f79c 100644 --- a/src/utils/keepQuery.ts +++ b/src/utils/keepQuery.ts @@ -7,10 +7,10 @@ export function keepSearchParams(to: any, componentName: string) { if (needKeep.some((item: string) => to.includes(item))) { keepAliveStore.add(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } else { keepAliveStore.remove(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } } diff --git a/src/utils/sessionData.ts b/src/utils/sessionData.ts index 07e9567..8500c1f 100644 --- a/src/utils/sessionData.ts +++ b/src/utils/sessionData.ts @@ -13,12 +13,12 @@ // 先判断indexDB中是否含有该数据 if (allData.filter((item: any) => item.name === name).length) { indexDB.update({ id: allData.filter((item: any) => item.name === name)[0].id, name: name, data: data }).then(() => { - console.log(`indexDB数据更新成功--${name}`) + // console.log(`indexDB数据更新成功--${name}`) }) } else { indexDB.add({ name: name, data: data }).then(() => { - console.log(`indexDB数据添加成功--${name}`) + // console.log(`indexDB数据添加成功--${name}`) }) } }) @@ -43,21 +43,21 @@ export const fetchCacheWell = () => { getWellList({}).then(res => { indexDBHandler('all-well-list', JSON.stringify(res.data)) - console.log(res.data, '闸井列表') + // console.log(res.data, '闸井列表') }) } // 九五示范区闸井列表 export const fetchCacheWell95 = () => { getWellList({ sfq: '1' }).then(res => { indexDBHandler('all-well-95-list', JSON.stringify(res.data)) - console.log(res.data, '九五示范区闸井列表') + // console.log(res.data, '九五示范区闸井列表') }) } // 场站列表 export const fetchCacheStation = () => { getStationList({}).then(res => { indexDBHandler('all-station-list', JSON.stringify(res.data)) - console.log(res.data, '场站列表') + // console.log(res.data, '场站列表') }) } // 管线列表 @@ -66,7 +66,7 @@ export const fetchCacheDept = () => { getDeptTreeList().then(res => { indexDBHandler('all-dept-list', JSON.stringify(res.data)) - console.log(res.data, '组织机构') + // console.log(res.data, '组织机构') }) } // 场站视频云台 diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 6c57fb1..186eb97 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -370,7 +370,7 @@
现场确认情况: - + {{ info.confirmContent }}
处置情况: - + {{ type === 'data' ? info.processContent : info.processStatusName }}
diff --git a/src/views/home/alarm/current/components/processDialog.vue b/src/views/home/alarm/current/components/processDialog.vue index d093fa3..32c7141 100644 --- a/src/views/home/alarm/current/components/processDialog.vue +++ b/src/views/home/alarm/current/components/processDialog.vue @@ -7,6 +7,7 @@ import { alarmProcessNode } from '@/api/home/alarm/current' import { uniqueMultiArray } from '@/utils/Array' import { encrypt, decrypt, isEncrypt } from '@/utils/security1' +import { insertNewline } from '@/utils/String' const emits = defineEmits(['refresh']) const dialogFormVisible = ref(false) // 对话框是否显示 const initData = [ @@ -36,7 +37,7 @@ }, { name: '处置人员', - procrssNames: ['待处置'], + procrssNames: ['待处置', '已处置'], processCode: ['6', '7'], icon0: '人员-0', icon1: '人员-1', @@ -45,7 +46,7 @@ { name: '设备正常', procrssNames: ['已处置'], - processCode: ['8'], + processCode: ['7','10'], icon0: '设备-0', icon1: '设备-1', active: 5, @@ -53,7 +54,7 @@ { name: '结束', procrssNames: ['已处置'], - processCode: ['9'], + processCode: ['7','10'], icon0: '结束', icon1: '结束', active: 6, @@ -155,7 +156,11 @@ 时间: ${data[index].APPROVAL_TIME}
人员: ${data[index].NAME || data[index].APPROVAL_PERSON}
操作: ${data[index].process_name}
- ${processData.value[cindex].procrssNames.includes('已确认') ? '确认' : processData.value[cindex].procrssNames.includes('已处置') ? '处置' : ''}内容: ${data[index].DESCN}
+ ${processData.value[cindex].procrssNames.includes('已确认') ? '确认' : processData.value[cindex].procrssNames.includes('已处置') ? '处置' : ''}内容: + + ${insertNewline(data[index].DESCN, 15)} + +
` } else { @@ -174,7 +179,7 @@ 操作: 报警生成
` // 确认误报 - if (data.length < 4 && Number(data[data.length - 1].FLOW_STATUS) >= 7) { + if (data.some((item) => item.DESCN.includes('误报')) && Number(data[data.length - 1].FLOW_STATUS) >= 7) { processData.value = processData.value.filter((item: any) => item.name !== '处置人员') const cindex = processData.value.findIndex((item: any) => item.name === '确认人员') if (!processData.value[cindex].content) { @@ -196,6 +201,7 @@ // processData.value[processData.value.length - 1].content = processData.value[processData.value.length - 2].content // } } + // console.log(processData.value, 'processDataprocessData') } loading.value = false }).catch(() => { diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@
- + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/utils/String.ts b/src/utils/String.ts index a34a192..6b28042 100644 --- a/src/utils/String.ts +++ b/src/utils/String.ts @@ -44,3 +44,15 @@ // return "rgb(" + r + ", " + g + ", " + b + ")"; return [r, g, b] } + +// ji在字符串特定位置插入换行符str 字符串 interval 指定位置 比如说5 就会在 5 10 15 20 添加 +export function insertNewline(str, interval) { + let result = ''; + for (let i = 0; i < str.length; i += interval) { + result += str.slice(i, i + interval) + (i + interval < str.length ? '
' : ''); + } + if(str.length < interval) { + return str + } + return result; +} diff --git a/src/utils/download.ts b/src/utils/download.ts index d70f539..dff7277 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -17,7 +17,7 @@ * @param name 图片名称 */ export function downloadFile(file: File, name: string) { - console.log(new Blob([file]), 'new Blob([file])') + // console.log(new Blob([file]), 'new Blob([file])') const objectUrl = URL.createObjectURL(new Blob([file])) const link = document.createElement('a') link.download = name @@ -119,7 +119,7 @@ // 下载图片 const photo = ['jpg', 'jpeg', 'png'] const fileType = url.split('.')[url.split('.').length - 1] - console.log(fileType, 'fileType') + // console.log(fileType, 'fileType') if (photo.includes(fileType)) { // 图片 将服务器图片地址转化成本地地址 const image = new Image() diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts index 82d436b..0464065 100644 --- a/src/utils/exportXlsx.ts +++ b/src/utils/exportXlsx.ts @@ -39,7 +39,7 @@ if (keyArray.length < getLength(element)) { keyArray.push(key2) } - console.log(keyArray, 'keyArray') + // console.log(keyArray, 'keyArray') } } data.push(rowDataArray) @@ -47,7 +47,7 @@ } // keyArray为英文字段表头 data.splice(0, 0, keyArray as any, params.titleArr as any) - console.log('data', data) + // console.log('data', data) const ws = XLSX.utils.aoa_to_sheet(data) const wb = XLSX.utils.book_new() // 此处隐藏英文字段表头 diff --git a/src/utils/getLocation.ts b/src/utils/getLocation.ts index e046f94..7656bb8 100644 --- a/src/utils/getLocation.ts +++ b/src/utils/getLocation.ts @@ -20,7 +20,7 @@ return 'IE' } // 判断是否IE浏览器 } -console.log(myBrowser(), '当前浏览器') +// console.log(myBrowser(), '当前浏览器') export const getLocation = () => { const browserType = myBrowser() @@ -29,7 +29,7 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { @@ -41,7 +41,7 @@ } function errorCallback(error: any) { - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } else { @@ -49,25 +49,25 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { - console.log(position, 'position') + // console.log(position, 'position') var latitude = position.coords.latitude var longitude = position.coords.longitude - console.log(`Latitude22: ${latitude}`) - console.log(`Longitude22: ${longitude}`) + // console.log(`Latitude22: ${latitude}`) + // console.log(`Longitude22: ${longitude}`) const data = wgs84togcj02(Number(position.coords.longitude), Number(position.coords.latitude)) - console.log(`latitude: ${data[1]}`) - console.log(`longitude: ${data[0]}`) + // console.log(`latitude: ${data[1]}`) + // console.log(`longitude: ${data[0]}`) sessionStorage.setItem('latitude', data[1]) sessionStorage.setItem('longitude', data[0]) } function errorCallback(error: any) { // console.log('errorrr') - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } } diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts index 3b77c80..694f79c 100644 --- a/src/utils/keepQuery.ts +++ b/src/utils/keepQuery.ts @@ -7,10 +7,10 @@ export function keepSearchParams(to: any, componentName: string) { if (needKeep.some((item: string) => to.includes(item))) { keepAliveStore.add(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } else { keepAliveStore.remove(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } } diff --git a/src/utils/sessionData.ts b/src/utils/sessionData.ts index 07e9567..8500c1f 100644 --- a/src/utils/sessionData.ts +++ b/src/utils/sessionData.ts @@ -13,12 +13,12 @@ // 先判断indexDB中是否含有该数据 if (allData.filter((item: any) => item.name === name).length) { indexDB.update({ id: allData.filter((item: any) => item.name === name)[0].id, name: name, data: data }).then(() => { - console.log(`indexDB数据更新成功--${name}`) + // console.log(`indexDB数据更新成功--${name}`) }) } else { indexDB.add({ name: name, data: data }).then(() => { - console.log(`indexDB数据添加成功--${name}`) + // console.log(`indexDB数据添加成功--${name}`) }) } }) @@ -43,21 +43,21 @@ export const fetchCacheWell = () => { getWellList({}).then(res => { indexDBHandler('all-well-list', JSON.stringify(res.data)) - console.log(res.data, '闸井列表') + // console.log(res.data, '闸井列表') }) } // 九五示范区闸井列表 export const fetchCacheWell95 = () => { getWellList({ sfq: '1' }).then(res => { indexDBHandler('all-well-95-list', JSON.stringify(res.data)) - console.log(res.data, '九五示范区闸井列表') + // console.log(res.data, '九五示范区闸井列表') }) } // 场站列表 export const fetchCacheStation = () => { getStationList({}).then(res => { indexDBHandler('all-station-list', JSON.stringify(res.data)) - console.log(res.data, '场站列表') + // console.log(res.data, '场站列表') }) } // 管线列表 @@ -66,7 +66,7 @@ export const fetchCacheDept = () => { getDeptTreeList().then(res => { indexDBHandler('all-dept-list', JSON.stringify(res.data)) - console.log(res.data, '组织机构') + // console.log(res.data, '组织机构') }) } // 场站视频云台 diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 6c57fb1..186eb97 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -370,7 +370,7 @@
现场确认情况: - + {{ info.confirmContent }}
处置情况: - + {{ type === 'data' ? info.processContent : info.processStatusName }}
diff --git a/src/views/home/alarm/current/components/processDialog.vue b/src/views/home/alarm/current/components/processDialog.vue index d093fa3..32c7141 100644 --- a/src/views/home/alarm/current/components/processDialog.vue +++ b/src/views/home/alarm/current/components/processDialog.vue @@ -7,6 +7,7 @@ import { alarmProcessNode } from '@/api/home/alarm/current' import { uniqueMultiArray } from '@/utils/Array' import { encrypt, decrypt, isEncrypt } from '@/utils/security1' +import { insertNewline } from '@/utils/String' const emits = defineEmits(['refresh']) const dialogFormVisible = ref(false) // 对话框是否显示 const initData = [ @@ -36,7 +37,7 @@ }, { name: '处置人员', - procrssNames: ['待处置'], + procrssNames: ['待处置', '已处置'], processCode: ['6', '7'], icon0: '人员-0', icon1: '人员-1', @@ -45,7 +46,7 @@ { name: '设备正常', procrssNames: ['已处置'], - processCode: ['8'], + processCode: ['7','10'], icon0: '设备-0', icon1: '设备-1', active: 5, @@ -53,7 +54,7 @@ { name: '结束', procrssNames: ['已处置'], - processCode: ['9'], + processCode: ['7','10'], icon0: '结束', icon1: '结束', active: 6, @@ -155,7 +156,11 @@ 时间: ${data[index].APPROVAL_TIME}
人员: ${data[index].NAME || data[index].APPROVAL_PERSON}
操作: ${data[index].process_name}
- ${processData.value[cindex].procrssNames.includes('已确认') ? '确认' : processData.value[cindex].procrssNames.includes('已处置') ? '处置' : ''}内容: ${data[index].DESCN}
+ ${processData.value[cindex].procrssNames.includes('已确认') ? '确认' : processData.value[cindex].procrssNames.includes('已处置') ? '处置' : ''}内容: + + ${insertNewline(data[index].DESCN, 15)} + +
` } else { @@ -174,7 +179,7 @@ 操作: 报警生成
` // 确认误报 - if (data.length < 4 && Number(data[data.length - 1].FLOW_STATUS) >= 7) { + if (data.some((item) => item.DESCN.includes('误报')) && Number(data[data.length - 1].FLOW_STATUS) >= 7) { processData.value = processData.value.filter((item: any) => item.name !== '处置人员') const cindex = processData.value.findIndex((item: any) => item.name === '确认人员') if (!processData.value[cindex].content) { @@ -196,6 +201,7 @@ // processData.value[processData.value.length - 1].content = processData.value[processData.value.length - 2].content // } } + // console.log(processData.value, 'processDataprocessData') } loading.value = false }).catch(() => { diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index b407a43..40973a0 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -36,12 +36,12 @@ // 初始展示列 const columns = ref([ { text: '报警类型', value: 'alarmType', align: 'center', width: '130' }, - { text: '报警等级', value: 'alarmLevelName', align: 'center', width: '85', isRequired: false }, + { text: '报警等级', value: 'alarmLevelName', align: 'center', width: '85' }, { text: '报警原因', value: 'alarmReason', align: 'center', }, { text: '位置', value: 'position', align: 'center', isCustom: true, }, { text: '设备类型', value: 'devTypeName', align: 'center', width: '145', isRequired: false, }, { text: '设备编号', value: 'devcode', align: 'center', width: '160', isCustom: true, isRequired: false, }, - { text: '管理单位', value: 'deptName', align: 'center', width: '400', }, + { text: '管理单位', value: 'deptName', align: 'center', width: '400', isRequired: false, }, { text: '状态', value: 'processStatusName', align: 'center', width: '100', isCustom: true, }, { text: '报警时间', value: 'alarmTime', align: 'center', width: '170' }, ]) @@ -229,6 +229,14 @@ obj.endTime = row.ALARM_TIME datetimerange.value = [row.ALARM_TIME, row.ALARM_TIME] } + // 全局报警弹窗跳转过来 + if ($route.query.type === 'alarm-dialog') { + obj.begTime = row.alarmTime + obj.endTime = row.alarmTime + datetimerange.value = [row.alarmTime, row.alarmTime] + obj.position = row.tagNumber + listQuery.value.position = row.tagNumber + } getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = $route.query.type === 'localAnalyse' || $route.query.type === 'alarm-note' ? res.data.rows : res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { @@ -372,6 +380,7 @@ const mapData = ref({}) const cacheRow = ref({}) async function detail(row: any) { + // 分公司、集团点查看不切换状态 if (row.processStatusName === '未读') { list1.value[list1.value.findIndex((item: any) => item.id === row.id)].processStatusName = '已读' row.processStatusName = '已读' @@ -394,7 +403,7 @@ mapRef.value.mapRef.addMarker({ position: [data.lngGaode, data.latGaode], // content: '
', - content: row.alarmLevelName === '预警' || row.alarmLevelName === '一级' ? '
' : '
', + content: row.alarmLevelName === '预警' || row.alarmLevelName === '一级' ? '
' : '
', label: '', offsetX: -25, offsetY: -25, @@ -672,7 +681,7 @@ - + @@ -684,38 +693,41 @@ - - - - - - - - - - - - - - - - - - - - - - + +
diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@ - + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/utils/String.ts b/src/utils/String.ts index a34a192..6b28042 100644 --- a/src/utils/String.ts +++ b/src/utils/String.ts @@ -44,3 +44,15 @@ // return "rgb(" + r + ", " + g + ", " + b + ")"; return [r, g, b] } + +// ji在字符串特定位置插入换行符str 字符串 interval 指定位置 比如说5 就会在 5 10 15 20 添加 +export function insertNewline(str, interval) { + let result = ''; + for (let i = 0; i < str.length; i += interval) { + result += str.slice(i, i + interval) + (i + interval < str.length ? '
' : ''); + } + if(str.length < interval) { + return str + } + return result; +} diff --git a/src/utils/download.ts b/src/utils/download.ts index d70f539..dff7277 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -17,7 +17,7 @@ * @param name 图片名称 */ export function downloadFile(file: File, name: string) { - console.log(new Blob([file]), 'new Blob([file])') + // console.log(new Blob([file]), 'new Blob([file])') const objectUrl = URL.createObjectURL(new Blob([file])) const link = document.createElement('a') link.download = name @@ -119,7 +119,7 @@ // 下载图片 const photo = ['jpg', 'jpeg', 'png'] const fileType = url.split('.')[url.split('.').length - 1] - console.log(fileType, 'fileType') + // console.log(fileType, 'fileType') if (photo.includes(fileType)) { // 图片 将服务器图片地址转化成本地地址 const image = new Image() diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts index 82d436b..0464065 100644 --- a/src/utils/exportXlsx.ts +++ b/src/utils/exportXlsx.ts @@ -39,7 +39,7 @@ if (keyArray.length < getLength(element)) { keyArray.push(key2) } - console.log(keyArray, 'keyArray') + // console.log(keyArray, 'keyArray') } } data.push(rowDataArray) @@ -47,7 +47,7 @@ } // keyArray为英文字段表头 data.splice(0, 0, keyArray as any, params.titleArr as any) - console.log('data', data) + // console.log('data', data) const ws = XLSX.utils.aoa_to_sheet(data) const wb = XLSX.utils.book_new() // 此处隐藏英文字段表头 diff --git a/src/utils/getLocation.ts b/src/utils/getLocation.ts index e046f94..7656bb8 100644 --- a/src/utils/getLocation.ts +++ b/src/utils/getLocation.ts @@ -20,7 +20,7 @@ return 'IE' } // 判断是否IE浏览器 } -console.log(myBrowser(), '当前浏览器') +// console.log(myBrowser(), '当前浏览器') export const getLocation = () => { const browserType = myBrowser() @@ -29,7 +29,7 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { @@ -41,7 +41,7 @@ } function errorCallback(error: any) { - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } else { @@ -49,25 +49,25 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { - console.log(position, 'position') + // console.log(position, 'position') var latitude = position.coords.latitude var longitude = position.coords.longitude - console.log(`Latitude22: ${latitude}`) - console.log(`Longitude22: ${longitude}`) + // console.log(`Latitude22: ${latitude}`) + // console.log(`Longitude22: ${longitude}`) const data = wgs84togcj02(Number(position.coords.longitude), Number(position.coords.latitude)) - console.log(`latitude: ${data[1]}`) - console.log(`longitude: ${data[0]}`) + // console.log(`latitude: ${data[1]}`) + // console.log(`longitude: ${data[0]}`) sessionStorage.setItem('latitude', data[1]) sessionStorage.setItem('longitude', data[0]) } function errorCallback(error: any) { // console.log('errorrr') - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } } diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts index 3b77c80..694f79c 100644 --- a/src/utils/keepQuery.ts +++ b/src/utils/keepQuery.ts @@ -7,10 +7,10 @@ export function keepSearchParams(to: any, componentName: string) { if (needKeep.some((item: string) => to.includes(item))) { keepAliveStore.add(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } else { keepAliveStore.remove(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } } diff --git a/src/utils/sessionData.ts b/src/utils/sessionData.ts index 07e9567..8500c1f 100644 --- a/src/utils/sessionData.ts +++ b/src/utils/sessionData.ts @@ -13,12 +13,12 @@ // 先判断indexDB中是否含有该数据 if (allData.filter((item: any) => item.name === name).length) { indexDB.update({ id: allData.filter((item: any) => item.name === name)[0].id, name: name, data: data }).then(() => { - console.log(`indexDB数据更新成功--${name}`) + // console.log(`indexDB数据更新成功--${name}`) }) } else { indexDB.add({ name: name, data: data }).then(() => { - console.log(`indexDB数据添加成功--${name}`) + // console.log(`indexDB数据添加成功--${name}`) }) } }) @@ -43,21 +43,21 @@ export const fetchCacheWell = () => { getWellList({}).then(res => { indexDBHandler('all-well-list', JSON.stringify(res.data)) - console.log(res.data, '闸井列表') + // console.log(res.data, '闸井列表') }) } // 九五示范区闸井列表 export const fetchCacheWell95 = () => { getWellList({ sfq: '1' }).then(res => { indexDBHandler('all-well-95-list', JSON.stringify(res.data)) - console.log(res.data, '九五示范区闸井列表') + // console.log(res.data, '九五示范区闸井列表') }) } // 场站列表 export const fetchCacheStation = () => { getStationList({}).then(res => { indexDBHandler('all-station-list', JSON.stringify(res.data)) - console.log(res.data, '场站列表') + // console.log(res.data, '场站列表') }) } // 管线列表 @@ -66,7 +66,7 @@ export const fetchCacheDept = () => { getDeptTreeList().then(res => { indexDBHandler('all-dept-list', JSON.stringify(res.data)) - console.log(res.data, '组织机构') + // console.log(res.data, '组织机构') }) } // 场站视频云台 diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 6c57fb1..186eb97 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -370,7 +370,7 @@
现场确认情况: - + {{ info.confirmContent }}
处置情况: - + {{ type === 'data' ? info.processContent : info.processStatusName }}
diff --git a/src/views/home/alarm/current/components/processDialog.vue b/src/views/home/alarm/current/components/processDialog.vue index d093fa3..32c7141 100644 --- a/src/views/home/alarm/current/components/processDialog.vue +++ b/src/views/home/alarm/current/components/processDialog.vue @@ -7,6 +7,7 @@ import { alarmProcessNode } from '@/api/home/alarm/current' import { uniqueMultiArray } from '@/utils/Array' import { encrypt, decrypt, isEncrypt } from '@/utils/security1' +import { insertNewline } from '@/utils/String' const emits = defineEmits(['refresh']) const dialogFormVisible = ref(false) // 对话框是否显示 const initData = [ @@ -36,7 +37,7 @@ }, { name: '处置人员', - procrssNames: ['待处置'], + procrssNames: ['待处置', '已处置'], processCode: ['6', '7'], icon0: '人员-0', icon1: '人员-1', @@ -45,7 +46,7 @@ { name: '设备正常', procrssNames: ['已处置'], - processCode: ['8'], + processCode: ['7','10'], icon0: '设备-0', icon1: '设备-1', active: 5, @@ -53,7 +54,7 @@ { name: '结束', procrssNames: ['已处置'], - processCode: ['9'], + processCode: ['7','10'], icon0: '结束', icon1: '结束', active: 6, @@ -155,7 +156,11 @@ 时间: ${data[index].APPROVAL_TIME}
人员: ${data[index].NAME || data[index].APPROVAL_PERSON}
操作: ${data[index].process_name}
- ${processData.value[cindex].procrssNames.includes('已确认') ? '确认' : processData.value[cindex].procrssNames.includes('已处置') ? '处置' : ''}内容: ${data[index].DESCN}
+ ${processData.value[cindex].procrssNames.includes('已确认') ? '确认' : processData.value[cindex].procrssNames.includes('已处置') ? '处置' : ''}内容: + + ${insertNewline(data[index].DESCN, 15)} + +
` } else { @@ -174,7 +179,7 @@ 操作: 报警生成
` // 确认误报 - if (data.length < 4 && Number(data[data.length - 1].FLOW_STATUS) >= 7) { + if (data.some((item) => item.DESCN.includes('误报')) && Number(data[data.length - 1].FLOW_STATUS) >= 7) { processData.value = processData.value.filter((item: any) => item.name !== '处置人员') const cindex = processData.value.findIndex((item: any) => item.name === '确认人员') if (!processData.value[cindex].content) { @@ -196,6 +201,7 @@ // processData.value[processData.value.length - 1].content = processData.value[processData.value.length - 2].content // } } + // console.log(processData.value, 'processDataprocessData') } loading.value = false }).catch(() => { diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index b407a43..40973a0 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -36,12 +36,12 @@ // 初始展示列 const columns = ref([ { text: '报警类型', value: 'alarmType', align: 'center', width: '130' }, - { text: '报警等级', value: 'alarmLevelName', align: 'center', width: '85', isRequired: false }, + { text: '报警等级', value: 'alarmLevelName', align: 'center', width: '85' }, { text: '报警原因', value: 'alarmReason', align: 'center', }, { text: '位置', value: 'position', align: 'center', isCustom: true, }, { text: '设备类型', value: 'devTypeName', align: 'center', width: '145', isRequired: false, }, { text: '设备编号', value: 'devcode', align: 'center', width: '160', isCustom: true, isRequired: false, }, - { text: '管理单位', value: 'deptName', align: 'center', width: '400', }, + { text: '管理单位', value: 'deptName', align: 'center', width: '400', isRequired: false, }, { text: '状态', value: 'processStatusName', align: 'center', width: '100', isCustom: true, }, { text: '报警时间', value: 'alarmTime', align: 'center', width: '170' }, ]) @@ -229,6 +229,14 @@ obj.endTime = row.ALARM_TIME datetimerange.value = [row.ALARM_TIME, row.ALARM_TIME] } + // 全局报警弹窗跳转过来 + if ($route.query.type === 'alarm-dialog') { + obj.begTime = row.alarmTime + obj.endTime = row.alarmTime + datetimerange.value = [row.alarmTime, row.alarmTime] + obj.position = row.tagNumber + listQuery.value.position = row.tagNumber + } getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = $route.query.type === 'localAnalyse' || $route.query.type === 'alarm-note' ? res.data.rows : res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { @@ -372,6 +380,7 @@ const mapData = ref({}) const cacheRow = ref({}) async function detail(row: any) { + // 分公司、集团点查看不切换状态 if (row.processStatusName === '未读') { list1.value[list1.value.findIndex((item: any) => item.id === row.id)].processStatusName = '已读' row.processStatusName = '已读' @@ -394,7 +403,7 @@ mapRef.value.mapRef.addMarker({ position: [data.lngGaode, data.latGaode], // content: '
', - content: row.alarmLevelName === '预警' || row.alarmLevelName === '一级' ? '
' : '
', + content: row.alarmLevelName === '预警' || row.alarmLevelName === '一级' ? '
' : '
', label: '', offsetX: -25, offsetY: -25, @@ -672,7 +681,7 @@ - + @@ -684,38 +693,41 @@ - - - - - - - - - - - - - - - - - - - - - - + +
diff --git a/src/views/home/dashboard/components/detailInfoDialog.vue b/src/views/home/dashboard/components/detailInfoDialog.vue index 28ee981..84afa36 100644 --- a/src/views/home/dashboard/components/detailInfoDialog.vue +++ b/src/views/home/dashboard/components/detailInfoDialog.vue @@ -18,7 +18,7 @@ const flag = ref('') // 初始化 const initDialog = (e: any) => { - console.log(e, '信息窗体接收的数据') + // console.log(e, '信息窗体接收的数据') overlay.value = e.overlay infoWindow.value = e.infoWindow info.value = e.info diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@ - + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/utils/String.ts b/src/utils/String.ts index a34a192..6b28042 100644 --- a/src/utils/String.ts +++ b/src/utils/String.ts @@ -44,3 +44,15 @@ // return "rgb(" + r + ", " + g + ", " + b + ")"; return [r, g, b] } + +// ji在字符串特定位置插入换行符str 字符串 interval 指定位置 比如说5 就会在 5 10 15 20 添加 +export function insertNewline(str, interval) { + let result = ''; + for (let i = 0; i < str.length; i += interval) { + result += str.slice(i, i + interval) + (i + interval < str.length ? '
' : ''); + } + if(str.length < interval) { + return str + } + return result; +} diff --git a/src/utils/download.ts b/src/utils/download.ts index d70f539..dff7277 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -17,7 +17,7 @@ * @param name 图片名称 */ export function downloadFile(file: File, name: string) { - console.log(new Blob([file]), 'new Blob([file])') + // console.log(new Blob([file]), 'new Blob([file])') const objectUrl = URL.createObjectURL(new Blob([file])) const link = document.createElement('a') link.download = name @@ -119,7 +119,7 @@ // 下载图片 const photo = ['jpg', 'jpeg', 'png'] const fileType = url.split('.')[url.split('.').length - 1] - console.log(fileType, 'fileType') + // console.log(fileType, 'fileType') if (photo.includes(fileType)) { // 图片 将服务器图片地址转化成本地地址 const image = new Image() diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts index 82d436b..0464065 100644 --- a/src/utils/exportXlsx.ts +++ b/src/utils/exportXlsx.ts @@ -39,7 +39,7 @@ if (keyArray.length < getLength(element)) { keyArray.push(key2) } - console.log(keyArray, 'keyArray') + // console.log(keyArray, 'keyArray') } } data.push(rowDataArray) @@ -47,7 +47,7 @@ } // keyArray为英文字段表头 data.splice(0, 0, keyArray as any, params.titleArr as any) - console.log('data', data) + // console.log('data', data) const ws = XLSX.utils.aoa_to_sheet(data) const wb = XLSX.utils.book_new() // 此处隐藏英文字段表头 diff --git a/src/utils/getLocation.ts b/src/utils/getLocation.ts index e046f94..7656bb8 100644 --- a/src/utils/getLocation.ts +++ b/src/utils/getLocation.ts @@ -20,7 +20,7 @@ return 'IE' } // 判断是否IE浏览器 } -console.log(myBrowser(), '当前浏览器') +// console.log(myBrowser(), '当前浏览器') export const getLocation = () => { const browserType = myBrowser() @@ -29,7 +29,7 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { @@ -41,7 +41,7 @@ } function errorCallback(error: any) { - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } else { @@ -49,25 +49,25 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { - console.log(position, 'position') + // console.log(position, 'position') var latitude = position.coords.latitude var longitude = position.coords.longitude - console.log(`Latitude22: ${latitude}`) - console.log(`Longitude22: ${longitude}`) + // console.log(`Latitude22: ${latitude}`) + // console.log(`Longitude22: ${longitude}`) const data = wgs84togcj02(Number(position.coords.longitude), Number(position.coords.latitude)) - console.log(`latitude: ${data[1]}`) - console.log(`longitude: ${data[0]}`) + // console.log(`latitude: ${data[1]}`) + // console.log(`longitude: ${data[0]}`) sessionStorage.setItem('latitude', data[1]) sessionStorage.setItem('longitude', data[0]) } function errorCallback(error: any) { // console.log('errorrr') - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } } diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts index 3b77c80..694f79c 100644 --- a/src/utils/keepQuery.ts +++ b/src/utils/keepQuery.ts @@ -7,10 +7,10 @@ export function keepSearchParams(to: any, componentName: string) { if (needKeep.some((item: string) => to.includes(item))) { keepAliveStore.add(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } else { keepAliveStore.remove(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } } diff --git a/src/utils/sessionData.ts b/src/utils/sessionData.ts index 07e9567..8500c1f 100644 --- a/src/utils/sessionData.ts +++ b/src/utils/sessionData.ts @@ -13,12 +13,12 @@ // 先判断indexDB中是否含有该数据 if (allData.filter((item: any) => item.name === name).length) { indexDB.update({ id: allData.filter((item: any) => item.name === name)[0].id, name: name, data: data }).then(() => { - console.log(`indexDB数据更新成功--${name}`) + // console.log(`indexDB数据更新成功--${name}`) }) } else { indexDB.add({ name: name, data: data }).then(() => { - console.log(`indexDB数据添加成功--${name}`) + // console.log(`indexDB数据添加成功--${name}`) }) } }) @@ -43,21 +43,21 @@ export const fetchCacheWell = () => { getWellList({}).then(res => { indexDBHandler('all-well-list', JSON.stringify(res.data)) - console.log(res.data, '闸井列表') + // console.log(res.data, '闸井列表') }) } // 九五示范区闸井列表 export const fetchCacheWell95 = () => { getWellList({ sfq: '1' }).then(res => { indexDBHandler('all-well-95-list', JSON.stringify(res.data)) - console.log(res.data, '九五示范区闸井列表') + // console.log(res.data, '九五示范区闸井列表') }) } // 场站列表 export const fetchCacheStation = () => { getStationList({}).then(res => { indexDBHandler('all-station-list', JSON.stringify(res.data)) - console.log(res.data, '场站列表') + // console.log(res.data, '场站列表') }) } // 管线列表 @@ -66,7 +66,7 @@ export const fetchCacheDept = () => { getDeptTreeList().then(res => { indexDBHandler('all-dept-list', JSON.stringify(res.data)) - console.log(res.data, '组织机构') + // console.log(res.data, '组织机构') }) } // 场站视频云台 diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 6c57fb1..186eb97 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -370,7 +370,7 @@
现场确认情况: - + {{ info.confirmContent }}
处置情况: - + {{ type === 'data' ? info.processContent : info.processStatusName }}
diff --git a/src/views/home/alarm/current/components/processDialog.vue b/src/views/home/alarm/current/components/processDialog.vue index d093fa3..32c7141 100644 --- a/src/views/home/alarm/current/components/processDialog.vue +++ b/src/views/home/alarm/current/components/processDialog.vue @@ -7,6 +7,7 @@ import { alarmProcessNode } from '@/api/home/alarm/current' import { uniqueMultiArray } from '@/utils/Array' import { encrypt, decrypt, isEncrypt } from '@/utils/security1' +import { insertNewline } from '@/utils/String' const emits = defineEmits(['refresh']) const dialogFormVisible = ref(false) // 对话框是否显示 const initData = [ @@ -36,7 +37,7 @@ }, { name: '处置人员', - procrssNames: ['待处置'], + procrssNames: ['待处置', '已处置'], processCode: ['6', '7'], icon0: '人员-0', icon1: '人员-1', @@ -45,7 +46,7 @@ { name: '设备正常', procrssNames: ['已处置'], - processCode: ['8'], + processCode: ['7','10'], icon0: '设备-0', icon1: '设备-1', active: 5, @@ -53,7 +54,7 @@ { name: '结束', procrssNames: ['已处置'], - processCode: ['9'], + processCode: ['7','10'], icon0: '结束', icon1: '结束', active: 6, @@ -155,7 +156,11 @@ 时间: ${data[index].APPROVAL_TIME}
人员: ${data[index].NAME || data[index].APPROVAL_PERSON}
操作: ${data[index].process_name}
- ${processData.value[cindex].procrssNames.includes('已确认') ? '确认' : processData.value[cindex].procrssNames.includes('已处置') ? '处置' : ''}内容: ${data[index].DESCN}
+ ${processData.value[cindex].procrssNames.includes('已确认') ? '确认' : processData.value[cindex].procrssNames.includes('已处置') ? '处置' : ''}内容: + + ${insertNewline(data[index].DESCN, 15)} + +
` } else { @@ -174,7 +179,7 @@ 操作: 报警生成
` // 确认误报 - if (data.length < 4 && Number(data[data.length - 1].FLOW_STATUS) >= 7) { + if (data.some((item) => item.DESCN.includes('误报')) && Number(data[data.length - 1].FLOW_STATUS) >= 7) { processData.value = processData.value.filter((item: any) => item.name !== '处置人员') const cindex = processData.value.findIndex((item: any) => item.name === '确认人员') if (!processData.value[cindex].content) { @@ -196,6 +201,7 @@ // processData.value[processData.value.length - 1].content = processData.value[processData.value.length - 2].content // } } + // console.log(processData.value, 'processDataprocessData') } loading.value = false }).catch(() => { diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index b407a43..40973a0 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -36,12 +36,12 @@ // 初始展示列 const columns = ref([ { text: '报警类型', value: 'alarmType', align: 'center', width: '130' }, - { text: '报警等级', value: 'alarmLevelName', align: 'center', width: '85', isRequired: false }, + { text: '报警等级', value: 'alarmLevelName', align: 'center', width: '85' }, { text: '报警原因', value: 'alarmReason', align: 'center', }, { text: '位置', value: 'position', align: 'center', isCustom: true, }, { text: '设备类型', value: 'devTypeName', align: 'center', width: '145', isRequired: false, }, { text: '设备编号', value: 'devcode', align: 'center', width: '160', isCustom: true, isRequired: false, }, - { text: '管理单位', value: 'deptName', align: 'center', width: '400', }, + { text: '管理单位', value: 'deptName', align: 'center', width: '400', isRequired: false, }, { text: '状态', value: 'processStatusName', align: 'center', width: '100', isCustom: true, }, { text: '报警时间', value: 'alarmTime', align: 'center', width: '170' }, ]) @@ -229,6 +229,14 @@ obj.endTime = row.ALARM_TIME datetimerange.value = [row.ALARM_TIME, row.ALARM_TIME] } + // 全局报警弹窗跳转过来 + if ($route.query.type === 'alarm-dialog') { + obj.begTime = row.alarmTime + obj.endTime = row.alarmTime + datetimerange.value = [row.alarmTime, row.alarmTime] + obj.position = row.tagNumber + listQuery.value.position = row.tagNumber + } getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = $route.query.type === 'localAnalyse' || $route.query.type === 'alarm-note' ? res.data.rows : res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { @@ -372,6 +380,7 @@ const mapData = ref({}) const cacheRow = ref({}) async function detail(row: any) { + // 分公司、集团点查看不切换状态 if (row.processStatusName === '未读') { list1.value[list1.value.findIndex((item: any) => item.id === row.id)].processStatusName = '已读' row.processStatusName = '已读' @@ -394,7 +403,7 @@ mapRef.value.mapRef.addMarker({ position: [data.lngGaode, data.latGaode], // content: '
', - content: row.alarmLevelName === '预警' || row.alarmLevelName === '一级' ? '
' : '
', + content: row.alarmLevelName === '预警' || row.alarmLevelName === '一级' ? '
' : '
', label: '', offsetX: -25, offsetY: -25, @@ -672,7 +681,7 @@ - + @@ -684,38 +693,41 @@ - - - - - - - - - - - - - - - - - - - - - - + +
diff --git a/src/views/home/dashboard/components/detailInfoDialog.vue b/src/views/home/dashboard/components/detailInfoDialog.vue index 28ee981..84afa36 100644 --- a/src/views/home/dashboard/components/detailInfoDialog.vue +++ b/src/views/home/dashboard/components/detailInfoDialog.vue @@ -18,7 +18,7 @@ const flag = ref('') // 初始化 const initDialog = (e: any) => { - console.log(e, '信息窗体接收的数据') + // console.log(e, '信息窗体接收的数据') overlay.value = e.overlay infoWindow.value = e.infoWindow info.value = e.info diff --git a/src/views/home/dashboard/deviceMonitor.vue b/src/views/home/dashboard/deviceMonitor.vue new file mode 100644 index 0000000..bfa1117 --- /dev/null +++ b/src/views/home/dashboard/deviceMonitor.vue @@ -0,0 +1,268 @@ + + + + + + + diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@ - + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/utils/String.ts b/src/utils/String.ts index a34a192..6b28042 100644 --- a/src/utils/String.ts +++ b/src/utils/String.ts @@ -44,3 +44,15 @@ // return "rgb(" + r + ", " + g + ", " + b + ")"; return [r, g, b] } + +// ji在字符串特定位置插入换行符str 字符串 interval 指定位置 比如说5 就会在 5 10 15 20 添加 +export function insertNewline(str, interval) { + let result = ''; + for (let i = 0; i < str.length; i += interval) { + result += str.slice(i, i + interval) + (i + interval < str.length ? '
' : ''); + } + if(str.length < interval) { + return str + } + return result; +} diff --git a/src/utils/download.ts b/src/utils/download.ts index d70f539..dff7277 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -17,7 +17,7 @@ * @param name 图片名称 */ export function downloadFile(file: File, name: string) { - console.log(new Blob([file]), 'new Blob([file])') + // console.log(new Blob([file]), 'new Blob([file])') const objectUrl = URL.createObjectURL(new Blob([file])) const link = document.createElement('a') link.download = name @@ -119,7 +119,7 @@ // 下载图片 const photo = ['jpg', 'jpeg', 'png'] const fileType = url.split('.')[url.split('.').length - 1] - console.log(fileType, 'fileType') + // console.log(fileType, 'fileType') if (photo.includes(fileType)) { // 图片 将服务器图片地址转化成本地地址 const image = new Image() diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts index 82d436b..0464065 100644 --- a/src/utils/exportXlsx.ts +++ b/src/utils/exportXlsx.ts @@ -39,7 +39,7 @@ if (keyArray.length < getLength(element)) { keyArray.push(key2) } - console.log(keyArray, 'keyArray') + // console.log(keyArray, 'keyArray') } } data.push(rowDataArray) @@ -47,7 +47,7 @@ } // keyArray为英文字段表头 data.splice(0, 0, keyArray as any, params.titleArr as any) - console.log('data', data) + // console.log('data', data) const ws = XLSX.utils.aoa_to_sheet(data) const wb = XLSX.utils.book_new() // 此处隐藏英文字段表头 diff --git a/src/utils/getLocation.ts b/src/utils/getLocation.ts index e046f94..7656bb8 100644 --- a/src/utils/getLocation.ts +++ b/src/utils/getLocation.ts @@ -20,7 +20,7 @@ return 'IE' } // 判断是否IE浏览器 } -console.log(myBrowser(), '当前浏览器') +// console.log(myBrowser(), '当前浏览器') export const getLocation = () => { const browserType = myBrowser() @@ -29,7 +29,7 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { @@ -41,7 +41,7 @@ } function errorCallback(error: any) { - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } else { @@ -49,25 +49,25 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { - console.log(position, 'position') + // console.log(position, 'position') var latitude = position.coords.latitude var longitude = position.coords.longitude - console.log(`Latitude22: ${latitude}`) - console.log(`Longitude22: ${longitude}`) + // console.log(`Latitude22: ${latitude}`) + // console.log(`Longitude22: ${longitude}`) const data = wgs84togcj02(Number(position.coords.longitude), Number(position.coords.latitude)) - console.log(`latitude: ${data[1]}`) - console.log(`longitude: ${data[0]}`) + // console.log(`latitude: ${data[1]}`) + // console.log(`longitude: ${data[0]}`) sessionStorage.setItem('latitude', data[1]) sessionStorage.setItem('longitude', data[0]) } function errorCallback(error: any) { // console.log('errorrr') - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } } diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts index 3b77c80..694f79c 100644 --- a/src/utils/keepQuery.ts +++ b/src/utils/keepQuery.ts @@ -7,10 +7,10 @@ export function keepSearchParams(to: any, componentName: string) { if (needKeep.some((item: string) => to.includes(item))) { keepAliveStore.add(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } else { keepAliveStore.remove(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } } diff --git a/src/utils/sessionData.ts b/src/utils/sessionData.ts index 07e9567..8500c1f 100644 --- a/src/utils/sessionData.ts +++ b/src/utils/sessionData.ts @@ -13,12 +13,12 @@ // 先判断indexDB中是否含有该数据 if (allData.filter((item: any) => item.name === name).length) { indexDB.update({ id: allData.filter((item: any) => item.name === name)[0].id, name: name, data: data }).then(() => { - console.log(`indexDB数据更新成功--${name}`) + // console.log(`indexDB数据更新成功--${name}`) }) } else { indexDB.add({ name: name, data: data }).then(() => { - console.log(`indexDB数据添加成功--${name}`) + // console.log(`indexDB数据添加成功--${name}`) }) } }) @@ -43,21 +43,21 @@ export const fetchCacheWell = () => { getWellList({}).then(res => { indexDBHandler('all-well-list', JSON.stringify(res.data)) - console.log(res.data, '闸井列表') + // console.log(res.data, '闸井列表') }) } // 九五示范区闸井列表 export const fetchCacheWell95 = () => { getWellList({ sfq: '1' }).then(res => { indexDBHandler('all-well-95-list', JSON.stringify(res.data)) - console.log(res.data, '九五示范区闸井列表') + // console.log(res.data, '九五示范区闸井列表') }) } // 场站列表 export const fetchCacheStation = () => { getStationList({}).then(res => { indexDBHandler('all-station-list', JSON.stringify(res.data)) - console.log(res.data, '场站列表') + // console.log(res.data, '场站列表') }) } // 管线列表 @@ -66,7 +66,7 @@ export const fetchCacheDept = () => { getDeptTreeList().then(res => { indexDBHandler('all-dept-list', JSON.stringify(res.data)) - console.log(res.data, '组织机构') + // console.log(res.data, '组织机构') }) } // 场站视频云台 diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 6c57fb1..186eb97 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -370,7 +370,7 @@
现场确认情况: - + {{ info.confirmContent }}
处置情况: - + {{ type === 'data' ? info.processContent : info.processStatusName }}
diff --git a/src/views/home/alarm/current/components/processDialog.vue b/src/views/home/alarm/current/components/processDialog.vue index d093fa3..32c7141 100644 --- a/src/views/home/alarm/current/components/processDialog.vue +++ b/src/views/home/alarm/current/components/processDialog.vue @@ -7,6 +7,7 @@ import { alarmProcessNode } from '@/api/home/alarm/current' import { uniqueMultiArray } from '@/utils/Array' import { encrypt, decrypt, isEncrypt } from '@/utils/security1' +import { insertNewline } from '@/utils/String' const emits = defineEmits(['refresh']) const dialogFormVisible = ref(false) // 对话框是否显示 const initData = [ @@ -36,7 +37,7 @@ }, { name: '处置人员', - procrssNames: ['待处置'], + procrssNames: ['待处置', '已处置'], processCode: ['6', '7'], icon0: '人员-0', icon1: '人员-1', @@ -45,7 +46,7 @@ { name: '设备正常', procrssNames: ['已处置'], - processCode: ['8'], + processCode: ['7','10'], icon0: '设备-0', icon1: '设备-1', active: 5, @@ -53,7 +54,7 @@ { name: '结束', procrssNames: ['已处置'], - processCode: ['9'], + processCode: ['7','10'], icon0: '结束', icon1: '结束', active: 6, @@ -155,7 +156,11 @@ 时间: ${data[index].APPROVAL_TIME}
人员: ${data[index].NAME || data[index].APPROVAL_PERSON}
操作: ${data[index].process_name}
- ${processData.value[cindex].procrssNames.includes('已确认') ? '确认' : processData.value[cindex].procrssNames.includes('已处置') ? '处置' : ''}内容: ${data[index].DESCN}
+ ${processData.value[cindex].procrssNames.includes('已确认') ? '确认' : processData.value[cindex].procrssNames.includes('已处置') ? '处置' : ''}内容: + + ${insertNewline(data[index].DESCN, 15)} + +
` } else { @@ -174,7 +179,7 @@ 操作: 报警生成
` // 确认误报 - if (data.length < 4 && Number(data[data.length - 1].FLOW_STATUS) >= 7) { + if (data.some((item) => item.DESCN.includes('误报')) && Number(data[data.length - 1].FLOW_STATUS) >= 7) { processData.value = processData.value.filter((item: any) => item.name !== '处置人员') const cindex = processData.value.findIndex((item: any) => item.name === '确认人员') if (!processData.value[cindex].content) { @@ -196,6 +201,7 @@ // processData.value[processData.value.length - 1].content = processData.value[processData.value.length - 2].content // } } + // console.log(processData.value, 'processDataprocessData') } loading.value = false }).catch(() => { diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index b407a43..40973a0 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -36,12 +36,12 @@ // 初始展示列 const columns = ref([ { text: '报警类型', value: 'alarmType', align: 'center', width: '130' }, - { text: '报警等级', value: 'alarmLevelName', align: 'center', width: '85', isRequired: false }, + { text: '报警等级', value: 'alarmLevelName', align: 'center', width: '85' }, { text: '报警原因', value: 'alarmReason', align: 'center', }, { text: '位置', value: 'position', align: 'center', isCustom: true, }, { text: '设备类型', value: 'devTypeName', align: 'center', width: '145', isRequired: false, }, { text: '设备编号', value: 'devcode', align: 'center', width: '160', isCustom: true, isRequired: false, }, - { text: '管理单位', value: 'deptName', align: 'center', width: '400', }, + { text: '管理单位', value: 'deptName', align: 'center', width: '400', isRequired: false, }, { text: '状态', value: 'processStatusName', align: 'center', width: '100', isCustom: true, }, { text: '报警时间', value: 'alarmTime', align: 'center', width: '170' }, ]) @@ -229,6 +229,14 @@ obj.endTime = row.ALARM_TIME datetimerange.value = [row.ALARM_TIME, row.ALARM_TIME] } + // 全局报警弹窗跳转过来 + if ($route.query.type === 'alarm-dialog') { + obj.begTime = row.alarmTime + obj.endTime = row.alarmTime + datetimerange.value = [row.alarmTime, row.alarmTime] + obj.position = row.tagNumber + listQuery.value.position = row.tagNumber + } getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = $route.query.type === 'localAnalyse' || $route.query.type === 'alarm-note' ? res.data.rows : res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { @@ -372,6 +380,7 @@ const mapData = ref({}) const cacheRow = ref({}) async function detail(row: any) { + // 分公司、集团点查看不切换状态 if (row.processStatusName === '未读') { list1.value[list1.value.findIndex((item: any) => item.id === row.id)].processStatusName = '已读' row.processStatusName = '已读' @@ -394,7 +403,7 @@ mapRef.value.mapRef.addMarker({ position: [data.lngGaode, data.latGaode], // content: '
', - content: row.alarmLevelName === '预警' || row.alarmLevelName === '一级' ? '
' : '
', + content: row.alarmLevelName === '预警' || row.alarmLevelName === '一级' ? '
' : '
', label: '', offsetX: -25, offsetY: -25, @@ -672,7 +681,7 @@ - + @@ -684,38 +693,41 @@ - - - - - - - - - - - - - - - - - - - - - - + +
diff --git a/src/views/home/dashboard/components/detailInfoDialog.vue b/src/views/home/dashboard/components/detailInfoDialog.vue index 28ee981..84afa36 100644 --- a/src/views/home/dashboard/components/detailInfoDialog.vue +++ b/src/views/home/dashboard/components/detailInfoDialog.vue @@ -18,7 +18,7 @@ const flag = ref('') // 初始化 const initDialog = (e: any) => { - console.log(e, '信息窗体接收的数据') + // console.log(e, '信息窗体接收的数据') overlay.value = e.overlay infoWindow.value = e.infoWindow info.value = e.info diff --git a/src/views/home/dashboard/deviceMonitor.vue b/src/views/home/dashboard/deviceMonitor.vue new file mode 100644 index 0000000..bfa1117 --- /dev/null +++ b/src/views/home/dashboard/deviceMonitor.vue @@ -0,0 +1,268 @@ + + + + + + + diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/assets/icons/bell-alarm.svg b/src/assets/icons/bell-alarm.svg new file mode 100644 index 0000000..0306ca7 --- /dev/null +++ b/src/assets/icons/bell-alarm.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/bell.svg b/src/assets/icons/bell.svg new file mode 100644 index 0000000..3df8120 --- /dev/null +++ b/src/assets/icons/bell.svg @@ -0,0 +1 @@ + diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 0a381f4..8d8f810 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, @@ -142,7 +142,7 @@ emit('sortChange', { column, prop, order }) } const filterHandler = (a, b, c) => { - console.log(a, b, c) + // console.log(a, b, c) } // 刷新 function refresh() { diff --git a/src/components/TableContainer/index.vue b/src/components/TableContainer/index.vue index 9c8e8f4..2d9836d 100644 --- a/src/components/TableContainer/index.vue +++ b/src/components/TableContainer/index.vue @@ -59,11 +59,11 @@ } if (localStorage.getItem(props.configTitle)) { - console.log('有存储', props.configTitle) + // console.log('有存储', props.configTitle) props.edit(JSON.parse((localStorage.getItem(props.configTitle) as string))) } else { - console.log('无存储', props.configTitle, props.columns) + // console.log('无存储', props.configTitle, props.columns) props.edit(props.columns.filter((item: any) => item.isRequired !== false)) } diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 70f44d9..818af92 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -43,7 +43,7 @@ var geocoder = new AMap.value.Geocoder() var lnglat = location geocoder.getAddress(lnglat, (status: any, result: any) => { - console.log(status, result) + // console.log(status, result) if (status === 'complete' && result.info === 'OK') { // result为对应的地理位置详细信息 // console.log(result.regeocode.formattedAddress) @@ -105,7 +105,7 @@ }) .then((AMap1: any) => { // 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]) + // 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 // 初始化地图 map.value = new AMap1.Map('map', { @@ -118,7 +118,7 @@ // // 地图图块加载完成后触发 map.value.on('complete', () => { // 修改loading状态 - console.log('地图加载完成') + // console.log('地图加载完成') setTimeout(() => { $emits('complete', AMap.value) loading.value = false @@ -179,7 +179,7 @@ } } catch (error) { - console.log(error, 'error') + // console.log(error, 'error') } // 地图绑定右击事件 map.value.on('mousedown', clickHandler) @@ -190,12 +190,12 @@ // // 地图zoom map.value.on('zoomend', () => { zoom.value = map.value.getZoom() // 获取当前缩放级别 - console.log('当前缩放级别:', zoom.value) + // console.log('当前缩放级别:', zoom.value) }) // loading.value = false }) .catch((e) => { - console.log(e, '地图加载失败') + // console.log(e, '地图加载失败') loading.value = false }) } @@ -203,7 +203,7 @@ function clickHandler(e) { const location = [e.lnglat.getLng(), e.lnglat.getLat()] if (event.button === 2) { - console.log('当前点击坐标为: ', location) + // console.log('当前点击坐标为: ', location) } } // -------------------------------------切换图层---------------------------------------------------- @@ -224,7 +224,7 @@ if (!window.sessionStorage.getItem('ping-xunteng-layer')) { return } - map.value.setZoom(12) + // map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() return @@ -252,7 +252,10 @@ } // 移除管线图层 function removePiepleLayer() { - xunteng.value.hide() + if(xunteng.value) { + xunteng.value.hide() + } + // map.value.removeLayer(xunteng.value) } watch(() => showPieple.value, (newVal) => { @@ -265,7 +268,7 @@ }) } else if (String(newVal) === 'false') { - console.log('移除管线图层') + // console.log('移除管线图层') removePiepleLayer() } }, { @@ -322,7 +325,7 @@ polygon.on('mousedown', clickHandler) // if (style.dbclickSetCenter) { polygon.on('dblclick', (e) => { - console.log(`当前点击的是${style.name}`) + // console.log(`当前点击的是${style.name}`) $emits('polygonClick', { event: e, map: map.value, style }) }) polygonAllList.value.push(polygon) @@ -335,7 +338,7 @@ item.setMap(null) }) polygonAllList.value = [] - console.log('清除绘制的多边形') + // console.log('清除绘制的多边形') } // ------------------------------------------------------------------------------------------------ @@ -482,7 +485,7 @@ massMarksAllList.value.push(massMarks) massMarks.setMap(map.value) massMarks.on('click', (e) => { - console.log('点击了海量点标记') + // console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks }) }) } @@ -532,9 +535,10 @@ // -------------------------------------- 点聚合---------------------------------------------- const MarkerAllCluster = ref([]) // 点聚合数组 const cluster = ref() -// 添加点聚合 +// 添加点聚合(距离聚合) const addCluster = (points,styleList) => { // console.log(points.map((item: any) => ({ ...item, city: '北京' })), 'points') + console.log(points, 'points') var count = points.length var _renderClusterMarker = function (context) { var factor = (context.count / count) ** (1 / 18) @@ -603,13 +607,16 @@ } const removeCluster = () => { if (cluster.value) { - console.log('清除点聚合') + // console.log('清除点聚合') map.value.remove(cluster.value) cluster.value.setMap(null) cluster.value = '' } } +// 点聚合(行政区) +const addClusterForDistrict= () => { +} // ------------------------------------------------------------------------------------------------ onMounted(() => { // console.log(document.getElementById('map'), '地图容器') @@ -633,7 +640,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null @@ -647,7 +654,7 @@ xunteng.value = null } if (map.value) { - console.log('销毁地图') + // console.log('销毁地图') map.value.destroy() map.value = null AMap.value = null diff --git a/src/directives/drag-height/index.ts b/src/directives/drag-height/index.ts index f1c3a37..7c2c6b4 100644 --- a/src/directives/drag-height/index.ts +++ b/src/directives/drag-height/index.ts @@ -34,10 +34,10 @@ // 获取el距离浏览器顶部的距离 const elTop = el.offsetTop isPress = true - console.log('鼠标摁下') + // console.log('鼠标摁下') // 鼠标移动时,计算出拖拽的距离 document.onmousemove = (moveEvent) => { - console.log('鼠标移动') + // console.log('鼠标移动') let height = moveEvent.pageY - elTop - (binding.value || 1) if (height < minHeight) { height = minHeight diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index 3785cad..0d8c350 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -55,7 +55,8 @@ $router.push({ name: 'AlarmCurrent', query: { - row: JSON.stringify({ ...info.value, id: info.value.alarmIds }), + row: JSON.stringify({ ...info.value, id: info.value.alarmIds, type: 'alarm-dialog' }), + type: 'alarm-dialog' }, }) } diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 9b77deb..4dcda68 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -63,7 +63,7 @@ } // 查看当前行 const detailRow = (row: any) => { - console.log(row, 'row') + // console.log(row, 'row') if (!proxy.hasPerm('/alarm/current')) { return } $router.push({ name: 'AlarmCurrent', @@ -124,12 +124,12 @@ 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.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { - audio.setAttribute('src', alarmAudio) - } - else { + // if (messageList.value.some((item: any) => item.alarmReason.includes('断线') && item.isSound === '1' && item.processStatus === '1')) { + // audio.setAttribute('src', alarmAudio) + // } + // else { audio.setAttribute('src', otherAudio) - } + // } proxy.playAudio() localStorage.setItem('eventAudio', '') } @@ -139,7 +139,7 @@ } watch(() => socket.data, (newVal: any) => { if (newVal && newVal.alarmNoteMethod) { - console.log(userStore.dataScope, 'userStore.dataScope') + // console.log(userStore.dataScope, 'userStore.dataScope') if (newVal.alarmNoteMethod === '1' && (userStore.dataScope || []).includes(newVal.deptid)) { dialogRef.value.initDialog(newVal) diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 04abcef..9f95ee2 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -76,6 +76,43 @@ popoverRef.value.hide() } const alarmCount = computed(() => alarmRef.value?.messageList || []) + +const alarmFlicker = ref(0) +const showAlarmFlicker = ref(false) +watch(() => alarmRef.value?.messageList, (newVal) => { + if (newVal) { + if (newVal.length) { + // console.log(newVal, 'newVal') + if (newVal.some((item: any) => item.processStatus === '1' && (item.alarmLevelName === '预警' || item.alarmLevelName === '二级'))) { + alarmFlicker.value = 1 + } + else { + alarmFlicker.value = 0 + } + } + else { + alarmFlicker.value = 0 + } + } else { + alarmFlicker.value = 0 + } +}) +const alarmTimer = ref() +watch(() => alarmFlicker.value, () => { + if (alarmFlicker.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + alarmTimer.value = setInterval(() => { + showAlarmFlicker.value = !showAlarmFlicker.value + }, 1000); + } + else { + clearInterval(alarmTimer.value) + alarmTimer.value = null + showAlarmFlicker.value = false + } +}) onMounted(() => { // 连接 websocket // websocket.initWebSocket() @@ -83,6 +120,10 @@ onBeforeMount(() => { // 断开 websocket // websocket.destroyWebSocket() + if (alarmTimer.value) { + clearInterval(alarmTimer.value) + alarmTimer.value = null + } }) const { proxy } = getCurrentInstance() as any @@ -112,7 +153,8 @@
- + +
@@ -127,10 +169,8 @@ - + @@ -198,7 +238,12 @@ height: 24px; width: 34px; cursor: pointer; - vertical-align: middle; + // vertical-align:baseline; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + .el-icon { color: var(--el-text-color-primary); diff --git a/src/main.ts b/src/main.ts index 59a469c..0dfd51f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,9 +44,9 @@ }, }).then((result) => { const app = createApp(App) - console.log('get config') - console.log(window.localStorage.getItem('browser-type-bj-well'), 'mian中获取浏览器类型') - console.log(result) + // console.log('get config') + console.log(window.localStorage.getItem('browser-type-bj-well'), '浏览器类型pc/mobile') + // console.log(result) window.localStorage.setItem('url-bj-well', result.data.baseUrl) window.localStorage.setItem('securityJsCode', result.data.securityJsCode) window.localStorage.setItem('JsKey', result.data.JsKey) @@ -55,13 +55,13 @@ window.localStorage.setItem('project-name', result.data.title) if (window.localStorage.getItem('browser-type-bj-well') === 'pc') { axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { - console.log('请求通了') + console.log('地图管线图层请求成功') window.sessionStorage.setItem('ping-xunteng-layer', '1') }).catch((error) => { - console.log('请求不通') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') if (error.message) { - console.log('网络异常') + console.log('地图管线图层请求失败') window.sessionStorage.setItem('ping-xunteng-layer', '') } }) diff --git a/src/router/index.ts b/src/router/index.ts index 739f9c7..77240d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => { if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { - console.log('携带code跳转,需要免登录') + // console.log('携带code跳转,需要免登录') const data = encodeURIComponent(to.query.token as string) sessionStorage.setItem('NoLoginIdentifier', '1') try { @@ -142,7 +142,7 @@ // 获取用户信息 await userStore.getUserInfo() - console.log('index.ts-after userinfo', localStorage.token, userStore.username) + // console.log('index.ts-after userinfo', localStorage.token, userStore.username) } // 是否已根据权限动态生成并注册路由 if (routeStore.isGenerate) { diff --git a/src/utils/String.ts b/src/utils/String.ts index a34a192..6b28042 100644 --- a/src/utils/String.ts +++ b/src/utils/String.ts @@ -44,3 +44,15 @@ // return "rgb(" + r + ", " + g + ", " + b + ")"; return [r, g, b] } + +// ji在字符串特定位置插入换行符str 字符串 interval 指定位置 比如说5 就会在 5 10 15 20 添加 +export function insertNewline(str, interval) { + let result = ''; + for (let i = 0; i < str.length; i += interval) { + result += str.slice(i, i + interval) + (i + interval < str.length ? '
' : ''); + } + if(str.length < interval) { + return str + } + return result; +} diff --git a/src/utils/download.ts b/src/utils/download.ts index d70f539..dff7277 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -17,7 +17,7 @@ * @param name 图片名称 */ export function downloadFile(file: File, name: string) { - console.log(new Blob([file]), 'new Blob([file])') + // console.log(new Blob([file]), 'new Blob([file])') const objectUrl = URL.createObjectURL(new Blob([file])) const link = document.createElement('a') link.download = name @@ -119,7 +119,7 @@ // 下载图片 const photo = ['jpg', 'jpeg', 'png'] const fileType = url.split('.')[url.split('.').length - 1] - console.log(fileType, 'fileType') + // console.log(fileType, 'fileType') if (photo.includes(fileType)) { // 图片 将服务器图片地址转化成本地地址 const image = new Image() diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts index 82d436b..0464065 100644 --- a/src/utils/exportXlsx.ts +++ b/src/utils/exportXlsx.ts @@ -39,7 +39,7 @@ if (keyArray.length < getLength(element)) { keyArray.push(key2) } - console.log(keyArray, 'keyArray') + // console.log(keyArray, 'keyArray') } } data.push(rowDataArray) @@ -47,7 +47,7 @@ } // keyArray为英文字段表头 data.splice(0, 0, keyArray as any, params.titleArr as any) - console.log('data', data) + // console.log('data', data) const ws = XLSX.utils.aoa_to_sheet(data) const wb = XLSX.utils.book_new() // 此处隐藏英文字段表头 diff --git a/src/utils/getLocation.ts b/src/utils/getLocation.ts index e046f94..7656bb8 100644 --- a/src/utils/getLocation.ts +++ b/src/utils/getLocation.ts @@ -20,7 +20,7 @@ return 'IE' } // 判断是否IE浏览器 } -console.log(myBrowser(), '当前浏览器') +// console.log(myBrowser(), '当前浏览器') export const getLocation = () => { const browserType = myBrowser() @@ -29,7 +29,7 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { @@ -41,7 +41,7 @@ } function errorCallback(error: any) { - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } else { @@ -49,25 +49,25 @@ navigator.geolocation.getCurrentPosition(successCallback, errorCallback) } else { - console.log('Geolocation is not supported by this browser.') + // console.log('Geolocation is not supported by this browser.') } function successCallback(position: any) { - console.log(position, 'position') + // console.log(position, 'position') var latitude = position.coords.latitude var longitude = position.coords.longitude - console.log(`Latitude22: ${latitude}`) - console.log(`Longitude22: ${longitude}`) + // console.log(`Latitude22: ${latitude}`) + // console.log(`Longitude22: ${longitude}`) const data = wgs84togcj02(Number(position.coords.longitude), Number(position.coords.latitude)) - console.log(`latitude: ${data[1]}`) - console.log(`longitude: ${data[0]}`) + // console.log(`latitude: ${data[1]}`) + // console.log(`longitude: ${data[0]}`) sessionStorage.setItem('latitude', data[1]) sessionStorage.setItem('longitude', data[0]) } function errorCallback(error: any) { // console.log('errorrr') - console.log(`Error: ${error.message}`) + // console.log(`Error: ${error.message}`) } } } diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts index 3b77c80..694f79c 100644 --- a/src/utils/keepQuery.ts +++ b/src/utils/keepQuery.ts @@ -7,10 +7,10 @@ export function keepSearchParams(to: any, componentName: string) { if (needKeep.some((item: string) => to.includes(item))) { keepAliveStore.add(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } else { keepAliveStore.remove(componentName) - console.log(keepAliveStore.list) + // console.log(keepAliveStore.list) } } diff --git a/src/utils/sessionData.ts b/src/utils/sessionData.ts index 07e9567..8500c1f 100644 --- a/src/utils/sessionData.ts +++ b/src/utils/sessionData.ts @@ -13,12 +13,12 @@ // 先判断indexDB中是否含有该数据 if (allData.filter((item: any) => item.name === name).length) { indexDB.update({ id: allData.filter((item: any) => item.name === name)[0].id, name: name, data: data }).then(() => { - console.log(`indexDB数据更新成功--${name}`) + // console.log(`indexDB数据更新成功--${name}`) }) } else { indexDB.add({ name: name, data: data }).then(() => { - console.log(`indexDB数据添加成功--${name}`) + // console.log(`indexDB数据添加成功--${name}`) }) } }) @@ -43,21 +43,21 @@ export const fetchCacheWell = () => { getWellList({}).then(res => { indexDBHandler('all-well-list', JSON.stringify(res.data)) - console.log(res.data, '闸井列表') + // console.log(res.data, '闸井列表') }) } // 九五示范区闸井列表 export const fetchCacheWell95 = () => { getWellList({ sfq: '1' }).then(res => { indexDBHandler('all-well-95-list', JSON.stringify(res.data)) - console.log(res.data, '九五示范区闸井列表') + // console.log(res.data, '九五示范区闸井列表') }) } // 场站列表 export const fetchCacheStation = () => { getStationList({}).then(res => { indexDBHandler('all-station-list', JSON.stringify(res.data)) - console.log(res.data, '场站列表') + // console.log(res.data, '场站列表') }) } // 管线列表 @@ -66,7 +66,7 @@ export const fetchCacheDept = () => { getDeptTreeList().then(res => { indexDBHandler('all-dept-list', JSON.stringify(res.data)) - console.log(res.data, '组织机构') + // console.log(res.data, '组织机构') }) } // 场站视频云台 diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 6c57fb1..186eb97 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -370,7 +370,7 @@
现场确认情况: - + {{ info.confirmContent }}
处置情况: - + {{ type === 'data' ? info.processContent : info.processStatusName }}
diff --git a/src/views/home/alarm/current/components/processDialog.vue b/src/views/home/alarm/current/components/processDialog.vue index d093fa3..32c7141 100644 --- a/src/views/home/alarm/current/components/processDialog.vue +++ b/src/views/home/alarm/current/components/processDialog.vue @@ -7,6 +7,7 @@ import { alarmProcessNode } from '@/api/home/alarm/current' import { uniqueMultiArray } from '@/utils/Array' import { encrypt, decrypt, isEncrypt } from '@/utils/security1' +import { insertNewline } from '@/utils/String' const emits = defineEmits(['refresh']) const dialogFormVisible = ref(false) // 对话框是否显示 const initData = [ @@ -36,7 +37,7 @@ }, { name: '处置人员', - procrssNames: ['待处置'], + procrssNames: ['待处置', '已处置'], processCode: ['6', '7'], icon0: '人员-0', icon1: '人员-1', @@ -45,7 +46,7 @@ { name: '设备正常', procrssNames: ['已处置'], - processCode: ['8'], + processCode: ['7','10'], icon0: '设备-0', icon1: '设备-1', active: 5, @@ -53,7 +54,7 @@ { name: '结束', procrssNames: ['已处置'], - processCode: ['9'], + processCode: ['7','10'], icon0: '结束', icon1: '结束', active: 6, @@ -155,7 +156,11 @@ 时间: ${data[index].APPROVAL_TIME}
人员: ${data[index].NAME || data[index].APPROVAL_PERSON}
操作: ${data[index].process_name}
- ${processData.value[cindex].procrssNames.includes('已确认') ? '确认' : processData.value[cindex].procrssNames.includes('已处置') ? '处置' : ''}内容: ${data[index].DESCN}
+ ${processData.value[cindex].procrssNames.includes('已确认') ? '确认' : processData.value[cindex].procrssNames.includes('已处置') ? '处置' : ''}内容: + + ${insertNewline(data[index].DESCN, 15)} + +
` } else { @@ -174,7 +179,7 @@ 操作: 报警生成
` // 确认误报 - if (data.length < 4 && Number(data[data.length - 1].FLOW_STATUS) >= 7) { + if (data.some((item) => item.DESCN.includes('误报')) && Number(data[data.length - 1].FLOW_STATUS) >= 7) { processData.value = processData.value.filter((item: any) => item.name !== '处置人员') const cindex = processData.value.findIndex((item: any) => item.name === '确认人员') if (!processData.value[cindex].content) { @@ -196,6 +201,7 @@ // processData.value[processData.value.length - 1].content = processData.value[processData.value.length - 2].content // } } + // console.log(processData.value, 'processDataprocessData') } loading.value = false }).catch(() => { diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index b407a43..40973a0 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -36,12 +36,12 @@ // 初始展示列 const columns = ref([ { text: '报警类型', value: 'alarmType', align: 'center', width: '130' }, - { text: '报警等级', value: 'alarmLevelName', align: 'center', width: '85', isRequired: false }, + { text: '报警等级', value: 'alarmLevelName', align: 'center', width: '85' }, { text: '报警原因', value: 'alarmReason', align: 'center', }, { text: '位置', value: 'position', align: 'center', isCustom: true, }, { text: '设备类型', value: 'devTypeName', align: 'center', width: '145', isRequired: false, }, { text: '设备编号', value: 'devcode', align: 'center', width: '160', isCustom: true, isRequired: false, }, - { text: '管理单位', value: 'deptName', align: 'center', width: '400', }, + { text: '管理单位', value: 'deptName', align: 'center', width: '400', isRequired: false, }, { text: '状态', value: 'processStatusName', align: 'center', width: '100', isCustom: true, }, { text: '报警时间', value: 'alarmTime', align: 'center', width: '170' }, ]) @@ -229,6 +229,14 @@ obj.endTime = row.ALARM_TIME datetimerange.value = [row.ALARM_TIME, row.ALARM_TIME] } + // 全局报警弹窗跳转过来 + if ($route.query.type === 'alarm-dialog') { + obj.begTime = row.alarmTime + obj.endTime = row.alarmTime + datetimerange.value = [row.alarmTime, row.alarmTime] + obj.position = row.tagNumber + listQuery.value.position = row.tagNumber + } getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = $route.query.type === 'localAnalyse' || $route.query.type === 'alarm-note' ? res.data.rows : res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { @@ -372,6 +380,7 @@ const mapData = ref({}) const cacheRow = ref({}) async function detail(row: any) { + // 分公司、集团点查看不切换状态 if (row.processStatusName === '未读') { list1.value[list1.value.findIndex((item: any) => item.id === row.id)].processStatusName = '已读' row.processStatusName = '已读' @@ -394,7 +403,7 @@ mapRef.value.mapRef.addMarker({ position: [data.lngGaode, data.latGaode], // content: '
', - content: row.alarmLevelName === '预警' || row.alarmLevelName === '一级' ? '
' : '
', + content: row.alarmLevelName === '预警' || row.alarmLevelName === '一级' ? '
' : '
', label: '', offsetX: -25, offsetY: -25, @@ -672,7 +681,7 @@ - + @@ -684,38 +693,41 @@ - - - - - - - - - - - - - - - - - - - - - - + +
diff --git a/src/views/home/dashboard/components/detailInfoDialog.vue b/src/views/home/dashboard/components/detailInfoDialog.vue index 28ee981..84afa36 100644 --- a/src/views/home/dashboard/components/detailInfoDialog.vue +++ b/src/views/home/dashboard/components/detailInfoDialog.vue @@ -18,7 +18,7 @@ const flag = ref('') // 初始化 const initDialog = (e: any) => { - console.log(e, '信息窗体接收的数据') + // console.log(e, '信息窗体接收的数据') overlay.value = e.overlay infoWindow.value = e.infoWindow info.value = e.info diff --git a/src/views/home/dashboard/deviceMonitor.vue b/src/views/home/dashboard/deviceMonitor.vue new file mode 100644 index 0000000..bfa1117 --- /dev/null +++ b/src/views/home/dashboard/deviceMonitor.vue @@ -0,0 +1,268 @@ + + + + + + + diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ + :pagination="false" :height="tableHeight"> + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 -
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 -
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@ + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 -
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 -
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@ + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 -
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 -
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@ + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 -
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 -
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@ + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 -
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 -
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@ + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 -
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@ + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 -
+ :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@ + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 - + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@ + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 - + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@ + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 - + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/dashboard/index copy.vue b/src/views/home/dashboard/index copy.vue new file mode 100644 index 0000000..0cda8d2 --- /dev/null +++ b/src/views/home/dashboard/index copy.vue @@ -0,0 +1,618 @@ + + + + + + diff --git a/src/views/home/dashboard/index.vue b/src/views/home/dashboard/index.vue index 0cda8d2..d8482c7 100644 --- a/src/views/home/dashboard/index.vue +++ b/src/views/home/dashboard/index.vue @@ -1,618 +1,356 @@ diff --git a/src/views/home/device/device/components/controlRecord.vue b/src/views/home/device/device/components/controlRecord.vue index 1adced6..9dd99b6 100644 --- a/src/views/home/device/device/components/controlRecord.vue +++ b/src/views/home/device/device/components/controlRecord.vue @@ -188,8 +188,12 @@ value: item.id, })) } - +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight -60 - 50 - 10 - 40 -20 -20 -32 - 40 - 40 +} onMounted(async () => { + calcHeight() await fetchDict() fetchData() }) @@ -216,7 +220,7 @@ + :pagination="false" :height="tableHeight"> diff --git a/src/views/home/device/device/components/electricityAnalyse.vue b/src/views/home/device/device/components/electricityAnalyse.vue index a1e1244..1234471 100644 --- a/src/views/home/device/device/components/electricityAnalyse.vue +++ b/src/views/home/device/device/components/electricityAnalyse.vue @@ -58,7 +58,6 @@ data.value = [ { name: '电量', - // data: ['100', '87', '73', '53', '41', '32', '17'], data: JSON.parse(JSON.stringify(list.value)).slice().reverse().map((item: any) => item.cell).reverse(), symbol: 'none', }, @@ -68,7 +67,12 @@ loadingTable.value = false }) } +const tableHeight = ref(0) +const calcHeight = () => { + tableHeight.value = window.innerHeight - 60 - 50 - 10 - 40 - 20 - 20 - 32 - 40 - 40 +} onMounted(() => { + calcHeight() getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows fetchData() @@ -85,17 +89,13 @@ - 搜索 - + :pagination="false" :height="tableHeight">