Compare commits

...

2 Commits

Author SHA1 Message Date
wwl 9b4274b254 fix bug 2024-04-16 18:15:20 +08:00
wwl a79a3dfa14 fix bug 2024-04-15 17:23:34 +08:00
2 changed files with 80 additions and 6 deletions

View File

@ -3,7 +3,9 @@ import { getArticlePage, report, cateFileList, newDataList } from '@/api/daikin/
import { message } from '@/utils/message'
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()
@ -63,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
@ -71,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('您没有权限查看!')
}
}
@ -208,6 +253,14 @@ fetchNewDataList()
>
<swiper-slide v-for="(i, index) of newsData" :key="index"> -->
<div height="310px" class="h-310px overflow-hidden">
<!-- <div
class="absolute flex flex-col w-full h-full z-200 top-0 left-0 text-center bg-red justify-center items-center"
style="background-color: rgba(255, 255, 255, 0.8)"
>
<img src="@/assets/images/chah.png" />
<br />
<div class="text-#5683DB text-36px">做成中,敬请期待</div>
</div> -->
<!-- <div class="text-black mb-10px" v-for="(item, index) of newsData" :key="index"> -->
<div class="text-black mb-10px" v-for="(i, index) in newsData" :key="index">
<div class="flex justify-between items-center mb4px" v-if="index === 0">
@ -220,11 +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"
>
<!-- <img class="h-20px" src="@/assets/images/NEW.gif" alt="" /> -->
<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"
>
<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('您没有权限查看!')