异常工况推送详情字段显示修改

This commit is contained in:
2026-11-18 14:03:04 +08:00
parent cd8ca0fdbf
commit 58a86c50b0
3 changed files with 18 additions and 14 deletions
+3
View File
@@ -42,8 +42,11 @@ axios.interceptors.response.use(
},
(error) => {
if (error.response.status === 401) {
// 异常工况推送页为免登录页面,401 时不跳转登录页
if (router.currentRoute.value.path !== '/abnormal') {
showNotify({ message: '账号已过期,请重新登录!', background: '#ff7d00' });
router.push({ path: '/login' });
}
} else {
showNotify({ message: error.response.data.message || '服务错误', background: '#ff7d00' });
}
+8 -8
View File
@@ -18,6 +18,13 @@ const constantRoutes = [
component: () => import('../views/error/404.vue'),
meta: { title: '页面不存在' },
},
// 异常工况模块:异常工况推送(免登录,token 通过 URL 参数携带)
{
path: '/abnormal',
name: 'abnormal',
component: () => import('../views/abnormal/index.vue'),
meta: { title: '异常工况推送' },
},
];
const router = createRouter({
@@ -56,13 +63,6 @@ const asyncRoutes = [
component: () => import('../views/applyList/waitList.vue'),
meta: { title: '待审批列表' },
},
// 异常工况模块:异常工况推送
{
path: '/abnormal',
name: 'abnormal',
component: () => import('../views/abnormal/index.vue'),
meta: { title: '异常工况推送' },
},
]
// 标志位:是否已添加动态路由
@@ -86,7 +86,7 @@ router.beforeEach((to, from, next) => {
next()
}
} else {
if (to.path === '/login' || to.path === '/404') {
if (to.path === '/login' || to.path === '/404' || to.path === '/abnormal') {
next()
} else {
next({ path: '/login' })
+5 -4
View File
@@ -29,10 +29,10 @@ const getInfo = async () => {
messageInfo.value = {
card: res?.data?.title || '',
type: res?.data?.card_snapshot?.severity || '',
org: res.data?.org_id,
org: res.data?.org_name,
triggerTime: res?.data?.occurred_at || '',
name: res?.data?.rule_snapshot?.name || '',
condition: '液位正常控制25~205cm,HH=210cm;压力<1.3MPa;液位/压力趋势异常或出现报警。',
condition: res?.data?.condition_summary || '',
reason: res?.data?.card_snapshot?.causes?.map(item => item.cause).join(';') || '',
result: res?.data?.card_snapshot?.consequence || '',
feedback: !res?.data?.can_confirm,
@@ -72,10 +72,11 @@ const onFeedback = async (type) => {
}
}
onMounted(() => {
onMounted(async () => {
const { id,token } = router.currentRoute.value.query;
if(id && token){
// localStorage.setItem('token', token);
console.log(token)
await localStorage.setItem('token', token);
currentId.value = id;
getInfo()
}