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: 'createTime'
   },
   {
    title: '用户昵称',
    align:"center",
    dataIndex: 'nickName'
   },
   {
    title: '用户头像',
    align:"center",
    dataIndex: 'headImage',
    customRender:render.renderAvatar,
   },
   {
    title: '手机号码',
    align:"center",
    dataIndex: 'phone'
   },
   {
    title: '小程序标识',
    align:"center",
    dataIndex: 'appletOpenid'
   },
   {
    title: '直接邀请人',
    align:"center",
    dataIndex: 'shareId_dictText'
   },
   {
    title: '间接邀请人',
    align:"center",
    dataIndex: 'vid_dictText'
   },
   {
    title: '用户角色',
    align:"center",
    dataIndex: 'isPay_dictText'
   },
   {
    title: '微信号',
    align:"center",
    dataIndex: 'wxCode'
   },
   {
    title: '代理商到期时间',
    align:"center",
    dataIndex: 'endTime'
   },
   {
    title: '邀请码',
    align:"center",
    dataIndex: 'intentionCode'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "用户昵称",
      field: "nickName",
      component: 'Input',
      colProps: {span: 6},
 	},
	{
      label: "间接邀请人",
      field: "vid",
      component: 'JSearchSelect',
      componentProps:{
         dict:"han_hai_member,nick_name,id"
      },
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户昵称',
    field: 'nickName',
    component: 'Input',
  },
  {
    label: '用户头像',
    field: 'headImage',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '手机号码',
    field: 'phone',
    component: 'Input',
  },
  {
    label: '小程序标识',
    field: 'appletOpenid',
    component: 'Input',
  },
  {
    label: '直接邀请人',
    field: 'shareId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"han_hai_member,nick_name,id"
    },
  },
  {
    label: '间接邀请人',
    field: 'vid',
    component: 'JSearchSelect',
    componentProps:{
       dict:"han_hai_member,nick_name,id"
    },
  },
  {
    label: '用户角色',
    field: 'isPay',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"member_role"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入用户角色!'},
          ];
     },
  },
  {
    label: '微信号',
    field: 'wxCode',
    component: 'Input',
  },
  {
    label: '代理商到期时间',
    field: 'endTime',
    component: 'Input',
  },
  {
    label: '邀请码',
    field: 'intentionCode',
    component: 'Input',
  },
];
