diff --git a/src/views/home/components/New.vue b/src/views/home/components/New.vue index 55c1dc4..19fc8ae 100755 --- a/src/views/home/components/New.vue +++ b/src/views/home/components/New.vue @@ -5,6 +5,7 @@ import { Swiper, SwiperSlide } from 'swiper/vue' import { Autoplay, Navigation, Pagination, A11y } from 'swiper' import { isNotOneWeekAgo } from '@/utils' import dayjs from 'dayjs' +import { NPopover } from 'naive-ui' // import { NCarousel } from 'naive-ui' const route = useRoute() @@ -64,6 +65,45 @@ onMounted(getPageList) // message.info("您没有权限查看!") // } // } + +const codePath: any = { + App_Article: { + path: '/intelligence/outside/', + modulePath: '/Home/intelligence' + }, + App_Market: { + path: '/Home/market/', + modulePath: '/Home/market' + }, + App_data_platform: { + path: '/Home/cd/', + modulePath: '/Home/cd' + }, + App_BCP: { + path: '/Home/bcp/', + modulePath: '/Home/bcp/' + }, + // '碳中和模块', + App_CSR: { + path: '/Home/csr/', + modulePath: '/Home/csr/' + }, + // '品质模块', + App_Quality: { + path: '/Home/quality/', + modulePath: '/Home/quality/' + }, + // 'Lab模块', + App_Lab: { + path: '/Home/diffspace/', + modulePath: '/Home/diffspace' + }, + // 'DatabBase模块' + App_Database: { + path: '/DataBase?id=', + modulePath: '/DataBase' + } +} const toDetail2 = (n: any) => { console.log(n) if (n.id === 0) return @@ -72,11 +112,15 @@ const toDetail2 = (n: any) => { return push('/DataBase?id=' + n.cateId) } if (n.moduleCode === 'App_Article') { - return push('/Home/intelligence/' + n.id) + return push('/Home/intelligence/') } - push(`/intelligence/${n.type == 2 ? 'within' : 'outside'}/` + n.id) + const { moduleCode, id, cateId } = n + const { modulePath, path } = codePath[moduleCode] + push(modulePath) + + // push(`/intelligence/${n.type == 2 ? 'within' : 'outside'}/` + n.id) } else { - message.error('没有访问权限') + message.info('您没有权限查看!') } } @@ -229,16 +273,30 @@ fetchNewDataList()
+ + +
+ + {{ i.title || '' }} +
+
- {{ i.title || '' }}
diff --git a/src/views/home/news/news.vue b/src/views/home/news/news.vue index 87ee6a9..060ff43 100755 --- a/src/views/home/news/news.vue +++ b/src/views/home/news/news.vue @@ -143,14 +143,16 @@ const goModule = (item, type) => { } const clickItem = (item: any) => { const { id, filePath, isSelect, moduleCode, fileCommon = {} } = item - if (isSelect == 1) { + const { modulePath, path } = codePath[moduleCode] + if (isSelect === 1) { if (item.moduleCode === 'App_Article') { return push('/Home/intelligence/' + item.id) } if (['App_Database'].includes(moduleCode)) { goModule(item, 'path') } else { - downloads({ fileCommon, filePath }) + // downloads({ fileCommon, filePath }) + push(modulePath) } } else { message.info('您没有权限查看!')