<template>
  <PageWrapper dense contentFullHeight fixedHeight>
    <BasicTable @register="registerTable" isMenuTable>
      <template #toolbar> </template>
    </BasicTable>
  </PageWrapper>
</template>
<script lang="ts" setup>
  import { getProcessErrorPage } from '/@/api/workflow/delegate';
  import { BasicTable, useTable, FormSchema, BasicColumn } from '/@/components/Table';

  import { PageWrapper } from '/@/components/Page';
  import { useI18n } from '/@/hooks/web/useI18n';
  const { t } = useI18n();
  const configColumns: BasicColumn[] = [
    {
      title: t('流程名称'),
      dataIndex: 'processName',
      width: 180,
      resizable: true,
      sorter: {
        multiple: 1,
      },
    },
    {
      title: t('任务名称'),
      dataIndex: 'taskName',
      width: 180,
      resizable: true,
      sorter: {
        multiple: 1,
      },
    },
    {
      title: t('错误时间'),
      dataIndex: 'errorTime',
      width: 180,
      resizable: true,
      sorter: {
        multiple: 2,
      },
    },
    {
      title: t('错误信息'),
      dataIndex: 'errorMsg',
      width: 180,
      resizable: true,
      sorter: {
        multiple: 3,
      },
    },
  ];
  const searchFormSchema: FormSchema[] = [
    {
      field: 'keyword',
      label: t('关键字'),
      component: 'Input',
      colProps: { span: 8 },
      componentProps: {
        placeholder: t('请输入关键字'),
      },
    },
  ];
  const [registerTable] = useTable({
    title: t('流程异常分析列表'),
    api: getProcessErrorPage,
    columns: configColumns,
    formConfig: {
      rowProps: {
        gutter: 16,
      },
      schemas: searchFormSchema,
      showResetButton: false,
    },
    striped: false,
    useSearchForm: true,
    showTableSetting: true,
    tableSetting: {
      size: false,
    },
  });
</script>
