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",
    sorter: true,
    dataIndex: 'createTime'
   },
   {
    title: '昵称',
    align:"center",
    dataIndex: 'nickName'
   },
   {
    title: '用户头像',
    align:"center",
    dataIndex: 'headImage',
    customRender:render.renderAvatar,
   },
   {
    title: '手机号码',
    align:"center",
    sorter: true,
    dataIndex: 'phone'
   },
   {
    title: '公众号openid',
    align:"center",
    dataIndex: 'officialOpenid'
   },
   {
    title: '邀请人',
    align:"center",
    dataIndex: 'vid_dictText'
   },
   {
    title: '邀请时间',
    align:"center",
    dataIndex: 'vtime'
   },
   {
    title: '性别',
    align:"center",
    dataIndex: 'sex'
   },
   {
    title: '是否分销商',
    align:"center",
    dataIndex: 'isDai',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
     },
   },
];
//查询数据
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: '登录TOEKN',
    field: 'token',
    component: 'Input',
  },
  {
    label: '公众号openid',
    field: 'officialOpenid',
    component: 'Input',
  },
  {
    label: '邀请人',
    field: 'vid',
    component: 'JSearchSelect',
    componentProps:{
       dict:"han_hai_member,nick_name,id"
    },
  },
  {
    label: '邀请时间',
    field: 'vtime',
    component: 'Input',
  },
  {
    label: '性别',
    field: 'sex',
    component: 'Input',
  },
  {
    label: '是否分销商',
    field: 'isDai',
     component: 'JSwitch',
     componentProps:{
     },
  },
];
