diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 7dfd02d..040fb16 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -487,6 +487,7 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { +console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 @@ -884,7 +885,8 @@ getLocation, // 获取当前位置 addCluster, removeCluster, - addClusterForDistrict + addClusterForDistrict, + showPieple }) diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 7dfd02d..040fb16 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -487,6 +487,7 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { +console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 @@ -884,7 +885,8 @@ getLocation, // 获取当前位置 addCluster, removeCluster, - addClusterForDistrict + addClusterForDistrict, + showPieple }) diff --git a/src/router/index.ts b/src/router/index.ts index 77240d7..266c897 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,7 +11,7 @@ import useMenuStore from '@/store/modules/menu' import useRouteStore from '@/store/modules/route' import { getAdminToken } from '@/api/system/login' - +import { RSAencrypt } from '@/utils/security1' const { isLoading } = useNProgress() const router = createRouter({ @@ -20,10 +20,13 @@ }) router.beforeEach(async (to, from, next) => { - if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { + if ((to.query.token || to.query.avoid) && !sessionStorage.getItem('NoLoginIdentifier')) { // console.log('携带code跳转,需要免登录') - const data = encodeURIComponent(to.query.token as string) + let data = to.query.token ? encodeURIComponent(to.query.token as string) : encodeURIComponent(RSAencrypt('lyg')) sessionStorage.setItem('NoLoginIdentifier', '1') + if(to.query.avoid) { + sessionStorage.setItem('avoid', '1') + } try { const res = await getAdminToken(data) sessionStorage.removeItem('NoLoginIdentifier') @@ -280,8 +283,8 @@ // 加入面包屑 // if (!to.path.includes('detail')) { // path - if(to.name === 'dashboard') { - return + if (to.name === 'dashboard') { + return } // console.log(to, '加入面包屑') const menuStore = useMenuStore() diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 7dfd02d..040fb16 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -487,6 +487,7 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { +console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 @@ -884,7 +885,8 @@ getLocation, // 获取当前位置 addCluster, removeCluster, - addClusterForDistrict + addClusterForDistrict, + showPieple }) diff --git a/src/router/index.ts b/src/router/index.ts index 77240d7..266c897 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,7 +11,7 @@ import useMenuStore from '@/store/modules/menu' import useRouteStore from '@/store/modules/route' import { getAdminToken } from '@/api/system/login' - +import { RSAencrypt } from '@/utils/security1' const { isLoading } = useNProgress() const router = createRouter({ @@ -20,10 +20,13 @@ }) router.beforeEach(async (to, from, next) => { - if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { + if ((to.query.token || to.query.avoid) && !sessionStorage.getItem('NoLoginIdentifier')) { // console.log('携带code跳转,需要免登录') - const data = encodeURIComponent(to.query.token as string) + let data = to.query.token ? encodeURIComponent(to.query.token as string) : encodeURIComponent(RSAencrypt('lyg')) sessionStorage.setItem('NoLoginIdentifier', '1') + if(to.query.avoid) { + sessionStorage.setItem('avoid', '1') + } try { const res = await getAdminToken(data) sessionStorage.removeItem('NoLoginIdentifier') @@ -280,8 +283,8 @@ // 加入面包屑 // if (!to.path.includes('detail')) { // path - if(to.name === 'dashboard') { - return + if (to.name === 'dashboard') { + return } // console.log(to, '加入面包屑') const menuStore = useMenuStore() diff --git a/src/store/modules/route.ts b/src/store/modules/route.ts index 2b5ec6e..6ea30b5 100644 --- a/src/store/modules/route.ts +++ b/src/store/modules/route.ts @@ -223,16 +223,25 @@ } if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } // 设置 routes 数据 diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 7dfd02d..040fb16 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -487,6 +487,7 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { +console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 @@ -884,7 +885,8 @@ getLocation, // 获取当前位置 addCluster, removeCluster, - addClusterForDistrict + addClusterForDistrict, + showPieple }) diff --git a/src/router/index.ts b/src/router/index.ts index 77240d7..266c897 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,7 +11,7 @@ import useMenuStore from '@/store/modules/menu' import useRouteStore from '@/store/modules/route' import { getAdminToken } from '@/api/system/login' - +import { RSAencrypt } from '@/utils/security1' const { isLoading } = useNProgress() const router = createRouter({ @@ -20,10 +20,13 @@ }) router.beforeEach(async (to, from, next) => { - if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { + if ((to.query.token || to.query.avoid) && !sessionStorage.getItem('NoLoginIdentifier')) { // console.log('携带code跳转,需要免登录') - const data = encodeURIComponent(to.query.token as string) + let data = to.query.token ? encodeURIComponent(to.query.token as string) : encodeURIComponent(RSAencrypt('lyg')) sessionStorage.setItem('NoLoginIdentifier', '1') + if(to.query.avoid) { + sessionStorage.setItem('avoid', '1') + } try { const res = await getAdminToken(data) sessionStorage.removeItem('NoLoginIdentifier') @@ -280,8 +283,8 @@ // 加入面包屑 // if (!to.path.includes('detail')) { // path - if(to.name === 'dashboard') { - return + if (to.name === 'dashboard') { + return } // console.log(to, '加入面包屑') const menuStore = useMenuStore() diff --git a/src/store/modules/route.ts b/src/store/modules/route.ts index 2b5ec6e..6ea30b5 100644 --- a/src/store/modules/route.ts +++ b/src/store/modules/route.ts @@ -223,16 +223,25 @@ } if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } // 设置 routes 数据 diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 130a012..7dc2ba9 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -265,16 +265,26 @@ this.btns = btns if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + console.log(window.location.href, 'window.location.href') + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } resolve(btns) diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 7dfd02d..040fb16 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -487,6 +487,7 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { +console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 @@ -884,7 +885,8 @@ getLocation, // 获取当前位置 addCluster, removeCluster, - addClusterForDistrict + addClusterForDistrict, + showPieple }) diff --git a/src/router/index.ts b/src/router/index.ts index 77240d7..266c897 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,7 +11,7 @@ import useMenuStore from '@/store/modules/menu' import useRouteStore from '@/store/modules/route' import { getAdminToken } from '@/api/system/login' - +import { RSAencrypt } from '@/utils/security1' const { isLoading } = useNProgress() const router = createRouter({ @@ -20,10 +20,13 @@ }) router.beforeEach(async (to, from, next) => { - if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { + if ((to.query.token || to.query.avoid) && !sessionStorage.getItem('NoLoginIdentifier')) { // console.log('携带code跳转,需要免登录') - const data = encodeURIComponent(to.query.token as string) + let data = to.query.token ? encodeURIComponent(to.query.token as string) : encodeURIComponent(RSAencrypt('lyg')) sessionStorage.setItem('NoLoginIdentifier', '1') + if(to.query.avoid) { + sessionStorage.setItem('avoid', '1') + } try { const res = await getAdminToken(data) sessionStorage.removeItem('NoLoginIdentifier') @@ -280,8 +283,8 @@ // 加入面包屑 // if (!to.path.includes('detail')) { // path - if(to.name === 'dashboard') { - return + if (to.name === 'dashboard') { + return } // console.log(to, '加入面包屑') const menuStore = useMenuStore() diff --git a/src/store/modules/route.ts b/src/store/modules/route.ts index 2b5ec6e..6ea30b5 100644 --- a/src/store/modules/route.ts +++ b/src/store/modules/route.ts @@ -223,16 +223,25 @@ } if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } // 设置 routes 数据 diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 130a012..7dc2ba9 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -265,16 +265,26 @@ this.btns = btns if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + console.log(window.location.href, 'window.location.href') + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } resolve(btns) diff --git a/src/utils/security1.ts b/src/utils/security1.ts index 974c233..4b3b4c7 100644 --- a/src/utils/security1.ts +++ b/src/utils/security1.ts @@ -1,8 +1,9 @@ +import JsEncrypt from 'jsencrypt' const encodedString = 'encrypt'.charCodeAt(0) - 3 export const getencodedString = () => { return encodedString } -// 简易加密 +// 简易加密 加密结果 + encodedString = 结果 export function encrypt(str) { if (!str) { return '' @@ -62,3 +63,15 @@ return decryptedNum // return parseInt(decryptedNum); } + +// rsa加密 +let publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCu5k8gcTFJy5UtMfmtKiR3f/EcUe93kzfteRj6+sM5fHRvOib82+uqQMjgaRZiMcr3HiHIFY5vA6c+Rfb5R2COitoOhxyA9U2eLXknzxLUQIAqXAvKQO8KnerA1Qjcds7xhJB2XPhWFlY4RVtMT2wr2lMd29QDE4F/kzyDhNBpxwIDAQAB' +export function RSAencrypt(value: string) { + const encrypt = new JsEncrypt() + let enRes = '' + encrypt.setPublicKey(publicKey)// 从store中读取公钥 + enRes = encrypt.encrypt(value) || '' + + // console.log(enRes, 'enRes') + return enRes +} diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 7dfd02d..040fb16 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -487,6 +487,7 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { +console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 @@ -884,7 +885,8 @@ getLocation, // 获取当前位置 addCluster, removeCluster, - addClusterForDistrict + addClusterForDistrict, + showPieple }) diff --git a/src/router/index.ts b/src/router/index.ts index 77240d7..266c897 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,7 +11,7 @@ import useMenuStore from '@/store/modules/menu' import useRouteStore from '@/store/modules/route' import { getAdminToken } from '@/api/system/login' - +import { RSAencrypt } from '@/utils/security1' const { isLoading } = useNProgress() const router = createRouter({ @@ -20,10 +20,13 @@ }) router.beforeEach(async (to, from, next) => { - if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { + if ((to.query.token || to.query.avoid) && !sessionStorage.getItem('NoLoginIdentifier')) { // console.log('携带code跳转,需要免登录') - const data = encodeURIComponent(to.query.token as string) + let data = to.query.token ? encodeURIComponent(to.query.token as string) : encodeURIComponent(RSAencrypt('lyg')) sessionStorage.setItem('NoLoginIdentifier', '1') + if(to.query.avoid) { + sessionStorage.setItem('avoid', '1') + } try { const res = await getAdminToken(data) sessionStorage.removeItem('NoLoginIdentifier') @@ -280,8 +283,8 @@ // 加入面包屑 // if (!to.path.includes('detail')) { // path - if(to.name === 'dashboard') { - return + if (to.name === 'dashboard') { + return } // console.log(to, '加入面包屑') const menuStore = useMenuStore() diff --git a/src/store/modules/route.ts b/src/store/modules/route.ts index 2b5ec6e..6ea30b5 100644 --- a/src/store/modules/route.ts +++ b/src/store/modules/route.ts @@ -223,16 +223,25 @@ } if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } // 设置 routes 数据 diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 130a012..7dc2ba9 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -265,16 +265,26 @@ this.btns = btns if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + console.log(window.location.href, 'window.location.href') + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } resolve(btns) diff --git a/src/utils/security1.ts b/src/utils/security1.ts index 974c233..4b3b4c7 100644 --- a/src/utils/security1.ts +++ b/src/utils/security1.ts @@ -1,8 +1,9 @@ +import JsEncrypt from 'jsencrypt' const encodedString = 'encrypt'.charCodeAt(0) - 3 export const getencodedString = () => { return encodedString } -// 简易加密 +// 简易加密 加密结果 + encodedString = 结果 export function encrypt(str) { if (!str) { return '' @@ -62,3 +63,15 @@ return decryptedNum // return parseInt(decryptedNum); } + +// rsa加密 +let publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCu5k8gcTFJy5UtMfmtKiR3f/EcUe93kzfteRj6+sM5fHRvOib82+uqQMjgaRZiMcr3HiHIFY5vA6c+Rfb5R2COitoOhxyA9U2eLXknzxLUQIAqXAvKQO8KnerA1Qjcds7xhJB2XPhWFlY4RVtMT2wr2lMd29QDE4F/kzyDhNBpxwIDAQAB' +export function RSAencrypt(value: string) { + const encrypt = new JsEncrypt() + let enRes = '' + encrypt.setPublicKey(publicKey)// 从store中读取公钥 + enRes = encrypt.encrypt(value) || '' + + // console.log(enRes, 'enRes') + return enRes +} diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index 08c9eb4..7f53c6f 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -16,6 +16,7 @@ const loading = ref(false) const info = ref({}) const isFirstFill = ref(true) +const isDispose = ref(false) // 是否处置 const alarmCategoryName = ref('') const confirmSituationList = ref<{ id: string; name: string; value: string }[]>([]) const confirmSituationAllList = ref<{ id: string; name: string; value: string }[]>([]) @@ -26,15 +27,15 @@ value: '6', }, { - name: '已处置', + name: '处置中', id: '7', value: '7', }, - { - name: '无需处置', - id: '10', - value: '10', - }, + // { + // name: '无需处置', + // id: '10', + // value: '10', + // }, ]) const dataFormRef = ref() const dataForm = ref({ @@ -90,6 +91,7 @@ const record = ref([]) const initDialog = (row: any) => { record.value = [] + isDispose.value = false isFirstLoading.value = true dataForm.value = { confirmValue: '', // 现场浓度值 @@ -113,7 +115,7 @@ loading.value = true info.value = row alarmCategoryName.value = row.alarmCategory - console.log(row.alarmCategory, 'row.alarmCategory') + // console.log(row.alarmCategory, 'row.alarmCategory') if (row.alarmCategory.includes('浓度')) { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '0') @@ -121,31 +123,38 @@ else { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '3') // console.log(row.alarmCategory, 'row.alarmCategory') - if($route.fullPath.includes('operation')) { + if ($route.fullPath.includes('operation')) { confirmSituationList.value.shift() - if(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { + if (confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { confirmSituationList.value.unshift(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) } } } - getHandlerAlarmRecord({ alarmId: row.id, flowStatus: '5' }).then(res => { - record.value = res.data || [] - if (res.data.length > 0) { + getHandlerAlarmRecord({ alarmId: row.id }).then(res => { + record.value = (res.data || []).filter((item: any) => item.flowStatus === '5') + if (record.value.length) { isFirstFill.value = false - dataForm.value.flowStatus = '7' + dataForm.value.flowStatus = '6' dataForm.value.confirmValue = record.value[0].confirmValue - // console.log(record.value[0].confirmValue, 'record.value[0].confirmValue') dataForm.value.approvalStatus = record.value[0].approvalStatus dataForm.value.descn = record.value[0].descn dataForm.value.approvalPerson = record.value[0].approvalPerson dataForm.value.approvalTime = record.value[0].approvalTime - if (record.value[0].flowStatus === '5') { - dataForm.value.flowStatus = '10' + if ((res.data || []).length) { + const last = res.data[0] + if (last.flowStatus === '6' || last.flowStatus === '7') { + dataForm.value.flowStatus = last.flowStatus + if (dataForm.value.flowStatus === '7') { + isDispose.value = true + console.log(last, 'last') + dataForm.value.approvalPerson1 = last.approvalPerson + dataForm.value.descn1 = last.descn + dataForm.value.approvalTime1 = last.approvalTime + } + } } - if (record.value[0].flowStatus === '6') { - dataForm.value.flowStatus = '6' - } + } else { @@ -272,7 +281,8 @@ - + @@ -294,7 +304,7 @@ - + @@ -302,14 +312,15 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> - + @@ -328,7 +339,7 @@ - + @@ -336,7 +347,8 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 7dfd02d..040fb16 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -487,6 +487,7 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { +console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 @@ -884,7 +885,8 @@ getLocation, // 获取当前位置 addCluster, removeCluster, - addClusterForDistrict + addClusterForDistrict, + showPieple }) diff --git a/src/router/index.ts b/src/router/index.ts index 77240d7..266c897 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,7 +11,7 @@ import useMenuStore from '@/store/modules/menu' import useRouteStore from '@/store/modules/route' import { getAdminToken } from '@/api/system/login' - +import { RSAencrypt } from '@/utils/security1' const { isLoading } = useNProgress() const router = createRouter({ @@ -20,10 +20,13 @@ }) router.beforeEach(async (to, from, next) => { - if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { + if ((to.query.token || to.query.avoid) && !sessionStorage.getItem('NoLoginIdentifier')) { // console.log('携带code跳转,需要免登录') - const data = encodeURIComponent(to.query.token as string) + let data = to.query.token ? encodeURIComponent(to.query.token as string) : encodeURIComponent(RSAencrypt('lyg')) sessionStorage.setItem('NoLoginIdentifier', '1') + if(to.query.avoid) { + sessionStorage.setItem('avoid', '1') + } try { const res = await getAdminToken(data) sessionStorage.removeItem('NoLoginIdentifier') @@ -280,8 +283,8 @@ // 加入面包屑 // if (!to.path.includes('detail')) { // path - if(to.name === 'dashboard') { - return + if (to.name === 'dashboard') { + return } // console.log(to, '加入面包屑') const menuStore = useMenuStore() diff --git a/src/store/modules/route.ts b/src/store/modules/route.ts index 2b5ec6e..6ea30b5 100644 --- a/src/store/modules/route.ts +++ b/src/store/modules/route.ts @@ -223,16 +223,25 @@ } if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } // 设置 routes 数据 diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 130a012..7dc2ba9 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -265,16 +265,26 @@ this.btns = btns if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + console.log(window.location.href, 'window.location.href') + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } resolve(btns) diff --git a/src/utils/security1.ts b/src/utils/security1.ts index 974c233..4b3b4c7 100644 --- a/src/utils/security1.ts +++ b/src/utils/security1.ts @@ -1,8 +1,9 @@ +import JsEncrypt from 'jsencrypt' const encodedString = 'encrypt'.charCodeAt(0) - 3 export const getencodedString = () => { return encodedString } -// 简易加密 +// 简易加密 加密结果 + encodedString = 结果 export function encrypt(str) { if (!str) { return '' @@ -62,3 +63,15 @@ return decryptedNum // return parseInt(decryptedNum); } + +// rsa加密 +let publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCu5k8gcTFJy5UtMfmtKiR3f/EcUe93kzfteRj6+sM5fHRvOib82+uqQMjgaRZiMcr3HiHIFY5vA6c+Rfb5R2COitoOhxyA9U2eLXknzxLUQIAqXAvKQO8KnerA1Qjcds7xhJB2XPhWFlY4RVtMT2wr2lMd29QDE4F/kzyDhNBpxwIDAQAB' +export function RSAencrypt(value: string) { + const encrypt = new JsEncrypt() + let enRes = '' + encrypt.setPublicKey(publicKey)// 从store中读取公钥 + enRes = encrypt.encrypt(value) || '' + + // console.log(enRes, 'enRes') + return enRes +} diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index 08c9eb4..7f53c6f 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -16,6 +16,7 @@ const loading = ref(false) const info = ref({}) const isFirstFill = ref(true) +const isDispose = ref(false) // 是否处置 const alarmCategoryName = ref('') const confirmSituationList = ref<{ id: string; name: string; value: string }[]>([]) const confirmSituationAllList = ref<{ id: string; name: string; value: string }[]>([]) @@ -26,15 +27,15 @@ value: '6', }, { - name: '已处置', + name: '处置中', id: '7', value: '7', }, - { - name: '无需处置', - id: '10', - value: '10', - }, + // { + // name: '无需处置', + // id: '10', + // value: '10', + // }, ]) const dataFormRef = ref() const dataForm = ref({ @@ -90,6 +91,7 @@ const record = ref([]) const initDialog = (row: any) => { record.value = [] + isDispose.value = false isFirstLoading.value = true dataForm.value = { confirmValue: '', // 现场浓度值 @@ -113,7 +115,7 @@ loading.value = true info.value = row alarmCategoryName.value = row.alarmCategory - console.log(row.alarmCategory, 'row.alarmCategory') + // console.log(row.alarmCategory, 'row.alarmCategory') if (row.alarmCategory.includes('浓度')) { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '0') @@ -121,31 +123,38 @@ else { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '3') // console.log(row.alarmCategory, 'row.alarmCategory') - if($route.fullPath.includes('operation')) { + if ($route.fullPath.includes('operation')) { confirmSituationList.value.shift() - if(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { + if (confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { confirmSituationList.value.unshift(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) } } } - getHandlerAlarmRecord({ alarmId: row.id, flowStatus: '5' }).then(res => { - record.value = res.data || [] - if (res.data.length > 0) { + getHandlerAlarmRecord({ alarmId: row.id }).then(res => { + record.value = (res.data || []).filter((item: any) => item.flowStatus === '5') + if (record.value.length) { isFirstFill.value = false - dataForm.value.flowStatus = '7' + dataForm.value.flowStatus = '6' dataForm.value.confirmValue = record.value[0].confirmValue - // console.log(record.value[0].confirmValue, 'record.value[0].confirmValue') dataForm.value.approvalStatus = record.value[0].approvalStatus dataForm.value.descn = record.value[0].descn dataForm.value.approvalPerson = record.value[0].approvalPerson dataForm.value.approvalTime = record.value[0].approvalTime - if (record.value[0].flowStatus === '5') { - dataForm.value.flowStatus = '10' + if ((res.data || []).length) { + const last = res.data[0] + if (last.flowStatus === '6' || last.flowStatus === '7') { + dataForm.value.flowStatus = last.flowStatus + if (dataForm.value.flowStatus === '7') { + isDispose.value = true + console.log(last, 'last') + dataForm.value.approvalPerson1 = last.approvalPerson + dataForm.value.descn1 = last.descn + dataForm.value.approvalTime1 = last.approvalTime + } + } } - if (record.value[0].flowStatus === '6') { - dataForm.value.flowStatus = '6' - } + } else { @@ -272,7 +281,8 @@ - + @@ -294,7 +304,7 @@ - + @@ -302,14 +312,15 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> - + @@ -328,7 +339,7 @@ - + @@ -336,7 +347,8 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 101e4a8..d7756bd 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -248,7 +248,7 @@ else if (name?.includes('挂起')) { handlerStyle('#F58800') } - else if (name?.includes('已处置') || name?.includes('已确认')) { + else if (name?.includes('已处置') || name?.includes('已确认') || name?.includes('处置中')) { handlerStyle('#67c23a') } return style @@ -413,12 +413,12 @@ 报警处置 --> - {{ $route.fullPath.includes('operation') ? '报警处置' : '确认/处置记录' }} 挂起 diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 7dfd02d..040fb16 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -487,6 +487,7 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { +console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 @@ -884,7 +885,8 @@ getLocation, // 获取当前位置 addCluster, removeCluster, - addClusterForDistrict + addClusterForDistrict, + showPieple }) diff --git a/src/router/index.ts b/src/router/index.ts index 77240d7..266c897 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,7 +11,7 @@ import useMenuStore from '@/store/modules/menu' import useRouteStore from '@/store/modules/route' import { getAdminToken } from '@/api/system/login' - +import { RSAencrypt } from '@/utils/security1' const { isLoading } = useNProgress() const router = createRouter({ @@ -20,10 +20,13 @@ }) router.beforeEach(async (to, from, next) => { - if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { + if ((to.query.token || to.query.avoid) && !sessionStorage.getItem('NoLoginIdentifier')) { // console.log('携带code跳转,需要免登录') - const data = encodeURIComponent(to.query.token as string) + let data = to.query.token ? encodeURIComponent(to.query.token as string) : encodeURIComponent(RSAencrypt('lyg')) sessionStorage.setItem('NoLoginIdentifier', '1') + if(to.query.avoid) { + sessionStorage.setItem('avoid', '1') + } try { const res = await getAdminToken(data) sessionStorage.removeItem('NoLoginIdentifier') @@ -280,8 +283,8 @@ // 加入面包屑 // if (!to.path.includes('detail')) { // path - if(to.name === 'dashboard') { - return + if (to.name === 'dashboard') { + return } // console.log(to, '加入面包屑') const menuStore = useMenuStore() diff --git a/src/store/modules/route.ts b/src/store/modules/route.ts index 2b5ec6e..6ea30b5 100644 --- a/src/store/modules/route.ts +++ b/src/store/modules/route.ts @@ -223,16 +223,25 @@ } if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } // 设置 routes 数据 diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 130a012..7dc2ba9 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -265,16 +265,26 @@ this.btns = btns if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + console.log(window.location.href, 'window.location.href') + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } resolve(btns) diff --git a/src/utils/security1.ts b/src/utils/security1.ts index 974c233..4b3b4c7 100644 --- a/src/utils/security1.ts +++ b/src/utils/security1.ts @@ -1,8 +1,9 @@ +import JsEncrypt from 'jsencrypt' const encodedString = 'encrypt'.charCodeAt(0) - 3 export const getencodedString = () => { return encodedString } -// 简易加密 +// 简易加密 加密结果 + encodedString = 结果 export function encrypt(str) { if (!str) { return '' @@ -62,3 +63,15 @@ return decryptedNum // return parseInt(decryptedNum); } + +// rsa加密 +let publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCu5k8gcTFJy5UtMfmtKiR3f/EcUe93kzfteRj6+sM5fHRvOib82+uqQMjgaRZiMcr3HiHIFY5vA6c+Rfb5R2COitoOhxyA9U2eLXknzxLUQIAqXAvKQO8KnerA1Qjcds7xhJB2XPhWFlY4RVtMT2wr2lMd29QDE4F/kzyDhNBpxwIDAQAB' +export function RSAencrypt(value: string) { + const encrypt = new JsEncrypt() + let enRes = '' + encrypt.setPublicKey(publicKey)// 从store中读取公钥 + enRes = encrypt.encrypt(value) || '' + + // console.log(enRes, 'enRes') + return enRes +} diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index 08c9eb4..7f53c6f 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -16,6 +16,7 @@ const loading = ref(false) const info = ref({}) const isFirstFill = ref(true) +const isDispose = ref(false) // 是否处置 const alarmCategoryName = ref('') const confirmSituationList = ref<{ id: string; name: string; value: string }[]>([]) const confirmSituationAllList = ref<{ id: string; name: string; value: string }[]>([]) @@ -26,15 +27,15 @@ value: '6', }, { - name: '已处置', + name: '处置中', id: '7', value: '7', }, - { - name: '无需处置', - id: '10', - value: '10', - }, + // { + // name: '无需处置', + // id: '10', + // value: '10', + // }, ]) const dataFormRef = ref() const dataForm = ref({ @@ -90,6 +91,7 @@ const record = ref([]) const initDialog = (row: any) => { record.value = [] + isDispose.value = false isFirstLoading.value = true dataForm.value = { confirmValue: '', // 现场浓度值 @@ -113,7 +115,7 @@ loading.value = true info.value = row alarmCategoryName.value = row.alarmCategory - console.log(row.alarmCategory, 'row.alarmCategory') + // console.log(row.alarmCategory, 'row.alarmCategory') if (row.alarmCategory.includes('浓度')) { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '0') @@ -121,31 +123,38 @@ else { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '3') // console.log(row.alarmCategory, 'row.alarmCategory') - if($route.fullPath.includes('operation')) { + if ($route.fullPath.includes('operation')) { confirmSituationList.value.shift() - if(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { + if (confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { confirmSituationList.value.unshift(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) } } } - getHandlerAlarmRecord({ alarmId: row.id, flowStatus: '5' }).then(res => { - record.value = res.data || [] - if (res.data.length > 0) { + getHandlerAlarmRecord({ alarmId: row.id }).then(res => { + record.value = (res.data || []).filter((item: any) => item.flowStatus === '5') + if (record.value.length) { isFirstFill.value = false - dataForm.value.flowStatus = '7' + dataForm.value.flowStatus = '6' dataForm.value.confirmValue = record.value[0].confirmValue - // console.log(record.value[0].confirmValue, 'record.value[0].confirmValue') dataForm.value.approvalStatus = record.value[0].approvalStatus dataForm.value.descn = record.value[0].descn dataForm.value.approvalPerson = record.value[0].approvalPerson dataForm.value.approvalTime = record.value[0].approvalTime - if (record.value[0].flowStatus === '5') { - dataForm.value.flowStatus = '10' + if ((res.data || []).length) { + const last = res.data[0] + if (last.flowStatus === '6' || last.flowStatus === '7') { + dataForm.value.flowStatus = last.flowStatus + if (dataForm.value.flowStatus === '7') { + isDispose.value = true + console.log(last, 'last') + dataForm.value.approvalPerson1 = last.approvalPerson + dataForm.value.descn1 = last.descn + dataForm.value.approvalTime1 = last.approvalTime + } + } } - if (record.value[0].flowStatus === '6') { - dataForm.value.flowStatus = '6' - } + } else { @@ -272,7 +281,8 @@ - + @@ -294,7 +304,7 @@ - + @@ -302,14 +312,15 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> - + @@ -328,7 +339,7 @@ - + @@ -336,7 +347,8 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 101e4a8..d7756bd 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -248,7 +248,7 @@ else if (name?.includes('挂起')) { handlerStyle('#F58800') } - else if (name?.includes('已处置') || name?.includes('已确认')) { + else if (name?.includes('已处置') || name?.includes('已确认') || name?.includes('处置中')) { handlerStyle('#67c23a') } return style @@ -413,12 +413,12 @@ 报警处置 --> - {{ $route.fullPath.includes('operation') ? '报警处置' : '确认/处置记录' }} 挂起 diff --git a/src/views/home/alarm/current/components/dict.ts b/src/views/home/alarm/current/components/dict.ts index c8ce54f..045adcb 100644 --- a/src/views/home/alarm/current/components/dict.ts +++ b/src/views/home/alarm/current/components/dict.ts @@ -7,5 +7,6 @@ DiscR: '右侧断线报警', VibL: '左侧震动报警', VibR: '右侧震动报警', - WaterImmersionAlarm: '水浸报警' + WaterImmersionAlarm: '水浸报警', + DisplacementAlarm: '位移报警' } as { [key: string]: string } diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 7dfd02d..040fb16 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -487,6 +487,7 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { +console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 @@ -884,7 +885,8 @@ getLocation, // 获取当前位置 addCluster, removeCluster, - addClusterForDistrict + addClusterForDistrict, + showPieple }) diff --git a/src/router/index.ts b/src/router/index.ts index 77240d7..266c897 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,7 +11,7 @@ import useMenuStore from '@/store/modules/menu' import useRouteStore from '@/store/modules/route' import { getAdminToken } from '@/api/system/login' - +import { RSAencrypt } from '@/utils/security1' const { isLoading } = useNProgress() const router = createRouter({ @@ -20,10 +20,13 @@ }) router.beforeEach(async (to, from, next) => { - if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { + if ((to.query.token || to.query.avoid) && !sessionStorage.getItem('NoLoginIdentifier')) { // console.log('携带code跳转,需要免登录') - const data = encodeURIComponent(to.query.token as string) + let data = to.query.token ? encodeURIComponent(to.query.token as string) : encodeURIComponent(RSAencrypt('lyg')) sessionStorage.setItem('NoLoginIdentifier', '1') + if(to.query.avoid) { + sessionStorage.setItem('avoid', '1') + } try { const res = await getAdminToken(data) sessionStorage.removeItem('NoLoginIdentifier') @@ -280,8 +283,8 @@ // 加入面包屑 // if (!to.path.includes('detail')) { // path - if(to.name === 'dashboard') { - return + if (to.name === 'dashboard') { + return } // console.log(to, '加入面包屑') const menuStore = useMenuStore() diff --git a/src/store/modules/route.ts b/src/store/modules/route.ts index 2b5ec6e..6ea30b5 100644 --- a/src/store/modules/route.ts +++ b/src/store/modules/route.ts @@ -223,16 +223,25 @@ } if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } // 设置 routes 数据 diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 130a012..7dc2ba9 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -265,16 +265,26 @@ this.btns = btns if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + console.log(window.location.href, 'window.location.href') + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } resolve(btns) diff --git a/src/utils/security1.ts b/src/utils/security1.ts index 974c233..4b3b4c7 100644 --- a/src/utils/security1.ts +++ b/src/utils/security1.ts @@ -1,8 +1,9 @@ +import JsEncrypt from 'jsencrypt' const encodedString = 'encrypt'.charCodeAt(0) - 3 export const getencodedString = () => { return encodedString } -// 简易加密 +// 简易加密 加密结果 + encodedString = 结果 export function encrypt(str) { if (!str) { return '' @@ -62,3 +63,15 @@ return decryptedNum // return parseInt(decryptedNum); } + +// rsa加密 +let publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCu5k8gcTFJy5UtMfmtKiR3f/EcUe93kzfteRj6+sM5fHRvOib82+uqQMjgaRZiMcr3HiHIFY5vA6c+Rfb5R2COitoOhxyA9U2eLXknzxLUQIAqXAvKQO8KnerA1Qjcds7xhJB2XPhWFlY4RVtMT2wr2lMd29QDE4F/kzyDhNBpxwIDAQAB' +export function RSAencrypt(value: string) { + const encrypt = new JsEncrypt() + let enRes = '' + encrypt.setPublicKey(publicKey)// 从store中读取公钥 + enRes = encrypt.encrypt(value) || '' + + // console.log(enRes, 'enRes') + return enRes +} diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index 08c9eb4..7f53c6f 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -16,6 +16,7 @@ const loading = ref(false) const info = ref({}) const isFirstFill = ref(true) +const isDispose = ref(false) // 是否处置 const alarmCategoryName = ref('') const confirmSituationList = ref<{ id: string; name: string; value: string }[]>([]) const confirmSituationAllList = ref<{ id: string; name: string; value: string }[]>([]) @@ -26,15 +27,15 @@ value: '6', }, { - name: '已处置', + name: '处置中', id: '7', value: '7', }, - { - name: '无需处置', - id: '10', - value: '10', - }, + // { + // name: '无需处置', + // id: '10', + // value: '10', + // }, ]) const dataFormRef = ref() const dataForm = ref({ @@ -90,6 +91,7 @@ const record = ref([]) const initDialog = (row: any) => { record.value = [] + isDispose.value = false isFirstLoading.value = true dataForm.value = { confirmValue: '', // 现场浓度值 @@ -113,7 +115,7 @@ loading.value = true info.value = row alarmCategoryName.value = row.alarmCategory - console.log(row.alarmCategory, 'row.alarmCategory') + // console.log(row.alarmCategory, 'row.alarmCategory') if (row.alarmCategory.includes('浓度')) { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '0') @@ -121,31 +123,38 @@ else { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '3') // console.log(row.alarmCategory, 'row.alarmCategory') - if($route.fullPath.includes('operation')) { + if ($route.fullPath.includes('operation')) { confirmSituationList.value.shift() - if(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { + if (confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { confirmSituationList.value.unshift(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) } } } - getHandlerAlarmRecord({ alarmId: row.id, flowStatus: '5' }).then(res => { - record.value = res.data || [] - if (res.data.length > 0) { + getHandlerAlarmRecord({ alarmId: row.id }).then(res => { + record.value = (res.data || []).filter((item: any) => item.flowStatus === '5') + if (record.value.length) { isFirstFill.value = false - dataForm.value.flowStatus = '7' + dataForm.value.flowStatus = '6' dataForm.value.confirmValue = record.value[0].confirmValue - // console.log(record.value[0].confirmValue, 'record.value[0].confirmValue') dataForm.value.approvalStatus = record.value[0].approvalStatus dataForm.value.descn = record.value[0].descn dataForm.value.approvalPerson = record.value[0].approvalPerson dataForm.value.approvalTime = record.value[0].approvalTime - if (record.value[0].flowStatus === '5') { - dataForm.value.flowStatus = '10' + if ((res.data || []).length) { + const last = res.data[0] + if (last.flowStatus === '6' || last.flowStatus === '7') { + dataForm.value.flowStatus = last.flowStatus + if (dataForm.value.flowStatus === '7') { + isDispose.value = true + console.log(last, 'last') + dataForm.value.approvalPerson1 = last.approvalPerson + dataForm.value.descn1 = last.descn + dataForm.value.approvalTime1 = last.approvalTime + } + } } - if (record.value[0].flowStatus === '6') { - dataForm.value.flowStatus = '6' - } + } else { @@ -272,7 +281,8 @@ - + @@ -294,7 +304,7 @@ - + @@ -302,14 +312,15 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> - + @@ -328,7 +339,7 @@ - + @@ -336,7 +347,8 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 101e4a8..d7756bd 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -248,7 +248,7 @@ else if (name?.includes('挂起')) { handlerStyle('#F58800') } - else if (name?.includes('已处置') || name?.includes('已确认')) { + else if (name?.includes('已处置') || name?.includes('已确认') || name?.includes('处置中')) { handlerStyle('#67c23a') } return style @@ -413,12 +413,12 @@ 报警处置 --> - {{ $route.fullPath.includes('operation') ? '报警处置' : '确认/处置记录' }} 挂起 diff --git a/src/views/home/alarm/current/components/dict.ts b/src/views/home/alarm/current/components/dict.ts index c8ce54f..045adcb 100644 --- a/src/views/home/alarm/current/components/dict.ts +++ b/src/views/home/alarm/current/components/dict.ts @@ -7,5 +7,6 @@ DiscR: '右侧断线报警', VibL: '左侧震动报警', VibR: '右侧震动报警', - WaterImmersionAlarm: '水浸报警' + WaterImmersionAlarm: '水浸报警', + DisplacementAlarm: '位移报警' } as { [key: string]: string } diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index af75307..69fae06 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -46,7 +46,7 @@ { text: '设备编号', value: 'devcode', align: 'center', width: '160', isCustom: true, isRequired: false, }, { text: '管理单位', value: 'deptName', align: 'center', width: '400', isRequired: false, }, { text: '状态', value: 'processStatusName', align: 'center', width: '100', isCustom: true, }, - { text: '报警时间', value: 'ts', align: 'center', width: '170' }, + { text: '报警时间', value: 'ts', align: 'center', width: '170', sortable: true }, ]) // 最终展示列 const switchFlag = ref(true) @@ -701,7 +701,7 @@ else if (name.includes('挂起')) { handlerStyle('#F58800') } - else if (name.includes('已处置') || name.includes('已确认')) { + else if (name.includes('已处置') || name.includes('已确认') || name.includes('处置中')) { handlerStyle('#67c23a') } return style diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 7dfd02d..040fb16 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -487,6 +487,7 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { +console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 @@ -884,7 +885,8 @@ getLocation, // 获取当前位置 addCluster, removeCluster, - addClusterForDistrict + addClusterForDistrict, + showPieple }) diff --git a/src/router/index.ts b/src/router/index.ts index 77240d7..266c897 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,7 +11,7 @@ import useMenuStore from '@/store/modules/menu' import useRouteStore from '@/store/modules/route' import { getAdminToken } from '@/api/system/login' - +import { RSAencrypt } from '@/utils/security1' const { isLoading } = useNProgress() const router = createRouter({ @@ -20,10 +20,13 @@ }) router.beforeEach(async (to, from, next) => { - if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { + if ((to.query.token || to.query.avoid) && !sessionStorage.getItem('NoLoginIdentifier')) { // console.log('携带code跳转,需要免登录') - const data = encodeURIComponent(to.query.token as string) + let data = to.query.token ? encodeURIComponent(to.query.token as string) : encodeURIComponent(RSAencrypt('lyg')) sessionStorage.setItem('NoLoginIdentifier', '1') + if(to.query.avoid) { + sessionStorage.setItem('avoid', '1') + } try { const res = await getAdminToken(data) sessionStorage.removeItem('NoLoginIdentifier') @@ -280,8 +283,8 @@ // 加入面包屑 // if (!to.path.includes('detail')) { // path - if(to.name === 'dashboard') { - return + if (to.name === 'dashboard') { + return } // console.log(to, '加入面包屑') const menuStore = useMenuStore() diff --git a/src/store/modules/route.ts b/src/store/modules/route.ts index 2b5ec6e..6ea30b5 100644 --- a/src/store/modules/route.ts +++ b/src/store/modules/route.ts @@ -223,16 +223,25 @@ } if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } // 设置 routes 数据 diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 130a012..7dc2ba9 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -265,16 +265,26 @@ this.btns = btns if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + console.log(window.location.href, 'window.location.href') + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } resolve(btns) diff --git a/src/utils/security1.ts b/src/utils/security1.ts index 974c233..4b3b4c7 100644 --- a/src/utils/security1.ts +++ b/src/utils/security1.ts @@ -1,8 +1,9 @@ +import JsEncrypt from 'jsencrypt' const encodedString = 'encrypt'.charCodeAt(0) - 3 export const getencodedString = () => { return encodedString } -// 简易加密 +// 简易加密 加密结果 + encodedString = 结果 export function encrypt(str) { if (!str) { return '' @@ -62,3 +63,15 @@ return decryptedNum // return parseInt(decryptedNum); } + +// rsa加密 +let publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCu5k8gcTFJy5UtMfmtKiR3f/EcUe93kzfteRj6+sM5fHRvOib82+uqQMjgaRZiMcr3HiHIFY5vA6c+Rfb5R2COitoOhxyA9U2eLXknzxLUQIAqXAvKQO8KnerA1Qjcds7xhJB2XPhWFlY4RVtMT2wr2lMd29QDE4F/kzyDhNBpxwIDAQAB' +export function RSAencrypt(value: string) { + const encrypt = new JsEncrypt() + let enRes = '' + encrypt.setPublicKey(publicKey)// 从store中读取公钥 + enRes = encrypt.encrypt(value) || '' + + // console.log(enRes, 'enRes') + return enRes +} diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index 08c9eb4..7f53c6f 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -16,6 +16,7 @@ const loading = ref(false) const info = ref({}) const isFirstFill = ref(true) +const isDispose = ref(false) // 是否处置 const alarmCategoryName = ref('') const confirmSituationList = ref<{ id: string; name: string; value: string }[]>([]) const confirmSituationAllList = ref<{ id: string; name: string; value: string }[]>([]) @@ -26,15 +27,15 @@ value: '6', }, { - name: '已处置', + name: '处置中', id: '7', value: '7', }, - { - name: '无需处置', - id: '10', - value: '10', - }, + // { + // name: '无需处置', + // id: '10', + // value: '10', + // }, ]) const dataFormRef = ref() const dataForm = ref({ @@ -90,6 +91,7 @@ const record = ref([]) const initDialog = (row: any) => { record.value = [] + isDispose.value = false isFirstLoading.value = true dataForm.value = { confirmValue: '', // 现场浓度值 @@ -113,7 +115,7 @@ loading.value = true info.value = row alarmCategoryName.value = row.alarmCategory - console.log(row.alarmCategory, 'row.alarmCategory') + // console.log(row.alarmCategory, 'row.alarmCategory') if (row.alarmCategory.includes('浓度')) { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '0') @@ -121,31 +123,38 @@ else { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '3') // console.log(row.alarmCategory, 'row.alarmCategory') - if($route.fullPath.includes('operation')) { + if ($route.fullPath.includes('operation')) { confirmSituationList.value.shift() - if(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { + if (confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { confirmSituationList.value.unshift(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) } } } - getHandlerAlarmRecord({ alarmId: row.id, flowStatus: '5' }).then(res => { - record.value = res.data || [] - if (res.data.length > 0) { + getHandlerAlarmRecord({ alarmId: row.id }).then(res => { + record.value = (res.data || []).filter((item: any) => item.flowStatus === '5') + if (record.value.length) { isFirstFill.value = false - dataForm.value.flowStatus = '7' + dataForm.value.flowStatus = '6' dataForm.value.confirmValue = record.value[0].confirmValue - // console.log(record.value[0].confirmValue, 'record.value[0].confirmValue') dataForm.value.approvalStatus = record.value[0].approvalStatus dataForm.value.descn = record.value[0].descn dataForm.value.approvalPerson = record.value[0].approvalPerson dataForm.value.approvalTime = record.value[0].approvalTime - if (record.value[0].flowStatus === '5') { - dataForm.value.flowStatus = '10' + if ((res.data || []).length) { + const last = res.data[0] + if (last.flowStatus === '6' || last.flowStatus === '7') { + dataForm.value.flowStatus = last.flowStatus + if (dataForm.value.flowStatus === '7') { + isDispose.value = true + console.log(last, 'last') + dataForm.value.approvalPerson1 = last.approvalPerson + dataForm.value.descn1 = last.descn + dataForm.value.approvalTime1 = last.approvalTime + } + } } - if (record.value[0].flowStatus === '6') { - dataForm.value.flowStatus = '6' - } + } else { @@ -272,7 +281,8 @@ - + @@ -294,7 +304,7 @@ - + @@ -302,14 +312,15 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> - + @@ -328,7 +339,7 @@ - + @@ -336,7 +347,8 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 101e4a8..d7756bd 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -248,7 +248,7 @@ else if (name?.includes('挂起')) { handlerStyle('#F58800') } - else if (name?.includes('已处置') || name?.includes('已确认')) { + else if (name?.includes('已处置') || name?.includes('已确认') || name?.includes('处置中')) { handlerStyle('#67c23a') } return style @@ -413,12 +413,12 @@ 报警处置 --> - {{ $route.fullPath.includes('operation') ? '报警处置' : '确认/处置记录' }} 挂起 diff --git a/src/views/home/alarm/current/components/dict.ts b/src/views/home/alarm/current/components/dict.ts index c8ce54f..045adcb 100644 --- a/src/views/home/alarm/current/components/dict.ts +++ b/src/views/home/alarm/current/components/dict.ts @@ -7,5 +7,6 @@ DiscR: '右侧断线报警', VibL: '左侧震动报警', VibR: '右侧震动报警', - WaterImmersionAlarm: '水浸报警' + WaterImmersionAlarm: '水浸报警', + DisplacementAlarm: '位移报警' } as { [key: string]: string } diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index af75307..69fae06 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -46,7 +46,7 @@ { text: '设备编号', value: 'devcode', align: 'center', width: '160', isCustom: true, isRequired: false, }, { text: '管理单位', value: 'deptName', align: 'center', width: '400', isRequired: false, }, { text: '状态', value: 'processStatusName', align: 'center', width: '100', isCustom: true, }, - { text: '报警时间', value: 'ts', align: 'center', width: '170' }, + { text: '报警时间', value: 'ts', align: 'center', width: '170', sortable: true }, ]) // 最终展示列 const switchFlag = ref(true) @@ -701,7 +701,7 @@ else if (name.includes('挂起')) { handlerStyle('#F58800') } - else if (name.includes('已处置') || name.includes('已确认')) { + else if (name.includes('已处置') || name.includes('已确认') || name.includes('处置中')) { handlerStyle('#67c23a') } return style diff --git a/src/views/home/alarm/history/index.vue b/src/views/home/alarm/history/index.vue index c410ac8..2fb7ba7 100644 --- a/src/views/home/alarm/history/index.vue +++ b/src/views/home/alarm/history/index.vue @@ -47,8 +47,8 @@ { text: '设备编号', value: 'devcode', align: 'center', width: '130', isCustom: true, isRequired: false }, { text: '管理单位', value: 'deptName', align: 'center' }, // { text: '是否误报', value: 'realAlarmName', align: 'center', width: '90' }, - { text: '报警时间', value: 'ts', align: 'center', width: '180' }, - { text: '解除时间', value: 'cancelTime', align: 'center', width: '180' }, + { text: '报警时间', value: 'ts', align: 'center', width: '180', sortable: true }, + { text: '解除时间', value: 'cancelTime', align: 'center', width: '180', sortable: true }, // { text: '解除时长', value: 'cancelDuration', align: 'center' }, ]) // 最终展示列 diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 7dfd02d..040fb16 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -487,6 +487,7 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { +console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 @@ -884,7 +885,8 @@ getLocation, // 获取当前位置 addCluster, removeCluster, - addClusterForDistrict + addClusterForDistrict, + showPieple }) diff --git a/src/router/index.ts b/src/router/index.ts index 77240d7..266c897 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,7 +11,7 @@ import useMenuStore from '@/store/modules/menu' import useRouteStore from '@/store/modules/route' import { getAdminToken } from '@/api/system/login' - +import { RSAencrypt } from '@/utils/security1' const { isLoading } = useNProgress() const router = createRouter({ @@ -20,10 +20,13 @@ }) router.beforeEach(async (to, from, next) => { - if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { + if ((to.query.token || to.query.avoid) && !sessionStorage.getItem('NoLoginIdentifier')) { // console.log('携带code跳转,需要免登录') - const data = encodeURIComponent(to.query.token as string) + let data = to.query.token ? encodeURIComponent(to.query.token as string) : encodeURIComponent(RSAencrypt('lyg')) sessionStorage.setItem('NoLoginIdentifier', '1') + if(to.query.avoid) { + sessionStorage.setItem('avoid', '1') + } try { const res = await getAdminToken(data) sessionStorage.removeItem('NoLoginIdentifier') @@ -280,8 +283,8 @@ // 加入面包屑 // if (!to.path.includes('detail')) { // path - if(to.name === 'dashboard') { - return + if (to.name === 'dashboard') { + return } // console.log(to, '加入面包屑') const menuStore = useMenuStore() diff --git a/src/store/modules/route.ts b/src/store/modules/route.ts index 2b5ec6e..6ea30b5 100644 --- a/src/store/modules/route.ts +++ b/src/store/modules/route.ts @@ -223,16 +223,25 @@ } if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } // 设置 routes 数据 diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 130a012..7dc2ba9 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -265,16 +265,26 @@ this.btns = btns if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + console.log(window.location.href, 'window.location.href') + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } resolve(btns) diff --git a/src/utils/security1.ts b/src/utils/security1.ts index 974c233..4b3b4c7 100644 --- a/src/utils/security1.ts +++ b/src/utils/security1.ts @@ -1,8 +1,9 @@ +import JsEncrypt from 'jsencrypt' const encodedString = 'encrypt'.charCodeAt(0) - 3 export const getencodedString = () => { return encodedString } -// 简易加密 +// 简易加密 加密结果 + encodedString = 结果 export function encrypt(str) { if (!str) { return '' @@ -62,3 +63,15 @@ return decryptedNum // return parseInt(decryptedNum); } + +// rsa加密 +let publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCu5k8gcTFJy5UtMfmtKiR3f/EcUe93kzfteRj6+sM5fHRvOib82+uqQMjgaRZiMcr3HiHIFY5vA6c+Rfb5R2COitoOhxyA9U2eLXknzxLUQIAqXAvKQO8KnerA1Qjcds7xhJB2XPhWFlY4RVtMT2wr2lMd29QDE4F/kzyDhNBpxwIDAQAB' +export function RSAencrypt(value: string) { + const encrypt = new JsEncrypt() + let enRes = '' + encrypt.setPublicKey(publicKey)// 从store中读取公钥 + enRes = encrypt.encrypt(value) || '' + + // console.log(enRes, 'enRes') + return enRes +} diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index 08c9eb4..7f53c6f 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -16,6 +16,7 @@ const loading = ref(false) const info = ref({}) const isFirstFill = ref(true) +const isDispose = ref(false) // 是否处置 const alarmCategoryName = ref('') const confirmSituationList = ref<{ id: string; name: string; value: string }[]>([]) const confirmSituationAllList = ref<{ id: string; name: string; value: string }[]>([]) @@ -26,15 +27,15 @@ value: '6', }, { - name: '已处置', + name: '处置中', id: '7', value: '7', }, - { - name: '无需处置', - id: '10', - value: '10', - }, + // { + // name: '无需处置', + // id: '10', + // value: '10', + // }, ]) const dataFormRef = ref() const dataForm = ref({ @@ -90,6 +91,7 @@ const record = ref([]) const initDialog = (row: any) => { record.value = [] + isDispose.value = false isFirstLoading.value = true dataForm.value = { confirmValue: '', // 现场浓度值 @@ -113,7 +115,7 @@ loading.value = true info.value = row alarmCategoryName.value = row.alarmCategory - console.log(row.alarmCategory, 'row.alarmCategory') + // console.log(row.alarmCategory, 'row.alarmCategory') if (row.alarmCategory.includes('浓度')) { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '0') @@ -121,31 +123,38 @@ else { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '3') // console.log(row.alarmCategory, 'row.alarmCategory') - if($route.fullPath.includes('operation')) { + if ($route.fullPath.includes('operation')) { confirmSituationList.value.shift() - if(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { + if (confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { confirmSituationList.value.unshift(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) } } } - getHandlerAlarmRecord({ alarmId: row.id, flowStatus: '5' }).then(res => { - record.value = res.data || [] - if (res.data.length > 0) { + getHandlerAlarmRecord({ alarmId: row.id }).then(res => { + record.value = (res.data || []).filter((item: any) => item.flowStatus === '5') + if (record.value.length) { isFirstFill.value = false - dataForm.value.flowStatus = '7' + dataForm.value.flowStatus = '6' dataForm.value.confirmValue = record.value[0].confirmValue - // console.log(record.value[0].confirmValue, 'record.value[0].confirmValue') dataForm.value.approvalStatus = record.value[0].approvalStatus dataForm.value.descn = record.value[0].descn dataForm.value.approvalPerson = record.value[0].approvalPerson dataForm.value.approvalTime = record.value[0].approvalTime - if (record.value[0].flowStatus === '5') { - dataForm.value.flowStatus = '10' + if ((res.data || []).length) { + const last = res.data[0] + if (last.flowStatus === '6' || last.flowStatus === '7') { + dataForm.value.flowStatus = last.flowStatus + if (dataForm.value.flowStatus === '7') { + isDispose.value = true + console.log(last, 'last') + dataForm.value.approvalPerson1 = last.approvalPerson + dataForm.value.descn1 = last.descn + dataForm.value.approvalTime1 = last.approvalTime + } + } } - if (record.value[0].flowStatus === '6') { - dataForm.value.flowStatus = '6' - } + } else { @@ -272,7 +281,8 @@ - + @@ -294,7 +304,7 @@ - + @@ -302,14 +312,15 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> - + @@ -328,7 +339,7 @@ - + @@ -336,7 +347,8 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 101e4a8..d7756bd 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -248,7 +248,7 @@ else if (name?.includes('挂起')) { handlerStyle('#F58800') } - else if (name?.includes('已处置') || name?.includes('已确认')) { + else if (name?.includes('已处置') || name?.includes('已确认') || name?.includes('处置中')) { handlerStyle('#67c23a') } return style @@ -413,12 +413,12 @@ 报警处置 --> - {{ $route.fullPath.includes('operation') ? '报警处置' : '确认/处置记录' }} 挂起 diff --git a/src/views/home/alarm/current/components/dict.ts b/src/views/home/alarm/current/components/dict.ts index c8ce54f..045adcb 100644 --- a/src/views/home/alarm/current/components/dict.ts +++ b/src/views/home/alarm/current/components/dict.ts @@ -7,5 +7,6 @@ DiscR: '右侧断线报警', VibL: '左侧震动报警', VibR: '右侧震动报警', - WaterImmersionAlarm: '水浸报警' + WaterImmersionAlarm: '水浸报警', + DisplacementAlarm: '位移报警' } as { [key: string]: string } diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index af75307..69fae06 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -46,7 +46,7 @@ { text: '设备编号', value: 'devcode', align: 'center', width: '160', isCustom: true, isRequired: false, }, { text: '管理单位', value: 'deptName', align: 'center', width: '400', isRequired: false, }, { text: '状态', value: 'processStatusName', align: 'center', width: '100', isCustom: true, }, - { text: '报警时间', value: 'ts', align: 'center', width: '170' }, + { text: '报警时间', value: 'ts', align: 'center', width: '170', sortable: true }, ]) // 最终展示列 const switchFlag = ref(true) @@ -701,7 +701,7 @@ else if (name.includes('挂起')) { handlerStyle('#F58800') } - else if (name.includes('已处置') || name.includes('已确认')) { + else if (name.includes('已处置') || name.includes('已确认') || name.includes('处置中')) { handlerStyle('#67c23a') } return style diff --git a/src/views/home/alarm/history/index.vue b/src/views/home/alarm/history/index.vue index c410ac8..2fb7ba7 100644 --- a/src/views/home/alarm/history/index.vue +++ b/src/views/home/alarm/history/index.vue @@ -47,8 +47,8 @@ { text: '设备编号', value: 'devcode', align: 'center', width: '130', isCustom: true, isRequired: false }, { text: '管理单位', value: 'deptName', align: 'center' }, // { text: '是否误报', value: 'realAlarmName', align: 'center', width: '90' }, - { text: '报警时间', value: 'ts', align: 'center', width: '180' }, - { text: '解除时间', value: 'cancelTime', align: 'center', width: '180' }, + { text: '报警时间', value: 'ts', align: 'center', width: '180', sortable: true }, + { text: '解除时间', value: 'cancelTime', align: 'center', width: '180', sortable: true }, // { text: '解除时长', value: 'cancelDuration', align: 'center' }, ]) // 最终展示列 diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 806e814..8420319 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -91,7 +91,7 @@ else if (name?.includes('挂起')) { handlerStyle('#F58800') } - else if (name?.includes('已处置') || name?.includes('已确认')) { + else if (name?.includes('已处置') || name?.includes('已确认')|| name?.includes('处置中')) { handlerStyle('#67c23a') } return style diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 7dfd02d..040fb16 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -487,6 +487,7 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { +console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 @@ -884,7 +885,8 @@ getLocation, // 获取当前位置 addCluster, removeCluster, - addClusterForDistrict + addClusterForDistrict, + showPieple }) diff --git a/src/router/index.ts b/src/router/index.ts index 77240d7..266c897 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,7 +11,7 @@ import useMenuStore from '@/store/modules/menu' import useRouteStore from '@/store/modules/route' import { getAdminToken } from '@/api/system/login' - +import { RSAencrypt } from '@/utils/security1' const { isLoading } = useNProgress() const router = createRouter({ @@ -20,10 +20,13 @@ }) router.beforeEach(async (to, from, next) => { - if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { + if ((to.query.token || to.query.avoid) && !sessionStorage.getItem('NoLoginIdentifier')) { // console.log('携带code跳转,需要免登录') - const data = encodeURIComponent(to.query.token as string) + let data = to.query.token ? encodeURIComponent(to.query.token as string) : encodeURIComponent(RSAencrypt('lyg')) sessionStorage.setItem('NoLoginIdentifier', '1') + if(to.query.avoid) { + sessionStorage.setItem('avoid', '1') + } try { const res = await getAdminToken(data) sessionStorage.removeItem('NoLoginIdentifier') @@ -280,8 +283,8 @@ // 加入面包屑 // if (!to.path.includes('detail')) { // path - if(to.name === 'dashboard') { - return + if (to.name === 'dashboard') { + return } // console.log(to, '加入面包屑') const menuStore = useMenuStore() diff --git a/src/store/modules/route.ts b/src/store/modules/route.ts index 2b5ec6e..6ea30b5 100644 --- a/src/store/modules/route.ts +++ b/src/store/modules/route.ts @@ -223,16 +223,25 @@ } if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } // 设置 routes 数据 diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 130a012..7dc2ba9 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -265,16 +265,26 @@ this.btns = btns if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + console.log(window.location.href, 'window.location.href') + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } resolve(btns) diff --git a/src/utils/security1.ts b/src/utils/security1.ts index 974c233..4b3b4c7 100644 --- a/src/utils/security1.ts +++ b/src/utils/security1.ts @@ -1,8 +1,9 @@ +import JsEncrypt from 'jsencrypt' const encodedString = 'encrypt'.charCodeAt(0) - 3 export const getencodedString = () => { return encodedString } -// 简易加密 +// 简易加密 加密结果 + encodedString = 结果 export function encrypt(str) { if (!str) { return '' @@ -62,3 +63,15 @@ return decryptedNum // return parseInt(decryptedNum); } + +// rsa加密 +let publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCu5k8gcTFJy5UtMfmtKiR3f/EcUe93kzfteRj6+sM5fHRvOib82+uqQMjgaRZiMcr3HiHIFY5vA6c+Rfb5R2COitoOhxyA9U2eLXknzxLUQIAqXAvKQO8KnerA1Qjcds7xhJB2XPhWFlY4RVtMT2wr2lMd29QDE4F/kzyDhNBpxwIDAQAB' +export function RSAencrypt(value: string) { + const encrypt = new JsEncrypt() + let enRes = '' + encrypt.setPublicKey(publicKey)// 从store中读取公钥 + enRes = encrypt.encrypt(value) || '' + + // console.log(enRes, 'enRes') + return enRes +} diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index 08c9eb4..7f53c6f 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -16,6 +16,7 @@ const loading = ref(false) const info = ref({}) const isFirstFill = ref(true) +const isDispose = ref(false) // 是否处置 const alarmCategoryName = ref('') const confirmSituationList = ref<{ id: string; name: string; value: string }[]>([]) const confirmSituationAllList = ref<{ id: string; name: string; value: string }[]>([]) @@ -26,15 +27,15 @@ value: '6', }, { - name: '已处置', + name: '处置中', id: '7', value: '7', }, - { - name: '无需处置', - id: '10', - value: '10', - }, + // { + // name: '无需处置', + // id: '10', + // value: '10', + // }, ]) const dataFormRef = ref() const dataForm = ref({ @@ -90,6 +91,7 @@ const record = ref([]) const initDialog = (row: any) => { record.value = [] + isDispose.value = false isFirstLoading.value = true dataForm.value = { confirmValue: '', // 现场浓度值 @@ -113,7 +115,7 @@ loading.value = true info.value = row alarmCategoryName.value = row.alarmCategory - console.log(row.alarmCategory, 'row.alarmCategory') + // console.log(row.alarmCategory, 'row.alarmCategory') if (row.alarmCategory.includes('浓度')) { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '0') @@ -121,31 +123,38 @@ else { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '3') // console.log(row.alarmCategory, 'row.alarmCategory') - if($route.fullPath.includes('operation')) { + if ($route.fullPath.includes('operation')) { confirmSituationList.value.shift() - if(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { + if (confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { confirmSituationList.value.unshift(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) } } } - getHandlerAlarmRecord({ alarmId: row.id, flowStatus: '5' }).then(res => { - record.value = res.data || [] - if (res.data.length > 0) { + getHandlerAlarmRecord({ alarmId: row.id }).then(res => { + record.value = (res.data || []).filter((item: any) => item.flowStatus === '5') + if (record.value.length) { isFirstFill.value = false - dataForm.value.flowStatus = '7' + dataForm.value.flowStatus = '6' dataForm.value.confirmValue = record.value[0].confirmValue - // console.log(record.value[0].confirmValue, 'record.value[0].confirmValue') dataForm.value.approvalStatus = record.value[0].approvalStatus dataForm.value.descn = record.value[0].descn dataForm.value.approvalPerson = record.value[0].approvalPerson dataForm.value.approvalTime = record.value[0].approvalTime - if (record.value[0].flowStatus === '5') { - dataForm.value.flowStatus = '10' + if ((res.data || []).length) { + const last = res.data[0] + if (last.flowStatus === '6' || last.flowStatus === '7') { + dataForm.value.flowStatus = last.flowStatus + if (dataForm.value.flowStatus === '7') { + isDispose.value = true + console.log(last, 'last') + dataForm.value.approvalPerson1 = last.approvalPerson + dataForm.value.descn1 = last.descn + dataForm.value.approvalTime1 = last.approvalTime + } + } } - if (record.value[0].flowStatus === '6') { - dataForm.value.flowStatus = '6' - } + } else { @@ -272,7 +281,8 @@ - + @@ -294,7 +304,7 @@ - + @@ -302,14 +312,15 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> - + @@ -328,7 +339,7 @@ - + @@ -336,7 +347,8 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 101e4a8..d7756bd 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -248,7 +248,7 @@ else if (name?.includes('挂起')) { handlerStyle('#F58800') } - else if (name?.includes('已处置') || name?.includes('已确认')) { + else if (name?.includes('已处置') || name?.includes('已确认') || name?.includes('处置中')) { handlerStyle('#67c23a') } return style @@ -413,12 +413,12 @@ 报警处置 --> - {{ $route.fullPath.includes('operation') ? '报警处置' : '确认/处置记录' }} 挂起 diff --git a/src/views/home/alarm/current/components/dict.ts b/src/views/home/alarm/current/components/dict.ts index c8ce54f..045adcb 100644 --- a/src/views/home/alarm/current/components/dict.ts +++ b/src/views/home/alarm/current/components/dict.ts @@ -7,5 +7,6 @@ DiscR: '右侧断线报警', VibL: '左侧震动报警', VibR: '右侧震动报警', - WaterImmersionAlarm: '水浸报警' + WaterImmersionAlarm: '水浸报警', + DisplacementAlarm: '位移报警' } as { [key: string]: string } diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index af75307..69fae06 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -46,7 +46,7 @@ { text: '设备编号', value: 'devcode', align: 'center', width: '160', isCustom: true, isRequired: false, }, { text: '管理单位', value: 'deptName', align: 'center', width: '400', isRequired: false, }, { text: '状态', value: 'processStatusName', align: 'center', width: '100', isCustom: true, }, - { text: '报警时间', value: 'ts', align: 'center', width: '170' }, + { text: '报警时间', value: 'ts', align: 'center', width: '170', sortable: true }, ]) // 最终展示列 const switchFlag = ref(true) @@ -701,7 +701,7 @@ else if (name.includes('挂起')) { handlerStyle('#F58800') } - else if (name.includes('已处置') || name.includes('已确认')) { + else if (name.includes('已处置') || name.includes('已确认') || name.includes('处置中')) { handlerStyle('#67c23a') } return style diff --git a/src/views/home/alarm/history/index.vue b/src/views/home/alarm/history/index.vue index c410ac8..2fb7ba7 100644 --- a/src/views/home/alarm/history/index.vue +++ b/src/views/home/alarm/history/index.vue @@ -47,8 +47,8 @@ { text: '设备编号', value: 'devcode', align: 'center', width: '130', isCustom: true, isRequired: false }, { text: '管理单位', value: 'deptName', align: 'center' }, // { text: '是否误报', value: 'realAlarmName', align: 'center', width: '90' }, - { text: '报警时间', value: 'ts', align: 'center', width: '180' }, - { text: '解除时间', value: 'cancelTime', align: 'center', width: '180' }, + { text: '报警时间', value: 'ts', align: 'center', width: '180', sortable: true }, + { text: '解除时间', value: 'cancelTime', align: 'center', width: '180', sortable: true }, // { text: '解除时长', value: 'cancelDuration', align: 'center' }, ]) // 最终展示列 diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 806e814..8420319 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -91,7 +91,7 @@ else if (name?.includes('挂起')) { handlerStyle('#F58800') } - else if (name?.includes('已处置') || name?.includes('已确认')) { + else if (name?.includes('已处置') || name?.includes('已确认')|| name?.includes('处置中')) { handlerStyle('#67c23a') } return style diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue index 3758264..c189051 100644 --- a/src/views/home/dashboard/components/controlMap.vue +++ b/src/views/home/dashboard/components/controlMap.vue @@ -1682,18 +1682,18 @@ - + - +
- + - +
diff --git a/src/App.vue b/src/App.vue index 3b3c411..dd26c6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,6 +118,7 @@ window.addEventListener('beforeunload', function (e) { + console.log(1111) // var confirmationMessage = '确定要离开此页面吗?'; // e.returnValue = confirmationMessage; console.log(e.type, 'type') diff --git a/src/api/home/well/well.ts b/src/api/home/well/well.ts index ae43a8b..3f8c967 100644 --- a/src/api/home/well/well.ts +++ b/src/api/home/well/well.ts @@ -8,7 +8,10 @@ return request({ url: `/monitor/well/listPage?limit=${data.limit}&offset=${data.offset}`, method: 'post', - data, + data: { + ...data, + monitorState: data.monitorState ? data.monitorState : '1,2,3' + }, }) } // 列表-不分页 diff --git a/src/components.d.ts b/src/components.d.ts index e1cc6fe..b6e680f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -54,6 +54,7 @@ NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] NormalTable: typeof import('./components/NormalTable/index.vue')['default'] + offline: typeof import('./components/map/index offline.vue')['default'] PageHeader: typeof import('./components/PageHeader/index.vue')['default'] PageMain: typeof import('./components/PageMain/index.vue')['default'] PcasCascader: typeof import('./components/PcasCascader/index.vue')['default'] diff --git a/src/components/HKplayer/index.vue b/src/components/HKplayer/index.vue index 64269b9..07a80bd 100644 --- a/src/components/HKplayer/index.vue +++ b/src/components/HKplayer/index.vue @@ -32,6 +32,7 @@ const emit = defineEmits(['error', 'complete']) const player = ref() const playerInfo = ref({}) +const error = ref(false) const initPlayer = () => { emit('complete') // console.log(props.iWidth, 'props.iWidth') @@ -64,16 +65,20 @@ console.error('流中断') // 重新自动播放 emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } else { emit('error', errorCode[iErrorCode] || '播放失败') + error.value = true } } }) } const wndIndex = ref(0) +const playerUrl = ref('') const createPlayer = (url: string, i = wndIndex.value) => { + playerUrl.value = url console.log('视频流地址:', url, props.playId) if (!url) return playerInfo.value = { @@ -95,7 +100,7 @@ img.style.top = '0' img.style.left = '0' img.style.position = "absolute" - + error.value = false video.appendChild(img) player.value.JS_Play(url, { playURL: url, mode: 0 }, i).then( () => { @@ -103,6 +108,7 @@ // 播放成功删除图片 img.remove() ElMessage.warning('播放十秒自动关闭') + error.value = false }, (err) => { // message.warning('播放失败!') @@ -110,6 +116,7 @@ // 视频加载失败图片修改为加载失败img img.src = errorImg emit('error', errorCode[err] || '播放失败') + error.value = true } ) } @@ -135,6 +142,7 @@ // 创建图片 const img = document.createElement("img") img.src = loadingImg + error.value = false // 将图片放在视频之上 const width = video.style.width const height = video.style.height @@ -151,12 +159,14 @@ console.log('playbackStart success') // 播放成功删除图片 img.remove() + error.value = false ElMessage.warning('播放十秒自动关闭') }, (err) => { console.info('JS_Play failed:', errorCode[err] || '播放失败') // 视频加载失败图片修改为加载失败img img.src = errorImg + error.value = true emit('error', errorCode[err] || '播放失败') } ) @@ -192,13 +202,17 @@ console.info('JS_StopRealPlayAll success') }) }) +const refreshPlayer = () => { + error.value = false + createPlayer(playerUrl.value, 0) +} diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 7dfd02d..040fb16 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -487,6 +487,7 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { +console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 @@ -884,7 +885,8 @@ getLocation, // 获取当前位置 addCluster, removeCluster, - addClusterForDistrict + addClusterForDistrict, + showPieple }) diff --git a/src/router/index.ts b/src/router/index.ts index 77240d7..266c897 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,7 +11,7 @@ import useMenuStore from '@/store/modules/menu' import useRouteStore from '@/store/modules/route' import { getAdminToken } from '@/api/system/login' - +import { RSAencrypt } from '@/utils/security1' const { isLoading } = useNProgress() const router = createRouter({ @@ -20,10 +20,13 @@ }) router.beforeEach(async (to, from, next) => { - if (to.query.token && !sessionStorage.getItem('NoLoginIdentifier')) { + if ((to.query.token || to.query.avoid) && !sessionStorage.getItem('NoLoginIdentifier')) { // console.log('携带code跳转,需要免登录') - const data = encodeURIComponent(to.query.token as string) + let data = to.query.token ? encodeURIComponent(to.query.token as string) : encodeURIComponent(RSAencrypt('lyg')) sessionStorage.setItem('NoLoginIdentifier', '1') + if(to.query.avoid) { + sessionStorage.setItem('avoid', '1') + } try { const res = await getAdminToken(data) sessionStorage.removeItem('NoLoginIdentifier') @@ -280,8 +283,8 @@ // 加入面包屑 // if (!to.path.includes('detail')) { // path - if(to.name === 'dashboard') { - return + if (to.name === 'dashboard') { + return } // console.log(to, '加入面包屑') const menuStore = useMenuStore() diff --git a/src/store/modules/route.ts b/src/store/modules/route.ts index 2b5ec6e..6ea30b5 100644 --- a/src/store/modules/route.ts +++ b/src/store/modules/route.ts @@ -223,16 +223,25 @@ } if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } // 设置 routes 数据 diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 130a012..7dc2ba9 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -265,16 +265,26 @@ this.btns = btns if (indexDB.getStatus() && window.localStorage.getItem('browser-type-bj-well') === 'pc') { console.log('获取缓存') - // 重新拉取缓存 - fetchCacheDept() - fetchCacheVideo() - fetchCacheWell95() - fetchCacheDevice() - fetchCacheLeak() - setTimeout(() => { - fetchCacheWell() - fetchCacheStation() - }, 5000) + console.log(window.location.href, 'window.location.href') + if (window.location.href.includes('avoid=true')) { + setTimeout(() => { + fetchCacheWell() + fetchCacheWell95() + }, 5000); + } + else { + // 重新拉取缓存 + fetchCacheDept() + fetchCacheVideo() + fetchCacheWell95() + fetchCacheDevice() + fetchCacheLeak() + setTimeout(() => { + fetchCacheWell() + fetchCacheStation() + }, 5000) + } + } resolve(btns) diff --git a/src/utils/security1.ts b/src/utils/security1.ts index 974c233..4b3b4c7 100644 --- a/src/utils/security1.ts +++ b/src/utils/security1.ts @@ -1,8 +1,9 @@ +import JsEncrypt from 'jsencrypt' const encodedString = 'encrypt'.charCodeAt(0) - 3 export const getencodedString = () => { return encodedString } -// 简易加密 +// 简易加密 加密结果 + encodedString = 结果 export function encrypt(str) { if (!str) { return '' @@ -62,3 +63,15 @@ return decryptedNum // return parseInt(decryptedNum); } + +// rsa加密 +let publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCu5k8gcTFJy5UtMfmtKiR3f/EcUe93kzfteRj6+sM5fHRvOib82+uqQMjgaRZiMcr3HiHIFY5vA6c+Rfb5R2COitoOhxyA9U2eLXknzxLUQIAqXAvKQO8KnerA1Qjcds7xhJB2XPhWFlY4RVtMT2wr2lMd29QDE4F/kzyDhNBpxwIDAQAB' +export function RSAencrypt(value: string) { + const encrypt = new JsEncrypt() + let enRes = '' + encrypt.setPublicKey(publicKey)// 从store中读取公钥 + enRes = encrypt.encrypt(value) || '' + + // console.log(enRes, 'enRes') + return enRes +} diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index 08c9eb4..7f53c6f 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -16,6 +16,7 @@ const loading = ref(false) const info = ref({}) const isFirstFill = ref(true) +const isDispose = ref(false) // 是否处置 const alarmCategoryName = ref('') const confirmSituationList = ref<{ id: string; name: string; value: string }[]>([]) const confirmSituationAllList = ref<{ id: string; name: string; value: string }[]>([]) @@ -26,15 +27,15 @@ value: '6', }, { - name: '已处置', + name: '处置中', id: '7', value: '7', }, - { - name: '无需处置', - id: '10', - value: '10', - }, + // { + // name: '无需处置', + // id: '10', + // value: '10', + // }, ]) const dataFormRef = ref() const dataForm = ref({ @@ -90,6 +91,7 @@ const record = ref([]) const initDialog = (row: any) => { record.value = [] + isDispose.value = false isFirstLoading.value = true dataForm.value = { confirmValue: '', // 现场浓度值 @@ -113,7 +115,7 @@ loading.value = true info.value = row alarmCategoryName.value = row.alarmCategory - console.log(row.alarmCategory, 'row.alarmCategory') + // console.log(row.alarmCategory, 'row.alarmCategory') if (row.alarmCategory.includes('浓度')) { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '0') @@ -121,31 +123,38 @@ else { confirmSituationList.value = confirmSituationAllList.value.filter((item) => item.value.split('-')[1] === '3') // console.log(row.alarmCategory, 'row.alarmCategory') - if($route.fullPath.includes('operation')) { + if ($route.fullPath.includes('operation')) { confirmSituationList.value.shift() - if(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { + if (confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) { confirmSituationList.value.unshift(confirmSituationAllList.value.filter((item) => item.value.includes('5'))[0]) } } } - getHandlerAlarmRecord({ alarmId: row.id, flowStatus: '5' }).then(res => { - record.value = res.data || [] - if (res.data.length > 0) { + getHandlerAlarmRecord({ alarmId: row.id }).then(res => { + record.value = (res.data || []).filter((item: any) => item.flowStatus === '5') + if (record.value.length) { isFirstFill.value = false - dataForm.value.flowStatus = '7' + dataForm.value.flowStatus = '6' dataForm.value.confirmValue = record.value[0].confirmValue - // console.log(record.value[0].confirmValue, 'record.value[0].confirmValue') dataForm.value.approvalStatus = record.value[0].approvalStatus dataForm.value.descn = record.value[0].descn dataForm.value.approvalPerson = record.value[0].approvalPerson dataForm.value.approvalTime = record.value[0].approvalTime - if (record.value[0].flowStatus === '5') { - dataForm.value.flowStatus = '10' + if ((res.data || []).length) { + const last = res.data[0] + if (last.flowStatus === '6' || last.flowStatus === '7') { + dataForm.value.flowStatus = last.flowStatus + if (dataForm.value.flowStatus === '7') { + isDispose.value = true + console.log(last, 'last') + dataForm.value.approvalPerson1 = last.approvalPerson + dataForm.value.descn1 = last.descn + dataForm.value.approvalTime1 = last.approvalTime + } + } } - if (record.value[0].flowStatus === '6') { - dataForm.value.flowStatus = '6' - } + } else { @@ -272,7 +281,8 @@ - + @@ -294,7 +304,7 @@ - + @@ -302,14 +312,15 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> - + @@ -328,7 +339,7 @@ - + @@ -336,7 +347,8 @@ + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" + :disabled="isDispose" /> diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 101e4a8..d7756bd 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -248,7 +248,7 @@ else if (name?.includes('挂起')) { handlerStyle('#F58800') } - else if (name?.includes('已处置') || name?.includes('已确认')) { + else if (name?.includes('已处置') || name?.includes('已确认') || name?.includes('处置中')) { handlerStyle('#67c23a') } return style @@ -413,12 +413,12 @@ 报警处置 --> - {{ $route.fullPath.includes('operation') ? '报警处置' : '确认/处置记录' }} 挂起 diff --git a/src/views/home/alarm/current/components/dict.ts b/src/views/home/alarm/current/components/dict.ts index c8ce54f..045adcb 100644 --- a/src/views/home/alarm/current/components/dict.ts +++ b/src/views/home/alarm/current/components/dict.ts @@ -7,5 +7,6 @@ DiscR: '右侧断线报警', VibL: '左侧震动报警', VibR: '右侧震动报警', - WaterImmersionAlarm: '水浸报警' + WaterImmersionAlarm: '水浸报警', + DisplacementAlarm: '位移报警' } as { [key: string]: string } diff --git a/src/views/home/alarm/current/index.vue b/src/views/home/alarm/current/index.vue index af75307..69fae06 100644 --- a/src/views/home/alarm/current/index.vue +++ b/src/views/home/alarm/current/index.vue @@ -46,7 +46,7 @@ { text: '设备编号', value: 'devcode', align: 'center', width: '160', isCustom: true, isRequired: false, }, { text: '管理单位', value: 'deptName', align: 'center', width: '400', isRequired: false, }, { text: '状态', value: 'processStatusName', align: 'center', width: '100', isCustom: true, }, - { text: '报警时间', value: 'ts', align: 'center', width: '170' }, + { text: '报警时间', value: 'ts', align: 'center', width: '170', sortable: true }, ]) // 最终展示列 const switchFlag = ref(true) @@ -701,7 +701,7 @@ else if (name.includes('挂起')) { handlerStyle('#F58800') } - else if (name.includes('已处置') || name.includes('已确认')) { + else if (name.includes('已处置') || name.includes('已确认') || name.includes('处置中')) { handlerStyle('#67c23a') } return style diff --git a/src/views/home/alarm/history/index.vue b/src/views/home/alarm/history/index.vue index c410ac8..2fb7ba7 100644 --- a/src/views/home/alarm/history/index.vue +++ b/src/views/home/alarm/history/index.vue @@ -47,8 +47,8 @@ { text: '设备编号', value: 'devcode', align: 'center', width: '130', isCustom: true, isRequired: false }, { text: '管理单位', value: 'deptName', align: 'center' }, // { text: '是否误报', value: 'realAlarmName', align: 'center', width: '90' }, - { text: '报警时间', value: 'ts', align: 'center', width: '180' }, - { text: '解除时间', value: 'cancelTime', align: 'center', width: '180' }, + { text: '报警时间', value: 'ts', align: 'center', width: '180', sortable: true }, + { text: '解除时间', value: 'cancelTime', align: 'center', width: '180', sortable: true }, // { text: '解除时长', value: 'cancelDuration', align: 'center' }, ]) // 最终展示列 diff --git a/src/views/home/dashboard/components/alarmDialog.vue b/src/views/home/dashboard/components/alarmDialog.vue index 806e814..8420319 100644 --- a/src/views/home/dashboard/components/alarmDialog.vue +++ b/src/views/home/dashboard/components/alarmDialog.vue @@ -91,7 +91,7 @@ else if (name?.includes('挂起')) { handlerStyle('#F58800') } - else if (name?.includes('已处置') || name?.includes('已确认')) { + else if (name?.includes('已处置') || name?.includes('已确认')|| name?.includes('处置中')) { handlerStyle('#67c23a') } return style diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue index 3758264..c189051 100644 --- a/src/views/home/dashboard/components/controlMap.vue +++ b/src/views/home/dashboard/components/controlMap.vue @@ -1682,18 +1682,18 @@ - + - +
- + - +
diff --git a/src/views/home/dashboard/components/detailInfoDialog.vue b/src/views/home/dashboard/components/detailInfoDialog.vue index 84afa36..cbc2584 100644 --- a/src/views/home/dashboard/components/detailInfoDialog.vue +++ b/src/views/home/dashboard/components/detailInfoDialog.vue @@ -50,7 +50,7 @@