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: 'itemName',
    title: '考核项',
    minWidth: 150,
  },
  {
    field: 'standardScore',
    title: '分项（分）',
    minWidth: 120,
  },
  {
    field: 'description',
    title: '说明',
    minWidth: 200,
  },
  {
    field: 'action',
    fixed: 'right',
    slots: { default: 'action' },
    title: '操作',
    width: 150,
  },
];

export const drawerFormSchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    dependencies: {
      show: () => false,
      triggerFields: [''],
    },
    fieldName: 'id',
  },
  {
    component: 'Input',
    fieldName: 'itemName',
    label: '考核项',
    componentProps: {
      placeholder: '请输入考核项',
      maxlength: 100,
    },
    rules: 'required',
  },
  {
    component: 'InputNumber',
    fieldName: 'standardScore',
    label: '分项（分）',
    componentProps: {
      placeholder: '请输入分值',
      min: 0,
      max: 100,
      step: 1,
      style: {
        width: '100%',
      },
    },
    rules: 'required',
  },
  {
    component: 'Input',
    fieldName: 'description',
    label: '说明',
    componentProps: {
      placeholder: '请输入说明',
      maxlength: 200,
      type: 'textarea',
      rows: 3,
    },
  },
];


