import { BasicColumn, FormSchema } from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '活动编号',
    align:"left",
    dataIndex: 'caNo',
    width:100,
   },
   {
    title: '控制活动名称',
    align:"left",
    dataIndex: 'caName',
    width:150,
   },
   {
    title: '所属领域名称',
    align:"left",
    dataIndex: 'domainName',
    width:200,
   },
   {
    title: '标签',
    align: "left",
    dataIndex: 'lableNameList',
    width:200,
   },
   {
    title: '更新时间',
    align:"left",
    dataIndex: 'updatedTime',
    width:140,
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "控制活动",
      field: 'caName',
      component: 'Input',
      colProps: {span: 6},
 	},
	{
      label: "所属领域",
      field: 'domainCodeMore',
      component: 'Input',
      colProps: {span: 6},
 	},
   {
    label: "标签",
    field: 'lableName',
    component: 'Input',
    colProps: {span: 6},
 },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '控制活动编号',
    field: 'caNo',
    dynamicDisabled: true,
    component: 'Input',
    colProps: {lg: 12},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '控制活动名称',
    field: 'caName',
    component: 'Input',
    colProps: {lg: 12},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
    dynamicRules: ({model,schema}) => {
      return [
             { required: true, message: '请输入控制活动名称!'},
      ];
    },
  },
  {
    label: '所属领域',
    field: 'domainCode',
    component: 'JCascaderDomain',
    componentProps: {
      dict: "st_domain,domain_name,domain_code",
      pidField: "upper_domain_code",
      pidValue:"0",
      hasChildField:"has_child",
      maxHeight: '165px'
    },
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 3},},wrapperCol:{xs: {span: 24},sm: {span: 21},}},
    dynamicRules: ({model,schema}) => {
      return [
             { required: true, message: '请选择所属领域!'},
      ];
    },
  },
  {
    label: '标签',
    field: 'lableList',
    component: 'StSelectLable',//'JSelectUser',//
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 3},},wrapperCol:{xs: {span: 24},sm: {span: 21},}},
    dynamicRules: ({model,schema}) => {
      return [
             { required: true, message: '请选择标签!'},
      ];
    },
  },
  {
    label: '控制活动说明',
    field: 'caDesc',
    component: 'InputTextArea',
    componentProps:{
      rows: 4
    },
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 3},},wrapperCol:{xs: {span: 24},sm: {span: 21},}},
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



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