<template>
  <div style="pointer-events: all">
    <InfoHeader
      name="电梯基础信息"
      eName="Elevator basic information"
    ></InfoHeader>
    <InfoContent height="1.6rem">
      <el-table
        :header-cell-style="{ background: '#063070', color: '#fff' }"
        :data="tableData"
        style="width: 100%"
      >
        <el-table-column prop="name" label="电梯名称" width="180">
        </el-table-column>
        <el-table-column prop="address" label="电梯地址" width="200">
        </el-table-column>
        <el-table-column prop="tenements" label="物业单位" width="200">
        </el-table-column>
        <el-table-column prop="maintenance" label="维保单位"> </el-table-column>
      </el-table>
    </InfoContent>
  </div>
</template>

<script>
import InfoHeader from "@/components/infoHeader";
import InfoContent from "@/components/infoContent";
import { getWorkElevatorRunDetail } from "@/api/elevator";
export default {
  components: {
    InfoHeader,
    InfoContent,
  },
  data() {
    return {
      tableData: [{ name: "", address: "", tenements: "", maintenance: "" }],
      elevatorName: "",
    };
  },
  created() {
    console.log(this.$route.query);
    if (this.$route.query) {
      this.elevatorNum = this.$route.query.elevatorNum;
      this.getWorkElevatorRunDetaiilApi();
    }
  },

  beforeDestroy() {
    this.$store.commit("RESET_APP_NAME");
    this.$store.commit("CHANGE_MIDDLE_MENU", true);
    this.$store.commit("CHANGE_LEFT_NAME", "智慧电梯云平台");
  },
  methods: {
    getWorkElevatorRunDetaiilApi() {
      getWorkElevatorRunDetail(this.elevatorNum).then((res) => {
        this.tableData.forEach((item) => {
          item.name = res.data.elevatorName;
          this.elevatorName = res.data.elevatorName;
          item.address = res.data.elevatorAddress;
          item.tenements = res.data.tenementName;
          item.maintenance = res.data.maintenanceName;
          this.$store.commit("CHANGE_APP_NAME", this.elevatorName);
          this.$store.commit("CHANGE_MIDDLE_MENU", false);
          this.$store.commit("CHANGE_LEFT_NAME", "返回");
        });
      });
    },
  },
};
</script>
<style lang="scss" scoped>
::v-deep
  .el-table--enable-row-hover
  .el-table__body
  tr:hover
  > td.el-table__cell {
  background: rgba(1, 13, 56, 0.9) !important;
}
::v-deep .el-table__cell {
  background-color: #10295f;
  color: white;
  border-bottom: none !important;
}
/* 针对特定元素的滚动条 */
.info-list::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}
.info-list {
  .info-item {
    cursor: pointer;
    height: 0.65rem;
    background-color: #10295f;
    margin-bottom: 0.1rem;

    .classic {
      width: 1rem;
      font-size: 0.25rem;
      font-weight: bolder;

      color: #f6d54c;

      background-color: #173c7d;
    }
    .ele-name {
      width: 3.5rem;

      font-size: 0.18rem;

      color: white;
    }
    .time {
      width: 2rem;
      font-size: 0.18rem;
      color: white;
    }
    .status {
      font-size: 0.18rem;
      color: red;
    }
  }
}
</style>
