<template>
  <div class="home-right">
    <msg-card title="当前方案">
      <div class="cardInner">
        <div class="comp">
          <cross-control :crossId="schemalCross"/>
        </div>
        <el-table
          :header-cell-style="{backgroundColor:'rgba(46, 119, 255, 0.15)',color:'rgba(217, 229, 255, 1)'}"
          :row-class-name="userTab"
          :data="tableData"
          border
          style="background-color: transparent; width: 100%;">
          <el-table-column
            align="center"
            prop="phase"
            label="相位"
            width="100">
          </el-table-column>
          <el-table-column
            prop="type"
            align="center"
            label="对象类型">
          </el-table-column>
          <el-table-column
            prop="direction"
            align="center"
            label="方向">
          </el-table-column>
          <el-table-column
            prop="sat"
            align="center"
            label="饱和度">
          </el-table-column>
          <el-table-column
            prop="time"
            align="center"
            label="空放时间">
            <template slot-scope="scope">
              {{ scope.row.time }}秒
            </template>
          </el-table-column>
        </el-table>
      </div>
    </msg-card>
  </div>
</template>

<script>
import CesiumMap from "../../../components/Standard/mapCesium.vue";
import MsgCard from "../../../components/Standard/msg-card.vue";
import CameraVideo from "../../../components/Standard/cameraVideo.vue";
import CrossControl from "../../../components/CrossControl/crossControl.vue";


export default {
  name: "homeRight",
  components: {CrossControl, CameraVideo, MsgCard, CesiumMap},
  computed: {
    schemalCross(){
      return situation_phaseAirPlay.currentSchemalCross
    }
  },
  data() {
    return {
      tableData: [
      ],
      spanArr: []
    };
  },
  mounted() {
    this.tableData = situation_phaseAirPlay.scheme
  },
  methods: {
    userTab({row, rowIndex}) {
      if (rowIndex % 2 === 0) {
        return 'warning-row'
      } else if (rowIndex % 2 !== 0) {
        return 'pager-row'
      }
    },
    objectSpanMethod({row, column, rowIndex, columnIndex}) {
      if (columnIndex === 0) {
        if (rowIndex === 0 || rowIndex === 8) {
          return {
            rowspan: 2,
            colspan: 1
          };
        } else if (rowIndex === 2 || rowIndex === 5) {
          return {
            rowspan: 3,
            colspan: 1
          };
        } else {
          return {
            rowspan: 0,
            colspan: 0
          };
        }
      }
      if (columnIndex === 1) {
        if (rowIndex === 0) {
          return {
            rowspan: 2,
            colspan: 1
          };
        } else if (rowIndex === 2) {
          return {
            rowspan: 3,
            colspan: 1
          };
        } else if (rowIndex === 5) {
          return {
            rowspan: 2,
            colspan: 1
          };
        } else if (rowIndex === 7 || rowIndex === 8 || rowIndex === 9) {
          return {
            rowspan: 1,
            colspan: 1
          };
        } else {
          return {
            rowspan: 0,
            colspan: 0
          };
        }
      }
    }
  },

  beforeDestroy() {
  },
};
</script>

<style lang='less' scoped>
.full-h {
  height: 100%;
}

::v-deep .content {
  margin: 0
}

.top-left {
  position: absolute;
  left: -1px;
  top: -1px;
  padding: 10px;
  border-style: solid;
  border-color: rgba(24, 144, 255, 1);
  border-width: 3px 0 0 3px;
}

.top-right {
  position: absolute;
  right: -1px;
  top: -1px;
  padding: 10px;
  border-style: solid;
  border-color: rgba(24, 144, 255, 1);
  border-width: 3px 3px 0 0;
}

.bottom-left {
  position: absolute;
  right: -1px;
  bottom: -1px;
  padding: 10px;
  border-style: solid;
  border-color: rgba(24, 144, 255, 1);
  border-width: 0 3px 3px 0;
}

.bottom-right {
  position: absolute;
  left: -1px;
  bottom: -1px;
  padding: 10px;
  border-style: solid;
  border-color: rgba(24, 144, 255, 1);
  border-width: 0 0 3px 3px;
}

.home-right {
  position: absolute;
  right: 0;
  top: 0;
  padding: 15px 25px;
  height: 100%;
  width: 668px;

  background-color: rgba(3, 11, 25, 0.45);
  // background-image: linear-gradient(90deg, rgba(8, 20, 31, 0) 0%, rgba(6, 16, 26, 1) 100%);

  .cardInner {
    .comp {
      height: 15%;
      padding: 10px 0;
    }

    ::v-deep .el-table {
      height: 85%;
      overflow-y: auto;
    }

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;

    ::v-deep .el-table--small td, .el-table--small th {
      padding: 10px 0;
    }

    ::v-deep .el-table th {
      padding: 12px 0;
    }

    ::v-deep .el-table {
      width: 440px;
      color: rgba(217, 229, 255, 1);
      font-size: 16px;
    }

    ::v-deep .el-table tr {
      background-color: unset;
    }

    ::v-deep .el-table .warning-row {
      background-color: transparent;
    }

    ::v-deep .el-table tbody tr:hover > td {
      background-color: transparent;
    }

    ::v-deep .el-table__body tr.current-row > td {
      background: transparent !important;
    }

    ::v-deep .el-table .pager-row {
      background-color: transparent;
    }

    ::v-deep .el-table .cell .el-table th div {
      padding-right: 0;
    }

    ::v-deep .el-table--border td {
      border-right: 1px solid rgba(62, 108, 150, 1);
      border-bottom: 1px solid rgba(62, 108, 150, 1);
      border-left: 1px solid rgba(62, 108, 150, 1);
    }

    ::v-deep .el-table--border th {
      border: 1px solid rgba(62, 108, 150, 1);
    }

    ::v-deep .el-table--border {
      border: none;
    }

    ::v-deep .el-table--border::after {
      width: 0;
    }

    ::v-deep .el-table--border::before {
      height: 0;
    }
  }
}
</style>