<script setup lang="ts">
import type { VbenFormProps } from '@vben/common-ui';

import type { VxeGridProps } from '#/adapter/vxe-table';

import { onMounted, ref } from 'vue';

import { Page } from '@vben/common-ui';

import { useVbenVxeGrid } from '#/adapter/vxe-table';

// 创建响应式的表单选项
const formOptions = ref<VbenFormProps>({
  commonConfig: {
    labelWidth: 80,
    componentProps: {
      allowClear: true,
    },
  },
  schema: [],
  wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-4',
});

const gridOptions: VxeGridProps = {
  checkboxConfig: {
    highlight: true,
    reserve: true,
    trigger: 'default',
  },
  columns: [],
  size: 'medium',
  height: 'auto',
  proxyConfig: {
    ajax: {
      query: async ({ page }, formValues = {}) => {
        return {
          items: [],
          total: 0,
        };
      },
    },
  },
  rowConfig: {
    keyField: 'id',
  },
  toolbarConfig: {
    custom: true,
    refresh: true,
    zoom: true,
  },
  id: 'system-infoEntry-connectInfo-index',
};

const [BasicTable] = useVbenVxeGrid({
  formOptions: formOptions.value,
  gridOptions,
});

onMounted(() => {
  // 页面加载时的初始化逻辑
});
</script>

<template>
  <Page :auto-content-height="true">
    <BasicTable table-title="后续再说">
      <template #toolbar-tools>
        <!-- 工具栏按钮 -->
      </template>
    </BasicTable>
  </Page>
</template>

<style scoped lang="scss">
:deep(.el-tooltip__trigger:focus) {
  outline: none;
}
</style>
