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

export const queryFormSchema: FormSchemaGetter = () => [];

export const tableColumns: VxeGridProps['columns'] = [
  {
    type: 'checkbox',
    width: 80,
  },
  {
    field: 'assessmentItem',
    title: '考核项',
    minWidth: 150,
    align: 'center',
  },
  {
    field: 'score',
    title: '分项（分）',
    minWidth: 100,
    align: 'center',
  },
  {
    field: 'description',
    title: '说明',
    minWidth: 200,
    align: 'left',
  },
  {
    field: 'action',
    fixed: 'right',
    slots: { default: 'action' },
    title: '操作',
    width: 150,
    align: 'center',
  },
];

export const drawerFormSchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    dependencies: {
      show: () => false,
      triggerFields: [''],
    },
    fieldName: 'id',
  },
  {
    component: 'Input',
    fieldName: 'assessmentItem',
    label: '考核项',
    componentProps: {
      placeholder: '请输入考核项',
      maxlength: 100,
    },
    rules: 'required',
  },
  {
    component: 'InputNumber',
    fieldName: 'score',
    label: '分项（分）',
    componentProps: {
      placeholder: '请输入分数',
      min: 0,
      step: 0.1,
    },
    rules: 'required',
  },
  {
    component: 'Input',
    fieldName: 'description',
    label: '说明',
    componentProps: {
      placeholder: '请输入说明',
      type: 'textarea',
      rows: 3,
    },
  },
];

