<script setup>
import { ref, onMounted } from "vue";

const faultAlarmList = ref([
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED1",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED2",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED3",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
  {
    location: "1楼中庭",
    time: "2023-11-28  16:58:02",
    name: "LED4",
  },
]);
const runTimeList = ref([
  {
    name: "西大厅1",
    value: false,
  },
  {
    name: "西大厅2",
    value: true,
  },
  {
    name: "西大厅3",
    value: true,
  },
  {
    name: "西大厅4",
    value: true,
  },

]);
</script>

<template>
  <div class="page m100">
    <div class="page-left-box">
      <div class="title">
        <span>故障报警</span>
      </div>
      <div
        class="page-big-box margin10"
        style="display: flex; align-items: center"
      >
        <div class="alarm">
          <div
            class="alarmList"
            v-for="(item, index) in faultAlarmList"
            :key="index"
          >
            <span class="name">{{ item.name }}</span>
            <div class="content">
              <span class="location">地点：{{ item.location }}</span>
              <span class="time">时间：{{ item.time }}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="page-right-box">
      <div class="title">
        <span>运行状态</span>
      </div>
      <div class="page-big-box margin10">
        <div class="runningState">
          <div class="tableTitle">
            <span>区域名称</span>
            <span>状态</span>
          </div>
          <div class="tableContent">
            <div
              class="tableBoby"
              v-for="(item, index) in runTimeList"
              :key="index"
            >
              <span>{{ item.name }}</span>
              <el-switch v-model="item.value" style="left: 8px" />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.alarm {
  width: 100%;
  height: 94%;
  padding: 0 3%;
  box-sizing: border-box;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-content: flex-start;
  overflow: auto;
  scrollbar-width: none; /* firefox */
  -ms-overflow-style: none; /* IE 10+ */
  .alarmList {
    width: 93.2%;
    height: 6.2%;
    margin-top: 2.6%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: url("../../assets/images/overview/alarm.png") no-repeat;
    background-size: 100% 100%;
    padding: 0 2%;
    .content {
      display: flex;
      flex-direction: column;
      .location {
        font-size: 16px;
        color: rgba(255, 255, 255, 1);
      }
      .time {
        font-size: 12px;
        color: rgba(218, 218, 218, 1);
      }
    }
    .name {
      font-size: 22px;
      font-weight: 700;
      color: rgba(91, 250, 241, 1);
      position: relative;
      margin-left: 14%;
    }
  }
}
::-webkit-scrollbar {
  display: none; /* Chrome Safari */
}
.runningState {
  height: 98%;
  width: 100%;
  padding: 3% 3%;
  box-sizing: border-box;
  .tableTitle {
    background: url("../../assets/images/overview/runTime.png") no-repeat;
    background-size: 100% 100%;
    width: 100%;
    height: 4.5%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 16px;
  }
  .tableContent {
    width: 100%;
    height: calc(100% - 4.5%);
    overflow: auto;
    scrollbar-width: none; /* firefox */
    -ms-overflow-style: none; /* IE 10+ */
    .tableBoby {
      background: url("../../assets/images/overview/runTime.png") no-repeat;
      background-size: 100% 100%;
      width: 100%;
      height: 3.5%;
      display: flex;
      justify-content: space-around;
      align-items: center;
      font-size: 14px;
      margin-top: 2%;
    }
  }
  ::-webkit-scrollbar {
    display: none; /* Chrome Safari */
  }
}
:deep(.el-switch__core) {
  border-radius: 0;
  background: transparent;
  border: 1px solid rgba(223, 94, 94, 1);
}

:deep(.el-switch.is-checked .el-switch__core) {
  background: transparent;
  border: 1px solid rgba(80, 233, 83, 1);
}
:deep(.el-switch__core .el-switch__action) {
  border-radius: 0;
  height: 13px;
  width: 13px;
  background: rgba(223, 94, 94, 1);
}
:deep(.el-switch.is-checked .el-switch__action) {
  border-radius: 0;
  height: 13px;
  width: 13px;
  background: rgba(80, 233, 83, 1);
}
</style>
