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


export const querySchema: FormSchemaGetter = () => [
  
  {
    component: 'Input',
    fieldName: 'deptName',
    label: '部门名称',
  },
  {
    component: 'Input',
    fieldName: 'policeName',
    label: '人员姓名',
  },
  {
    fieldName: 'salaryYearMonth',
    label: '工资季度',
    component: 'DatePicker',
    componentProps : {
      picker: 'quarter',
      format: 'YYYY年第Q季度',
      valueFormat: 'YYYY年第Q季度',
    }
  },
];

// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
  { type: 'checkbox', width: 60 },
  
  {
    title: '人员姓名',
    field: 'policeName',
  },
  {
    title: '身份证号',
    field: 'idcard',
  },
  {
    title: '银行卡号',
    field: 'bankCard',
  },
  {
    title: '部门名称',
    field: 'deptName',
  },
  {
    title: '工资季度',
    field: 'salaryYearMonth',
  },
  {
    title: '包村差旅补助',
    field: 'villageSubsidy',
    cellRender: { name: 'CellAmount' }
  },
  // {
  //   title: '备注',
  //   field: 'remark',
  // },
  {
    field: 'action',
    fixed: 'right',
    slots: { default: 'action' },
    title: '操作',
    width: 180,
  },
];

export const modalSchema: FormSchemaGetter = () => [
  {
    label: 'ID',
    fieldName: 'id',
    component: 'Input',
    dependencies: {
      show: () => false,
      triggerFields: [''],
    },
  },
  
  {
    label: '部门名称',
    fieldName: 'deptName',
    component: 'Input',
    componentProps:{
      readonly: true,
	  bordered: false
    }
  },
  {
    label: '人员姓名',
    fieldName: 'policeName',
    component: 'Input',
    componentProps:{
      readonly: true,
	  bordered: false
    }
  },
  {
    label: '身份证号',
    fieldName: 'idcard',
    component: 'Input',
    componentProps:{
      readonly: true,
	  bordered: false
    }
  },
  {
    label: '银行卡号',
    fieldName: 'bankCard',
    component: 'Input',
  },
  
  {
    label: '工资季度',
    fieldName: 'salaryYearMonth',
    component: 'DatePicker',
    componentProps : {
      picker: 'quarter',
      format: 'YYYY年第Q季度',
      valueFormat: 'YYYY年第Q季度',
    }
  },
  {
    label: '包村差旅补助',
    fieldName: 'villageSubsidy',
    component: 'Input',
  },
  {
    label: '备注',
    fieldName: 'remark',
    component: 'Textarea',
  },
  
];
