This commit is contained in:
2025-08-15 03:08:47 +08:00
parent 384069ecbf
commit 34b4ccfc5f
3 changed files with 23 additions and 6 deletions

View File

@ -5,7 +5,7 @@ VITE_APP_TITLE = 新能源项目管理平台
VITE_APP_ENV = 'development'
# 开发环境
VITE_APP_BASE_API = 'http://192.168.110.118:8898'
VITE_APP_BASE_API = 'http://192.168.110.159:8898'
# 无人机接口地址

View File

@ -54,7 +54,8 @@ const onNewsClick = (item: any) => {
//并且写入pinia
noticeStore.state.value.notices = newsList.value;
//如果有formPath就前往
console.log('🚀 ~ onNewsClick ~ item.formPath:', newsList.value);
console.log(1111111111111111);
console.log(newsList.value[item]);
if (newsList.value[item].route) {
proxy?.$tab.openPage('/' + newsList.value[item].route, '', { id: newsList.value[item].detailId, type: 'view' });
}

View File

@ -25,15 +25,31 @@ export const initSSE = (url: any) => {
});
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({
message: data.value,
message: label,
read: false,
time: new Date().toLocaleString()
time: new Date().toLocaleString(),
route: route1
});
ElNotification({
title: '消息',
message: data.value,
message: label,
type: 'success',
duration: 3000
});