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

export const queryFormSchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    fieldName: 'name',
    label: '检查表单名称',
    componentProps: {
      placeholder: '请输入检查表单名称',
    },
  },
];

export const tableColumns: VxeGridProps['columns'] = [
  {
    type: 'checkbox',
    width: 80,
  },
  {
    field: 'name',
    title: '检查表单名称',
    minWidth: 180,
  },
  {
    field: 'createBy',
    title: '操作人',
    minWidth: 120,
  },
  {
    field: 'createTime',
    title: '操作时间',
    minWidth: 120,
  },
  {
    field: 'action',
    fixed: 'right',
    slots: { default: 'action' },
    title: '操作',
    width: 280,
  },
];

export const drawerFormSchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    dependencies: {
      show: () => false,
      triggerFields: [''],
    },
    fieldName: 'id',
  },
  {
    component: 'Input',
    fieldName: 'name',
    label: '检查表单名称',
    componentProps: {
      placeholder: '请输入检查表单名称',
      maxlength: 100,
    },
    rules: 'required',
  },
];
