diff --git a/.env.development b/.env.development index 21892b7..fe20df3 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VITE_APP_TITLE = 新能源项目管理平台 VITE_APP_ENV = 'development' # 开发环境 -VITE_APP_BASE_API = 'http://192.168.110.180:8898' +VITE_APP_BASE_API = 'http://192.168.110.159:8898' # 无人机接口地址 diff --git a/src/layout/components/notice/index.vue b/src/layout/components/notice/index.vue index 12e8289..0deeb5a 100644 --- a/src/layout/components/notice/index.vue +++ b/src/layout/components/notice/index.vue @@ -26,6 +26,9 @@ import { storeToRefs } from 'pinia'; import useNoticeStore from '@/store/modules/notice'; +const router = useRouter(); +const { proxy } = getCurrentInstance(); + const noticeStore = storeToRefs(useNoticeStore()); const { readAll } = useNoticeStore(); @@ -50,6 +53,11 @@ const onNewsClick = (item: any) => { newsList.value[item].read = true; //并且写入pinia noticeStore.state.value.notices = newsList.value; + //如果有formPath,就前往 + console.log('🚀 ~ onNewsClick ~ item.formPath:', item.formPath, newsList.value); + if (newsList.value[item].formPath) { + proxy?.$tab.openPage('/' + newsList.value[item].formPath, '', { id: newsList.value[item].businessId, type: 'view' }); + } }; // 前往通知中心点击 diff --git a/src/store/modules/notice.ts b/src/store/modules/notice.ts index de980b6..cbf4fb8 100644 --- a/src/store/modules/notice.ts +++ b/src/store/modules/notice.ts @@ -5,11 +5,22 @@ interface NoticeItem { read: boolean; message: any; time: string; + formPath?: string; + businessId?: string; } export const useNoticeStore = defineStore('notice', () => { const state = reactive({ - notices: [] as NoticeItem[] + notices: [ + { + title: '通知公告', + read: false, + message: '这是一条通知公告', + time: '2023-01-01', + formPath: 'design-management/scheme/indexEdit', + businessId: '1955636050617094146' + } + ] as NoticeItem[] }); const addNotice = (notice: NoticeItem) => { diff --git a/src/views/design/billofQuantities/index.vue b/src/views/design/billofQuantities/index.vue index 03dc600..a25aea2 100644 --- a/src/views/design/billofQuantities/index.vue +++ b/src/views/design/billofQuantities/index.vue @@ -1,82 +1,4 @@