<template>
  <MapTitle text="创新示范区县(市、区）排名" />

  <el-scrollbar height="240px">
    <el-table
      :data="tableData"
      size="small"
      style="width: 100%"
      empty-text="--"
      header-row-class-name="tabs-header"
    >
      <el-table-column label="序号" width="120" align="center">
        <template #default="scope">
          <div>
            <div v-if="scope.$index > 2">{{ scope.$index + 1 }}</div>
            <div
              v-else
              class="tab-index"
              :style="{ background: `${colors[scope.$index + 1]}` }"
            >
              {{ scope.$index + 1 }}
            </div>
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="name" label="地区" align="center" />
      <el-table-column prop="score" label="分数" width="120" align="center">
        <template #default="scope">
          <div>
            {{ scope.row.score }}
            <!-- <el-icon :color="scope.row.type === 1 ? '#67C23A' : '#F56C6C'">
              <Bottom v-if="scope.row.type === 1" />
              <Top v-else />
            </el-icon> -->
          </div>
        </template>
      </el-table-column>
    </el-table>
  </el-scrollbar>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import MapTitle from "@/components/mapTitle/index.vue";

import { Bottom, Top } from "@element-plus/icons";
const TabData = [
  {
    name: "南湖区",
    score: 69.5,
    type: 1,
  },
  {
    name: "萧山区",
    score: 68,
    type: 2,
  },
  {
    name: "鄞州区",
    score: 67,
    type: 2,
  },
  {
    name: "西湖区",
    score: 66,
    type: 2,
  },
  {
    name: "长兴县",
    score: 66,
    type: 1,
  },
  {
    name: "诸暨市",
    score: 63,
    type: 2,
  },
  {
    name: "海曙区",
    score: 60,
    type: 2,
  },
  {
    name: "上城区",
    score: 60,
    type: 1,
  },
  {
    name: "永康市",
    score: 59.5,
    type: 2,
  },
  {
    name: "衢江区",
    score: 57.5,
    type: 2,
  },
  {
    name: "象山县",
    score: 57,
    type: 2,
  },
  {
    name: "德清县",
    score: 55.5,
    type: 2,
  },
  {
    name: "温岭市",
    score: 52,
    type: 2,
  },
  {
    name: "缙云县",
    score: 46.5,
    type: 1,
  },
];
const Colors = {
  1: "#e45c5c",
  2: "#ea8234",
  3: "#fac858",
};

export default defineComponent({
  components: {
    MapTitle,
    Bottom,
    Top,
  },
  setup() {},
  data() {
    return {
      tableData: [
        {
          name: "南湖区",
          score: 69.5,
          type: 1,
        },
        {
          name: "萧山区",
          score: 68,
          type: 2,
        },
        {
          name: "鄞州区",
          score: 67,
          type: 2,
        },
        {
          name: "西湖区",
          score: 66,
          type: 2,
        },
        {
          name: "长兴县",
          score: 66,
          type: 1,
        },
        {
          name: "诸暨市",
          score: 63,
          type: 2,
        },
        {
          name: "海曙区",
          score: 60,
          type: 2,
        },
        {
          name: "上城区",
          score: 60,
          type: 1,
        },
        {
          name: "永康市",
          score: 59.5,
          type: 2,
        },
        {
          name: "衢江区",
          score: 57.5,
          type: 2,
        },
        {
          name: "象山县",
          score: 57,
          type: 2,
        },
        {
          name: "德清县",
          score: 55.5,
          type: 2,
        },
        {
          name: "温岭市",
          score: 52,
          type: 2,
        },
        {
          name: "缙云县",
          score: 46.5,
          type: 1,
        },
      ],
      colors: {
        1: "#e45c5c",
        2: "#ea8234",
        3: "#fac858",
      },
    };
  },
  methods: {
    detailsHandle() {},
  },
});
</script>
<style>
.tabs-header {
}
.tabs-header .el-table__cell {
  background-color: #e3f0ff !important;
  color: #333;
  font-weight: bold;
  font-size: 14px;
}
</style>
<style lang="scss" scoped>
.el-scrollbar {
  margin-top: 10px;
}
.tab-other-index {
  text-align: center;
}
.tab-index {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid;
  color: #fff;
  font-size: 16px;
  font-family: tabTypeFace;
  margin: 0 auto;
}
</style>
