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: 'rangeName',
    width:150,
   },
   {
    title: '范围说明',
    align:"left",
    dataIndex: 'rangeDesc',
    width:250,
   },
   {
    title: '更新时间',
    align:"left",
    dataIndex: 'updatedTime',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
    width:140,
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "范围名称",
      field: 'rangeName',
      component: 'Input',
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '范围名称',
    field: 'rangeName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入范围名称!'},
          ];
     },
  },
  {
    label: '范围说明',
    field: 'rangeDesc',
    component: 'InputTextArea',
    componentProps: {
      rows: 5
    }
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



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