<template>
  <div>
    <el-table
      ref="multipleTable"
      class="statistics-table"
      :data="tableData"
      tooltip-effect="dark"
      style="width: 100%; height: auto"
      :row-class-name="tableRowClassName"
      :row-style="{ height: '50px' }"
      :header-cell-style="{
        background: '#eaf1fe',
        color: '#000',
        fontWeight: 700,
        height: '50px',
      }"
    >
      <el-table-column type="index" label="序号" width="55" align="center" />

      <el-table-column prop="equipCode" label="设备编号" align="center" />
      <el-table-column
        prop="equipName"
        label="设备名称"
        show-overflow-tooltip
        align="center"
      />
      <el-table-column prop="ip" label="设备IP" align="center" />
      <el-table-column prop="railWayName" label="设备型号" align="center" />
      <el-table-column prop="siteName" label="设备位置" align="center" />
      <el-table-column
        prop="action"
        label="操作"
        show-overflow-tooltip
        align="center"
      >
        <template slot-scope="{ row }">
          <el-link type="primary" :underline="false" @click="handleView(row)"
            >添加</el-link
          >
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          equipCode: "123456",
          equipName: "123456",
          ip: "123456",
          railWayName: "123456",
          siteName: "123456",
        },
        {
          equipCode: "123456",
          equipName: "123456",
          ip: "123456",
          railWayName: "123456",
        },
      ],
    };
  },
  methods: {
    tableRowClassName({ row, rowIndex }) {
      return rowIndex % 2 === 0 ? "" : "single-row";
    },
  },
};
</script>
<style lang="scss" scoped>
.statistics-table {
  .single-row {
    background: #f1f6ff;
  }
  td {
    padding: 5px !important;
  }
}
</style>