<template>
  <div class="app-container">
    <el-form v-model="queryParams" :inline="true">
      <el-form-item label="父类设备类型id">
        <el-input placeholder="请输入父类设备类型id"></el-input>
      </el-form-item>
      <el-form-item label="巡检类型名称">
        <el-input placeholder="请输入巡检类型名称"></el-input>
      </el-form-item>
      <el-form-item label="巡视类型编码">
        <el-input placeholder="请输入巡视类型编码"></el-input>
      </el-form-item>
      <el-form-item label="层级">
        <el-input placeholder="请输入层级"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          @click="handleQuery"
          size="mini"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" @click="resetQuery" size="mini"
          >重置</el-button
        >
      </el-form-item>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          plain
          size="mini"
          @click="add"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" icon="el-icon-edit" plain size="mini"
          >修改</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" icon="el-icon-delete" plain size="mini"
          >删除</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button type="warning" icon="el-icon-download" plain size="mini"
          >导出</el-button
        >
      </el-col>
    </el-row>
    <el-table :data="tableData" style="width: 100%; margin-bottom: 20px">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="巡视类型id" prop="name" align="center" />
      <el-table-column label="父设备类型id" prop="name" align="center" />
      <el-table-column label="巡视类型名称" prop="name" align="center" />
      <el-table-column label="巡视类型编码" prop="name" align="center" />
      <el-table-column label="层级" prop="name" align="center" />
      <el-table-column label="备注" prop="name" align="center" />
      <el-table-column label="操作" align="center">
        <template slot-scope="scope">
          <el-button
            type="text"
            size="small"
            @click="handleEdit(scope.$index, scope.row)"
            >修改</el-button
          >
          <el-button
            type="text"
            size="small"
            @click="handleDelete(scope.$index, 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"
    />
    <el-dialog
      :title="title"
      :visible.sync="dialogVisible"
      width="30%"
      :before-close="handleClose"
    >
      <el-form v-model="dialogForm">
        <el-form-item label="父类设备类型id" label-width="110px">
          <el-input placeholder="请输入父类设备类型id"></el-input>
        </el-form-item>
        <el-form-item label="巡检类型名称" label-width="110px">
          <el-input placeholder="请输入巡检类型名称"></el-input>
        </el-form-item>
        <el-form-item label="巡视类型编码" label-width="110px">
          <el-input placeholder="请输入巡视类型编码"></el-input>
        </el-form-item>
        <el-form-item label="删除标志" label-width="110px">
          <el-input placeholder="请输入删除标志"></el-input>
        </el-form-item>
        <el-form-item label="层级" label-width="110px">
          <el-input placeholder="请输入层级"></el-input>
        </el-form-item>
        <el-form-item label="备注" label-width="110px">
          <el-input placeholder="请输入备注" type="textarea"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      queryParams: {},
      tableData: [
        {
          id: 1,
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          id: 2,
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄",
        },
        {
          id: 3,
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1519 弄",
        },
        {
          id: 4,
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1516 弄",
        },
      ],
      total: 10,
      dialogVisible: false,
      title: "添加巡检点预置位",
      dialogForm: {},
    };
  },
  mounted() {},
  methods: {
    add(){
        this.dialogVisible = true
    }
  },
};
</script>

<style scoped></style>
