<script>
import { list, item } from "@/api/system/table-template";
export default {
  name: "TableTemplateTable",
  data() {
    return {
      from: { input: "", select: "" },
      options: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶",
        },
        {
          value: "选项3",
          label: "蚵仔煎",
        },
        {
          value: "选项4",
          label: "龙须面",
        },
        {
          value: "选项5",
          label: "北京烤鸭",
        },
      ],
      tableData: [
        {
          date: "2016-05-022016-05-022016-05-022016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1519 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1516 弄",
        },
      ],
    };
  },
  methods: {
    duanduan(value) {
      this.$message(value + "duanduan");
    },
  },
};
</script>

<template>
  <el-container class="table-template-table">
    <el-header>
      <div class="table-header-top">
        <span>查询条件</span>
        <div>
          <el-select v-model="from.select" size="small" placeholder="请选择">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
          <el-input
            v-model="from.input"
            size="small"
            placeholder="请输入内容"
            :readonly="isSearching"
            @change="onSearch"
          >
            <template #suffix>
              <i
                v-show="isSearching"
                class="el-input__icon el-icon-loading"
              ></i>
              <i
                v-show="!isSearching"
                class="el-input__icon el-icon-search"
              ></i>
            </template>
          </el-input>
          <el-button size="small">搜索</el-button>
          <el-button size="small">重置</el-button>
        </div>
      </div>
      <div class="table-header-bottom">
        <el-button size="small">新增</el-button>
        <el-button size="small">导入</el-button>
        <el-button size="small">导出</el-button>
      </div>
    </el-header>
    <el-main>
      <el-table :data="tableData">
        <el-table-column
          type="selection"
          width="55"
          fixed="left"
          align="center"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column prop="date" label="日期" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="name" label="姓名" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="address" label="地址" show-overflow-tooltip>
        </el-table-column>
      </el-table>
    </el-main>
    <el-footer>
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage4"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="100"
        layout="total, prev, pager, next, sizes, jumper"
        :total="400"
      >
      </el-pagination>
    </el-footer>
  </el-container>
</template>

<style scoped>
.table-template-table .el-header {
  height: fit-content !important;
  padding-top: var(--padding);
  padding-bottom: var(--padding);
  border-bottom: 1px solid #dcdfe6;
}
.table-template-table .table-header-top {
  margin-bottom: var(--margin);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.table-template-table .table-header-top .el-select {
  width: 150px;
  margin-right: var(--margin);
}
.table-template-table .table-header-top .el-input {
  width: 250px;
  margin-right: var(--margin);
}
.table-template-table .el-main {
  padding: 0;
}
.table-template-table .el-main .el-table {
  width: 100%;
  height: 100%;
}
.table-template-table .el-footer {
  display: flex;
  justify-content: end;
  align-items: center;
}
</style>
