diff --git a/src/api/index.ts b/src/api/index.ts index c44d085..fb47f1a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -131,7 +131,7 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - if(!message.includes('timeout')) { + if(!message.includes('timeout') || !message.includes('接口请求超时')) { ElMessage({ message, type: 'error', diff --git a/src/api/index.ts b/src/api/index.ts index c44d085..fb47f1a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -131,7 +131,7 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - if(!message.includes('timeout')) { + if(!message.includes('timeout') || !message.includes('接口请求超时')) { ElMessage({ message, type: 'error', diff --git a/src/components/VirtualTable/index.vue b/src/components/VirtualTable/index.vue index a7a15cf..76f7d10 100644 --- a/src/components/VirtualTable/index.vue +++ b/src/components/VirtualTable/index.vue @@ -1,5 +1,5 @@ diff --git a/src/api/index.ts b/src/api/index.ts index c44d085..fb47f1a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -131,7 +131,7 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - if(!message.includes('timeout')) { + if(!message.includes('timeout') || !message.includes('接口请求超时')) { ElMessage({ message, type: 'error', diff --git a/src/components/VirtualTable/index.vue b/src/components/VirtualTable/index.vue index a7a15cf..76f7d10 100644 --- a/src/components/VirtualTable/index.vue +++ b/src/components/VirtualTable/index.vue @@ -1,5 +1,5 @@ diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index dfe3a07..199a47a 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -165,7 +165,7 @@ // 去挂起 const pendingRef = ref() const pending = () => { - if (!dataForm.value.confirmValue) { + if (!dataForm.value.confirmValue && info.value.alarmCategory?.includes('浓度')) { ElMessage.warning('现场浓度值不能为空') return } diff --git a/src/api/index.ts b/src/api/index.ts index c44d085..fb47f1a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -131,7 +131,7 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - if(!message.includes('timeout')) { + if(!message.includes('timeout') || !message.includes('接口请求超时')) { ElMessage({ message, type: 'error', diff --git a/src/components/VirtualTable/index.vue b/src/components/VirtualTable/index.vue index a7a15cf..76f7d10 100644 --- a/src/components/VirtualTable/index.vue +++ b/src/components/VirtualTable/index.vue @@ -1,5 +1,5 @@ diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index dfe3a07..199a47a 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -165,7 +165,7 @@ // 去挂起 const pendingRef = ref() const pending = () => { - if (!dataForm.value.confirmValue) { + if (!dataForm.value.confirmValue && info.value.alarmCategory?.includes('浓度')) { ElMessage.warning('现场浓度值不能为空') return } diff --git a/src/views/home/alarm/current/components/detail.vue b/src/views/home/alarm/current/components/detail.vue index 9edd699..4572d68 100644 --- a/src/views/home/alarm/current/components/detail.vue +++ b/src/views/home/alarm/current/components/detail.vue @@ -83,11 +83,11 @@ value: 'personName', align: 'center', }, - { - text: '是否误报', - value: 'realAlarmName', - align: 'center', - }, + // { + // text: '是否误报', + // value: 'realAlarmName', + // align: 'center', + // }, { text: '解除时间', value: 'cancelTime', @@ -98,13 +98,13 @@ value: 'duration', align: 'center', }, - { - text: '', - value: '', - align: '', - }, + // { + // text: '', + // value: '', + // align: '', + // }, ]) -if($route.query.type === 'history') { +if ($route.query.type === 'history') { descriptionsList.value = descriptionsList.value.filter((item) => item.text !== '是否误报' && item.text) } // 报警动态 @@ -139,6 +139,13 @@ else { detailInfo.value.alarmReason = (alarmValue[detailInfo.value.alarmValue] || '其他') } + if (!detailInfo.value.alarmCategory.includes('浓度') && !detailInfo.value.alarmTypeName.includes('浓度')) { + descriptionsList.value = descriptionsList.value.filter(item => item.text !== '详细地址') + descriptionsList.value.push({ + text: '', + value: '' + }) + } // 查询设备类型和厂商 getDeviceListPage({ offset: 1, limit: 1, devCode: detailInfo.value.devcode }).then(res => { if (res.data.rows.length) { @@ -168,6 +175,17 @@ ...item, approvalPerson: isEncrypt(item.approvalPerson) ? decrypt(item.approvalPerson) : item.approvalPerson, })) + alarmDynamics.value.forEach((item: any) => { + if (item.descn) { + if (item.process_name === '挂起') { + item.descn = `挂起时长:${item.descn.split('|')[0] || ''}${item.descn.split('|')[0] ? '小时' : ''} ; + 挂起原因:${item.descn.split('|')[1] || ''};` + } + else { + item.descn = `内容:${item.descn}` + } + } + }) loadingDynamics.value = false }).catch(() => { loadingDynamics.value = false @@ -176,7 +194,10 @@ // 点击经纬度展示地图 const mapRef = ref() const { proxy } = getCurrentInstance() as any -const showMap = (data: any) => { +const showMap = (data: any, skip: boolean) => { + if (!detailInfo.value.alarmCategory.includes('浓度') && !detailInfo.value.alarmTypeName.includes('浓度') && data.text === '位置' && !skip) { + return + } // console.log(data, 'data') if (data.text === '设备编号') { // JSON.parse($route.query.row as string).devcode @@ -288,15 +309,27 @@ + @click="showMap(item, false)"> {{ detailInfo[item.value] || '' }} - + @click="showMap(item, false)"> {{ detailInfo[item.value] || '' }} - + @click="showMap(item, false)"> {{ detailInfo[item.value] || '' }} - diff --git a/src/api/index.ts b/src/api/index.ts index c44d085..fb47f1a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -131,7 +131,7 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - if(!message.includes('timeout')) { + if(!message.includes('timeout') || !message.includes('接口请求超时')) { ElMessage({ message, type: 'error', diff --git a/src/components/VirtualTable/index.vue b/src/components/VirtualTable/index.vue index a7a15cf..76f7d10 100644 --- a/src/components/VirtualTable/index.vue +++ b/src/components/VirtualTable/index.vue @@ -1,5 +1,5 @@ diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index dfe3a07..199a47a 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -165,7 +165,7 @@ // 去挂起 const pendingRef = ref() const pending = () => { - if (!dataForm.value.confirmValue) { + if (!dataForm.value.confirmValue && info.value.alarmCategory?.includes('浓度')) { ElMessage.warning('现场浓度值不能为空') return } diff --git a/src/views/home/alarm/current/components/detail.vue b/src/views/home/alarm/current/components/detail.vue index 9edd699..4572d68 100644 --- a/src/views/home/alarm/current/components/detail.vue +++ b/src/views/home/alarm/current/components/detail.vue @@ -83,11 +83,11 @@ value: 'personName', align: 'center', }, - { - text: '是否误报', - value: 'realAlarmName', - align: 'center', - }, + // { + // text: '是否误报', + // value: 'realAlarmName', + // align: 'center', + // }, { text: '解除时间', value: 'cancelTime', @@ -98,13 +98,13 @@ value: 'duration', align: 'center', }, - { - text: '', - value: '', - align: '', - }, + // { + // text: '', + // value: '', + // align: '', + // }, ]) -if($route.query.type === 'history') { +if ($route.query.type === 'history') { descriptionsList.value = descriptionsList.value.filter((item) => item.text !== '是否误报' && item.text) } // 报警动态 @@ -139,6 +139,13 @@ else { detailInfo.value.alarmReason = (alarmValue[detailInfo.value.alarmValue] || '其他') } + if (!detailInfo.value.alarmCategory.includes('浓度') && !detailInfo.value.alarmTypeName.includes('浓度')) { + descriptionsList.value = descriptionsList.value.filter(item => item.text !== '详细地址') + descriptionsList.value.push({ + text: '', + value: '' + }) + } // 查询设备类型和厂商 getDeviceListPage({ offset: 1, limit: 1, devCode: detailInfo.value.devcode }).then(res => { if (res.data.rows.length) { @@ -168,6 +175,17 @@ ...item, approvalPerson: isEncrypt(item.approvalPerson) ? decrypt(item.approvalPerson) : item.approvalPerson, })) + alarmDynamics.value.forEach((item: any) => { + if (item.descn) { + if (item.process_name === '挂起') { + item.descn = `挂起时长:${item.descn.split('|')[0] || ''}${item.descn.split('|')[0] ? '小时' : ''} ; + 挂起原因:${item.descn.split('|')[1] || ''};` + } + else { + item.descn = `内容:${item.descn}` + } + } + }) loadingDynamics.value = false }).catch(() => { loadingDynamics.value = false @@ -176,7 +194,10 @@ // 点击经纬度展示地图 const mapRef = ref() const { proxy } = getCurrentInstance() as any -const showMap = (data: any) => { +const showMap = (data: any, skip: boolean) => { + if (!detailInfo.value.alarmCategory.includes('浓度') && !detailInfo.value.alarmTypeName.includes('浓度') && data.text === '位置' && !skip) { + return + } // console.log(data, 'data') if (data.text === '设备编号') { // JSON.parse($route.query.row as string).devcode @@ -288,15 +309,27 @@ + @click="showMap(item, false)"> {{ detailInfo[item.value] || '' }} - diff --git a/src/views/home/device/device/components/dataSearch.vue b/src/views/home/device/device/components/dataSearch.vue index 9740f68..e701d2e 100644 --- a/src/views/home/device/device/components/dataSearch.vue +++ b/src/views/home/device/device/components/dataSearch.vue @@ -23,6 +23,7 @@ upEndTime: '', }) const deviceTypeList = ref([]) +const isFirst = ref(true) // 时间查询条件 const timerangForCollect = ref([]) const timerangForReport = ref([]) @@ -261,6 +262,12 @@ } })) } + if (listQuery.value.typeName.includes('云台') && isFirst.value) { + timerangForReport.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + listQuery.value.logBegTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + listQuery.value.logEndTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + isFirst.value = false getDataSearch(listQuery.value).then((res) => { list.value = res.data.map((item: any) => toHumpObject(item)) // if (listQuery.value.typeName === '智能警示桩') { @@ -401,6 +408,8 @@ getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows setColumn() + + fetchData() }) }) diff --git a/src/api/index.ts b/src/api/index.ts index c44d085..fb47f1a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -131,7 +131,7 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - if(!message.includes('timeout')) { + if(!message.includes('timeout') || !message.includes('接口请求超时')) { ElMessage({ message, type: 'error', diff --git a/src/components/VirtualTable/index.vue b/src/components/VirtualTable/index.vue index a7a15cf..76f7d10 100644 --- a/src/components/VirtualTable/index.vue +++ b/src/components/VirtualTable/index.vue @@ -1,5 +1,5 @@ diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index dfe3a07..199a47a 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -165,7 +165,7 @@ // 去挂起 const pendingRef = ref() const pending = () => { - if (!dataForm.value.confirmValue) { + if (!dataForm.value.confirmValue && info.value.alarmCategory?.includes('浓度')) { ElMessage.warning('现场浓度值不能为空') return } diff --git a/src/views/home/alarm/current/components/detail.vue b/src/views/home/alarm/current/components/detail.vue index 9edd699..4572d68 100644 --- a/src/views/home/alarm/current/components/detail.vue +++ b/src/views/home/alarm/current/components/detail.vue @@ -83,11 +83,11 @@ value: 'personName', align: 'center', }, - { - text: '是否误报', - value: 'realAlarmName', - align: 'center', - }, + // { + // text: '是否误报', + // value: 'realAlarmName', + // align: 'center', + // }, { text: '解除时间', value: 'cancelTime', @@ -98,13 +98,13 @@ value: 'duration', align: 'center', }, - { - text: '', - value: '', - align: '', - }, + // { + // text: '', + // value: '', + // align: '', + // }, ]) -if($route.query.type === 'history') { +if ($route.query.type === 'history') { descriptionsList.value = descriptionsList.value.filter((item) => item.text !== '是否误报' && item.text) } // 报警动态 @@ -139,6 +139,13 @@ else { detailInfo.value.alarmReason = (alarmValue[detailInfo.value.alarmValue] || '其他') } + if (!detailInfo.value.alarmCategory.includes('浓度') && !detailInfo.value.alarmTypeName.includes('浓度')) { + descriptionsList.value = descriptionsList.value.filter(item => item.text !== '详细地址') + descriptionsList.value.push({ + text: '', + value: '' + }) + } // 查询设备类型和厂商 getDeviceListPage({ offset: 1, limit: 1, devCode: detailInfo.value.devcode }).then(res => { if (res.data.rows.length) { @@ -168,6 +175,17 @@ ...item, approvalPerson: isEncrypt(item.approvalPerson) ? decrypt(item.approvalPerson) : item.approvalPerson, })) + alarmDynamics.value.forEach((item: any) => { + if (item.descn) { + if (item.process_name === '挂起') { + item.descn = `挂起时长:${item.descn.split('|')[0] || ''}${item.descn.split('|')[0] ? '小时' : ''} ; + 挂起原因:${item.descn.split('|')[1] || ''};` + } + else { + item.descn = `内容:${item.descn}` + } + } + }) loadingDynamics.value = false }).catch(() => { loadingDynamics.value = false @@ -176,7 +194,10 @@ // 点击经纬度展示地图 const mapRef = ref() const { proxy } = getCurrentInstance() as any -const showMap = (data: any) => { +const showMap = (data: any, skip: boolean) => { + if (!detailInfo.value.alarmCategory.includes('浓度') && !detailInfo.value.alarmTypeName.includes('浓度') && data.text === '位置' && !skip) { + return + } // console.log(data, 'data') if (data.text === '设备编号') { // JSON.parse($route.query.row as string).devcode @@ -288,15 +309,27 @@ + @click="showMap(item, false)"> {{ detailInfo[item.value] || '' }} - diff --git a/src/views/home/device/device/components/dataSearch.vue b/src/views/home/device/device/components/dataSearch.vue index 9740f68..e701d2e 100644 --- a/src/views/home/device/device/components/dataSearch.vue +++ b/src/views/home/device/device/components/dataSearch.vue @@ -23,6 +23,7 @@ upEndTime: '', }) const deviceTypeList = ref([]) +const isFirst = ref(true) // 时间查询条件 const timerangForCollect = ref([]) const timerangForReport = ref([]) @@ -261,6 +262,12 @@ } })) } + if (listQuery.value.typeName.includes('云台') && isFirst.value) { + timerangForReport.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + listQuery.value.logBegTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + listQuery.value.logEndTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + isFirst.value = false getDataSearch(listQuery.value).then((res) => { list.value = res.data.map((item: any) => toHumpObject(item)) // if (listQuery.value.typeName === '智能警示桩') { @@ -401,6 +408,8 @@ getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows setColumn() + + fetchData() }) }) diff --git a/src/views/home/operation/alarm/components/detail.vue b/src/views/home/operation/alarm/components/detail.vue index e71e7fb..6111413 100644 --- a/src/views/home/operation/alarm/components/detail.vue +++ b/src/views/home/operation/alarm/components/detail.vue @@ -129,7 +129,7 @@ detailInfo.value.duration = detailInfo.value.ts && detailInfo.value.cancelTime ? getDateDiff(detailInfo.value.ts, detailInfo.value.cancelTime) : '' detailInfo.value.address = `${detailInfo.value.tagNumber} ${detailInfo.value.tagNumber ? '|' : ''}${res.data.ledgerName}` // console.log(detailInfo.value, 'detailInfo.value') - detailInfo.value.installDate = detailInfo.value.installDate ? dayjs(detailInfo.value.installDate).format('YYYY-MM-DD') : '' + detailInfo.value.installDate = detailInfo.value.installDate ? dayjs(detailInfo.value.installDate).format('YYYY-MM-DD') : '' loading.value = false }).catch(() => { loading.value = false @@ -146,12 +146,21 @@ approvalPerson: '报警生成', dept_name: '', }) - // approvalPerson alarmDynamics.value = alarmDynamics.value.map((item: any) => ({ ...item, approvalPerson: isEncrypt(item.approvalPerson) ? decrypt(item.approvalPerson) : item.approvalPerson, })) - // console.log(alarmDynamics.value, 'alarmDynamics.value') + alarmDynamics.value.forEach((item: any) => { + if (item.descn) { + if (item.process_name === '挂起') { + item.descn = `挂起时长:${item.descn.split('|')[0] || ''}${item.descn.split('|')[0] ? '小时' : ''} ; + 挂起原因:${item.descn.split('|')[1] || ''};` + } + else { + item.descn = `内容:${item.descn}` + } + } + }) loadingDynamics.value = false }).catch(() => { loadingDynamics.value = false @@ -161,7 +170,31 @@ const mapRef = ref() const { proxy } = getCurrentInstance() as any const showMap = (data: any) => { - // console.log(data, 'data') + if (data.text === '设备编号') { + if (!detailInfo.value.devcode || !detailInfo.value.devTypeName) { + ElMessage.warning('缺少设备关键信息') + return + } + if (!proxy.hasPerm('/device/manage/detail/menu')) { + ElMessage.warning('没有对应权限菜单') + return + } + $router.push({ + name: 'DeviceManageDetail', + params: { + type: 'detail', + }, + query: { + row: JSON.stringify({ + devcode: detailInfo.value.devcode, + deviceType: detailInfo.value.devTypeName, + deviceTypeName: detailInfo.value.devTypeName, + devTypeName: detailInfo.value.devTypeName, + }), + }, + }) + return + } if (data.text === '位置') { if (detailInfo.value.watchObject && detailInfo.value.devcode && detailInfo.value.ledgerId) { const watchObject = { @@ -227,10 +260,13 @@ - {{ detailInfo[item.value] || '' }} + :class="`${item.text === '详细地址' ? 'pointer link' : item.text === '位置' || item.text === '设备编号' ? 'pointer link' : ''}`" + @click="showMap(item)"> + + {{ detailInfo[item.value] || '' }} + + {{ detailInfo[item.value] || '' }} @@ -241,12 +277,11 @@
- - {{ `${item.approvalPerson}${item.dept_name ? '(' : ''}${item.dept_name}${item.dept_name ? ')' - : ''}${item.process_name}` }} + +
{{ `${item.approvalPerson}${item.dept_name ? '(' : ''}${item.dept_name}${item.dept_name ? ')' : + ''}${item.process_name}` }}
+
{{ item.descn }}
diff --git a/src/api/index.ts b/src/api/index.ts index c44d085..fb47f1a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -131,7 +131,7 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - if(!message.includes('timeout')) { + if(!message.includes('timeout') || !message.includes('接口请求超时')) { ElMessage({ message, type: 'error', diff --git a/src/components/VirtualTable/index.vue b/src/components/VirtualTable/index.vue index a7a15cf..76f7d10 100644 --- a/src/components/VirtualTable/index.vue +++ b/src/components/VirtualTable/index.vue @@ -1,5 +1,5 @@ diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index dfe3a07..199a47a 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -165,7 +165,7 @@ // 去挂起 const pendingRef = ref() const pending = () => { - if (!dataForm.value.confirmValue) { + if (!dataForm.value.confirmValue && info.value.alarmCategory?.includes('浓度')) { ElMessage.warning('现场浓度值不能为空') return } diff --git a/src/views/home/alarm/current/components/detail.vue b/src/views/home/alarm/current/components/detail.vue index 9edd699..4572d68 100644 --- a/src/views/home/alarm/current/components/detail.vue +++ b/src/views/home/alarm/current/components/detail.vue @@ -83,11 +83,11 @@ value: 'personName', align: 'center', }, - { - text: '是否误报', - value: 'realAlarmName', - align: 'center', - }, + // { + // text: '是否误报', + // value: 'realAlarmName', + // align: 'center', + // }, { text: '解除时间', value: 'cancelTime', @@ -98,13 +98,13 @@ value: 'duration', align: 'center', }, - { - text: '', - value: '', - align: '', - }, + // { + // text: '', + // value: '', + // align: '', + // }, ]) -if($route.query.type === 'history') { +if ($route.query.type === 'history') { descriptionsList.value = descriptionsList.value.filter((item) => item.text !== '是否误报' && item.text) } // 报警动态 @@ -139,6 +139,13 @@ else { detailInfo.value.alarmReason = (alarmValue[detailInfo.value.alarmValue] || '其他') } + if (!detailInfo.value.alarmCategory.includes('浓度') && !detailInfo.value.alarmTypeName.includes('浓度')) { + descriptionsList.value = descriptionsList.value.filter(item => item.text !== '详细地址') + descriptionsList.value.push({ + text: '', + value: '' + }) + } // 查询设备类型和厂商 getDeviceListPage({ offset: 1, limit: 1, devCode: detailInfo.value.devcode }).then(res => { if (res.data.rows.length) { @@ -168,6 +175,17 @@ ...item, approvalPerson: isEncrypt(item.approvalPerson) ? decrypt(item.approvalPerson) : item.approvalPerson, })) + alarmDynamics.value.forEach((item: any) => { + if (item.descn) { + if (item.process_name === '挂起') { + item.descn = `挂起时长:${item.descn.split('|')[0] || ''}${item.descn.split('|')[0] ? '小时' : ''} ; + 挂起原因:${item.descn.split('|')[1] || ''};` + } + else { + item.descn = `内容:${item.descn}` + } + } + }) loadingDynamics.value = false }).catch(() => { loadingDynamics.value = false @@ -176,7 +194,10 @@ // 点击经纬度展示地图 const mapRef = ref() const { proxy } = getCurrentInstance() as any -const showMap = (data: any) => { +const showMap = (data: any, skip: boolean) => { + if (!detailInfo.value.alarmCategory.includes('浓度') && !detailInfo.value.alarmTypeName.includes('浓度') && data.text === '位置' && !skip) { + return + } // console.log(data, 'data') if (data.text === '设备编号') { // JSON.parse($route.query.row as string).devcode @@ -288,15 +309,27 @@ + @click="showMap(item, false)"> {{ detailInfo[item.value] || '' }} - diff --git a/src/views/home/device/device/components/dataSearch.vue b/src/views/home/device/device/components/dataSearch.vue index 9740f68..e701d2e 100644 --- a/src/views/home/device/device/components/dataSearch.vue +++ b/src/views/home/device/device/components/dataSearch.vue @@ -23,6 +23,7 @@ upEndTime: '', }) const deviceTypeList = ref([]) +const isFirst = ref(true) // 时间查询条件 const timerangForCollect = ref([]) const timerangForReport = ref([]) @@ -261,6 +262,12 @@ } })) } + if (listQuery.value.typeName.includes('云台') && isFirst.value) { + timerangForReport.value = [dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')] + listQuery.value.logBegTime = dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss') + listQuery.value.logEndTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + } + isFirst.value = false getDataSearch(listQuery.value).then((res) => { list.value = res.data.map((item: any) => toHumpObject(item)) // if (listQuery.value.typeName === '智能警示桩') { @@ -401,6 +408,8 @@ getDeviceTypeListPage({ offset: 1, limit: 99999 }).then((res) => { deviceTypeList.value = res.data.rows setColumn() + + fetchData() }) }) diff --git a/src/views/home/operation/alarm/components/detail.vue b/src/views/home/operation/alarm/components/detail.vue index e71e7fb..6111413 100644 --- a/src/views/home/operation/alarm/components/detail.vue +++ b/src/views/home/operation/alarm/components/detail.vue @@ -129,7 +129,7 @@ detailInfo.value.duration = detailInfo.value.ts && detailInfo.value.cancelTime ? getDateDiff(detailInfo.value.ts, detailInfo.value.cancelTime) : '' detailInfo.value.address = `${detailInfo.value.tagNumber} ${detailInfo.value.tagNumber ? '|' : ''}${res.data.ledgerName}` // console.log(detailInfo.value, 'detailInfo.value') - detailInfo.value.installDate = detailInfo.value.installDate ? dayjs(detailInfo.value.installDate).format('YYYY-MM-DD') : '' + detailInfo.value.installDate = detailInfo.value.installDate ? dayjs(detailInfo.value.installDate).format('YYYY-MM-DD') : '' loading.value = false }).catch(() => { loading.value = false @@ -146,12 +146,21 @@ approvalPerson: '报警生成', dept_name: '', }) - // approvalPerson alarmDynamics.value = alarmDynamics.value.map((item: any) => ({ ...item, approvalPerson: isEncrypt(item.approvalPerson) ? decrypt(item.approvalPerson) : item.approvalPerson, })) - // console.log(alarmDynamics.value, 'alarmDynamics.value') + alarmDynamics.value.forEach((item: any) => { + if (item.descn) { + if (item.process_name === '挂起') { + item.descn = `挂起时长:${item.descn.split('|')[0] || ''}${item.descn.split('|')[0] ? '小时' : ''} ; + 挂起原因:${item.descn.split('|')[1] || ''};` + } + else { + item.descn = `内容:${item.descn}` + } + } + }) loadingDynamics.value = false }).catch(() => { loadingDynamics.value = false @@ -161,7 +170,31 @@ const mapRef = ref() const { proxy } = getCurrentInstance() as any const showMap = (data: any) => { - // console.log(data, 'data') + if (data.text === '设备编号') { + if (!detailInfo.value.devcode || !detailInfo.value.devTypeName) { + ElMessage.warning('缺少设备关键信息') + return + } + if (!proxy.hasPerm('/device/manage/detail/menu')) { + ElMessage.warning('没有对应权限菜单') + return + } + $router.push({ + name: 'DeviceManageDetail', + params: { + type: 'detail', + }, + query: { + row: JSON.stringify({ + devcode: detailInfo.value.devcode, + deviceType: detailInfo.value.devTypeName, + deviceTypeName: detailInfo.value.devTypeName, + devTypeName: detailInfo.value.devTypeName, + }), + }, + }) + return + } if (data.text === '位置') { if (detailInfo.value.watchObject && detailInfo.value.devcode && detailInfo.value.ledgerId) { const watchObject = { @@ -227,10 +260,13 @@ - {{ detailInfo[item.value] || '' }} + :class="`${item.text === '详细地址' ? 'pointer link' : item.text === '位置' || item.text === '设备编号' ? 'pointer link' : ''}`" + @click="showMap(item)"> + + {{ detailInfo[item.value] || '' }} + + {{ detailInfo[item.value] || '' }}
@@ -241,12 +277,11 @@
- - {{ `${item.approvalPerson}${item.dept_name ? '(' : ''}${item.dept_name}${item.dept_name ? ')' - : ''}${item.process_name}` }} + +
{{ `${item.approvalPerson}${item.dept_name ? '(' : ''}${item.dept_name}${item.dept_name ? ')' : + ''}${item.process_name}` }}
+
{{ item.descn }}
diff --git a/src/views/home/operation/history/detail.vue b/src/views/home/operation/history/detail.vue index 0703c85..9bd8873 100644 --- a/src/views/home/operation/history/detail.vue +++ b/src/views/home/operation/history/detail.vue @@ -150,6 +150,17 @@ ...item, approvalPerson: isEncrypt(item.approvalPerson) ? decrypt(item.approvalPerson) : item.approvalPerson, })) + alarmDynamics.value.forEach((item: any) => { + if (item.descn) { + if (item.process_name === '挂起') { + item.descn = `挂起时长:${item.descn.split('|')[0] || ''}${item.descn.split('|')[0] ? '小时' : ''} ; + 挂起原因:${item.descn.split('|')[1] || ''};` + } + else { + item.descn = `内容:${item.descn}` + } + } + }) loadingDynamics.value = false }).catch(() => { loadingDynamics.value = false @@ -157,32 +168,64 @@ } // 点击经纬度展示地图 const mapRef = ref() +const { proxy } = getCurrentInstance() as any const showMap = (data: any) => { - // console.log(data, 'data') - // if (data.text === '位置') { - // if (detailInfo.value.watchObject && detailInfo.value.devcode && detailInfo.value.ledgerId) { - // const watchObject = { - // 1: 'WellMonitorDetail', - // 2: 'StationMonitorDetail', - // 3: 'PipelineMonitorDetail', - // } as { [key: string]: string } - // $router.push({ - // name: watchObject[detailInfo.value.watchObject], - // query: { - // id: detailInfo.value.ledgerId, - // deviceCode: detailInfo.value.devcode, - // typeName: detailInfo.value.devTypeName, - // row: JSON.stringify({ - // id: detailInfo.value.ledgerId, - // typeName: detailInfo.value.devTypeName, - // deviceCode: detailInfo.value.devcode, - // }), - // }, - // }) - // // $router - // } - // return - // } + if (data.text === '设备编号') { + if (!detailInfo.value.devCode || !detailInfo.value.devTypeName) { + ElMessage.warning('缺少设备关键信息') + return + } + if (!proxy.hasPerm('/device/manage/detail/menu')) { + ElMessage.warning('没有对应权限菜单') + return + } + $router.push({ + name: 'DeviceManageDetail', + params: { + type: 'detail', + }, + query: { + row: JSON.stringify({ + devcode: detailInfo.value.devCode, + deviceType: detailInfo.value.devTypeName, + deviceTypeName: detailInfo.value.devTypeName, + devTypeName: detailInfo.value.devTypeName, + }), + }, + }) + return + } + if (data.text === '位置') { + if (detailInfo.value.watchObject && detailInfo.value.devCode && detailInfo.value.ledgerId) { + const watchObject = { + 1: 'WellMonitorDetail', + 2: 'StationMonitorDetail', + 3: 'PipelineMonitorDetail', + } as { [key: string]: string } + // 判断是否有菜单权限 + const watchObjectAuth = { + 1: '/well', + 2: '/station/monitor', + 3: '/pipeline', + } as { [key: string]: string } + if (!proxy.hasPerm(watchObjectAuth[detailInfo.value.watchObject])) { return } + $router.push({ + name: watchObject[detailInfo.value.watchObject], + query: { + id: detailInfo.value.ledgerId, + deviceCode: detailInfo.value.devCode, + typeName: detailInfo.value.devTypeName, + row: JSON.stringify({ + id: detailInfo.value.ledgerId, + typeName: detailInfo.value.devTypeName, + deviceCode: detailInfo.value.devCode, + }), + }, + }) + // $router + } + return + } if (data.text !== '详细地址' || !detailInfo.value[data.value]) { return } @@ -217,10 +260,13 @@
- {{ detailInfo[item.value] || '' }} + :class="`${item.text === '详细地址' ? 'pointer link' : item.text === '位置' || item.text === '设备编号' ? 'pointer link' : ''}`" + @click="showMap(item)"> + + {{ detailInfo[item.value] || '' }} + + {{ detailInfo[item.value] || '' }} @@ -231,12 +277,11 @@
- - {{ `${item.approvalPerson}${item.dept_name ? '(' : ''}${item.dept_name}${item.dept_name ? ')' - : ''}${item.process_name}` }} + +
{{ `${item.approvalPerson}${item.dept_name ? '(' : ''}${item.dept_name}${item.dept_name ? ')' : + ''}${item.process_name}` }}
+
{{ item.descn }}
@@ -261,13 +306,13 @@ } } -// .link { -// color: #3d7eff; +.link { + color: #0d76d4; -// &:hover { -// text-decoration: underline; -// } -// } + &:hover { + text-decoration: underline; + } +} .bottom { --el-descriptions-table-border-top: none;