import { BasicColumn, FormSchema } from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '序号',
    align:"left",
    dataIndex: 'seriNo',
    customRender:({text,record,index}) =>{
      return index+1
    },
    width:100,
   },
   {
    title: '适用对象名称',
    align:"left",
    dataIndex: 'applicableName',
    width:150,
   },
   {
    title: '适用对象说明',
    align:"left",
    dataIndex: 'applicableDesc',
    width:200,
   },
   {
    title: '更新时间',
    align:"left",
    dataIndex: 'updatedTime',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "适用对象名称",
      field: 'applicableName',
      component: 'Input',
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '适用对象名称',
    field: 'applicableName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入适用对象名称!'},
          ];
     },
  },
  {
    label: '适用对象说明',
    field: 'applicableDesc',
    component: 'InputTextArea',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}