<template>
  <div id="app">
    <el-container class="container">
      <el-header>
        <h1>监测数据管理</h1>
      </el-header>
      <el-main>
        <el-table
          :data="tableData"
          style="width: 100%">
          <el-table-column
            label="设备编号"
            width="180">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.deviceId }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="设备名称"
            width="180">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.deviceName }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="所属企业"
            width="180">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.companyName }}</span>
            </template>
          </el-table-column>
          // 设备编号
          <el-table-column
            label="设备启动日期"
            width="180">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.deviceStartDate }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="设备数据单位"
            width="180">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.deviceUnit }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="所属企业id"
            width="180">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.companyId}}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="所属企业名称"
            width="180">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.companyName}}</span>
            </template>
          </el-table-column>
<!--          <el-table-column label="操作">-->
<!--            <template slot-scope="scope">-->
<!--              <el-button type="primary" icon="el-icon-view" circle @click="handleView(scope.$index, scope.row)"></el-button>-->
<!--              <el-button type="primary" icon="el-icon-edit" circle @click="handleEdit(scope.$index, scope.row)"></el-button>-->
<!--              <el-button type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.$index, scope.row)"></el-button>-->
<!--            </template>-->
<!--          </el-table-column>-->
        </el-table>
      </el-main>
    </el-container>
  </div>
</template>
<script>

export default {

  data() {
    return {
      tableData: []
    }
  },
  methods: {
    handleView(index, row) {
      console.log(index, row)
    },
    handleEdit(index, row) {
      console.log(index, row)
    },
    handleDelete(index, row) {
      console.log(index, row)
    },
    test() {
      this.$get('/demp/info/deviceInfo/list').then((r) => {
        console.log(r.data.data.rows)
        this.tableData = r.data.data.rows
      })
    }
  },
  created() {
    this.test()
  }
}
</script>
<style>
h1{
  text-align: center;
}

</style>
