<template>
  <div class="p-3">
      <div class="bg-fff flex1 ov-hd d-flex flex-cln">
          <div class="pd-16 pb-4 border-bottom">
              <div class="f-s-20 c-333 f-w-7 mb-16">套餐管理</div>
              <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="auto">
                  <el-form-item>
                      <el-button type="primary">新增套餐</el-button>
                  </el-form-item>
                  <el-form-item>
                      <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
                      <el-button icon="Refresh" @click="resetQuery">重置</el-button>
                  </el-form-item>
              </el-form>
          </div>
          <div class="flex1 ov-hd pd-16">

              <vxe-table :loading="loading" border :data="list" min-height="0" max-height="100%">
                  <!-- 序号 -->
                  <vxe-column type="seq" width="60" title="序号" align="center" />
              </vxe-table>
          </div>
          <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
      </div>
  </div>
</template>
<script setup name="Menus" lang="ts">
import { testPackageList } from '@/api/cdt/menus';
import { colNoData } from '@/utils/noData';
const queryParams = ref<any>({
  pageNum: 1,
  pageSize: 10,
});
const queryFormRef = ref<any>();
const loading = ref(false);
const total = ref(0);
const list = ref<any>([]);
const getList = async () => {
  loading.value = true;
  const res = await testPackageList(queryParams.value);
  if (!res || res.code !== 200) return;
  list.value = res.rows;
  total.value = res.total;
  loading.value = false;
};
const handleQuery = () => {
  queryParams.value.pageNum = 1;
  getList();
};
const resetQuery = () => {
  queryFormRef.value?.resetFields();
  handleQuery();
};
onMounted(() => {
  getList();
});
</script>
