异常工况推送详情字段显示修改
This commit is contained in:
@@ -42,8 +42,11 @@ axios.interceptors.response.use(
|
|||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
if (error.response.status === 401) {
|
if (error.response.status === 401) {
|
||||||
|
// 异常工况推送页为免登录页面,401 时不跳转登录页
|
||||||
|
if (router.currentRoute.value.path !== '/abnormal') {
|
||||||
showNotify({ message: '账号已过期,请重新登录!', background: '#ff7d00' });
|
showNotify({ message: '账号已过期,请重新登录!', background: '#ff7d00' });
|
||||||
router.push({ path: '/login' });
|
router.push({ path: '/login' });
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
showNotify({ message: error.response.data.message || '服务错误', background: '#ff7d00' });
|
showNotify({ message: error.response.data.message || '服务错误', background: '#ff7d00' });
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-8
@@ -18,6 +18,13 @@ const constantRoutes = [
|
|||||||
component: () => import('../views/error/404.vue'),
|
component: () => import('../views/error/404.vue'),
|
||||||
meta: { title: '页面不存在' },
|
meta: { title: '页面不存在' },
|
||||||
},
|
},
|
||||||
|
// 异常工况模块:异常工况推送(免登录,token 通过 URL 参数携带)
|
||||||
|
{
|
||||||
|
path: '/abnormal',
|
||||||
|
name: 'abnormal',
|
||||||
|
component: () => import('../views/abnormal/index.vue'),
|
||||||
|
meta: { title: '异常工况推送' },
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
@@ -56,13 +63,6 @@ const asyncRoutes = [
|
|||||||
component: () => import('../views/applyList/waitList.vue'),
|
component: () => import('../views/applyList/waitList.vue'),
|
||||||
meta: { title: '待审批列表' },
|
meta: { title: '待审批列表' },
|
||||||
},
|
},
|
||||||
// 异常工况模块:异常工况推送
|
|
||||||
{
|
|
||||||
path: '/abnormal',
|
|
||||||
name: 'abnormal',
|
|
||||||
component: () => import('../views/abnormal/index.vue'),
|
|
||||||
meta: { title: '异常工况推送' },
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
// 标志位:是否已添加动态路由
|
// 标志位:是否已添加动态路由
|
||||||
@@ -86,7 +86,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (to.path === '/login' || to.path === '/404') {
|
if (to.path === '/login' || to.path === '/404' || to.path === '/abnormal') {
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
next({ path: '/login' })
|
next({ path: '/login' })
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ const getInfo = async () => {
|
|||||||
messageInfo.value = {
|
messageInfo.value = {
|
||||||
card: res?.data?.title || '',
|
card: res?.data?.title || '',
|
||||||
type: res?.data?.card_snapshot?.severity || '',
|
type: res?.data?.card_snapshot?.severity || '',
|
||||||
org: res.data?.org_id,
|
org: res.data?.org_name,
|
||||||
triggerTime: res?.data?.occurred_at || '',
|
triggerTime: res?.data?.occurred_at || '',
|
||||||
name: res?.data?.rule_snapshot?.name || '',
|
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(';') || '',
|
reason: res?.data?.card_snapshot?.causes?.map(item => item.cause).join(';') || '',
|
||||||
result: res?.data?.card_snapshot?.consequence || '',
|
result: res?.data?.card_snapshot?.consequence || '',
|
||||||
feedback: !res?.data?.can_confirm,
|
feedback: !res?.data?.can_confirm,
|
||||||
@@ -72,10 +72,11 @@ const onFeedback = async (type) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
const { id,token } = router.currentRoute.value.query;
|
const { id,token } = router.currentRoute.value.query;
|
||||||
if(id && token){
|
if(id && token){
|
||||||
// localStorage.setItem('token', token);
|
console.log(token)
|
||||||
|
await localStorage.setItem('token', token);
|
||||||
currentId.value = id;
|
currentId.value = id;
|
||||||
getInfo()
|
getInfo()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user