优化
This commit is contained in:
@ -5,7 +5,7 @@ VITE_APP_TITLE = 新能源项目管理平台
|
|||||||
VITE_APP_ENV = 'development'
|
VITE_APP_ENV = 'development'
|
||||||
|
|
||||||
# 开发环境
|
# 开发环境
|
||||||
VITE_APP_BASE_API = 'http://192.168.110.118:8898'
|
VITE_APP_BASE_API = 'http://192.168.110.159:8898'
|
||||||
|
|
||||||
# 无人机接口地址
|
# 无人机接口地址
|
||||||
|
|
||||||
|
@ -54,7 +54,8 @@ const onNewsClick = (item: any) => {
|
|||||||
//并且写入pinia
|
//并且写入pinia
|
||||||
noticeStore.state.value.notices = newsList.value;
|
noticeStore.state.value.notices = newsList.value;
|
||||||
//如果有formPath,就前往
|
//如果有formPath,就前往
|
||||||
console.log('🚀 ~ onNewsClick ~ item.formPath:', newsList.value);
|
console.log(1111111111111111);
|
||||||
|
console.log(newsList.value[item]);
|
||||||
if (newsList.value[item].route) {
|
if (newsList.value[item].route) {
|
||||||
proxy?.$tab.openPage('/' + newsList.value[item].route, '', { id: newsList.value[item].detailId, type: 'view' });
|
proxy?.$tab.openPage('/' + newsList.value[item].route, '', { id: newsList.value[item].detailId, type: 'view' });
|
||||||
}
|
}
|
||||||
|
@ -25,15 +25,31 @@ export const initSSE = (url: any) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
watch(data, () => {
|
watch(data, () => {
|
||||||
if (!data.value) return;
|
console.log(data.value);
|
||||||
|
let label = '';
|
||||||
|
let route1 = '';
|
||||||
|
try {
|
||||||
|
if (JSON.parse(data.value)) {
|
||||||
|
const obj = JSON.parse(data.value);
|
||||||
|
route1 = obj.route;
|
||||||
|
label = obj.message;
|
||||||
|
data.value = null;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
label = data.value;
|
||||||
|
}
|
||||||
|
console.log(route1);
|
||||||
|
console.log(label);
|
||||||
|
// if (!data.value) return;
|
||||||
useNoticeStore().addNotice({
|
useNoticeStore().addNotice({
|
||||||
message: data.value,
|
message: label,
|
||||||
read: false,
|
read: false,
|
||||||
time: new Date().toLocaleString()
|
time: new Date().toLocaleString(),
|
||||||
|
route: route1
|
||||||
});
|
});
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '消息',
|
title: '消息',
|
||||||
message: data.value,
|
message: label,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
duration: 3000
|
duration: 3000
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user