<template>
  <section class="app-container">
    <el-row>
      <el-form :inline="true" size="small">
        <el-form-item style="width: 130px">
          <el-radio v-model="radio" label="1" :inline="true">当前工单</el-radio>
        </el-form-item>
        <el-form-item style="width: 130px">
          <el-radio v-model="radio" label="2" :inline="true">当前工单</el-radio>
        </el-form-item>
        <el-form-item style="width: 130px">
          <el-select v-model="value" clearable>
            <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>
            <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>
            <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="请输入故障编码" />
        </el-form-item>
        <el-form-item style="width: 130px">
          <el-input v-model="input" placeholder="请输入业务类型" />
        </el-form-item>
        <el-form-item style="width: 130px">
          <el-input v-model="input" placeholder="请输入站址名称" />
        </el-form-item>
        <el-form-item style="width: 130px">
          <el-input v-model="input" placeholder="请输入设备名称" />
        </el-form-item>
      </el-form>
    </el-row>
    <el-row>
      <el-form :inline="true" size="small">
        <el-form-item style="width: 130px">
          <el-input placeholder="请输入设备编码" />
        </el-form-item>
        <el-form-item>
          <div class="block">
            <el-date-picker v-model="dateValue" type="daterange" range-separator="至">
            </el-date-picker>
          </div>
        </el-form-item>
      </el-form>
    </el-row>
    <el-row>
      <el-button type="primary" size="small" icon="el-icon-refresh-right">刷新</el-button>
      <el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button>
      <el-button type="primary" size="small" icon="el-icon-refresh-right" @click="resetQuery">重置</el-button>
      <el-button type="primary" size="small" icon="el-icon-refresh-right">一键接单</el-button>
    </el-row>
    <el-table :data="tableData" style="width: 100%" @selection-change="handleSelectionChange">
      <el-table-column align="center" type="selection" width="55">
      </el-table-column>
      <el-table-column align="center" prop="code" label="故障单编码">
      </el-table-column>
      <el-table-column align="center" prop="level" label="告警等级">
      </el-table-column>
      <el-table-column align="center" label="业务类型">
      </el-table-column>
      <el-table-column align="center" label="站址名称">
      </el-table-column>
      <el-table-column align="center" prop="name" label="设备名称">
      </el-table-column>
      <el-table-column align="center" label="设备编码">
      </el-table-column>
      <el-table-column align="center" label="告警状态">
      </el-table-column>
      <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改
          </el-button>
          <el-button class="text-danger" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</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-dialog title="提示" :visible.sync="open" width="500px" append-to-body>
      <span>这是一段信息</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="open = false">取 消</el-button>
        <el-button type="primary" @click="open = false">确 定</el-button>
      </span>
    </el-dialog>
  </section>
</template>

<script>
export default {
  name: 'monitorList',
  data () {
    return {
      radio: '1',
      options: '',
      value: '',
      input: '',
      open: false,
      dateValue: '',
      tableData: [
        {
          code: 'FS-157845-5446854-518',
          name: '锂电池组',
          level: '一级告警'
        }
      ],
      total: 1,
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
    }
  },
  methods: {
    handleQuery () { },
    resetQuery () { },
    handleSelectionChange () { },
    getList () { },
    handleUpdate () { this.open = true },
    handleDelete () {
      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$message({
          type: 'success',
          message: '删除成功!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
  }
}
</script>

<style>
</style>