import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
    {
    title: '记工日期',
    align:"center",
    dataIndex: 'workDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '工作类型',
    align:"center",
    dataIndex: 'type_dictText'
   },
   {
    title: '上班时长',
    align:"center",
    dataIndex: 'worktime'
   },
   {
    title: '加班时长',
    align:"center",
    dataIndex: 'overtime'
   },
   {
    title: '工资',
    align:"center",
    dataIndex: 'salary'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remarks',
    slots: { customRender: 'htmlSlot' },
   },
   {
    title: '关联账本id',
    align:"center",
    dataIndex: 'notebookId_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "工作类型",
      field: "type",
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"work_type"
      },
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '记工日期',
    field: 'workDate',
    component: 'DatePicker',
  },
  {
    label: '工作类型',
    field: 'type',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"work_type"
     },
  },
  {
    label: '上班时长',
    field: 'worktime',
    component: 'Input',
  },
  {
    label: '加班时长',
    field: 'overtime',
    component: 'Input',
  },
  {
    label: '工资',
    field: 'salary',
    component: 'InputNumber',
  },
  {
    label: '备注',
    field: 'remarks',
    component: 'JCodeEditor', //TODO String后缀暂未添加
  },
  {
    label: '关联账本id',
    field: 'notebookId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"employ_notebook,title,id"
     },
  },
];
