<template>
  <div class="right-card">
    <m-card title="测站名录" :height="500">
      <div class="station-list">
        <div class="station-list-header">
          <div class="header-item">名称</div>
          <div class="header-item">水位</div>
          <div class="header-item">警戒水位</div>
          <div class="header-item">超警</div>
          <div class="header-item">时间</div>
        </div>
        <div class="station-list-body">
          <div class="station-item" v-for="(item, index) in stationData" :key="index">
            <div class="item-cell">{{ item.name }}</div>
            <div class="item-cell">{{ item.waterLevel }}m</div>
            <div class="item-cell">{{ item.warningLevel }}m</div>
            <div class="item-cell" :class="{ 'exceeded': item.isExceeded }">
              {{ item.isExceeded ? '是' : '否' }}
            </div>
            <div class="item-cell">{{ item.time }}</div>
          </div>
        </div>
      </div>
    </m-card>
  </div>
</template>
<script setup>
import { ref } from "vue"
import mCard from "@/components/mCard/index.vue"

const stationData = ref([
  {
    name: "昆山（苏州水文)",
    waterLevel: 2.86,
    warningLevel: 3.43,
    isExceeded: false,
    time: "2026-02-04 15:00"
  },
  {
    name: "陈墓（苏州）",
    waterLevel: 2.65,
    warningLevel: 3.33,
    isExceeded: false,
    time: "2026-02-04 15:00"
  },
  {
    name: "巴城（苏州）",
    waterLevel: 2.93,
    warningLevel: 3.43,
    isExceeded: false,
    time: "2026-02-04 15:00"
  },
  {
    name: "周巷（苏州）",
    waterLevel: 2.84,
    warningLevel: 3.43,
    isExceeded: true,
    time: "2026-02-04 15:00"
  },
  {
    name: "千灯浦桥（太湖）",
    waterLevel: 2.65,
    warningLevel: 3.33,
    isExceeded: false,
    time: "2026-02-04 15:00"
  },
  {
    name: "道褐浦",
    waterLevel: 2.70,
    warningLevel: 3.33,
    isExceeded: true,
    time: "2026-02-04 15:00"
  },
  {
    name: "石牌(七)",
    waterLevel: 3.19,
    warningLevel: 3.43,
    isExceeded: false,
    time: "2026-02-04 15:20"
  },
  {
    name: "萧林",
    waterLevel: 2.94,
    warningLevel: 3.43,
    isExceeded: false,
    time: "2026-02-04 15:20"
  },
  {
    name: "东阳澄湖",
    waterLevel: 2.93,
    warningLevel: 3.43,
    isExceeded: false,
    time: "2026-02-04 15:20"
  },
  {
    name: "茅沙塘",
    waterLevel: 2.94,
    warningLevel: 3.43,
    isExceeded: false,
    time: "2026-02-04 15:20"
  },
  {
    name: "北温焦泾",
    waterLevel: 2.93,
    warningLevel: 3.43,
    isExceeded: false,
    time: "2026-02-04 15:20"
  },
  {
    name: "陆杨（新）",
    waterLevel: 2.87,
    warningLevel: 3.43,
    isExceeded: false,
    time: "2026-02-04 15:20"
  },
  {
    name: "斜塘",
    waterLevel: 3.00,
    warningLevel: 3.43,
    isExceeded: false,
    time: "2026-02-04 15:20"
  },
  {
    name: "创乐",
    waterLevel: 2.93,
    warningLevel: 3.43,
    isExceeded: true,
    time: "2026-02-04 15:20"
  }
])
</script>
<style lang="scss" scoped>
.right-card {
  margin-bottom: 16px;
  box-sizing: border-box;
}

.station-list {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 10px;
  box-sizing: border-box;
}

.station-list-header {
  display: flex;
  background-color: rgba(10, 40, 60, 0.5);
  border-radius: 4px 4px 0 0;
  padding: 10px 0;
  font-weight: bold;
  color: #30DCFF;
  border-bottom: 1px solid #3F5B73;
}

.header-item {
  flex: 1;
  text-align: center;
  font-size: 12px;
}

.station-list-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.station-item {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid rgba(63, 91, 115, 0.3);
  color: #D3F8F2;
  font-size: 12px;
  &:last-child {
    border-bottom: none;
  }
}

.item-cell {
  flex: 1;
  text-align: center;
}

.exceeded {
  color: #FF6B6B;
  font-weight: bold;
}

/* 滚动条样式 */
.station-list-body::-webkit-scrollbar {
  width: 6px;
}

.station-list-body::-webkit-scrollbar-track {
  background: rgba(10, 40, 60, 0.3);
  border-radius: 3px;
}

.station-list-body::-webkit-scrollbar-thumb {
  background: rgba(48, 220, 255, 0.5);
  border-radius: 3px;
}

.station-list-body::-webkit-scrollbar-thumb:hover {
  background: rgba(48, 220, 255, 0.8);
}
</style>