<template>
  <div class="app-container">
    <el-form v-model="queryParams" :inline="true">
      <el-form-item label="算法子类型名称" label-width="120px">
        <el-input placeholder="请输入算法子类型名称"></el-input>
      </el-form-item>
      <el-form-item label="创建时间" label-width="80px">
        <el-date-picker v-model="value1" type="date" placeholder="选择日期">
        </el-date-picker>
      </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 prop="date" label="算法子类型id" align="center">
      </el-table-column>
      <el-table-column prop="name" label="算法类型名称" align="center">
      </el-table-column>
      <el-table-column prop="name" label="算法子类型编码" align="center">
      </el-table-column>
      <el-table-column prop="name" label="算法子类型名称" align="center">
      </el-table-column>
      <el-table-column prop="name" label="正常范围下限" align="center">
      </el-table-column>
      <el-table-column prop="name" label="正常范围上限" align="center">
      </el-table-column>
      <el-table-column prop="address" label="操作" width="180" 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="算法主类型" label-width="110px">
          <el-select v-model="value" placeholder="请选择">
            <el-option label="item.label" value="item.value"> </el-option>
          </el-select>
        </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-switch
            v-model="value"
            active-color="#13ce66"
            inactive-color="#eee"
          >
          </el-switch>
        </el-form-item>
        <el-form-item label="下限标识" label-width="110px">
          <el-switch
            v-model="value"
            active-color="#13ce66"
            inactive-color="#eee"
          >
          </el-switch>
        </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,
      title: "添加算法附表",
      dialogVisible: false,
    };
  },
  methods: {
    add() {
      this.dialogVisible = true;
    },
    handleEdit() {
      this.dialogVisible = true;
    },
  },
};
</script>

<style scoped></style>
