diff --git a/src/components/Echart/PieChart3D.vue b/src/components/Echart/PieChart3D.vue index 4010cb6..6e9697c 100644 --- a/src/components/Echart/PieChart3D.vue +++ b/src/components/Echart/PieChart3D.vue @@ -338,7 +338,8 @@ false, false, k, - series[i].pieData.value, + series[i].pieData.value > 1000 ? 50 : series[i].pieData.value > 100 ? 10 : 1, + // 10, ) startValue = endValue @@ -602,7 +603,7 @@ }, grid3D: { show: false, - boxHeight: 5, + boxHeight: 1, left: '5%', top: '0%', width: '50%', diff --git a/src/components/Echart/PieChart3D.vue b/src/components/Echart/PieChart3D.vue index 4010cb6..6e9697c 100644 --- a/src/components/Echart/PieChart3D.vue +++ b/src/components/Echart/PieChart3D.vue @@ -338,7 +338,8 @@ false, false, k, - series[i].pieData.value, + series[i].pieData.value > 1000 ? 50 : series[i].pieData.value > 100 ? 10 : 1, + // 10, ) startValue = endValue @@ -602,7 +603,7 @@ }, grid3D: { show: false, - boxHeight: 5, + boxHeight: 1, left: '5%', top: '0%', width: '50%', diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 1132d98..490ee9d 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -74,7 +74,7 @@ AMapLoader.load({ key: localStorage.getItem('JsKey')!, // 后期需替换 version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 - plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 + plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 }) .then((AMap1: any) => { AMap.value = AMap1 @@ -119,27 +119,29 @@ map.value.setMapStyle('amap://styles/darkblue') } else if ($props.layer === 'xunteng') { - map.value.setZoom(12) - xunteng.value = new AMap.value.TileLayer({ - visible: true, - zIndex: 0, - opacity: 1, - zooms: [1, 19], - dataZooms: [1, 19], - getTileUrl: (a: any, b: any, c: any) => { - // 经纬度转换成本地瓦片所在路径 - const flag = '00000000' - const zz = c - const z = `L${String(zz).length === 1 ? `0${zz}` : zz}` - console.log(zz, 'zz') - const xx = a.toString(16) - const x = `C${flag.substring(0, 8 - xx.length)}${xx}` - const yy = b.toString(16) - const y = `R${flag.substring(0, 8 - yy.length)}${yy}` - return `${window.localStorage.getItem('xuntengMap')}/${z}/${y}/${x}.png` - }, - }) - map.value.addLayer(xunteng.value) + if (window.sessionStorage.getItem('ping-xunteng-layer')) { + map.value.setZoom(12) + xunteng.value = new AMap.value.TileLayer({ + visible: true, + zIndex: 0, + opacity: 1, + zooms: [1, 19], + dataZooms: [1, 19], + getTileUrl: (a: any, b: any, c: any) => { + // 经纬度转换成本地瓦片所在路径 + const flag = '00000000' + const zz = c + const z = `L${String(zz).length === 1 ? `0${zz}` : zz}` + console.log(zz, 'zz') + const xx = a.toString(16) + const x = `C${flag.substring(0, 8 - xx.length)}${xx}` + const yy = b.toString(16) + const y = `R${flag.substring(0, 8 - yy.length)}${yy}` + return `${window.localStorage.getItem('xuntengMap')}/${z}/${y}/${x}.png` + }, + }) + map.value.addLayer(xunteng.value) + } map.value.setMapStyle('amap://styles/darkblue') } if ($props.showPiepleLayer) { @@ -189,6 +191,9 @@ } // 添加管线图层 function addPiepleLayer() { + if (!window.sessionStorage.getItem('ping-xunteng-layer')) { + return + } map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() @@ -492,6 +497,78 @@ // massLineAllList.value = [] } // ------------------------------------------------------------------------------------------------ + +// -------------------------------------- 点聚合---------------------------------------------- +const MarkerAllCluster = ref([]) // 点聚合数组 +const cluster = ref() +// 添加点聚合 +const addCluster = (points) => { + var count = points.length + var _renderClusterMarker = function (context) { + var factor = (context.count / count) ** (1 / 18) + var div = document.createElement('div') + var Hue = 180 - factor * 130 + var bgColor = `hsla(${Hue},100%,40%,0.7)` + var fontColor = `hsla(${Hue},100%,90%,1)` + var borderColor = `hsla(${Hue},100%,40%,1)` + var shadowColor = `hsla(${Hue},100%,90%,1)` + div.style.backgroundColor = bgColor + var size = Math.round(30 + (context.count / count) ** (1 / 5) * 20) + div.style.width = div.style.height = `${size}px` + div.style.border = `solid 1px ${borderColor}` + div.style.borderRadius = `${size / 2}px` + div.style.boxShadow = `0 0 5px ${shadowColor}` + div.innerHTML = context.count + div.style.lineHeight = `${size}px` + div.style.color = fontColor + div.style.fontSize = '14px' + div.style.textAlign = 'center' + context.marker.setOffset(new AMap.value.Pixel(-size / 2, -size / 2)) + context.marker.setContent(div) + context.marker.on('click', (e) => { + map.value.setCenter(e.target._position) + map.value.setZoom(map.value.getZoom() + 3) + }) + } + const _renderMarker = (context: any) => { + const data = context.data[0] + // console.log(data, 'data') + const style = [ + { + url: `${publicPath}/image/well/闸井-正常.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-异常.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-离线.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-未部署.png`, // 图标地址 + }, + ] + const markerHtml = `` + var offset = new AMap.value.Pixel(-9, -9) + context.marker.setContent(markerHtml) + context.marker.setOffset(offset) + context.marker.on('click', (e) => { + // console.log(e, data, '1111') + $emits('massMarksClick', { event: { ...e, data: context.data[0] }, map: map.value, points, data }) + }) + } + cluster.value = new AMap.value.MarkerCluster(map.value, points, { + gridSize: 100, // 设置网格像素大小 + renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 + renderMarker: _renderMarker, // 自定义非聚合点样式 + }) +} +const removeCluster = () => { + if (cluster.value) { + cluster.value.setMap(null) + cluster.value = '' + } +} +// ------------------------------------------------------------------------------------------------ onMounted(() => { loading.value = true initMap() @@ -544,6 +621,9 @@ addMassLine, // 添加折线(海量线) removeMassLine, // 移除折线(海量线) getPosition, // 根据坐标获取详细位置信息 + + addCluster, + removeCluster, }) diff --git a/src/components/Echart/PieChart3D.vue b/src/components/Echart/PieChart3D.vue index 4010cb6..6e9697c 100644 --- a/src/components/Echart/PieChart3D.vue +++ b/src/components/Echart/PieChart3D.vue @@ -338,7 +338,8 @@ false, false, k, - series[i].pieData.value, + series[i].pieData.value > 1000 ? 50 : series[i].pieData.value > 100 ? 10 : 1, + // 10, ) startValue = endValue @@ -602,7 +603,7 @@ }, grid3D: { show: false, - boxHeight: 5, + boxHeight: 1, left: '5%', top: '0%', width: '50%', diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 1132d98..490ee9d 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -74,7 +74,7 @@ AMapLoader.load({ key: localStorage.getItem('JsKey')!, // 后期需替换 version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 - plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 + plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 }) .then((AMap1: any) => { AMap.value = AMap1 @@ -119,27 +119,29 @@ map.value.setMapStyle('amap://styles/darkblue') } else if ($props.layer === 'xunteng') { - map.value.setZoom(12) - xunteng.value = new AMap.value.TileLayer({ - visible: true, - zIndex: 0, - opacity: 1, - zooms: [1, 19], - dataZooms: [1, 19], - getTileUrl: (a: any, b: any, c: any) => { - // 经纬度转换成本地瓦片所在路径 - const flag = '00000000' - const zz = c - const z = `L${String(zz).length === 1 ? `0${zz}` : zz}` - console.log(zz, 'zz') - const xx = a.toString(16) - const x = `C${flag.substring(0, 8 - xx.length)}${xx}` - const yy = b.toString(16) - const y = `R${flag.substring(0, 8 - yy.length)}${yy}` - return `${window.localStorage.getItem('xuntengMap')}/${z}/${y}/${x}.png` - }, - }) - map.value.addLayer(xunteng.value) + if (window.sessionStorage.getItem('ping-xunteng-layer')) { + map.value.setZoom(12) + xunteng.value = new AMap.value.TileLayer({ + visible: true, + zIndex: 0, + opacity: 1, + zooms: [1, 19], + dataZooms: [1, 19], + getTileUrl: (a: any, b: any, c: any) => { + // 经纬度转换成本地瓦片所在路径 + const flag = '00000000' + const zz = c + const z = `L${String(zz).length === 1 ? `0${zz}` : zz}` + console.log(zz, 'zz') + const xx = a.toString(16) + const x = `C${flag.substring(0, 8 - xx.length)}${xx}` + const yy = b.toString(16) + const y = `R${flag.substring(0, 8 - yy.length)}${yy}` + return `${window.localStorage.getItem('xuntengMap')}/${z}/${y}/${x}.png` + }, + }) + map.value.addLayer(xunteng.value) + } map.value.setMapStyle('amap://styles/darkblue') } if ($props.showPiepleLayer) { @@ -189,6 +191,9 @@ } // 添加管线图层 function addPiepleLayer() { + if (!window.sessionStorage.getItem('ping-xunteng-layer')) { + return + } map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() @@ -492,6 +497,78 @@ // massLineAllList.value = [] } // ------------------------------------------------------------------------------------------------ + +// -------------------------------------- 点聚合---------------------------------------------- +const MarkerAllCluster = ref([]) // 点聚合数组 +const cluster = ref() +// 添加点聚合 +const addCluster = (points) => { + var count = points.length + var _renderClusterMarker = function (context) { + var factor = (context.count / count) ** (1 / 18) + var div = document.createElement('div') + var Hue = 180 - factor * 130 + var bgColor = `hsla(${Hue},100%,40%,0.7)` + var fontColor = `hsla(${Hue},100%,90%,1)` + var borderColor = `hsla(${Hue},100%,40%,1)` + var shadowColor = `hsla(${Hue},100%,90%,1)` + div.style.backgroundColor = bgColor + var size = Math.round(30 + (context.count / count) ** (1 / 5) * 20) + div.style.width = div.style.height = `${size}px` + div.style.border = `solid 1px ${borderColor}` + div.style.borderRadius = `${size / 2}px` + div.style.boxShadow = `0 0 5px ${shadowColor}` + div.innerHTML = context.count + div.style.lineHeight = `${size}px` + div.style.color = fontColor + div.style.fontSize = '14px' + div.style.textAlign = 'center' + context.marker.setOffset(new AMap.value.Pixel(-size / 2, -size / 2)) + context.marker.setContent(div) + context.marker.on('click', (e) => { + map.value.setCenter(e.target._position) + map.value.setZoom(map.value.getZoom() + 3) + }) + } + const _renderMarker = (context: any) => { + const data = context.data[0] + // console.log(data, 'data') + const style = [ + { + url: `${publicPath}/image/well/闸井-正常.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-异常.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-离线.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-未部署.png`, // 图标地址 + }, + ] + const markerHtml = `` + var offset = new AMap.value.Pixel(-9, -9) + context.marker.setContent(markerHtml) + context.marker.setOffset(offset) + context.marker.on('click', (e) => { + // console.log(e, data, '1111') + $emits('massMarksClick', { event: { ...e, data: context.data[0] }, map: map.value, points, data }) + }) + } + cluster.value = new AMap.value.MarkerCluster(map.value, points, { + gridSize: 100, // 设置网格像素大小 + renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 + renderMarker: _renderMarker, // 自定义非聚合点样式 + }) +} +const removeCluster = () => { + if (cluster.value) { + cluster.value.setMap(null) + cluster.value = '' + } +} +// ------------------------------------------------------------------------------------------------ onMounted(() => { loading.value = true initMap() @@ -544,6 +621,9 @@ addMassLine, // 添加折线(海量线) removeMassLine, // 移除折线(海量线) getPosition, // 根据坐标获取详细位置信息 + + addCluster, + removeCluster, }) diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22 -
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/components/Echart/PieChart3D.vue b/src/components/Echart/PieChart3D.vue index 4010cb6..6e9697c 100644 --- a/src/components/Echart/PieChart3D.vue +++ b/src/components/Echart/PieChart3D.vue @@ -338,7 +338,8 @@ false, false, k, - series[i].pieData.value, + series[i].pieData.value > 1000 ? 50 : series[i].pieData.value > 100 ? 10 : 1, + // 10, ) startValue = endValue @@ -602,7 +603,7 @@ }, grid3D: { show: false, - boxHeight: 5, + boxHeight: 1, left: '5%', top: '0%', width: '50%', diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 1132d98..490ee9d 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -74,7 +74,7 @@ AMapLoader.load({ key: localStorage.getItem('JsKey')!, // 后期需替换 version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 - plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 + plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 }) .then((AMap1: any) => { AMap.value = AMap1 @@ -119,27 +119,29 @@ map.value.setMapStyle('amap://styles/darkblue') } else if ($props.layer === 'xunteng') { - map.value.setZoom(12) - xunteng.value = new AMap.value.TileLayer({ - visible: true, - zIndex: 0, - opacity: 1, - zooms: [1, 19], - dataZooms: [1, 19], - getTileUrl: (a: any, b: any, c: any) => { - // 经纬度转换成本地瓦片所在路径 - const flag = '00000000' - const zz = c - const z = `L${String(zz).length === 1 ? `0${zz}` : zz}` - console.log(zz, 'zz') - const xx = a.toString(16) - const x = `C${flag.substring(0, 8 - xx.length)}${xx}` - const yy = b.toString(16) - const y = `R${flag.substring(0, 8 - yy.length)}${yy}` - return `${window.localStorage.getItem('xuntengMap')}/${z}/${y}/${x}.png` - }, - }) - map.value.addLayer(xunteng.value) + if (window.sessionStorage.getItem('ping-xunteng-layer')) { + map.value.setZoom(12) + xunteng.value = new AMap.value.TileLayer({ + visible: true, + zIndex: 0, + opacity: 1, + zooms: [1, 19], + dataZooms: [1, 19], + getTileUrl: (a: any, b: any, c: any) => { + // 经纬度转换成本地瓦片所在路径 + const flag = '00000000' + const zz = c + const z = `L${String(zz).length === 1 ? `0${zz}` : zz}` + console.log(zz, 'zz') + const xx = a.toString(16) + const x = `C${flag.substring(0, 8 - xx.length)}${xx}` + const yy = b.toString(16) + const y = `R${flag.substring(0, 8 - yy.length)}${yy}` + return `${window.localStorage.getItem('xuntengMap')}/${z}/${y}/${x}.png` + }, + }) + map.value.addLayer(xunteng.value) + } map.value.setMapStyle('amap://styles/darkblue') } if ($props.showPiepleLayer) { @@ -189,6 +191,9 @@ } // 添加管线图层 function addPiepleLayer() { + if (!window.sessionStorage.getItem('ping-xunteng-layer')) { + return + } map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() @@ -492,6 +497,78 @@ // massLineAllList.value = [] } // ------------------------------------------------------------------------------------------------ + +// -------------------------------------- 点聚合---------------------------------------------- +const MarkerAllCluster = ref([]) // 点聚合数组 +const cluster = ref() +// 添加点聚合 +const addCluster = (points) => { + var count = points.length + var _renderClusterMarker = function (context) { + var factor = (context.count / count) ** (1 / 18) + var div = document.createElement('div') + var Hue = 180 - factor * 130 + var bgColor = `hsla(${Hue},100%,40%,0.7)` + var fontColor = `hsla(${Hue},100%,90%,1)` + var borderColor = `hsla(${Hue},100%,40%,1)` + var shadowColor = `hsla(${Hue},100%,90%,1)` + div.style.backgroundColor = bgColor + var size = Math.round(30 + (context.count / count) ** (1 / 5) * 20) + div.style.width = div.style.height = `${size}px` + div.style.border = `solid 1px ${borderColor}` + div.style.borderRadius = `${size / 2}px` + div.style.boxShadow = `0 0 5px ${shadowColor}` + div.innerHTML = context.count + div.style.lineHeight = `${size}px` + div.style.color = fontColor + div.style.fontSize = '14px' + div.style.textAlign = 'center' + context.marker.setOffset(new AMap.value.Pixel(-size / 2, -size / 2)) + context.marker.setContent(div) + context.marker.on('click', (e) => { + map.value.setCenter(e.target._position) + map.value.setZoom(map.value.getZoom() + 3) + }) + } + const _renderMarker = (context: any) => { + const data = context.data[0] + // console.log(data, 'data') + const style = [ + { + url: `${publicPath}/image/well/闸井-正常.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-异常.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-离线.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-未部署.png`, // 图标地址 + }, + ] + const markerHtml = `` + var offset = new AMap.value.Pixel(-9, -9) + context.marker.setContent(markerHtml) + context.marker.setOffset(offset) + context.marker.on('click', (e) => { + // console.log(e, data, '1111') + $emits('massMarksClick', { event: { ...e, data: context.data[0] }, map: map.value, points, data }) + }) + } + cluster.value = new AMap.value.MarkerCluster(map.value, points, { + gridSize: 100, // 设置网格像素大小 + renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 + renderMarker: _renderMarker, // 自定义非聚合点样式 + }) +} +const removeCluster = () => { + if (cluster.value) { + cluster.value.setMap(null) + cluster.value = '' + } +} +// ------------------------------------------------------------------------------------------------ onMounted(() => { loading.value = true initMap() @@ -544,6 +621,9 @@ addMassLine, // 添加折线(海量线) removeMassLine, // 移除折线(海量线) getPosition, // 根据坐标获取详细位置信息 + + addCluster, + removeCluster, }) diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/components/Echart/PieChart3D.vue b/src/components/Echart/PieChart3D.vue index 4010cb6..6e9697c 100644 --- a/src/components/Echart/PieChart3D.vue +++ b/src/components/Echart/PieChart3D.vue @@ -338,7 +338,8 @@ false, false, k, - series[i].pieData.value, + series[i].pieData.value > 1000 ? 50 : series[i].pieData.value > 100 ? 10 : 1, + // 10, ) startValue = endValue @@ -602,7 +603,7 @@ }, grid3D: { show: false, - boxHeight: 5, + boxHeight: 1, left: '5%', top: '0%', width: '50%', diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 1132d98..490ee9d 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -74,7 +74,7 @@ AMapLoader.load({ key: localStorage.getItem('JsKey')!, // 后期需替换 version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 - plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 + plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 }) .then((AMap1: any) => { AMap.value = AMap1 @@ -119,27 +119,29 @@ map.value.setMapStyle('amap://styles/darkblue') } else if ($props.layer === 'xunteng') { - map.value.setZoom(12) - xunteng.value = new AMap.value.TileLayer({ - visible: true, - zIndex: 0, - opacity: 1, - zooms: [1, 19], - dataZooms: [1, 19], - getTileUrl: (a: any, b: any, c: any) => { - // 经纬度转换成本地瓦片所在路径 - const flag = '00000000' - const zz = c - const z = `L${String(zz).length === 1 ? `0${zz}` : zz}` - console.log(zz, 'zz') - const xx = a.toString(16) - const x = `C${flag.substring(0, 8 - xx.length)}${xx}` - const yy = b.toString(16) - const y = `R${flag.substring(0, 8 - yy.length)}${yy}` - return `${window.localStorage.getItem('xuntengMap')}/${z}/${y}/${x}.png` - }, - }) - map.value.addLayer(xunteng.value) + if (window.sessionStorage.getItem('ping-xunteng-layer')) { + map.value.setZoom(12) + xunteng.value = new AMap.value.TileLayer({ + visible: true, + zIndex: 0, + opacity: 1, + zooms: [1, 19], + dataZooms: [1, 19], + getTileUrl: (a: any, b: any, c: any) => { + // 经纬度转换成本地瓦片所在路径 + const flag = '00000000' + const zz = c + const z = `L${String(zz).length === 1 ? `0${zz}` : zz}` + console.log(zz, 'zz') + const xx = a.toString(16) + const x = `C${flag.substring(0, 8 - xx.length)}${xx}` + const yy = b.toString(16) + const y = `R${flag.substring(0, 8 - yy.length)}${yy}` + return `${window.localStorage.getItem('xuntengMap')}/${z}/${y}/${x}.png` + }, + }) + map.value.addLayer(xunteng.value) + } map.value.setMapStyle('amap://styles/darkblue') } if ($props.showPiepleLayer) { @@ -189,6 +191,9 @@ } // 添加管线图层 function addPiepleLayer() { + if (!window.sessionStorage.getItem('ping-xunteng-layer')) { + return + } map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() @@ -492,6 +497,78 @@ // massLineAllList.value = [] } // ------------------------------------------------------------------------------------------------ + +// -------------------------------------- 点聚合---------------------------------------------- +const MarkerAllCluster = ref([]) // 点聚合数组 +const cluster = ref() +// 添加点聚合 +const addCluster = (points) => { + var count = points.length + var _renderClusterMarker = function (context) { + var factor = (context.count / count) ** (1 / 18) + var div = document.createElement('div') + var Hue = 180 - factor * 130 + var bgColor = `hsla(${Hue},100%,40%,0.7)` + var fontColor = `hsla(${Hue},100%,90%,1)` + var borderColor = `hsla(${Hue},100%,40%,1)` + var shadowColor = `hsla(${Hue},100%,90%,1)` + div.style.backgroundColor = bgColor + var size = Math.round(30 + (context.count / count) ** (1 / 5) * 20) + div.style.width = div.style.height = `${size}px` + div.style.border = `solid 1px ${borderColor}` + div.style.borderRadius = `${size / 2}px` + div.style.boxShadow = `0 0 5px ${shadowColor}` + div.innerHTML = context.count + div.style.lineHeight = `${size}px` + div.style.color = fontColor + div.style.fontSize = '14px' + div.style.textAlign = 'center' + context.marker.setOffset(new AMap.value.Pixel(-size / 2, -size / 2)) + context.marker.setContent(div) + context.marker.on('click', (e) => { + map.value.setCenter(e.target._position) + map.value.setZoom(map.value.getZoom() + 3) + }) + } + const _renderMarker = (context: any) => { + const data = context.data[0] + // console.log(data, 'data') + const style = [ + { + url: `${publicPath}/image/well/闸井-正常.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-异常.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-离线.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-未部署.png`, // 图标地址 + }, + ] + const markerHtml = `` + var offset = new AMap.value.Pixel(-9, -9) + context.marker.setContent(markerHtml) + context.marker.setOffset(offset) + context.marker.on('click', (e) => { + // console.log(e, data, '1111') + $emits('massMarksClick', { event: { ...e, data: context.data[0] }, map: map.value, points, data }) + }) + } + cluster.value = new AMap.value.MarkerCluster(map.value, points, { + gridSize: 100, // 设置网格像素大小 + renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 + renderMarker: _renderMarker, // 自定义非聚合点样式 + }) +} +const removeCluster = () => { + if (cluster.value) { + cluster.value.setMap(null) + cluster.value = '' + } +} +// ------------------------------------------------------------------------------------------------ onMounted(() => { loading.value = true initMap() @@ -544,6 +621,9 @@ addMassLine, // 添加折线(海量线) removeMassLine, // 移除折线(海量线) getPosition, // 根据坐标获取详细位置信息 + + addCluster, + removeCluster, }) diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index 9c992cd..d851391 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -133,7 +133,16 @@ if ($route.query.row) { loadingTable.value = true const row = JSON.parse($route.query.row as string) - getCurrentAlarmListPage({ offset: 1, limit: 50 }).then((res) => { + const obj = { + begTime: '', + endTime: '', + } + if ($route.query.real) { + datetimerange.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + obj.begTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + obj.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { list1.value = data.map((item: any) => ({ diff --git a/src/components/Echart/PieChart3D.vue b/src/components/Echart/PieChart3D.vue index 4010cb6..6e9697c 100644 --- a/src/components/Echart/PieChart3D.vue +++ b/src/components/Echart/PieChart3D.vue @@ -338,7 +338,8 @@ false, false, k, - series[i].pieData.value, + series[i].pieData.value > 1000 ? 50 : series[i].pieData.value > 100 ? 10 : 1, + // 10, ) startValue = endValue @@ -602,7 +603,7 @@ }, grid3D: { show: false, - boxHeight: 5, + boxHeight: 1, left: '5%', top: '0%', width: '50%', diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 1132d98..490ee9d 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -74,7 +74,7 @@ AMapLoader.load({ key: localStorage.getItem('JsKey')!, // 后期需替换 version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 - plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 + plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 }) .then((AMap1: any) => { AMap.value = AMap1 @@ -119,27 +119,29 @@ map.value.setMapStyle('amap://styles/darkblue') } else if ($props.layer === 'xunteng') { - map.value.setZoom(12) - xunteng.value = new AMap.value.TileLayer({ - visible: true, - zIndex: 0, - opacity: 1, - zooms: [1, 19], - dataZooms: [1, 19], - getTileUrl: (a: any, b: any, c: any) => { - // 经纬度转换成本地瓦片所在路径 - const flag = '00000000' - const zz = c - const z = `L${String(zz).length === 1 ? `0${zz}` : zz}` - console.log(zz, 'zz') - const xx = a.toString(16) - const x = `C${flag.substring(0, 8 - xx.length)}${xx}` - const yy = b.toString(16) - const y = `R${flag.substring(0, 8 - yy.length)}${yy}` - return `${window.localStorage.getItem('xuntengMap')}/${z}/${y}/${x}.png` - }, - }) - map.value.addLayer(xunteng.value) + if (window.sessionStorage.getItem('ping-xunteng-layer')) { + map.value.setZoom(12) + xunteng.value = new AMap.value.TileLayer({ + visible: true, + zIndex: 0, + opacity: 1, + zooms: [1, 19], + dataZooms: [1, 19], + getTileUrl: (a: any, b: any, c: any) => { + // 经纬度转换成本地瓦片所在路径 + const flag = '00000000' + const zz = c + const z = `L${String(zz).length === 1 ? `0${zz}` : zz}` + console.log(zz, 'zz') + const xx = a.toString(16) + const x = `C${flag.substring(0, 8 - xx.length)}${xx}` + const yy = b.toString(16) + const y = `R${flag.substring(0, 8 - yy.length)}${yy}` + return `${window.localStorage.getItem('xuntengMap')}/${z}/${y}/${x}.png` + }, + }) + map.value.addLayer(xunteng.value) + } map.value.setMapStyle('amap://styles/darkblue') } if ($props.showPiepleLayer) { @@ -189,6 +191,9 @@ } // 添加管线图层 function addPiepleLayer() { + if (!window.sessionStorage.getItem('ping-xunteng-layer')) { + return + } map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() @@ -492,6 +497,78 @@ // massLineAllList.value = [] } // ------------------------------------------------------------------------------------------------ + +// -------------------------------------- 点聚合---------------------------------------------- +const MarkerAllCluster = ref([]) // 点聚合数组 +const cluster = ref() +// 添加点聚合 +const addCluster = (points) => { + var count = points.length + var _renderClusterMarker = function (context) { + var factor = (context.count / count) ** (1 / 18) + var div = document.createElement('div') + var Hue = 180 - factor * 130 + var bgColor = `hsla(${Hue},100%,40%,0.7)` + var fontColor = `hsla(${Hue},100%,90%,1)` + var borderColor = `hsla(${Hue},100%,40%,1)` + var shadowColor = `hsla(${Hue},100%,90%,1)` + div.style.backgroundColor = bgColor + var size = Math.round(30 + (context.count / count) ** (1 / 5) * 20) + div.style.width = div.style.height = `${size}px` + div.style.border = `solid 1px ${borderColor}` + div.style.borderRadius = `${size / 2}px` + div.style.boxShadow = `0 0 5px ${shadowColor}` + div.innerHTML = context.count + div.style.lineHeight = `${size}px` + div.style.color = fontColor + div.style.fontSize = '14px' + div.style.textAlign = 'center' + context.marker.setOffset(new AMap.value.Pixel(-size / 2, -size / 2)) + context.marker.setContent(div) + context.marker.on('click', (e) => { + map.value.setCenter(e.target._position) + map.value.setZoom(map.value.getZoom() + 3) + }) + } + const _renderMarker = (context: any) => { + const data = context.data[0] + // console.log(data, 'data') + const style = [ + { + url: `${publicPath}/image/well/闸井-正常.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-异常.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-离线.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-未部署.png`, // 图标地址 + }, + ] + const markerHtml = `` + var offset = new AMap.value.Pixel(-9, -9) + context.marker.setContent(markerHtml) + context.marker.setOffset(offset) + context.marker.on('click', (e) => { + // console.log(e, data, '1111') + $emits('massMarksClick', { event: { ...e, data: context.data[0] }, map: map.value, points, data }) + }) + } + cluster.value = new AMap.value.MarkerCluster(map.value, points, { + gridSize: 100, // 设置网格像素大小 + renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 + renderMarker: _renderMarker, // 自定义非聚合点样式 + }) +} +const removeCluster = () => { + if (cluster.value) { + cluster.value.setMap(null) + cluster.value = '' + } +} +// ------------------------------------------------------------------------------------------------ onMounted(() => { loading.value = true initMap() @@ -544,6 +621,9 @@ addMassLine, // 添加折线(海量线) removeMassLine, // 移除折线(海量线) getPosition, // 根据坐标获取详细位置信息 + + addCluster, + removeCluster, }) diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index 9c992cd..d851391 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -133,7 +133,16 @@ if ($route.query.row) { loadingTable.value = true const row = JSON.parse($route.query.row as string) - getCurrentAlarmListPage({ offset: 1, limit: 50 }).then((res) => { + const obj = { + begTime: '', + endTime: '', + } + if ($route.query.real) { + datetimerange.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + obj.begTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + obj.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { list1.value = data.map((item: any) => ({ diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 37a01c2..d164c20 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -54,10 +54,13 @@ @@ -146,6 +149,7 @@ height: 30px; display: flex; align-items: center; + justify-content: space-between; .icon-alarm { width: 25px; @@ -157,6 +161,16 @@ padding-left: 10px; color: #fff; } + + .close11 { + font-size: 18px; + color: #fff; + + &:hover { + cursor: pointer; + color: #ccc; + } + } } .contnt-alarm { @@ -190,7 +204,8 @@ margin-top: 10px; display: flex; justify-items: center; - justify-content: center; + // justify-content: center; + justify-content: end; } } } diff --git a/src/components/Echart/PieChart3D.vue b/src/components/Echart/PieChart3D.vue index 4010cb6..6e9697c 100644 --- a/src/components/Echart/PieChart3D.vue +++ b/src/components/Echart/PieChart3D.vue @@ -338,7 +338,8 @@ false, false, k, - series[i].pieData.value, + series[i].pieData.value > 1000 ? 50 : series[i].pieData.value > 100 ? 10 : 1, + // 10, ) startValue = endValue @@ -602,7 +603,7 @@ }, grid3D: { show: false, - boxHeight: 5, + boxHeight: 1, left: '5%', top: '0%', width: '50%', diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 1132d98..490ee9d 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -74,7 +74,7 @@ AMapLoader.load({ key: localStorage.getItem('JsKey')!, // 后期需替换 version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 - plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 + plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 }) .then((AMap1: any) => { AMap.value = AMap1 @@ -119,27 +119,29 @@ map.value.setMapStyle('amap://styles/darkblue') } else if ($props.layer === 'xunteng') { - map.value.setZoom(12) - xunteng.value = new AMap.value.TileLayer({ - visible: true, - zIndex: 0, - opacity: 1, - zooms: [1, 19], - dataZooms: [1, 19], - getTileUrl: (a: any, b: any, c: any) => { - // 经纬度转换成本地瓦片所在路径 - const flag = '00000000' - const zz = c - const z = `L${String(zz).length === 1 ? `0${zz}` : zz}` - console.log(zz, 'zz') - const xx = a.toString(16) - const x = `C${flag.substring(0, 8 - xx.length)}${xx}` - const yy = b.toString(16) - const y = `R${flag.substring(0, 8 - yy.length)}${yy}` - return `${window.localStorage.getItem('xuntengMap')}/${z}/${y}/${x}.png` - }, - }) - map.value.addLayer(xunteng.value) + if (window.sessionStorage.getItem('ping-xunteng-layer')) { + map.value.setZoom(12) + xunteng.value = new AMap.value.TileLayer({ + visible: true, + zIndex: 0, + opacity: 1, + zooms: [1, 19], + dataZooms: [1, 19], + getTileUrl: (a: any, b: any, c: any) => { + // 经纬度转换成本地瓦片所在路径 + const flag = '00000000' + const zz = c + const z = `L${String(zz).length === 1 ? `0${zz}` : zz}` + console.log(zz, 'zz') + const xx = a.toString(16) + const x = `C${flag.substring(0, 8 - xx.length)}${xx}` + const yy = b.toString(16) + const y = `R${flag.substring(0, 8 - yy.length)}${yy}` + return `${window.localStorage.getItem('xuntengMap')}/${z}/${y}/${x}.png` + }, + }) + map.value.addLayer(xunteng.value) + } map.value.setMapStyle('amap://styles/darkblue') } if ($props.showPiepleLayer) { @@ -189,6 +191,9 @@ } // 添加管线图层 function addPiepleLayer() { + if (!window.sessionStorage.getItem('ping-xunteng-layer')) { + return + } map.value.setZoom(12) if (xunteng.value) { xunteng.value.show() @@ -492,6 +497,78 @@ // massLineAllList.value = [] } // ------------------------------------------------------------------------------------------------ + +// -------------------------------------- 点聚合---------------------------------------------- +const MarkerAllCluster = ref([]) // 点聚合数组 +const cluster = ref() +// 添加点聚合 +const addCluster = (points) => { + var count = points.length + var _renderClusterMarker = function (context) { + var factor = (context.count / count) ** (1 / 18) + var div = document.createElement('div') + var Hue = 180 - factor * 130 + var bgColor = `hsla(${Hue},100%,40%,0.7)` + var fontColor = `hsla(${Hue},100%,90%,1)` + var borderColor = `hsla(${Hue},100%,40%,1)` + var shadowColor = `hsla(${Hue},100%,90%,1)` + div.style.backgroundColor = bgColor + var size = Math.round(30 + (context.count / count) ** (1 / 5) * 20) + div.style.width = div.style.height = `${size}px` + div.style.border = `solid 1px ${borderColor}` + div.style.borderRadius = `${size / 2}px` + div.style.boxShadow = `0 0 5px ${shadowColor}` + div.innerHTML = context.count + div.style.lineHeight = `${size}px` + div.style.color = fontColor + div.style.fontSize = '14px' + div.style.textAlign = 'center' + context.marker.setOffset(new AMap.value.Pixel(-size / 2, -size / 2)) + context.marker.setContent(div) + context.marker.on('click', (e) => { + map.value.setCenter(e.target._position) + map.value.setZoom(map.value.getZoom() + 3) + }) + } + const _renderMarker = (context: any) => { + const data = context.data[0] + // console.log(data, 'data') + const style = [ + { + url: `${publicPath}/image/well/闸井-正常.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-异常.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-离线.png`, // 图标地址 + }, + { + url: `${publicPath}/image/well/闸井-未部署.png`, // 图标地址 + }, + ] + const markerHtml = `` + var offset = new AMap.value.Pixel(-9, -9) + context.marker.setContent(markerHtml) + context.marker.setOffset(offset) + context.marker.on('click', (e) => { + // console.log(e, data, '1111') + $emits('massMarksClick', { event: { ...e, data: context.data[0] }, map: map.value, points, data }) + }) + } + cluster.value = new AMap.value.MarkerCluster(map.value, points, { + gridSize: 100, // 设置网格像素大小 + renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 + renderMarker: _renderMarker, // 自定义非聚合点样式 + }) +} +const removeCluster = () => { + if (cluster.value) { + cluster.value.setMap(null) + cluster.value = '' + } +} +// ------------------------------------------------------------------------------------------------ onMounted(() => { loading.value = true initMap() @@ -544,6 +621,9 @@ addMassLine, // 添加折线(海量线) removeMassLine, // 移除折线(海量线) getPosition, // 根据坐标获取详细位置信息 + + addCluster, + removeCluster, }) diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index 9c992cd..d851391 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -133,7 +133,16 @@ if ($route.query.row) { loadingTable.value = true const row = JSON.parse($route.query.row as string) - getCurrentAlarmListPage({ offset: 1, limit: 50 }).then((res) => { + const obj = { + begTime: '', + endTime: '', + } + if ($route.query.real) { + datetimerange.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + obj.begTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + obj.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { list1.value = data.map((item: any) => ({ diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 37a01c2..d164c20 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -54,10 +54,13 @@ @@ -146,6 +149,7 @@ height: 30px; display: flex; align-items: center; + justify-content: space-between; .icon-alarm { width: 25px; @@ -157,6 +161,16 @@ padding-left: 10px; color: #fff; } + + .close11 { + font-size: 18px; + color: #fff; + + &:hover { + cursor: pointer; + color: #ccc; + } + } } .contnt-alarm { @@ -190,7 +204,8 @@ margin-top: 10px; display: flex; justify-items: center; - justify-content: center; + // justify-content: center; + justify-content: end; } } } diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue index 49e8adc..561d89c 100644 --- a/src/views/home/dashboard/components/controlMap.vue +++ b/src/views/home/dashboard/components/controlMap.vue @@ -4,6 +4,7 @@ Date: 2024-07-18 --> diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index 9c992cd..d851391 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -133,7 +133,16 @@ if ($route.query.row) { loadingTable.value = true const row = JSON.parse($route.query.row as string) - getCurrentAlarmListPage({ offset: 1, limit: 50 }).then((res) => { + const obj = { + begTime: '', + endTime: '', + } + if ($route.query.real) { + datetimerange.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + obj.begTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + obj.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { list1.value = data.map((item: any) => ({ diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 37a01c2..d164c20 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -54,10 +54,13 @@ @@ -146,6 +149,7 @@ height: 30px; display: flex; align-items: center; + justify-content: space-between; .icon-alarm { width: 25px; @@ -157,6 +161,16 @@ padding-left: 10px; color: #fff; } + + .close11 { + font-size: 18px; + color: #fff; + + &:hover { + cursor: pointer; + color: #ccc; + } + } } .contnt-alarm { @@ -190,7 +204,8 @@ margin-top: 10px; display: flex; justify-items: center; - justify-content: center; + // justify-content: center; + justify-content: end; } } } diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue index 49e8adc..561d89c 100644 --- a/src/views/home/dashboard/components/controlMap.vue +++ b/src/views/home/dashboard/components/controlMap.vue @@ -4,6 +4,7 @@ Date: 2024-07-18 --> diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index 9c992cd..d851391 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -133,7 +133,16 @@ if ($route.query.row) { loadingTable.value = true const row = JSON.parse($route.query.row as string) - getCurrentAlarmListPage({ offset: 1, limit: 50 }).then((res) => { + const obj = { + begTime: '', + endTime: '', + } + if ($route.query.real) { + datetimerange.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + obj.begTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + obj.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { list1.value = data.map((item: any) => ({ diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 37a01c2..d164c20 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -54,10 +54,13 @@ @@ -146,6 +149,7 @@ height: 30px; display: flex; align-items: center; + justify-content: space-between; .icon-alarm { width: 25px; @@ -157,6 +161,16 @@ padding-left: 10px; color: #fff; } + + .close11 { + font-size: 18px; + color: #fff; + + &:hover { + cursor: pointer; + color: #ccc; + } + } } .contnt-alarm { @@ -190,7 +204,8 @@ margin-top: 10px; display: flex; justify-items: center; - justify-content: center; + // justify-content: center; + justify-content: end; } } } diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue index 49e8adc..561d89c 100644 --- a/src/views/home/dashboard/components/controlMap.vue +++ b/src/views/home/dashboard/components/controlMap.vue @@ -4,6 +4,7 @@ Date: 2024-07-18 --> diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index 9c992cd..d851391 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -133,7 +133,16 @@ if ($route.query.row) { loadingTable.value = true const row = JSON.parse($route.query.row as string) - getCurrentAlarmListPage({ offset: 1, limit: 50 }).then((res) => { + const obj = { + begTime: '', + endTime: '', + } + if ($route.query.real) { + datetimerange.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + obj.begTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + obj.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { list1.value = data.map((item: any) => ({ diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 37a01c2..d164c20 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -54,10 +54,13 @@ @@ -146,6 +149,7 @@ height: 30px; display: flex; align-items: center; + justify-content: space-between; .icon-alarm { width: 25px; @@ -157,6 +161,16 @@ padding-left: 10px; color: #fff; } + + .close11 { + font-size: 18px; + color: #fff; + + &:hover { + cursor: pointer; + color: #ccc; + } + } } .contnt-alarm { @@ -190,7 +204,8 @@ margin-top: 10px; display: flex; justify-items: center; - justify-content: center; + // justify-content: center; + justify-content: end; } } } diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue index 49e8adc..561d89c 100644 --- a/src/views/home/dashboard/components/controlMap.vue +++ b/src/views/home/dashboard/components/controlMap.vue @@ -4,6 +4,7 @@ Date: 2024-07-18 --> diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index 9c992cd..d851391 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -133,7 +133,16 @@ if ($route.query.row) { loadingTable.value = true const row = JSON.parse($route.query.row as string) - getCurrentAlarmListPage({ offset: 1, limit: 50 }).then((res) => { + const obj = { + begTime: '', + endTime: '', + } + if ($route.query.real) { + datetimerange.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + obj.begTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + obj.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { list1.value = data.map((item: any) => ({ diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 37a01c2..d164c20 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -54,10 +54,13 @@ @@ -146,6 +149,7 @@ height: 30px; display: flex; align-items: center; + justify-content: space-between; .icon-alarm { width: 25px; @@ -157,6 +161,16 @@ padding-left: 10px; color: #fff; } + + .close11 { + font-size: 18px; + color: #fff; + + &:hover { + cursor: pointer; + color: #ccc; + } + } } .contnt-alarm { @@ -190,7 +204,8 @@ margin-top: 10px; display: flex; justify-items: center; - justify-content: center; + // justify-content: center; + justify-content: end; } } } diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue index 49e8adc..561d89c 100644 --- a/src/views/home/dashboard/components/controlMap.vue +++ b/src/views/home/dashboard/components/controlMap.vue @@ -4,6 +4,7 @@ Date: 2024-07-18 --> diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index 9c992cd..d851391 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -133,7 +133,16 @@ if ($route.query.row) { loadingTable.value = true const row = JSON.parse($route.query.row as string) - getCurrentAlarmListPage({ offset: 1, limit: 50 }).then((res) => { + const obj = { + begTime: '', + endTime: '', + } + if ($route.query.real) { + datetimerange.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + obj.begTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + obj.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { list1.value = data.map((item: any) => ({ diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 37a01c2..d164c20 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -54,10 +54,13 @@ @@ -146,6 +149,7 @@ height: 30px; display: flex; align-items: center; + justify-content: space-between; .icon-alarm { width: 25px; @@ -157,6 +161,16 @@ padding-left: 10px; color: #fff; } + + .close11 { + font-size: 18px; + color: #fff; + + &:hover { + cursor: pointer; + color: #ccc; + } + } } .contnt-alarm { @@ -190,7 +204,8 @@ margin-top: 10px; display: flex; justify-items: center; - justify-content: center; + // justify-content: center; + justify-content: end; } } } diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue index 49e8adc..561d89c 100644 --- a/src/views/home/dashboard/components/controlMap.vue +++ b/src/views/home/dashboard/components/controlMap.vue @@ -4,6 +4,7 @@ Date: 2024-07-18 --> diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index 9c992cd..d851391 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -133,7 +133,16 @@ if ($route.query.row) { loadingTable.value = true const row = JSON.parse($route.query.row as string) - getCurrentAlarmListPage({ offset: 1, limit: 50 }).then((res) => { + const obj = { + begTime: '', + endTime: '', + } + if ($route.query.real) { + datetimerange.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + obj.begTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + obj.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { list1.value = data.map((item: any) => ({ diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 37a01c2..d164c20 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -54,10 +54,13 @@ @@ -146,6 +149,7 @@ height: 30px; display: flex; align-items: center; + justify-content: space-between; .icon-alarm { width: 25px; @@ -157,6 +161,16 @@ padding-left: 10px; color: #fff; } + + .close11 { + font-size: 18px; + color: #fff; + + &:hover { + cursor: pointer; + color: #ccc; + } + } } .contnt-alarm { @@ -190,7 +204,8 @@ margin-top: 10px; display: flex; justify-items: center; - justify-content: center; + // justify-content: center; + justify-content: end; } } } diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue index 49e8adc..561d89c 100644 --- a/src/views/home/dashboard/components/controlMap.vue +++ b/src/views/home/dashboard/components/controlMap.vue @@ -4,6 +4,7 @@ Date: 2024-07-18 --> diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index 9c992cd..d851391 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -133,7 +133,16 @@ if ($route.query.row) { loadingTable.value = true const row = JSON.parse($route.query.row as string) - getCurrentAlarmListPage({ offset: 1, limit: 50 }).then((res) => { + const obj = { + begTime: '', + endTime: '', + } + if ($route.query.real) { + datetimerange.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + obj.begTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + obj.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { list1.value = data.map((item: any) => ({ diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 37a01c2..d164c20 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -54,10 +54,13 @@ @@ -146,6 +149,7 @@ height: 30px; display: flex; align-items: center; + justify-content: space-between; .icon-alarm { width: 25px; @@ -157,6 +161,16 @@ padding-left: 10px; color: #fff; } + + .close11 { + font-size: 18px; + color: #fff; + + &:hover { + cursor: pointer; + color: #ccc; + } + } } .contnt-alarm { @@ -190,7 +204,8 @@ margin-top: 10px; display: flex; justify-items: center; - justify-content: center; + // justify-content: center; + justify-content: end; } } } diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue index 49e8adc..561d89c 100644 --- a/src/views/home/dashboard/components/controlMap.vue +++ b/src/views/home/dashboard/components/controlMap.vue @@ -4,6 +4,7 @@ Date: 2024-07-18 --> diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index 9c992cd..d851391 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -133,7 +133,16 @@ if ($route.query.row) { loadingTable.value = true const row = JSON.parse($route.query.row as string) - getCurrentAlarmListPage({ offset: 1, limit: 50 }).then((res) => { + const obj = { + begTime: '', + endTime: '', + } + if ($route.query.real) { + datetimerange.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + obj.begTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + obj.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { list1.value = data.map((item: any) => ({ diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 37a01c2..d164c20 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -54,10 +54,13 @@ @@ -146,6 +149,7 @@ height: 30px; display: flex; align-items: center; + justify-content: space-between; .icon-alarm { width: 25px; @@ -157,6 +161,16 @@ padding-left: 10px; color: #fff; } + + .close11 { + font-size: 18px; + color: #fff; + + &:hover { + cursor: pointer; + color: #ccc; + } + } } .contnt-alarm { @@ -190,7 +204,8 @@ margin-top: 10px; display: flex; justify-items: center; - justify-content: center; + // justify-content: center; + justify-content: end; } } } diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue index 49e8adc..561d89c 100644 --- a/src/views/home/dashboard/components/controlMap.vue +++ b/src/views/home/dashboard/components/controlMap.vue @@ -4,6 +4,7 @@ Date: 2024-07-18 --> diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index 9c992cd..d851391 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -133,7 +133,16 @@ if ($route.query.row) { loadingTable.value = true const row = JSON.parse($route.query.row as string) - getCurrentAlarmListPage({ offset: 1, limit: 50 }).then((res) => { + const obj = { + begTime: '', + endTime: '', + } + if ($route.query.real) { + datetimerange.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + obj.begTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + obj.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { list1.value = data.map((item: any) => ({ diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 37a01c2..d164c20 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -54,10 +54,13 @@ @@ -146,6 +149,7 @@ height: 30px; display: flex; align-items: center; + justify-content: space-between; .icon-alarm { width: 25px; @@ -157,6 +161,16 @@ padding-left: 10px; color: #fff; } + + .close11 { + font-size: 18px; + color: #fff; + + &:hover { + cursor: pointer; + color: #ccc; + } + } } .contnt-alarm { @@ -190,7 +204,8 @@ margin-top: 10px; display: flex; justify-items: center; - justify-content: center; + // justify-content: center; + justify-content: end; } } } diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue index 49e8adc..561d89c 100644 --- a/src/views/home/dashboard/components/controlMap.vue +++ b/src/views/home/dashboard/components/controlMap.vue @@ -4,6 +4,7 @@ Date: 2024-07-18 --> diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 1274d52..422df87 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -158,14 +158,14 @@ > 22
-
+
{{ message.alarmMsg }}
{{ message.alarmTime }}
-
+
{{ message.processStatus === '未读' ? '未读' : '已读' }} @@ -226,11 +226,12 @@ } .message-item { - display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 8px 5px; cursor: pointer; + width: 100%; + display: inline-block; &:hover { background-color: #f6f6f6; @@ -239,6 +240,9 @@ .title { display: flex; font-size: 12px; + // display: inline-block; + width: 100%; + flex-wrap: nowrap; // width: 70%; // display: flex; @@ -264,9 +268,26 @@ } } + .tag { + width: 20%; + display: flex; + } + .mar { margin: 0 5px; } + + .mar1 { + width: 60%; + display: inline-block; + overflow: hidden; + + /* 确保超出的内容会被裁剪 */ + white-space: nowrap; + + /* 确保文本在一行内显示 */ + text-overflow: ellipsis; + } } .circle-1 { diff --git a/src/main.ts b/src/main.ts index 05c8c94..4f1a2eb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,17 @@ window.localStorage.setItem('JsKey', result.data.JsKey) // window.localStorage.setItem('amapResource', result.data.amapResource) window.localStorage.setItem('xuntengMap', result.data.xuntengMap) + axios.get(`${window.localStorage.getItem('xuntengMap') as string}/L16/R00006105/C0000d2ba.png?ts=${new Date().getTime()}`).then(() => { + console.log('请求通了') + window.sessionStorage.setItem('ping-xunteng-layer', '1') + }).catch((error) => { + console.log('请求不通') + window.sessionStorage.setItem('ping-xunteng-layer', '') + if (error.message) { + console.log('网络异常') + window.sessionStorage.setItem('ping-xunteng-layer', '') + } + }) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index 9c992cd..d851391 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -133,7 +133,16 @@ if ($route.query.row) { loadingTable.value = true const row = JSON.parse($route.query.row as string) - getCurrentAlarmListPage({ offset: 1, limit: 50 }).then((res) => { + const obj = { + begTime: '', + endTime: '', + } + if ($route.query.real) { + datetimerange.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + obj.begTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + obj.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + getCurrentAlarmListPage({ offset: 1, limit: 50, ...obj }).then((res) => { const data = res.data.rows.filter((item: any) => item.id === (row.id || row.alarmId)) if (data.length) { list1.value = data.map((item: any) => ({ diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 37a01c2..d164c20 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -54,10 +54,13 @@ @@ -146,6 +149,7 @@ height: 30px; display: flex; align-items: center; + justify-content: space-between; .icon-alarm { width: 25px; @@ -157,6 +161,16 @@ padding-left: 10px; color: #fff; } + + .close11 { + font-size: 18px; + color: #fff; + + &:hover { + cursor: pointer; + color: #ccc; + } + } } .contnt-alarm { @@ -190,7 +204,8 @@ margin-top: 10px; display: flex; justify-items: center; - justify-content: center; + // justify-content: center; + justify-content: end; } } } diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue index 49e8adc..561d89c 100644 --- a/src/views/home/dashboard/components/controlMap.vue +++ b/src/views/home/dashboard/components/controlMap.vue @@ -4,6 +4,7 @@ Date: 2024-07-18 -->