fileList.vue
3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<template>
<div>
<div class="box">
<!-- <el-breadcrumb class="mt20" :separator-icon="ArrowRight">-->
<!-- <el-breadcrumb-item :to="{ path: '/' }">-->
<!-- <el-icon>-->
<!-- <HomeFilled/>-->
<!-- </el-icon>-->
<!-- 首页-->
<!-- </el-breadcrumb-item>-->
<!-- <el-breadcrumb-item :to="{ path: '/business/index' }">商务专区</el-breadcrumb-item>-->
<!-- <el-breadcrumb-item>文件下载</el-breadcrumb-item>-->
<!-- </el-breadcrumb>-->
<el-card class=" mt20 mb20" style="min-height: 70vh;">
<div>
<div v-for="n in newsList" class="item" @click="goDetail(n)">
<a class="file-item" target="_blank" :href="fillImgUrl_webSite(n.attacthJsonObj[0]?.url)">
<h3 class="esp underline" style="color: var(--el-color-primary)">
<i class="icon pdf" v-if="n.attacthJsonObj[0]?.url.indexOf('pdf')>-1"></i>
<i class="icon doc" v-else-if="n.attacthJsonObj[0]?.url.indexOf('doc')>-1"></i>
<i class="icon xls" v-else-if="n.attacthJsonObj[0]?.url.indexOf('xls')>-1"></i>
<i class="icon txt" v-else-if="n.attacthJsonObj[0]?.url.indexOf('txt')>-1"></i>
<i class="icon ppt" v-else-if="n.attacthJsonObj[0]?.url.indexOf('ppt')>-1"></i>
<i class="icon zip" v-else-if="n.attacthJsonObj[0]?.url.indexOf('zip')>-1"></i>
<i class="icon zip" v-else-if="n.attacthJsonObj[0]?.url.indexOf('rar')>-1"></i>
<i class="icon othe" v-else></i>
<el-icon color="#453DEA" size="20" style="position: relative;top: 2px"><download/></el-icon>
{{ n.name }}
</h3>
</a>
</div>
</div>
<div class="pc-page-box" v-if="total>8">
<PaginationPc v-model:page="query.pageNum" v-model:limit="query.pageSize" :total="total" @pagination="getList"/>
</div>
<el-empty v-if="newsList.length == 0" description="暂无数据"/>
</el-card>
</div>
</div>
</template>
<script setup>
import { ArrowRight } from '@element-plus/icons-vue'
const route = useRoute()
const router = useRouter()
import { onMounted, ref } from 'vue'
import { getNewsListById } from '@/apiPc/webSite'
import { useRoute, useRouter } from 'vue-router'
const query = ref({
pageSize: 10,
pageNum: 1
})
const total = ref(0)
const newsList = ref([
{name:'Invitation to WDSF Asian DanceSport Festival 2023(230502).pdf',attacthJsonObj:{}},
{name:'Invitation WDSF World Championship Junior 2 Standard and Adult Latin 2023.pdf',attacthJsonObj:{}},
{name:'WDSF DanceSport Championship Protocol .pdf',attacthJsonObj:{}},
])
onMounted(() => {
query.value.sortId = route.query.sortId
query.value.code = route.query.code
// getList()
})
const getList = () => {
getNewsListById(query.value).then(res => {
newsList.value = res.rows
for(var f of newsList.value){
f.attacthJsonObj = JSON.parse(f.attacthJson)
}
total.value = res.total
})
}
const goDetail = (n) => {
// if (n.isOut == '1') {
// window.open(n.jumpUrl)
// } else {
// router.push({
// path: `/news/detail/${n.noteId}`
// })
// }
}
</script>
<style scoped lang="scss">
.file-item{
&:hover{background: #BE8EFB;}
}
</style>