<template>
  <section class="app-container">
    <el-row>
      <el-col :span="4">
        <div>地区</div>
      </el-col>
      <el-col :span="20">
        <el-form :inline="true" size="small">
          <el-form-item style="width: 130px">
            <el-select v-model="value" clearable placeholder="产品名称">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item style="width: 130px">
            <el-select v-model="value" clearable placeholder="节点">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item style="width: 130px">
            <el-select v-model="value" clearable placeholder="所属客户">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item style="width: 130px">
            <el-select v-model="value" clearable placeholder="所属项目">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item style="width: 130px">
            <el-input v-model="input" placeholder="请输入设备SN" />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search">搜索</el-button>
            <el-button icon="el-icon-refresh">重置</el-button>
          </el-form-item>
        </el-form>
        <el-row>
          <el-button size="small">批量升级</el-button>
          <el-button size="small">增加</el-button>
          <el-button size="small">删除</el-button>
          <el-button size="small">修改</el-button>
        </el-row>
          <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
            @selection-change="handleSelectionChange">
            <el-table-column align="center" type="selection" width="55">
            </el-table-column>
            <el-table-column align="center" prop="nodeId" label="节点SN">
            </el-table-column>
            <el-table-column align="center" prop="deviceId" label="设备SN">
            </el-table-column>
            <el-table-column align="center" prop="productName" label="产品名称">
            </el-table-column>
            <el-table-column align="center" prop="userName" label="所属客户">
            </el-table-column>
            <el-table-column align="center" prop="projectName" label="所属项目">
            </el-table-column>
            <el-table-column align="center" prop="nowVersion" label="当前软件版本">
            </el-table-column>
            <el-table-column align="center" prop="version" label="可升级软件版本">
            </el-table-column>
            <el-table-column align="center" prop="onUpdateTime" label="上次升级时间">
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template>
                <el-button size="mini" type="text" >
                  升级
                </el-button>
              </template>
            </el-table-column>
          </el-table>
        <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
          @pagination="getList" />
      </el-col>
    </el-row>
  </section>
</template>

<script>
import { list } from "@/api/firmware/firmwareupdate";
export default {
  name: "Uplist",
  data () {
    return {
      value: '',
      options: '',
      input: '',
      // 表格数据
      tableData: null,
      // 总条数
      total: 0,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
    }
  },
  created () {
    this.getList();
  },
  methods: {
    handleSelectionChange () { },
    getList () {
      list(this.queryParams).then((response) => {
        this.tableData = response.rows;
        this.total = response.total;
      });
    },
    handleUpdate () { },
  }

}
</script>

<style>
</style>