<script setup>
import { reactive, ref, toRefs } from "vue";

const queryRef = ref(null);
const formRef = ref(null);
const tableData = ref([]);
const total = ref(0);
const loading = ref(false);
const data = reactive({
  queryParams: {
    pageNum: 1,
    pageSize: 10,
  },
});
const { queryParams } = toRefs(data);

/**
 * 获取列表数据
 */
const getList = () => {};

const handleQuery = () => {
  queryParams.value.pageNum = 1;
  getList();
};

/**
 * 重置查询条件
 */
const resetQuery = () => {
  queryRef.value.resetFields();
  handleQuery();
};

/**
 * 删除指定行
 * @param id
 */
const handleDelete = (id) => {};
</script>

<template>
  <div class="app-container">
    <el-form ref="queryRef" :model="queryParams" inline>
      <el-form-item label="订单号">
        <el-input v-model="queryParams.orderNo"></el-input>
      </el-form-item>
      <el-form-item label="时间段">
        <el-input v-model="queryParams.timeRange"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="getList">查询</el-button>
        <el-button @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-table size="large" :data="tableData">
      <el-table-column label="Name" prop="name" />
      <el-table-column label="Age" prop="age" />
      <el-table-column label="Address" prop="address" />
      <el-table-column label="操作">
        <template #default="{ row }">
          <el-button type="text" @click="handleDelete(row.id)"
            >Delete</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total > 0"
      v-model:limit="queryParams.pageSize"
      v-model:page="queryParams.pageNum"
      :total="total"
      @pagination="getList"
    />
  </div>
</template>

<style lang="scss" scoped>
//:deep(.el-table--large) {
//font-size: 18px;
//th {
//font-size: 18px;
//}
//}
</style>
