{ }">
-
diff --git a/src/views/home/dashboard/deviceMonitor.vue b/src/views/home/dashboard/deviceMonitor.vue
index ca22a96..f6205ac 100644
--- a/src/views/home/dashboard/deviceMonitor.vue
+++ b/src/views/home/dashboard/deviceMonitor.vue
@@ -574,7 +574,6 @@
loadingPonit.value = true
getPointStatistics().then(res => {
const areaCode = JSON.parse(localStorage.getItem('areaCode') as string)
- // const noShowCode = ['19', '18', '17']
let data = res.data.filter((item: any) => item.latGaode && item.lngGaode && item.id).map((item: any) => ({
...item,
areaName: areaCode[item.area]
diff --git a/src/views/home/dashboard/fullScreen-components/alarmCount.vue b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
index 64f0c3b..7bae529 100644
--- a/src/views/home/dashboard/fullScreen-components/alarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
@@ -9,10 +9,10 @@
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
index 1e3bf3f..bccf93e 100644
--- a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
+++ b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
@@ -13,59 +13,68 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
- window.addEventListener('resize', () => {})
+ window.addEventListener('resize', () => { })
})
const img = {
frame1: new URL('@/assets/images/map/frame1.png', import.meta.url),
frame2: new URL('@/assets/images/map/frame2.png', import.meta.url),
}
const dataList = ref([
- {
- name: '闸井泄漏',
- id: '1',
- value: '0',
- },
- {
- name: '管线泄漏',
- id: '2',
- value: '0',
- },
- {
- name: '场站泄漏',
- id: '3',
- value: '0',
- },
- {
- name: '现场作业',
- id: '4',
- value: '0',
- },
- {
- name: '外力破坏',
- id: '5',
- value: '0',
- },
- {
- name: '其他',
- id: '6',
- value: '0',
- },
+ // {
+ // name: '闸井泄漏',
+ // id: '1',
+ // value: '0',
+ // },
+ // {
+ // name: '管线泄漏',
+ // id: '2',
+ // value: '0',
+ // },
+ // {
+ // name: '场站泄漏',
+ // id: '3',
+ // value: '0',
+ // },
+ // {
+ // name: '现场作业',
+ // id: '4',
+ // value: '0',
+ // },
+ // {
+ // name: '外力破坏',
+ // id: '5',
+ // value: '0',
+ // },
+ // {
+ // name: '其他',
+ // id: '6',
+ // value: '0',
+ // },
])
const pre = computed(() => {
- return dataList.value.slice(0, 3)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(0, 2)
})
const next = computed(() => {
- return dataList.value.slice(3, 6)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(2, 4)
})
const allAlarm = computed(() => {
+ if (!dataList.value.length) {
+ return 0
+ }
return dataList.value.map((item: any) => Number(item.value)).reduce((pre, next) => {
return pre + next
})
@@ -74,16 +83,43 @@
// 获取数据
const loading = ref(true)
const fetchData = () => {
- loading.value = true
alarmStatistics({ type: $props.type }).then((res) => {
- dataList.value = res.data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
+ const needShow = ['浓度超限', '第三方破坏']
+ const data = res.data.filter((item: any) => needShow.some((citem: string) => item.name.includes(citem)))
+ data.forEach((element: any) => {
+ if (element.name === '浓度超限') {
+ element.name = '管线浓度超限'
+ }
+ });
+ dataList.value = data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
loading.value = false
}).catch(() => {
loading.value = false
})
}
+const timer = ref()
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
+
+onMounted(() => {
+ openTimer()
+})
+onBeforeUnmount(() => {
+ closeTimer()
+})
watch(() => $props.type, (newVal) => {
if (newVal) {
+ loading.value = true
fetchData()
}
else {
@@ -96,18 +132,20 @@
-
+
-
-
+
+
{{ item.name }}
-
@@ -129,14 +167,15 @@
-
-
+
+
{{ item.name }}
-
@@ -159,24 +198,27 @@
.left {
width: 30%;
color: #a7ceec;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
.item {
- margin: 7px 0;
+ // margin: 7px 0;
display: flex;
justify-content: center;
align-items: center;
position: relative;
img {
- width: 88%;
+ width: 100%;
// height: 100%;
- margin: 0 auto;
+ // margin: 0 auto;
}
.name {
position: absolute;
- top: 51%;
- left: 46%;
+ top: 50%;
+ left: 50%;
transform: translate(-50%, -50%);
.name1 {
@@ -248,5 +290,4 @@
// // padding-left: 20px;
// box-sizing: border-box;
// }
-// }
-
+// }
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 @@
{ }">
-
diff --git a/src/views/home/dashboard/deviceMonitor.vue b/src/views/home/dashboard/deviceMonitor.vue
index ca22a96..f6205ac 100644
--- a/src/views/home/dashboard/deviceMonitor.vue
+++ b/src/views/home/dashboard/deviceMonitor.vue
@@ -574,7 +574,6 @@
loadingPonit.value = true
getPointStatistics().then(res => {
const areaCode = JSON.parse(localStorage.getItem('areaCode') as string)
- // const noShowCode = ['19', '18', '17']
let data = res.data.filter((item: any) => item.latGaode && item.lngGaode && item.id).map((item: any) => ({
...item,
areaName: areaCode[item.area]
diff --git a/src/views/home/dashboard/fullScreen-components/alarmCount.vue b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
index 64f0c3b..7bae529 100644
--- a/src/views/home/dashboard/fullScreen-components/alarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
@@ -9,10 +9,10 @@
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
index 1e3bf3f..bccf93e 100644
--- a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
+++ b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
@@ -13,59 +13,68 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
- window.addEventListener('resize', () => {})
+ window.addEventListener('resize', () => { })
})
const img = {
frame1: new URL('@/assets/images/map/frame1.png', import.meta.url),
frame2: new URL('@/assets/images/map/frame2.png', import.meta.url),
}
const dataList = ref([
- {
- name: '闸井泄漏',
- id: '1',
- value: '0',
- },
- {
- name: '管线泄漏',
- id: '2',
- value: '0',
- },
- {
- name: '场站泄漏',
- id: '3',
- value: '0',
- },
- {
- name: '现场作业',
- id: '4',
- value: '0',
- },
- {
- name: '外力破坏',
- id: '5',
- value: '0',
- },
- {
- name: '其他',
- id: '6',
- value: '0',
- },
+ // {
+ // name: '闸井泄漏',
+ // id: '1',
+ // value: '0',
+ // },
+ // {
+ // name: '管线泄漏',
+ // id: '2',
+ // value: '0',
+ // },
+ // {
+ // name: '场站泄漏',
+ // id: '3',
+ // value: '0',
+ // },
+ // {
+ // name: '现场作业',
+ // id: '4',
+ // value: '0',
+ // },
+ // {
+ // name: '外力破坏',
+ // id: '5',
+ // value: '0',
+ // },
+ // {
+ // name: '其他',
+ // id: '6',
+ // value: '0',
+ // },
])
const pre = computed(() => {
- return dataList.value.slice(0, 3)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(0, 2)
})
const next = computed(() => {
- return dataList.value.slice(3, 6)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(2, 4)
})
const allAlarm = computed(() => {
+ if (!dataList.value.length) {
+ return 0
+ }
return dataList.value.map((item: any) => Number(item.value)).reduce((pre, next) => {
return pre + next
})
@@ -74,16 +83,43 @@
// 获取数据
const loading = ref(true)
const fetchData = () => {
- loading.value = true
alarmStatistics({ type: $props.type }).then((res) => {
- dataList.value = res.data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
+ const needShow = ['浓度超限', '第三方破坏']
+ const data = res.data.filter((item: any) => needShow.some((citem: string) => item.name.includes(citem)))
+ data.forEach((element: any) => {
+ if (element.name === '浓度超限') {
+ element.name = '管线浓度超限'
+ }
+ });
+ dataList.value = data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
loading.value = false
}).catch(() => {
loading.value = false
})
}
+const timer = ref()
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
+
+onMounted(() => {
+ openTimer()
+})
+onBeforeUnmount(() => {
+ closeTimer()
+})
watch(() => $props.type, (newVal) => {
if (newVal) {
+ loading.value = true
fetchData()
}
else {
@@ -96,18 +132,20 @@
-
+
-
-
+
+
{{ item.name }}
-
@@ -129,14 +167,15 @@
-
-
+
+
{{ item.name }}
-
@@ -159,24 +198,27 @@
.left {
width: 30%;
color: #a7ceec;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
.item {
- margin: 7px 0;
+ // margin: 7px 0;
display: flex;
justify-content: center;
align-items: center;
position: relative;
img {
- width: 88%;
+ width: 100%;
// height: 100%;
- margin: 0 auto;
+ // margin: 0 auto;
}
.name {
position: absolute;
- top: 51%;
- left: 46%;
+ top: 50%;
+ left: 50%;
transform: translate(-50%, -50%);
.name1 {
@@ -248,5 +290,4 @@
// // padding-left: 20px;
// box-sizing: border-box;
// }
-// }
-
+// }
diff --git a/src/views/home/dashboard/fullScreen-components/baseOverView.vue b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
index e116cc4..d34f7c3 100644
--- a/src/views/home/dashboard/fullScreen-components/baseOverView.vue
+++ b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
@@ -13,10 +13,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -74,7 +74,6 @@
...item,
value: item.name === 'tyz' ? Number(item.value) - Number(res.data.filter((item: any) => item.name === 'tyx')[0]?.value || '0') : item.value
}))
- // console.log(res.data, '基本概括222222222222222')
const dataDict = {
调压箱: 'tyx',
闸井: 'zj',
@@ -109,7 +108,7 @@
-
+
![]()
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 @@
{ }">
-
diff --git a/src/views/home/dashboard/deviceMonitor.vue b/src/views/home/dashboard/deviceMonitor.vue
index ca22a96..f6205ac 100644
--- a/src/views/home/dashboard/deviceMonitor.vue
+++ b/src/views/home/dashboard/deviceMonitor.vue
@@ -574,7 +574,6 @@
loadingPonit.value = true
getPointStatistics().then(res => {
const areaCode = JSON.parse(localStorage.getItem('areaCode') as string)
- // const noShowCode = ['19', '18', '17']
let data = res.data.filter((item: any) => item.latGaode && item.lngGaode && item.id).map((item: any) => ({
...item,
areaName: areaCode[item.area]
diff --git a/src/views/home/dashboard/fullScreen-components/alarmCount.vue b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
index 64f0c3b..7bae529 100644
--- a/src/views/home/dashboard/fullScreen-components/alarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
@@ -9,10 +9,10 @@
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
index 1e3bf3f..bccf93e 100644
--- a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
+++ b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
@@ -13,59 +13,68 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
- window.addEventListener('resize', () => {})
+ window.addEventListener('resize', () => { })
})
const img = {
frame1: new URL('@/assets/images/map/frame1.png', import.meta.url),
frame2: new URL('@/assets/images/map/frame2.png', import.meta.url),
}
const dataList = ref([
- {
- name: '闸井泄漏',
- id: '1',
- value: '0',
- },
- {
- name: '管线泄漏',
- id: '2',
- value: '0',
- },
- {
- name: '场站泄漏',
- id: '3',
- value: '0',
- },
- {
- name: '现场作业',
- id: '4',
- value: '0',
- },
- {
- name: '外力破坏',
- id: '5',
- value: '0',
- },
- {
- name: '其他',
- id: '6',
- value: '0',
- },
+ // {
+ // name: '闸井泄漏',
+ // id: '1',
+ // value: '0',
+ // },
+ // {
+ // name: '管线泄漏',
+ // id: '2',
+ // value: '0',
+ // },
+ // {
+ // name: '场站泄漏',
+ // id: '3',
+ // value: '0',
+ // },
+ // {
+ // name: '现场作业',
+ // id: '4',
+ // value: '0',
+ // },
+ // {
+ // name: '外力破坏',
+ // id: '5',
+ // value: '0',
+ // },
+ // {
+ // name: '其他',
+ // id: '6',
+ // value: '0',
+ // },
])
const pre = computed(() => {
- return dataList.value.slice(0, 3)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(0, 2)
})
const next = computed(() => {
- return dataList.value.slice(3, 6)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(2, 4)
})
const allAlarm = computed(() => {
+ if (!dataList.value.length) {
+ return 0
+ }
return dataList.value.map((item: any) => Number(item.value)).reduce((pre, next) => {
return pre + next
})
@@ -74,16 +83,43 @@
// 获取数据
const loading = ref(true)
const fetchData = () => {
- loading.value = true
alarmStatistics({ type: $props.type }).then((res) => {
- dataList.value = res.data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
+ const needShow = ['浓度超限', '第三方破坏']
+ const data = res.data.filter((item: any) => needShow.some((citem: string) => item.name.includes(citem)))
+ data.forEach((element: any) => {
+ if (element.name === '浓度超限') {
+ element.name = '管线浓度超限'
+ }
+ });
+ dataList.value = data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
loading.value = false
}).catch(() => {
loading.value = false
})
}
+const timer = ref()
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
+
+onMounted(() => {
+ openTimer()
+})
+onBeforeUnmount(() => {
+ closeTimer()
+})
watch(() => $props.type, (newVal) => {
if (newVal) {
+ loading.value = true
fetchData()
}
else {
@@ -96,18 +132,20 @@
-
+
-
-
+
+
{{ item.name }}
-
@@ -129,14 +167,15 @@
-
-
+
+
{{ item.name }}
-
@@ -159,24 +198,27 @@
.left {
width: 30%;
color: #a7ceec;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
.item {
- margin: 7px 0;
+ // margin: 7px 0;
display: flex;
justify-content: center;
align-items: center;
position: relative;
img {
- width: 88%;
+ width: 100%;
// height: 100%;
- margin: 0 auto;
+ // margin: 0 auto;
}
.name {
position: absolute;
- top: 51%;
- left: 46%;
+ top: 50%;
+ left: 50%;
transform: translate(-50%, -50%);
.name1 {
@@ -248,5 +290,4 @@
// // padding-left: 20px;
// box-sizing: border-box;
// }
-// }
-
+// }
diff --git a/src/views/home/dashboard/fullScreen-components/baseOverView.vue b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
index e116cc4..d34f7c3 100644
--- a/src/views/home/dashboard/fullScreen-components/baseOverView.vue
+++ b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
@@ -13,10 +13,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -74,7 +74,6 @@
...item,
value: item.name === 'tyz' ? Number(item.value) - Number(res.data.filter((item: any) => item.name === 'tyx')[0]?.value || '0') : item.value
}))
- // console.log(res.data, '基本概括222222222222222')
const dataDict = {
调压箱: 'tyx',
闸井: 'zj',
@@ -109,7 +108,7 @@
-
+
![]()
diff --git a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
index 2cb78cf..4ed77e8 100644
--- a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
+++ b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
@@ -10,11 +10,12 @@
import { alarmValue } from '@/views/home/alarm/current/components/dict'
import { ElMessage } from 'element-plus'
const $emit = defineEmits(['clickMaker'])
+const timer = ref()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 + 20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -31,26 +32,46 @@
])
const list = ref
([])
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
+const fetchData = () => {
+ getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
+ // console.log(res.data.rows, '当前报警数据')
+ list.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
+ })).filter((item: any) => !item.alarmType.includes('故障'))
+ loadingTable.value = false
+ })
+}
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
onMounted(() => {
loadingTable.value = true
// 报警类别
getDictByCode('alarmCategory').then((res) => {
alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
- getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
- // console.log(res.data.rows, '当前报警数据')
- list.value = res.data.rows.map((item: any) => ({
- ...item,
- alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
- // showDeviceTips: false, // 展示设备编号提示
- })).map((item: any) => ({
- ...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
- })).filter((item:any) => !item.alarmType.includes('故障'))
- loadingTable.value = false
- })
+ fetchData()
})
-
+ openTimer()
})
+onBeforeUnmount(() => {
+ closeTimer()
+})
+
+
const rowClick = (data: any) => {
if (!data.latGaode || !data.lngGaode) {
@@ -115,6 +136,7 @@
::v-deep(.el-table__row) {
background-color: #5c5d6b;
font-size: 12px;
+
&:hover {
cursor: pointer;
}
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 @@
{ }">
-
diff --git a/src/views/home/dashboard/deviceMonitor.vue b/src/views/home/dashboard/deviceMonitor.vue
index ca22a96..f6205ac 100644
--- a/src/views/home/dashboard/deviceMonitor.vue
+++ b/src/views/home/dashboard/deviceMonitor.vue
@@ -574,7 +574,6 @@
loadingPonit.value = true
getPointStatistics().then(res => {
const areaCode = JSON.parse(localStorage.getItem('areaCode') as string)
- // const noShowCode = ['19', '18', '17']
let data = res.data.filter((item: any) => item.latGaode && item.lngGaode && item.id).map((item: any) => ({
...item,
areaName: areaCode[item.area]
diff --git a/src/views/home/dashboard/fullScreen-components/alarmCount.vue b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
index 64f0c3b..7bae529 100644
--- a/src/views/home/dashboard/fullScreen-components/alarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
@@ -9,10 +9,10 @@
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
index 1e3bf3f..bccf93e 100644
--- a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
+++ b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
@@ -13,59 +13,68 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
- window.addEventListener('resize', () => {})
+ window.addEventListener('resize', () => { })
})
const img = {
frame1: new URL('@/assets/images/map/frame1.png', import.meta.url),
frame2: new URL('@/assets/images/map/frame2.png', import.meta.url),
}
const dataList = ref([
- {
- name: '闸井泄漏',
- id: '1',
- value: '0',
- },
- {
- name: '管线泄漏',
- id: '2',
- value: '0',
- },
- {
- name: '场站泄漏',
- id: '3',
- value: '0',
- },
- {
- name: '现场作业',
- id: '4',
- value: '0',
- },
- {
- name: '外力破坏',
- id: '5',
- value: '0',
- },
- {
- name: '其他',
- id: '6',
- value: '0',
- },
+ // {
+ // name: '闸井泄漏',
+ // id: '1',
+ // value: '0',
+ // },
+ // {
+ // name: '管线泄漏',
+ // id: '2',
+ // value: '0',
+ // },
+ // {
+ // name: '场站泄漏',
+ // id: '3',
+ // value: '0',
+ // },
+ // {
+ // name: '现场作业',
+ // id: '4',
+ // value: '0',
+ // },
+ // {
+ // name: '外力破坏',
+ // id: '5',
+ // value: '0',
+ // },
+ // {
+ // name: '其他',
+ // id: '6',
+ // value: '0',
+ // },
])
const pre = computed(() => {
- return dataList.value.slice(0, 3)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(0, 2)
})
const next = computed(() => {
- return dataList.value.slice(3, 6)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(2, 4)
})
const allAlarm = computed(() => {
+ if (!dataList.value.length) {
+ return 0
+ }
return dataList.value.map((item: any) => Number(item.value)).reduce((pre, next) => {
return pre + next
})
@@ -74,16 +83,43 @@
// 获取数据
const loading = ref(true)
const fetchData = () => {
- loading.value = true
alarmStatistics({ type: $props.type }).then((res) => {
- dataList.value = res.data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
+ const needShow = ['浓度超限', '第三方破坏']
+ const data = res.data.filter((item: any) => needShow.some((citem: string) => item.name.includes(citem)))
+ data.forEach((element: any) => {
+ if (element.name === '浓度超限') {
+ element.name = '管线浓度超限'
+ }
+ });
+ dataList.value = data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
loading.value = false
}).catch(() => {
loading.value = false
})
}
+const timer = ref()
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
+
+onMounted(() => {
+ openTimer()
+})
+onBeforeUnmount(() => {
+ closeTimer()
+})
watch(() => $props.type, (newVal) => {
if (newVal) {
+ loading.value = true
fetchData()
}
else {
@@ -96,18 +132,20 @@
-
+
-
-
+
+
{{ item.name }}
-
@@ -129,14 +167,15 @@
-
-
+
+
{{ item.name }}
-
@@ -159,24 +198,27 @@
.left {
width: 30%;
color: #a7ceec;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
.item {
- margin: 7px 0;
+ // margin: 7px 0;
display: flex;
justify-content: center;
align-items: center;
position: relative;
img {
- width: 88%;
+ width: 100%;
// height: 100%;
- margin: 0 auto;
+ // margin: 0 auto;
}
.name {
position: absolute;
- top: 51%;
- left: 46%;
+ top: 50%;
+ left: 50%;
transform: translate(-50%, -50%);
.name1 {
@@ -248,5 +290,4 @@
// // padding-left: 20px;
// box-sizing: border-box;
// }
-// }
-
+// }
diff --git a/src/views/home/dashboard/fullScreen-components/baseOverView.vue b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
index e116cc4..d34f7c3 100644
--- a/src/views/home/dashboard/fullScreen-components/baseOverView.vue
+++ b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
@@ -13,10 +13,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -74,7 +74,6 @@
...item,
value: item.name === 'tyz' ? Number(item.value) - Number(res.data.filter((item: any) => item.name === 'tyx')[0]?.value || '0') : item.value
}))
- // console.log(res.data, '基本概括222222222222222')
const dataDict = {
调压箱: 'tyx',
闸井: 'zj',
@@ -109,7 +108,7 @@
-
+
![]()
diff --git a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
index 2cb78cf..4ed77e8 100644
--- a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
+++ b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
@@ -10,11 +10,12 @@
import { alarmValue } from '@/views/home/alarm/current/components/dict'
import { ElMessage } from 'element-plus'
const $emit = defineEmits(['clickMaker'])
+const timer = ref()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 + 20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -31,26 +32,46 @@
])
const list = ref
([])
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
+const fetchData = () => {
+ getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
+ // console.log(res.data.rows, '当前报警数据')
+ list.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
+ })).filter((item: any) => !item.alarmType.includes('故障'))
+ loadingTable.value = false
+ })
+}
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
onMounted(() => {
loadingTable.value = true
// 报警类别
getDictByCode('alarmCategory').then((res) => {
alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
- getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
- // console.log(res.data.rows, '当前报警数据')
- list.value = res.data.rows.map((item: any) => ({
- ...item,
- alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
- // showDeviceTips: false, // 展示设备编号提示
- })).map((item: any) => ({
- ...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
- })).filter((item:any) => !item.alarmType.includes('故障'))
- loadingTable.value = false
- })
+ fetchData()
})
-
+ openTimer()
})
+onBeforeUnmount(() => {
+ closeTimer()
+})
+
+
const rowClick = (data: any) => {
if (!data.latGaode || !data.lngGaode) {
@@ -115,6 +136,7 @@
::v-deep(.el-table__row) {
background-color: #5c5d6b;
font-size: 12px;
+
&:hover {
cursor: pointer;
}
diff --git a/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue b/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
index 636f3ae..54fa14a 100644
--- a/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
@@ -16,10 +16,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 + 20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
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 @@
{ }">
-
diff --git a/src/views/home/dashboard/deviceMonitor.vue b/src/views/home/dashboard/deviceMonitor.vue
index ca22a96..f6205ac 100644
--- a/src/views/home/dashboard/deviceMonitor.vue
+++ b/src/views/home/dashboard/deviceMonitor.vue
@@ -574,7 +574,6 @@
loadingPonit.value = true
getPointStatistics().then(res => {
const areaCode = JSON.parse(localStorage.getItem('areaCode') as string)
- // const noShowCode = ['19', '18', '17']
let data = res.data.filter((item: any) => item.latGaode && item.lngGaode && item.id).map((item: any) => ({
...item,
areaName: areaCode[item.area]
diff --git a/src/views/home/dashboard/fullScreen-components/alarmCount.vue b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
index 64f0c3b..7bae529 100644
--- a/src/views/home/dashboard/fullScreen-components/alarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
@@ -9,10 +9,10 @@
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
index 1e3bf3f..bccf93e 100644
--- a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
+++ b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
@@ -13,59 +13,68 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
- window.addEventListener('resize', () => {})
+ window.addEventListener('resize', () => { })
})
const img = {
frame1: new URL('@/assets/images/map/frame1.png', import.meta.url),
frame2: new URL('@/assets/images/map/frame2.png', import.meta.url),
}
const dataList = ref([
- {
- name: '闸井泄漏',
- id: '1',
- value: '0',
- },
- {
- name: '管线泄漏',
- id: '2',
- value: '0',
- },
- {
- name: '场站泄漏',
- id: '3',
- value: '0',
- },
- {
- name: '现场作业',
- id: '4',
- value: '0',
- },
- {
- name: '外力破坏',
- id: '5',
- value: '0',
- },
- {
- name: '其他',
- id: '6',
- value: '0',
- },
+ // {
+ // name: '闸井泄漏',
+ // id: '1',
+ // value: '0',
+ // },
+ // {
+ // name: '管线泄漏',
+ // id: '2',
+ // value: '0',
+ // },
+ // {
+ // name: '场站泄漏',
+ // id: '3',
+ // value: '0',
+ // },
+ // {
+ // name: '现场作业',
+ // id: '4',
+ // value: '0',
+ // },
+ // {
+ // name: '外力破坏',
+ // id: '5',
+ // value: '0',
+ // },
+ // {
+ // name: '其他',
+ // id: '6',
+ // value: '0',
+ // },
])
const pre = computed(() => {
- return dataList.value.slice(0, 3)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(0, 2)
})
const next = computed(() => {
- return dataList.value.slice(3, 6)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(2, 4)
})
const allAlarm = computed(() => {
+ if (!dataList.value.length) {
+ return 0
+ }
return dataList.value.map((item: any) => Number(item.value)).reduce((pre, next) => {
return pre + next
})
@@ -74,16 +83,43 @@
// 获取数据
const loading = ref(true)
const fetchData = () => {
- loading.value = true
alarmStatistics({ type: $props.type }).then((res) => {
- dataList.value = res.data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
+ const needShow = ['浓度超限', '第三方破坏']
+ const data = res.data.filter((item: any) => needShow.some((citem: string) => item.name.includes(citem)))
+ data.forEach((element: any) => {
+ if (element.name === '浓度超限') {
+ element.name = '管线浓度超限'
+ }
+ });
+ dataList.value = data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
loading.value = false
}).catch(() => {
loading.value = false
})
}
+const timer = ref()
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
+
+onMounted(() => {
+ openTimer()
+})
+onBeforeUnmount(() => {
+ closeTimer()
+})
watch(() => $props.type, (newVal) => {
if (newVal) {
+ loading.value = true
fetchData()
}
else {
@@ -96,18 +132,20 @@
-
+
-
-
+
+
{{ item.name }}
-
@@ -129,14 +167,15 @@
-
-
+
+
{{ item.name }}
-
@@ -159,24 +198,27 @@
.left {
width: 30%;
color: #a7ceec;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
.item {
- margin: 7px 0;
+ // margin: 7px 0;
display: flex;
justify-content: center;
align-items: center;
position: relative;
img {
- width: 88%;
+ width: 100%;
// height: 100%;
- margin: 0 auto;
+ // margin: 0 auto;
}
.name {
position: absolute;
- top: 51%;
- left: 46%;
+ top: 50%;
+ left: 50%;
transform: translate(-50%, -50%);
.name1 {
@@ -248,5 +290,4 @@
// // padding-left: 20px;
// box-sizing: border-box;
// }
-// }
-
+// }
diff --git a/src/views/home/dashboard/fullScreen-components/baseOverView.vue b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
index e116cc4..d34f7c3 100644
--- a/src/views/home/dashboard/fullScreen-components/baseOverView.vue
+++ b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
@@ -13,10 +13,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -74,7 +74,6 @@
...item,
value: item.name === 'tyz' ? Number(item.value) - Number(res.data.filter((item: any) => item.name === 'tyx')[0]?.value || '0') : item.value
}))
- // console.log(res.data, '基本概括222222222222222')
const dataDict = {
调压箱: 'tyx',
闸井: 'zj',
@@ -109,7 +108,7 @@
-
+
![]()
diff --git a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
index 2cb78cf..4ed77e8 100644
--- a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
+++ b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
@@ -10,11 +10,12 @@
import { alarmValue } from '@/views/home/alarm/current/components/dict'
import { ElMessage } from 'element-plus'
const $emit = defineEmits(['clickMaker'])
+const timer = ref()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 + 20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -31,26 +32,46 @@
])
const list = ref
([])
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
+const fetchData = () => {
+ getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
+ // console.log(res.data.rows, '当前报警数据')
+ list.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
+ })).filter((item: any) => !item.alarmType.includes('故障'))
+ loadingTable.value = false
+ })
+}
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
onMounted(() => {
loadingTable.value = true
// 报警类别
getDictByCode('alarmCategory').then((res) => {
alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
- getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
- // console.log(res.data.rows, '当前报警数据')
- list.value = res.data.rows.map((item: any) => ({
- ...item,
- alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
- // showDeviceTips: false, // 展示设备编号提示
- })).map((item: any) => ({
- ...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
- })).filter((item:any) => !item.alarmType.includes('故障'))
- loadingTable.value = false
- })
+ fetchData()
})
-
+ openTimer()
})
+onBeforeUnmount(() => {
+ closeTimer()
+})
+
+
const rowClick = (data: any) => {
if (!data.latGaode || !data.lngGaode) {
@@ -115,6 +136,7 @@
::v-deep(.el-table__row) {
background-color: #5c5d6b;
font-size: 12px;
+
&:hover {
cursor: pointer;
}
diff --git a/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue b/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
index 636f3ae..54fa14a 100644
--- a/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
@@ -16,10 +16,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 + 20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue b/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
index df87104..befa3a1 100644
--- a/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
+++ b/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
@@ -7,10 +7,10 @@
import layout from './layout.vue'
import { alarmTrend } from '@/api/home/dashboard/fullScreen'
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
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 @@
{ }">
-
diff --git a/src/views/home/dashboard/deviceMonitor.vue b/src/views/home/dashboard/deviceMonitor.vue
index ca22a96..f6205ac 100644
--- a/src/views/home/dashboard/deviceMonitor.vue
+++ b/src/views/home/dashboard/deviceMonitor.vue
@@ -574,7 +574,6 @@
loadingPonit.value = true
getPointStatistics().then(res => {
const areaCode = JSON.parse(localStorage.getItem('areaCode') as string)
- // const noShowCode = ['19', '18', '17']
let data = res.data.filter((item: any) => item.latGaode && item.lngGaode && item.id).map((item: any) => ({
...item,
areaName: areaCode[item.area]
diff --git a/src/views/home/dashboard/fullScreen-components/alarmCount.vue b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
index 64f0c3b..7bae529 100644
--- a/src/views/home/dashboard/fullScreen-components/alarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
@@ -9,10 +9,10 @@
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
index 1e3bf3f..bccf93e 100644
--- a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
+++ b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
@@ -13,59 +13,68 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
- window.addEventListener('resize', () => {})
+ window.addEventListener('resize', () => { })
})
const img = {
frame1: new URL('@/assets/images/map/frame1.png', import.meta.url),
frame2: new URL('@/assets/images/map/frame2.png', import.meta.url),
}
const dataList = ref([
- {
- name: '闸井泄漏',
- id: '1',
- value: '0',
- },
- {
- name: '管线泄漏',
- id: '2',
- value: '0',
- },
- {
- name: '场站泄漏',
- id: '3',
- value: '0',
- },
- {
- name: '现场作业',
- id: '4',
- value: '0',
- },
- {
- name: '外力破坏',
- id: '5',
- value: '0',
- },
- {
- name: '其他',
- id: '6',
- value: '0',
- },
+ // {
+ // name: '闸井泄漏',
+ // id: '1',
+ // value: '0',
+ // },
+ // {
+ // name: '管线泄漏',
+ // id: '2',
+ // value: '0',
+ // },
+ // {
+ // name: '场站泄漏',
+ // id: '3',
+ // value: '0',
+ // },
+ // {
+ // name: '现场作业',
+ // id: '4',
+ // value: '0',
+ // },
+ // {
+ // name: '外力破坏',
+ // id: '5',
+ // value: '0',
+ // },
+ // {
+ // name: '其他',
+ // id: '6',
+ // value: '0',
+ // },
])
const pre = computed(() => {
- return dataList.value.slice(0, 3)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(0, 2)
})
const next = computed(() => {
- return dataList.value.slice(3, 6)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(2, 4)
})
const allAlarm = computed(() => {
+ if (!dataList.value.length) {
+ return 0
+ }
return dataList.value.map((item: any) => Number(item.value)).reduce((pre, next) => {
return pre + next
})
@@ -74,16 +83,43 @@
// 获取数据
const loading = ref(true)
const fetchData = () => {
- loading.value = true
alarmStatistics({ type: $props.type }).then((res) => {
- dataList.value = res.data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
+ const needShow = ['浓度超限', '第三方破坏']
+ const data = res.data.filter((item: any) => needShow.some((citem: string) => item.name.includes(citem)))
+ data.forEach((element: any) => {
+ if (element.name === '浓度超限') {
+ element.name = '管线浓度超限'
+ }
+ });
+ dataList.value = data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
loading.value = false
}).catch(() => {
loading.value = false
})
}
+const timer = ref()
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
+
+onMounted(() => {
+ openTimer()
+})
+onBeforeUnmount(() => {
+ closeTimer()
+})
watch(() => $props.type, (newVal) => {
if (newVal) {
+ loading.value = true
fetchData()
}
else {
@@ -96,18 +132,20 @@
-
+
-
-
+
+
{{ item.name }}
-
@@ -129,14 +167,15 @@
-
-
+
+
{{ item.name }}
-
@@ -159,24 +198,27 @@
.left {
width: 30%;
color: #a7ceec;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
.item {
- margin: 7px 0;
+ // margin: 7px 0;
display: flex;
justify-content: center;
align-items: center;
position: relative;
img {
- width: 88%;
+ width: 100%;
// height: 100%;
- margin: 0 auto;
+ // margin: 0 auto;
}
.name {
position: absolute;
- top: 51%;
- left: 46%;
+ top: 50%;
+ left: 50%;
transform: translate(-50%, -50%);
.name1 {
@@ -248,5 +290,4 @@
// // padding-left: 20px;
// box-sizing: border-box;
// }
-// }
-
+// }
diff --git a/src/views/home/dashboard/fullScreen-components/baseOverView.vue b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
index e116cc4..d34f7c3 100644
--- a/src/views/home/dashboard/fullScreen-components/baseOverView.vue
+++ b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
@@ -13,10 +13,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -74,7 +74,6 @@
...item,
value: item.name === 'tyz' ? Number(item.value) - Number(res.data.filter((item: any) => item.name === 'tyx')[0]?.value || '0') : item.value
}))
- // console.log(res.data, '基本概括222222222222222')
const dataDict = {
调压箱: 'tyx',
闸井: 'zj',
@@ -109,7 +108,7 @@
-
+
![]()
diff --git a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
index 2cb78cf..4ed77e8 100644
--- a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
+++ b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
@@ -10,11 +10,12 @@
import { alarmValue } from '@/views/home/alarm/current/components/dict'
import { ElMessage } from 'element-plus'
const $emit = defineEmits(['clickMaker'])
+const timer = ref()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 + 20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -31,26 +32,46 @@
])
const list = ref
([])
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
+const fetchData = () => {
+ getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
+ // console.log(res.data.rows, '当前报警数据')
+ list.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
+ })).filter((item: any) => !item.alarmType.includes('故障'))
+ loadingTable.value = false
+ })
+}
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
onMounted(() => {
loadingTable.value = true
// 报警类别
getDictByCode('alarmCategory').then((res) => {
alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
- getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
- // console.log(res.data.rows, '当前报警数据')
- list.value = res.data.rows.map((item: any) => ({
- ...item,
- alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
- // showDeviceTips: false, // 展示设备编号提示
- })).map((item: any) => ({
- ...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
- })).filter((item:any) => !item.alarmType.includes('故障'))
- loadingTable.value = false
- })
+ fetchData()
})
-
+ openTimer()
})
+onBeforeUnmount(() => {
+ closeTimer()
+})
+
+
const rowClick = (data: any) => {
if (!data.latGaode || !data.lngGaode) {
@@ -115,6 +136,7 @@
::v-deep(.el-table__row) {
background-color: #5c5d6b;
font-size: 12px;
+
&:hover {
cursor: pointer;
}
diff --git a/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue b/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
index 636f3ae..54fa14a 100644
--- a/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
@@ -16,10 +16,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 + 20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue b/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
index df87104..befa3a1 100644
--- a/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
+++ b/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
@@ -7,10 +7,10 @@
import layout from './layout.vue'
import { alarmTrend } from '@/api/home/dashboard/fullScreen'
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue b/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue
index c74cac5..227f097 100644
--- a/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue
+++ b/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue
@@ -8,10 +8,10 @@
import layout from './layout.vue'
import { color } from 'echarts'
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
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 @@
{ }">
-
diff --git a/src/views/home/dashboard/deviceMonitor.vue b/src/views/home/dashboard/deviceMonitor.vue
index ca22a96..f6205ac 100644
--- a/src/views/home/dashboard/deviceMonitor.vue
+++ b/src/views/home/dashboard/deviceMonitor.vue
@@ -574,7 +574,6 @@
loadingPonit.value = true
getPointStatistics().then(res => {
const areaCode = JSON.parse(localStorage.getItem('areaCode') as string)
- // const noShowCode = ['19', '18', '17']
let data = res.data.filter((item: any) => item.latGaode && item.lngGaode && item.id).map((item: any) => ({
...item,
areaName: areaCode[item.area]
diff --git a/src/views/home/dashboard/fullScreen-components/alarmCount.vue b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
index 64f0c3b..7bae529 100644
--- a/src/views/home/dashboard/fullScreen-components/alarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
@@ -9,10 +9,10 @@
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
index 1e3bf3f..bccf93e 100644
--- a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
+++ b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
@@ -13,59 +13,68 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
- window.addEventListener('resize', () => {})
+ window.addEventListener('resize', () => { })
})
const img = {
frame1: new URL('@/assets/images/map/frame1.png', import.meta.url),
frame2: new URL('@/assets/images/map/frame2.png', import.meta.url),
}
const dataList = ref([
- {
- name: '闸井泄漏',
- id: '1',
- value: '0',
- },
- {
- name: '管线泄漏',
- id: '2',
- value: '0',
- },
- {
- name: '场站泄漏',
- id: '3',
- value: '0',
- },
- {
- name: '现场作业',
- id: '4',
- value: '0',
- },
- {
- name: '外力破坏',
- id: '5',
- value: '0',
- },
- {
- name: '其他',
- id: '6',
- value: '0',
- },
+ // {
+ // name: '闸井泄漏',
+ // id: '1',
+ // value: '0',
+ // },
+ // {
+ // name: '管线泄漏',
+ // id: '2',
+ // value: '0',
+ // },
+ // {
+ // name: '场站泄漏',
+ // id: '3',
+ // value: '0',
+ // },
+ // {
+ // name: '现场作业',
+ // id: '4',
+ // value: '0',
+ // },
+ // {
+ // name: '外力破坏',
+ // id: '5',
+ // value: '0',
+ // },
+ // {
+ // name: '其他',
+ // id: '6',
+ // value: '0',
+ // },
])
const pre = computed(() => {
- return dataList.value.slice(0, 3)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(0, 2)
})
const next = computed(() => {
- return dataList.value.slice(3, 6)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(2, 4)
})
const allAlarm = computed(() => {
+ if (!dataList.value.length) {
+ return 0
+ }
return dataList.value.map((item: any) => Number(item.value)).reduce((pre, next) => {
return pre + next
})
@@ -74,16 +83,43 @@
// 获取数据
const loading = ref(true)
const fetchData = () => {
- loading.value = true
alarmStatistics({ type: $props.type }).then((res) => {
- dataList.value = res.data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
+ const needShow = ['浓度超限', '第三方破坏']
+ const data = res.data.filter((item: any) => needShow.some((citem: string) => item.name.includes(citem)))
+ data.forEach((element: any) => {
+ if (element.name === '浓度超限') {
+ element.name = '管线浓度超限'
+ }
+ });
+ dataList.value = data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
loading.value = false
}).catch(() => {
loading.value = false
})
}
+const timer = ref()
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
+
+onMounted(() => {
+ openTimer()
+})
+onBeforeUnmount(() => {
+ closeTimer()
+})
watch(() => $props.type, (newVal) => {
if (newVal) {
+ loading.value = true
fetchData()
}
else {
@@ -96,18 +132,20 @@
-
+
-
-
+
+
{{ item.name }}
-
@@ -129,14 +167,15 @@
-
-
+
+
{{ item.name }}
-
@@ -159,24 +198,27 @@
.left {
width: 30%;
color: #a7ceec;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
.item {
- margin: 7px 0;
+ // margin: 7px 0;
display: flex;
justify-content: center;
align-items: center;
position: relative;
img {
- width: 88%;
+ width: 100%;
// height: 100%;
- margin: 0 auto;
+ // margin: 0 auto;
}
.name {
position: absolute;
- top: 51%;
- left: 46%;
+ top: 50%;
+ left: 50%;
transform: translate(-50%, -50%);
.name1 {
@@ -248,5 +290,4 @@
// // padding-left: 20px;
// box-sizing: border-box;
// }
-// }
-
+// }
diff --git a/src/views/home/dashboard/fullScreen-components/baseOverView.vue b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
index e116cc4..d34f7c3 100644
--- a/src/views/home/dashboard/fullScreen-components/baseOverView.vue
+++ b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
@@ -13,10 +13,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -74,7 +74,6 @@
...item,
value: item.name === 'tyz' ? Number(item.value) - Number(res.data.filter((item: any) => item.name === 'tyx')[0]?.value || '0') : item.value
}))
- // console.log(res.data, '基本概括222222222222222')
const dataDict = {
调压箱: 'tyx',
闸井: 'zj',
@@ -109,7 +108,7 @@
-
+
![]()
diff --git a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
index 2cb78cf..4ed77e8 100644
--- a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
+++ b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
@@ -10,11 +10,12 @@
import { alarmValue } from '@/views/home/alarm/current/components/dict'
import { ElMessage } from 'element-plus'
const $emit = defineEmits(['clickMaker'])
+const timer = ref()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 + 20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -31,26 +32,46 @@
])
const list = ref
([])
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
+const fetchData = () => {
+ getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
+ // console.log(res.data.rows, '当前报警数据')
+ list.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
+ })).filter((item: any) => !item.alarmType.includes('故障'))
+ loadingTable.value = false
+ })
+}
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
onMounted(() => {
loadingTable.value = true
// 报警类别
getDictByCode('alarmCategory').then((res) => {
alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
- getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
- // console.log(res.data.rows, '当前报警数据')
- list.value = res.data.rows.map((item: any) => ({
- ...item,
- alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
- // showDeviceTips: false, // 展示设备编号提示
- })).map((item: any) => ({
- ...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
- })).filter((item:any) => !item.alarmType.includes('故障'))
- loadingTable.value = false
- })
+ fetchData()
})
-
+ openTimer()
})
+onBeforeUnmount(() => {
+ closeTimer()
+})
+
+
const rowClick = (data: any) => {
if (!data.latGaode || !data.lngGaode) {
@@ -115,6 +136,7 @@
::v-deep(.el-table__row) {
background-color: #5c5d6b;
font-size: 12px;
+
&:hover {
cursor: pointer;
}
diff --git a/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue b/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
index 636f3ae..54fa14a 100644
--- a/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
@@ -16,10 +16,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 + 20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue b/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
index df87104..befa3a1 100644
--- a/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
+++ b/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
@@ -7,10 +7,10 @@
import layout from './layout.vue'
import { alarmTrend } from '@/api/home/dashboard/fullScreen'
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue b/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue
index c74cac5..227f097 100644
--- a/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue
+++ b/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue
@@ -8,10 +8,10 @@
import layout from './layout.vue'
import { color } from 'echarts'
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/deviceRunStatus.vue b/src/views/home/dashboard/fullScreen-components/deviceRunStatus.vue
index a120328..fce4384 100644
--- a/src/views/home/dashboard/fullScreen-components/deviceRunStatus.vue
+++ b/src/views/home/dashboard/fullScreen-components/deviceRunStatus.vue
@@ -14,10 +14,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 +20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 +20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
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 @@
{ }">
-
diff --git a/src/views/home/dashboard/deviceMonitor.vue b/src/views/home/dashboard/deviceMonitor.vue
index ca22a96..f6205ac 100644
--- a/src/views/home/dashboard/deviceMonitor.vue
+++ b/src/views/home/dashboard/deviceMonitor.vue
@@ -574,7 +574,6 @@
loadingPonit.value = true
getPointStatistics().then(res => {
const areaCode = JSON.parse(localStorage.getItem('areaCode') as string)
- // const noShowCode = ['19', '18', '17']
let data = res.data.filter((item: any) => item.latGaode && item.lngGaode && item.id).map((item: any) => ({
...item,
areaName: areaCode[item.area]
diff --git a/src/views/home/dashboard/fullScreen-components/alarmCount.vue b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
index 64f0c3b..7bae529 100644
--- a/src/views/home/dashboard/fullScreen-components/alarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
@@ -9,10 +9,10 @@
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
index 1e3bf3f..bccf93e 100644
--- a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
+++ b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
@@ -13,59 +13,68 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
- window.addEventListener('resize', () => {})
+ window.addEventListener('resize', () => { })
})
const img = {
frame1: new URL('@/assets/images/map/frame1.png', import.meta.url),
frame2: new URL('@/assets/images/map/frame2.png', import.meta.url),
}
const dataList = ref([
- {
- name: '闸井泄漏',
- id: '1',
- value: '0',
- },
- {
- name: '管线泄漏',
- id: '2',
- value: '0',
- },
- {
- name: '场站泄漏',
- id: '3',
- value: '0',
- },
- {
- name: '现场作业',
- id: '4',
- value: '0',
- },
- {
- name: '外力破坏',
- id: '5',
- value: '0',
- },
- {
- name: '其他',
- id: '6',
- value: '0',
- },
+ // {
+ // name: '闸井泄漏',
+ // id: '1',
+ // value: '0',
+ // },
+ // {
+ // name: '管线泄漏',
+ // id: '2',
+ // value: '0',
+ // },
+ // {
+ // name: '场站泄漏',
+ // id: '3',
+ // value: '0',
+ // },
+ // {
+ // name: '现场作业',
+ // id: '4',
+ // value: '0',
+ // },
+ // {
+ // name: '外力破坏',
+ // id: '5',
+ // value: '0',
+ // },
+ // {
+ // name: '其他',
+ // id: '6',
+ // value: '0',
+ // },
])
const pre = computed(() => {
- return dataList.value.slice(0, 3)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(0, 2)
})
const next = computed(() => {
- return dataList.value.slice(3, 6)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(2, 4)
})
const allAlarm = computed(() => {
+ if (!dataList.value.length) {
+ return 0
+ }
return dataList.value.map((item: any) => Number(item.value)).reduce((pre, next) => {
return pre + next
})
@@ -74,16 +83,43 @@
// 获取数据
const loading = ref(true)
const fetchData = () => {
- loading.value = true
alarmStatistics({ type: $props.type }).then((res) => {
- dataList.value = res.data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
+ const needShow = ['浓度超限', '第三方破坏']
+ const data = res.data.filter((item: any) => needShow.some((citem: string) => item.name.includes(citem)))
+ data.forEach((element: any) => {
+ if (element.name === '浓度超限') {
+ element.name = '管线浓度超限'
+ }
+ });
+ dataList.value = data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
loading.value = false
}).catch(() => {
loading.value = false
})
}
+const timer = ref()
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
+
+onMounted(() => {
+ openTimer()
+})
+onBeforeUnmount(() => {
+ closeTimer()
+})
watch(() => $props.type, (newVal) => {
if (newVal) {
+ loading.value = true
fetchData()
}
else {
@@ -96,18 +132,20 @@
-
+
-
-
+
+
{{ item.name }}
-
@@ -129,14 +167,15 @@
-
-
+
+
{{ item.name }}
-
@@ -159,24 +198,27 @@
.left {
width: 30%;
color: #a7ceec;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
.item {
- margin: 7px 0;
+ // margin: 7px 0;
display: flex;
justify-content: center;
align-items: center;
position: relative;
img {
- width: 88%;
+ width: 100%;
// height: 100%;
- margin: 0 auto;
+ // margin: 0 auto;
}
.name {
position: absolute;
- top: 51%;
- left: 46%;
+ top: 50%;
+ left: 50%;
transform: translate(-50%, -50%);
.name1 {
@@ -248,5 +290,4 @@
// // padding-left: 20px;
// box-sizing: border-box;
// }
-// }
-
+// }
diff --git a/src/views/home/dashboard/fullScreen-components/baseOverView.vue b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
index e116cc4..d34f7c3 100644
--- a/src/views/home/dashboard/fullScreen-components/baseOverView.vue
+++ b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
@@ -13,10 +13,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -74,7 +74,6 @@
...item,
value: item.name === 'tyz' ? Number(item.value) - Number(res.data.filter((item: any) => item.name === 'tyx')[0]?.value || '0') : item.value
}))
- // console.log(res.data, '基本概括222222222222222')
const dataDict = {
调压箱: 'tyx',
闸井: 'zj',
@@ -109,7 +108,7 @@
-
+
![]()
diff --git a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
index 2cb78cf..4ed77e8 100644
--- a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
+++ b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
@@ -10,11 +10,12 @@
import { alarmValue } from '@/views/home/alarm/current/components/dict'
import { ElMessage } from 'element-plus'
const $emit = defineEmits(['clickMaker'])
+const timer = ref()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 + 20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -31,26 +32,46 @@
])
const list = ref
([])
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
+const fetchData = () => {
+ getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
+ // console.log(res.data.rows, '当前报警数据')
+ list.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
+ })).filter((item: any) => !item.alarmType.includes('故障'))
+ loadingTable.value = false
+ })
+}
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
onMounted(() => {
loadingTable.value = true
// 报警类别
getDictByCode('alarmCategory').then((res) => {
alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
- getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
- // console.log(res.data.rows, '当前报警数据')
- list.value = res.data.rows.map((item: any) => ({
- ...item,
- alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
- // showDeviceTips: false, // 展示设备编号提示
- })).map((item: any) => ({
- ...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
- })).filter((item:any) => !item.alarmType.includes('故障'))
- loadingTable.value = false
- })
+ fetchData()
})
-
+ openTimer()
})
+onBeforeUnmount(() => {
+ closeTimer()
+})
+
+
const rowClick = (data: any) => {
if (!data.latGaode || !data.lngGaode) {
@@ -115,6 +136,7 @@
::v-deep(.el-table__row) {
background-color: #5c5d6b;
font-size: 12px;
+
&:hover {
cursor: pointer;
}
diff --git a/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue b/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
index 636f3ae..54fa14a 100644
--- a/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
@@ -16,10 +16,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 + 20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue b/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
index df87104..befa3a1 100644
--- a/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
+++ b/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
@@ -7,10 +7,10 @@
import layout from './layout.vue'
import { alarmTrend } from '@/api/home/dashboard/fullScreen'
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue b/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue
index c74cac5..227f097 100644
--- a/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue
+++ b/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue
@@ -8,10 +8,10 @@
import layout from './layout.vue'
import { color } from 'echarts'
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/deviceRunStatus.vue b/src/views/home/dashboard/fullScreen-components/deviceRunStatus.vue
index a120328..fce4384 100644
--- a/src/views/home/dashboard/fullScreen-components/deviceRunStatus.vue
+++ b/src/views/home/dashboard/fullScreen-components/deviceRunStatus.vue
@@ -14,10 +14,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 +20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 +20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/monitorDeviceCount.vue b/src/views/home/dashboard/fullScreen-components/monitorDeviceCount.vue
index f2e403c..48d3e50 100644
--- a/src/views/home/dashboard/fullScreen-components/monitorDeviceCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/monitorDeviceCount.vue
@@ -14,14 +14,14 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
- window.addEventListener('resize', () => {})
+ window.addEventListener('resize', () => { })
})
const data = ref([])
onMounted(() => {
@@ -76,7 +76,8 @@
-
+
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 @@
{ }">
-
diff --git a/src/views/home/dashboard/deviceMonitor.vue b/src/views/home/dashboard/deviceMonitor.vue
index ca22a96..f6205ac 100644
--- a/src/views/home/dashboard/deviceMonitor.vue
+++ b/src/views/home/dashboard/deviceMonitor.vue
@@ -574,7 +574,6 @@
loadingPonit.value = true
getPointStatistics().then(res => {
const areaCode = JSON.parse(localStorage.getItem('areaCode') as string)
- // const noShowCode = ['19', '18', '17']
let data = res.data.filter((item: any) => item.latGaode && item.lngGaode && item.id).map((item: any) => ({
...item,
areaName: areaCode[item.area]
diff --git a/src/views/home/dashboard/fullScreen-components/alarmCount.vue b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
index 64f0c3b..7bae529 100644
--- a/src/views/home/dashboard/fullScreen-components/alarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
@@ -9,10 +9,10 @@
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
index 1e3bf3f..bccf93e 100644
--- a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
+++ b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
@@ -13,59 +13,68 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
- window.addEventListener('resize', () => {})
+ window.addEventListener('resize', () => { })
})
const img = {
frame1: new URL('@/assets/images/map/frame1.png', import.meta.url),
frame2: new URL('@/assets/images/map/frame2.png', import.meta.url),
}
const dataList = ref([
- {
- name: '闸井泄漏',
- id: '1',
- value: '0',
- },
- {
- name: '管线泄漏',
- id: '2',
- value: '0',
- },
- {
- name: '场站泄漏',
- id: '3',
- value: '0',
- },
- {
- name: '现场作业',
- id: '4',
- value: '0',
- },
- {
- name: '外力破坏',
- id: '5',
- value: '0',
- },
- {
- name: '其他',
- id: '6',
- value: '0',
- },
+ // {
+ // name: '闸井泄漏',
+ // id: '1',
+ // value: '0',
+ // },
+ // {
+ // name: '管线泄漏',
+ // id: '2',
+ // value: '0',
+ // },
+ // {
+ // name: '场站泄漏',
+ // id: '3',
+ // value: '0',
+ // },
+ // {
+ // name: '现场作业',
+ // id: '4',
+ // value: '0',
+ // },
+ // {
+ // name: '外力破坏',
+ // id: '5',
+ // value: '0',
+ // },
+ // {
+ // name: '其他',
+ // id: '6',
+ // value: '0',
+ // },
])
const pre = computed(() => {
- return dataList.value.slice(0, 3)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(0, 2)
})
const next = computed(() => {
- return dataList.value.slice(3, 6)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(2, 4)
})
const allAlarm = computed(() => {
+ if (!dataList.value.length) {
+ return 0
+ }
return dataList.value.map((item: any) => Number(item.value)).reduce((pre, next) => {
return pre + next
})
@@ -74,16 +83,43 @@
// 获取数据
const loading = ref(true)
const fetchData = () => {
- loading.value = true
alarmStatistics({ type: $props.type }).then((res) => {
- dataList.value = res.data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
+ const needShow = ['浓度超限', '第三方破坏']
+ const data = res.data.filter((item: any) => needShow.some((citem: string) => item.name.includes(citem)))
+ data.forEach((element: any) => {
+ if (element.name === '浓度超限') {
+ element.name = '管线浓度超限'
+ }
+ });
+ dataList.value = data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
loading.value = false
}).catch(() => {
loading.value = false
})
}
+const timer = ref()
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
+
+onMounted(() => {
+ openTimer()
+})
+onBeforeUnmount(() => {
+ closeTimer()
+})
watch(() => $props.type, (newVal) => {
if (newVal) {
+ loading.value = true
fetchData()
}
else {
@@ -96,18 +132,20 @@
-
+
-
-
+
+
{{ item.name }}
-
@@ -129,14 +167,15 @@
-
-
+
+
{{ item.name }}
-
@@ -159,24 +198,27 @@
.left {
width: 30%;
color: #a7ceec;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
.item {
- margin: 7px 0;
+ // margin: 7px 0;
display: flex;
justify-content: center;
align-items: center;
position: relative;
img {
- width: 88%;
+ width: 100%;
// height: 100%;
- margin: 0 auto;
+ // margin: 0 auto;
}
.name {
position: absolute;
- top: 51%;
- left: 46%;
+ top: 50%;
+ left: 50%;
transform: translate(-50%, -50%);
.name1 {
@@ -248,5 +290,4 @@
// // padding-left: 20px;
// box-sizing: border-box;
// }
-// }
-
+// }
diff --git a/src/views/home/dashboard/fullScreen-components/baseOverView.vue b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
index e116cc4..d34f7c3 100644
--- a/src/views/home/dashboard/fullScreen-components/baseOverView.vue
+++ b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
@@ -13,10 +13,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -74,7 +74,6 @@
...item,
value: item.name === 'tyz' ? Number(item.value) - Number(res.data.filter((item: any) => item.name === 'tyx')[0]?.value || '0') : item.value
}))
- // console.log(res.data, '基本概括222222222222222')
const dataDict = {
调压箱: 'tyx',
闸井: 'zj',
@@ -109,7 +108,7 @@
-
+
![]()
diff --git a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
index 2cb78cf..4ed77e8 100644
--- a/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
+++ b/src/views/home/dashboard/fullScreen-components/currentAlarm.vue
@@ -10,11 +10,12 @@
import { alarmValue } from '@/views/home/alarm/current/components/dict'
import { ElMessage } from 'element-plus'
const $emit = defineEmits(['clickMaker'])
+const timer = ref()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 + 20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -31,26 +32,46 @@
])
const list = ref
([])
const alarmCategoryList = ref<{ id: string; name: string; value: string }[]>([]) // 报警类别
+const fetchData = () => {
+ getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
+ // console.log(res.data.rows, '当前报警数据')
+ list.value = res.data.rows.map((item: any) => ({
+ ...item,
+ alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
+ // showDeviceTips: false, // 展示设备编号提示
+ })).map((item: any) => ({
+ ...item,
+ alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
+ })).filter((item: any) => !item.alarmType.includes('故障'))
+ loadingTable.value = false
+ })
+}
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
onMounted(() => {
loadingTable.value = true
// 报警类别
getDictByCode('alarmCategory').then((res) => {
alarmCategoryList.value = res.data.filter((item: any) => !item.name.includes('设备'))
- getCurrentAlarmListPage({ offset: 1, limit: 999 }).then(res => {
- // console.log(res.data.rows, '当前报警数据')
- list.value = res.data.rows.map((item: any) => ({
- ...item,
- alarmCategoryName: alarmCategoryList.value.length ? alarmCategoryList.value.filter((citem: any) => citem.value === item.alarmCategory)[0]?.name || '' : '',
- // showDeviceTips: false, // 展示设备编号提示
- })).map((item: any) => ({
- ...item,
- alarmReason: item.alarmCategoryName.includes('浓度') ? `${item.alarmValue}${!item.alarmValue ? '' : item.watchObject === '2' ? 'PPM.M' : '%LEL'}` : (alarmValue[item.alarmValue] || '其他')
- })).filter((item:any) => !item.alarmType.includes('故障'))
- loadingTable.value = false
- })
+ fetchData()
})
-
+ openTimer()
})
+onBeforeUnmount(() => {
+ closeTimer()
+})
+
+
const rowClick = (data: any) => {
if (!data.latGaode || !data.lngGaode) {
@@ -115,6 +136,7 @@
::v-deep(.el-table__row) {
background-color: #5c5d6b;
font-size: 12px;
+
&:hover {
cursor: pointer;
}
diff --git a/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue b/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
index 636f3ae..54fa14a 100644
--- a/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/deptAlarmCount.vue
@@ -16,10 +16,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 + 20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue b/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
index df87104..befa3a1 100644
--- a/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
+++ b/src/views/home/dashboard/fullScreen-components/deviceAlarmTrend.vue
@@ -7,10 +7,10 @@
import layout from './layout.vue'
import { alarmTrend } from '@/api/home/dashboard/fullScreen'
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue b/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue
index c74cac5..227f097 100644
--- a/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue
+++ b/src/views/home/dashboard/fullScreen-components/deviceOnlineMonitor.vue
@@ -8,10 +8,10 @@
import layout from './layout.vue'
import { color } from 'echarts'
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/deviceRunStatus.vue b/src/views/home/dashboard/fullScreen-components/deviceRunStatus.vue
index a120328..fce4384 100644
--- a/src/views/home/dashboard/fullScreen-components/deviceRunStatus.vue
+++ b/src/views/home/dashboard/fullScreen-components/deviceRunStatus.vue
@@ -14,10 +14,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50 +20) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 +20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/monitorDeviceCount.vue b/src/views/home/dashboard/fullScreen-components/monitorDeviceCount.vue
index f2e403c..48d3e50 100644
--- a/src/views/home/dashboard/fullScreen-components/monitorDeviceCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/monitorDeviceCount.vue
@@ -14,14 +14,14 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
- window.addEventListener('resize', () => {})
+ window.addEventListener('resize', () => { })
})
const data = ref([])
onMounted(() => {
@@ -76,7 +76,8 @@
-
+
diff --git a/src/views/home/dashboard/fullScreen-components/pipeNetworkType.vue b/src/views/home/dashboard/fullScreen-components/pipeNetworkType.vue
index 4b4e434..056aff1 100644
--- a/src/views/home/dashboard/fullScreen-components/pipeNetworkType.vue
+++ b/src/views/home/dashboard/fullScreen-components/pipeNetworkType.vue
@@ -17,10 +17,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
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 @@
{ }">
-
diff --git a/src/views/home/dashboard/deviceMonitor.vue b/src/views/home/dashboard/deviceMonitor.vue
index ca22a96..f6205ac 100644
--- a/src/views/home/dashboard/deviceMonitor.vue
+++ b/src/views/home/dashboard/deviceMonitor.vue
@@ -574,7 +574,6 @@
loadingPonit.value = true
getPointStatistics().then(res => {
const areaCode = JSON.parse(localStorage.getItem('areaCode') as string)
- // const noShowCode = ['19', '18', '17']
let data = res.data.filter((item: any) => item.latGaode && item.lngGaode && item.id).map((item: any) => ({
...item,
areaName: areaCode[item.area]
diff --git a/src/views/home/dashboard/fullScreen-components/alarmCount.vue b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
index 64f0c3b..7bae529 100644
--- a/src/views/home/dashboard/fullScreen-components/alarmCount.vue
+++ b/src/views/home/dashboard/fullScreen-components/alarmCount.vue
@@ -9,10 +9,10 @@
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
diff --git a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
index 1e3bf3f..bccf93e 100644
--- a/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
+++ b/src/views/home/dashboard/fullScreen-components/allAlarmStatus.vue
@@ -13,59 +13,68 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
- window.addEventListener('resize', () => {})
+ window.addEventListener('resize', () => { })
})
const img = {
frame1: new URL('@/assets/images/map/frame1.png', import.meta.url),
frame2: new URL('@/assets/images/map/frame2.png', import.meta.url),
}
const dataList = ref([
- {
- name: '闸井泄漏',
- id: '1',
- value: '0',
- },
- {
- name: '管线泄漏',
- id: '2',
- value: '0',
- },
- {
- name: '场站泄漏',
- id: '3',
- value: '0',
- },
- {
- name: '现场作业',
- id: '4',
- value: '0',
- },
- {
- name: '外力破坏',
- id: '5',
- value: '0',
- },
- {
- name: '其他',
- id: '6',
- value: '0',
- },
+ // {
+ // name: '闸井泄漏',
+ // id: '1',
+ // value: '0',
+ // },
+ // {
+ // name: '管线泄漏',
+ // id: '2',
+ // value: '0',
+ // },
+ // {
+ // name: '场站泄漏',
+ // id: '3',
+ // value: '0',
+ // },
+ // {
+ // name: '现场作业',
+ // id: '4',
+ // value: '0',
+ // },
+ // {
+ // name: '外力破坏',
+ // id: '5',
+ // value: '0',
+ // },
+ // {
+ // name: '其他',
+ // id: '6',
+ // value: '0',
+ // },
])
const pre = computed(() => {
- return dataList.value.slice(0, 3)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(0, 2)
})
const next = computed(() => {
- return dataList.value.slice(3, 6)
+ if (!dataList.value.length) {
+ return []
+ }
+ return dataList.value.slice(2, 4)
})
const allAlarm = computed(() => {
+ if (!dataList.value.length) {
+ return 0
+ }
return dataList.value.map((item: any) => Number(item.value)).reduce((pre, next) => {
return pre + next
})
@@ -74,16 +83,43 @@
// 获取数据
const loading = ref(true)
const fetchData = () => {
- loading.value = true
alarmStatistics({ type: $props.type }).then((res) => {
- dataList.value = res.data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
+ const needShow = ['浓度超限', '第三方破坏']
+ const data = res.data.filter((item: any) => needShow.some((citem: string) => item.name.includes(citem)))
+ data.forEach((element: any) => {
+ if (element.name === '浓度超限') {
+ element.name = '管线浓度超限'
+ }
+ });
+ dataList.value = data.map((item: any, index: number) => ({ ...item, id: index + 1 }))
loading.value = false
}).catch(() => {
loading.value = false
})
}
+const timer = ref()
+const closeTimer = () => {
+ if (timer.value) {
+ clearInterval(timer.value)
+ timer.value = null
+ }
+}
+const openTimer = () => {
+ closeTimer()
+ timer.value = setInterval(() => {
+ fetchData()
+ }, 1000 * 60 * 2)
+}
+
+onMounted(() => {
+ openTimer()
+})
+onBeforeUnmount(() => {
+ closeTimer()
+})
watch(() => $props.type, (newVal) => {
if (newVal) {
+ loading.value = true
fetchData()
}
else {
@@ -96,18 +132,20 @@
-
+
-
-
+
+
{{ item.name }}
-
@@ -129,14 +167,15 @@
-
-
+
+
{{ item.name }}
-
@@ -159,24 +198,27 @@
.left {
width: 30%;
color: #a7ceec;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
.item {
- margin: 7px 0;
+ // margin: 7px 0;
display: flex;
justify-content: center;
align-items: center;
position: relative;
img {
- width: 88%;
+ width: 100%;
// height: 100%;
- margin: 0 auto;
+ // margin: 0 auto;
}
.name {
position: absolute;
- top: 51%;
- left: 46%;
+ top: 50%;
+ left: 50%;
transform: translate(-50%, -50%);
.name1 {
@@ -248,5 +290,4 @@
// // padding-left: 20px;
// box-sizing: border-box;
// }
-// }
-
+// }
diff --git a/src/views/home/dashboard/fullScreen-components/baseOverView.vue b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
index e116cc4..d34f7c3 100644
--- a/src/views/home/dashboard/fullScreen-components/baseOverView.vue
+++ b/src/views/home/dashboard/fullScreen-components/baseOverView.vue
@@ -13,10 +13,10 @@
},
})
// 宽高
-const height = ref((window.innerHeight - 100 - 50) / 3)
+const height = ref((window.innerHeight - 100 - 50) / 3 + 20)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
- height.value = (window.innerHeight - 100 - 50) / 3
+ height.value = (window.innerHeight - 100 - 50 + 20) / 3
width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
onBeforeUnmount(() => {
@@ -74,7 +74,6 @@
...item,
value: item.name === 'tyz' ? Number(item.value) - Number(res.data.filter((item: any) => item.name === 'tyx')[0]?.value || '0') : item.value
}))
- // console.log(res.data, '基本概括222222222222222')
const dataDict = {
调压箱: 'tyx',
闸井: 'zj',
@@ -109,7 +108,7 @@
-