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

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

/**
 * 删除指定行
 * @param row
 */
const deleteRecord = (row) => {};

// 重置查询条件 resetQuery
const resetQuery = () => {
  queryRef.value.resetFields();
  handleQuery();
};
const handleQuery = () => {
  queryParams.value.pageNum = 1;
  getList();
};
</script>

<template>
  <el-form ref="queryRef" :model="queryParams" label-width="80px">
    <!--    时间段查询-->
    <el-form-item label="时间段">
      <el-date-picker
        v-model="queryParams.timeRange"
        end-placeholder="结束日期"
        range-separator="至"
        start-placeholder="开始日期"
        type="datetimerange"
        value-format="YYYY-MM-dd"
      ></el-date-picker>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="handleQuery">查询</el-button>
      <el-button @click="resetQuery">重置</el-button>
    </el-form-item>
  </el-form>

  <!-- el-radio-group 状态切换, 已审批和待审批 -->
  <el-radio-group v-model="queryParams.status" style="width: 100%">
    <el-radio label="已审批" value="1" />
    <el-radio label="待审批" value="2" />
  </el-radio-group>
  <!--  用h2 展示提现金额,加粗字体-->
  <h2 style="font-weight: bold">提现金额 : {{ 312312 }}¥</h2>

  <!--提现记录表格 element-plus -->
  <el-table size="large" :data="tableData" class="withdraw-table">
    <el-table-column
      label="提现金额"
      prop="amount"
      width="150"
    ></el-table-column>
    <el-table-column label="提现类型" prop="type" width="150"></el-table-column>
    <el-table-column
      label="提现状态"
      prop="status"
      width="150"
    ></el-table-column>
    <el-table-column label="提现时间" prop="time" width="150"></el-table-column>
    <el-table-column label="操作" prop="action" width="150">
      <template #default="{ row }">
        <!--删除-->
        <el-button type="text" @click="deleteRecord(row)">删除 </el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

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