<template>
  <section class="app-container">
    <el-row>
      <el-form :inline="true" size="small">
        <el-form-item>
          <el-input placeholder="请输入告警名称" v-model="input" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-input placeholder="请输入派单启动时限(分)" v-model="input" clearable></el-input>
        </el-form-item>
      </el-form>
    </el-row>
    <el-row>
      <el-button type="primary" size="small" icon="el-icon-plus" @click="handleAdd">增加</el-button>
      <el-button type="primary" size="small" icon="el-icon-delete" @click="handleDelete">删除</el-button>
      <el-button type="primary" size="small" icon="el-icon-edit" @click="handleUpdate">修改</el-button>
      <el-button type="primary" size="small" icon="el-icon-view">查看</el-button>
      <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-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="organization" label="应用组织">
      </el-table-column>
      <el-table-column align="center" prop="name" label="告警名称">
      </el-table-column>
      <el-table-column align="center" prop="time" label="派单启动时限(分)">
      </el-table-column>
      <el-table-column align="center" prop="starttime" label="开始时间点">
      </el-table-column>
      <el-table-column align="center" prop="endtime" label="结束时间点">
      </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="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 {
  data () {
    return {
      input: '',
      total: 1,
      title: "",
        open: false,
      tableData: [
        {
          organization: '1',
          name: '1',
          time: '1',
          starttime: '1',
          endtime: '1'
        }
      ],
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
    }
  },
  methods: {
    handleQuery () { },
    resetQuery () { },
    handleSelectionChange () { },
    getList () { },
    handleAdd () { this.open = true; this.title = "添加";},
    handleUpdate () { this.open = true; this.title = "修改";},
    handleDelete () {
      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$message({
          type: 'success',
          message: '删除成功!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
  }
}
</script>

<style>
</style>