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: 'image',
    customRender:render.renderAvatar,
   },
   {
    title: '跳转地址',
    align:"center",
    dataIndex: 'toUrl'
   },
   {
    title: '排序',
    align:"center",
    dataIndex: 'sort'
   },
   {
    title: '0 首页上方banner轮播 1 首页第二处 2首页第三处',
    align:"center",
    dataIndex: 'type_dictText'
   },
   {
    title: '是否删除 0否 1是',
    align:"center",
    dataIndex: 'isDisable_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '图片',
    field: 'image',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '跳转地址',
    field: 'toUrl',
    component: 'Input',
  },
  {
    label: '排序',
    field: 'sort',
    component: 'JPopup',
    componentProps: ({ formActionType }) => {
         const {setFieldsValue} = formActionType;
         return{
             setFieldsValue:setFieldsValue,
             code:"",
             fieldConfig:,
             multi:true,
         }
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入排序!'},
          ];
     },
  },
  {
    label: '0 首页上方banner轮播 1 首页第二处 2首页第三处',
    field: 'type',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"bannerType"
     },
  },
  {
    label: '是否删除 0否 1是',
    field: 'isDisable',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"is_disable"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否删除 0否 1是!'},
          ];
     },
  },
];
