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

import { getSyncChinaOrderLogList } from '../api';

export const gridOptions: VxeGridProps<any> = {
  columns: [
    { field: 'id', title: 'ID', width: 80 },
    { field: 'order_id', title: '订单ID', width: 100 },
    {
      field: 'is_success_txt',
      title: '结果',
      width: 90,
      slots: { default: 'is_success' },
    },
    { field: 'content_preview', title: '内容预览', minWidth: 260 },
    { field: 'created_at', title: '同步时间', width: 180 },
    { title: '操作', width: 90, fixed: 'right', slots: { default: 'action' } },
  ],
  keepSource: true,
  pagerConfig: {},
  proxyConfig: {
    ajax: {
      query: async ({ page }, formValues) =>
        getSyncChinaOrderLogList({
          page: page.currentPage,
          pageSize: page.pageSize,
          ...formValues,
        }),
    },
  },
  height: 'auto',
  toolbarConfig: { search: true, refresh: true, zoom: true },
};
