main
wwl 2024-04-16 18:15:20 +08:00
parent a79a3dfa14
commit 9b4274b254
2 changed files with 71 additions and 11 deletions

View File

@ -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()
</div>
<!-- <template v-for="(i, k) in item" :key="k"> -->
<div class="flex items-baseline flex-1">
<n-popover v-if="i.title?.length > 14" trigger="hover" placement="top-start">
<template #trigger>
<div
@click="toDetail2(i)"
class="text-#142142 truncate text-18px font-bold w-95% no-underline text-#142142 cursor-pointer hover:underline h-16px leading-16px"
>
<span>{{ i.title || '' }}</span>
</div>
</template>
<div class="text-#142142 text-18px font-bold no-underline h-16px leading-16px">
<img
v-if="isNotOneWeekAgo(i.createTime)"
class="h-20px"
src="@/assets/images/NEW.gif"
alt=""
/>
<span>{{ i.title || '' }}</span>
</div>
</n-popover>
<div
v-else
@click="toDetail2(i)"
class="text-#142142 truncate text-18px font-bold w-95% no-underline text-#142142 cursor-pointer hover:underline h-16px leading-16px"
>
<img
v-if="isNotOneWeekAgo(i.createTime)"
class="h-20px"
src="@/assets/images/NEW.gif"
alt=""
/>
<span>{{ i.title || '' }}</span>
</div>
<div class="text-#808696 ml20px text-14px flex items-center justify-between mb-10px">

View File

@ -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('您没有权限查看!')