<!--省控线-->
<script setup>
import {ref} from "vue";
import ApiConstant from "@/common/ApiConstant";
import Request from '@/common/request'
import {onMounted} from "vue";
import StaticConstant from "@/common/StaticConstant";

let request = new Request()
const dataList = ref()
const scoreUpdate = ref()
function getHistoryList() {
  let that = this
  let scoreInfo = uni.getStorageSync('scoreInfo')
  let data = {
    professionalCategory: '美术与设计类',
    category: '文科'
  }
  if (scoreInfo && scoreInfo.professionalCategory) {
    data.professionalCategory = scoreInfo.professionalCategory
  }
  if (scoreInfo && scoreInfo.cognitioPolyclinic) {
    data.category = scoreInfo.cognitioPolyclinic
  }

  //获取 24艺考改革专业分调整
  let scoreUpdater = StaticConstant.professionalCategoryScoreUpdadtes[data.professionalCategory]
  if (scoreUpdater && scoreUpdater.scoreMax) {
    scoreUpdate.value = {...scoreUpdater,professionalCategory:data.professionalCategory}
  }

  request.get(ApiConstant.Score.historyScoreControlLineListGroupYear, data).then(r => {
    if (r.success) {
      let data2 = r.result
      let list = []
      let dataKeys = Object.keys(data2)
      dataKeys.sort(function (a, b) {
        return b - a;
      });
      for (let i = 0; i < dataKeys.length; i++) {
        list.push({year: dataKeys[i], list: data2[dataKeys[i]]})
      }
      dataList.value = list
    }
  }).catch(err => {
  }).finally(() => {
  });
}

onMounted(() => {
  getHistoryList()
})

</script>

<template>
  <view class="container" style="background-color: #ffffcb">
    <text class="uni-h6" v-if="scoreUpdate && scoreUpdate.scoreMax">2024艺考改革，原专业满分{{scoreUpdate.oldScoreMax}}分调整为{{scoreUpdate.scoreMax}}分。</text>
  </view>
  <view class="content">
    <view class="table">
      <view class="tr uni-flex" style="background-color: #f5c4b8;">
        <view class="th flex-item-1">
          <text>年份</text>
        </view>
        <view class="th flex-item-3">
          <text>批次</text>
        </view>
        <view class="th flex-item-3">
          <text>专业线(统/校)</text>
        </view>
        <view class="th flex-item-3">
          <text>文化线(统/校)</text>
        </view>

      </view>
      <view class="tr uni-flex" v-for="(item,index) in dataList" :key="index">
        <view class="flex-item-10">
          <view class="uni-flex">
            <view class="flex-item-1 left"
                  :style="(index+1)%2===0?'lineOned':'lineTwod'">
              <text class="font-size-medium"
                    style="width: 20rpx;margin-top: 100rpx;line-height: 30rpx;text-orientation: upright; writing-mode: vertical-rl;">
                {{ item.year }}
              </text>
            </view>
            <view class="flex-item-9">
              <view class="uni-flex right" v-for="(it,i) in item.list" :key="i">
                <view class="flex-item-33 right-co">
                  <text>{{ it.batch || '-' }}</text>
                </view>
                <view class="flex-item-33 right-co">
                  <text>{{ it.specialScore || '-' }}</text>
                  <text v-if="it.specialScoreXk">/{{ it.specialScoreXk || '-' }}</text>
                </view>
                <view class="flex-item-33 right-co">
                  <text>{{ it.culturalScore || '-' }}</text>
                  <text v-if="it.culturalScoreXk">/{{ it.culturalScoreXk || '-' }}</text>
                </view>
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>

</template>

<style scoped lang="scss">
.container {
  line-height: 80rpx;
  padding: 0 30rpx;
  font-weight: 550;
}

.content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background-color: white;
}

.tr {
  line-height: 100rpx;
  width: 100%;
  text-align: center;
}

.tr .th {
  color: #f36646;
  //color: #eae7ff;
  font-weight: 600;
}

.tr .td {
  width: 33.3%;
}

.left {
  color: #f36646;
  //color:#eae7ff;
  border-radius: 5rpx;
  margin: 10rpx 0;
}

.right {
  //background-color: #f5c4b8;
  background-color: #f9f9f9;
  color: #41464e;
  font-weight: 550;
  margin: 10rpx 5rpx;
  height: 90rpx;
  line-height: 90rpx;
}
.lineOned{
  background-color: #d68e7e;
}
.lineTwod{
  background-color: #f5c4b8;
}
</style>
