fileList.vue 3.37 KB
<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>