index.vue 5.64 KB
<template>
  <div>
    <div class="box">

      <div class="mt20" />
      <el-card>
        <el-row :gutter="20">
          <el-col :sm="24" :lg="12">
            <!--赛事日历-->

            <el-calendar v-model="calendarValue">
              <template #date-cell="data">
                <div class="date" :class="data.data.day==calendarValue?'primaryDate':''" @click="selectDate(data.data.day)">
                  {{ data.data.day.slice(8,10) }}
                </div>

              </template>
            </el-calendar>

          </el-col>
          <el-col :sm="24" :lg="12">
            <div class="calendarList">
<!--              <ul>-->
<!--                <li v-for="n in schList">-->
<!--                  <label>08:00~10:30</label> 无锡公开赛-->
<!--                </li>-->
<!--              </ul>-->
            </div>
            <el-empty :image="`/img/order_no.png`" :image-size="200"/>

          </el-col>
        </el-row>
      </el-card>

      <el-card class="mt20 mb20" v-for="(n,index) in cjList">
        <div class="leftboderTT">{{ language==0?n.title:n.en_title }}</div>
        <div v-for="(m,jndex) in n.list">
          <h3 class="text-center">{{ m.title }}</h3>
          <div class="tablebody">
            <table class="table table-striped">
              <thead>
              <tr class="bg-lineg">
                <td class="text-center">{{ language==0?'名次':'RANK' }}</td>
                <td class="text-center">{{ language==0?'组合':'COUPLE' }}</td>
                <td class="text-center w15">{{ language==0?'国家':'COUNTRY' }}</td>
                <td class="text-center w15">START #</td>
                <td class="text-center w15" v-if="index>0">BASE</td>
                <td class="text-center w15" v-if="index>0">POINTS</td>
              </tr>
              </thead>
              <tbody>
              <tr v-for="(l,kndex) in m.rows">
                <td class="text-center">{{ l.RANK }}</td>
                <td class="text-center">{{ l.COUPLE}}</td>
                <td class="text-center">{{ l.COUNTRY }}</td>
                <td class="text-primary text-center">{{ l.START }}</td>
                <td class="text-center" v-if="index>0">{{l.BASE}}</td>
                <td v-if="index>0" class="text-primary text-center">{{ l.POINTS }}</td>
              </tr>
              </tbody>
            </table>
          </div>
        </div>

      </el-card>
        <br><br>
    </div>
  </div>
</template>

<script setup>
import { onMounted, ref, watch } from 'vue'
import { getPlanYears, getYearZtxPlanList } from '@/apiPc/train'
import {cjList} from '@/assets/js/data'
import { ArrowRight } from '@element-plus/icons-vue'
import { dayjs } from 'element-plus'
import { szToHz } from '@/utils/ruoyi'
import {useStorage} from "@vueuse/core/index";
const language = useStorage('language', 0)

const years = ref([])
const currYear = ref(null)
const ztxPlanList = ref([])
const planList = ref([])
const schList = ref([])
const loading = ref(false)
const calendarValue = ref(new Date())


// onMounted(() => {
//   currYear.value = dayjs().year()
//   getPlanYears().then(res => {
//     years.value = res.data
//   })
// })
//
// watch(currYear, (val) => {
//   if (val) {
//     getPlanList()
//   }
// })

function selectDate(date) {
  console.log(date,calendarValue.value)
}

function getPlanList() {
  loading.value = true

  Promise.all([
    getYearZtxPlanList({
      year: currYear.value,
      type: 1// 中跆协
    }),
    getYearZtxPlanList({
      year: currYear.value,
      type: 0 // 省
    })
  ]).then(res => {
    loading.value = false
    ztxPlanList.value = res[0].rows
    planList.value = res[1].rows
  })
}

</script>

<style scoped lang="scss">
.leftboderTT{margin: 0 0 20px;color: var(--el-color-primary);
  font-size: 20px;}
h3{background: #F5F0FF;margin: 0;padding: 10px 0;
  color: var(--el-color-primary);
  font-size: 18px;}
.table {    border-spacing: 0;
  border-collapse: collapse;
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
  td,th{    padding: 8px;    font-size: 14px;}
}
:deep(.table-striped > tbody > tr:nth-of-type(odd)){
  background: #F6F9FE;
}

.el-calendar{--el-calendar-border:none;--el-calendar-cell-width:51px;text-align:center;
  --el-text-color-regular:#8E8D94;
  :deep(.el-calendar__header){justify-content: center;}
  :deep(.el-calendar__body){border: 1px solid #F0F0F0;padding: 0}
  :deep(.el-calendar-table .el-calendar-day){padding: 1px;}
  :deep(.el-calendar-table td.is-selected){background: transparent;}
  :deep(.el-calendar__button-group){display: none;}
}
.primaryDate{color: #fff;
  background: linear-gradient(90deg, #8623FC, #453DEA);}
.date{  margin:5px auto;border-radius: 50%;width: 30px;height: 30px;line-height: 30px;
  font-weight: bold;
}
.calendarList{border: 1px solid #F0F0F0;padding:12px 20px;overflow: hidden;
  margin: 46px 0 0;
  ul{
    li{background: #F6F9FE;margin:7px 0 7px 20px;position: relative;padding: 13px;
      border-radius: 10px;
      font-weight: 500;
      font-size: 15px;
      label{color: #453DEA;margin-right: 15px;
        &::before{content: '';background:#fff;left: -17px;top: 0px;bottom: 0;margin: auto;
          border-radius: 50%;width: 2px;height: 2px;position: absolute;z-index: 1}
      }
    }
    li::before{content: '';background: linear-gradient(0deg, #8623FC, #453DEA);
      border-radius: 50%;width: 8px;height: 8px;position: absolute;
      left: -20px;top: 0;bottom: 0;margin: auto;z-index: 1;
    }
    li::after{content: ''; left: -16px;width: 1px;height: 100%;
      background: #EBEBEB;    position: absolute;top: 20px}
    li:hover{color: #fff;
      background: linear-gradient(-90deg, #8623FC, #453DEA);
      label{color: #fff;}
    }
  }
}
.w15{width: 15%;}
</style>