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: 'type'
   },
   {
    title: '记账日期',
    align:"center",
    sorter: true,
    dataIndex: 'billDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '记账金额',
    align:"center",
    sorter: true,
    dataIndex: 'amount'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remarks',
    slots: { customRender: 'htmlSlot' },
   },
   {
    title: '关联账本id',
    align:"center",
    dataIndex: 'notebookId_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "账单类型",
      field: "type",
      component: 'Input',
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '账单类型',
    field: 'type',
    component: 'InputNumber',
  },
  {
    label: '记账日期',
    field: 'billDate',
    component: 'DatePicker',
  },
  {
    label: '记账金额',
    field: 'amount',
    component: 'InputNumber',
  },
  {
    label: '备注',
    field: 'remarks',
    component: 'JCodeEditor', //TODO String后缀暂未添加
  },
  {
    label: '关联账本id',
    field: 'notebookId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"employ_notebook,title,id"
     },
  },
];
