<template>
  <div class='' style="padding:10px 20px 20px 20px">
    <!-- 表格start -->
    <el-table
      :data='tableData'
      border
      stripe
      :header-cell-style='headClass'
      :cell-style='cellStyle'
    >
      <el-table-column fixed prop='stationName' label='站点名称' width=''>
      </el-table-column>
      <el-table-column prop='stationStatus' label='状态' width=''>
        <template #default>
          <el-avatar class='status'></el-avatar>
        </template>
      </el-table-column>
      <el-table-column prop='deviceName' label='设备名称' width=''>
      </el-table-column>
      <el-table-column prop='siteNo' label='编号' width=''> </el-table-column>
      <el-table-column prop='eddy' label='额定电压' width=''> </el-table-column>
      <el-table-column prop='eddl' label='额定电流' width=''> </el-table-column>
     
      
    </el-table>
    <!-- 表格end -->
  </div>
</template>

<script>
export default {
  name: 'workTable',
  // computed: {
  //   ...mapGetters(['name']),
  // },

  data() {
    return {
      showDialog: false,

      input: '请输入站点名称',
      tableData: [
        {
          stationName: '测试站点1',
          stationStatus: '~',
          deviceName: '电力监测设备',
          siteNo: 'cssb1',
          eddy: '10',
          eddl: '12',
          dlfzl: '80%',
        },
        {
          stationName: '测试站点1',
          stationStatus: '~',
          deviceName: '视频监测设备',
          siteNo: 'cssb1',
          eddy: '10',
          eddl: '12',
          dlfzl: '80%',
        },
        {
          stationName: '测试站点1',
          stationStatus: '~',
          deviceName: '电力监测设备',
          siteNo: 'spjcsdb1',
          eddy: '10',
          eddl: '12',
          dlfzl: '80%',
        },
        {
          stationName: '测试站点1',
          stationStatus: '~',
          deviceName: '电力监测设备',
          siteNo: 'cssb1',
          eddy: '10',
          eddl: '12',
          dlfzl: '80%',
        },
        {
          stationName: '测试站点1',
          stationStatus: '~',
          deviceName: '电力监测设备',
          siteNo: 'cssb1',
          eddy: '10',
          eddl: '12',
          dlfzl: '80%',
        },
      ],
    };
  },
  methods: {
    goBack() {
      this.$router.replace('/stationManage/index');
    },
    // 表头样式设置
    headClass() {
      return 'background:#FAFAFA;';
    },

    //自定义列样式
    cellStyle({ row, column, rowIndex, columnIndex }) {
      row, column, rowIndex
      if (columnIndex === 1) {
        return `color:#04F21C`;
      } else {
        return '';
      }
    },
    //查看
     handleClick(row) {
         alert('查看对应站点（页面跳转）')
        console.log(row);
      },

    // 添加操作
    addItem() {
      this.tableItem = {
        id: '',
        stationName: '',
        stationStatus: '',
        deviceName: '',
        siteList: [],
        done: '',
        guaZai: '',
      };
      this.dialogTitle = '新增';
      this.showDialog = true;
      this.$nextTick(() => {
        this.$refs['dialogComponent'].showDialog = true;
      });
    },
  },
};
</script>

<style lang='scss' scoped>
</style>
