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: 'screenName'
  },
  {
    title: '微博用户性别',
    align: "center",
    dataIndex: 'gender'
  },
  {
    title: '微博数',
    align: "center",
    dataIndex: 'statusesCount'
  },
  {
    title: '粉丝数',
    align: "center",
    dataIndex: 'followersCount'
  },
  {
    title: '关注数',
    align: "center",
    dataIndex: 'followCount'
  },
  {
    title: '注册时间',
    align: "center",
    dataIndex: 'registrationTime'
  },
  {
    title: '阳光信用',
    align: "center",
    dataIndex: 'sunshine'
  },
  {
    title: '生日',
    align: "center",
    dataIndex: 'birthday'
  },
  {
    title: '所在地',
    align: "center",
    dataIndex: 'location'
  },
  {
    title: '教育经历',
    align: "center",
    dataIndex: 'education'
  },
  {
    title: '公司',
    align: "center",
    dataIndex: 'company'
  },
  {
    title: '微博简介',
    align: "center",
    dataIndex: 'description'
  },
  {
    title: '微博主页',
    align: "center",
    dataIndex: 'profileUrl'
  },
  {
    title: '微博头像url',
    align: "center",
    dataIndex: 'profileImageUrl',
    customRender: render.renderImage,
  },
  {
    title: '微博高清头像url',
    align: "center",
    dataIndex: 'avatarHd',
    customRender: render.renderImage,
  },
  {
    title: '微博等级',
    align: "center",
    dataIndex: 'urank'
  },
  {
    title: '微博会员等级',
    align: "center",
    dataIndex: 'mbrank'
  },
  {
    title: '微博是否认证',
    align: "center",
    dataIndex: 'verified'
  },
  {
    title: '微博认证类型',
    align: "center",
    dataIndex: 'verifiedType'
  },
  {
    title: '微博认证信息',
    align: "center",
    dataIndex: 'verifiedReason'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "微博用户昵称",
    field: 'screenName',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "微博用户性别",
    field: 'gender',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "微博数",
    field: 'statusesCount',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "粉丝数",
    field: 'followersCount',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "关注数",
    field: 'followCount',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "注册时间",
    field: 'registrationTime',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "阳光信用",
    field: 'sunshine',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "生日",
    field: 'birthday',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "所在地",
    field: 'location',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "教育经历",
    field: 'education',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "公司",
    field: 'company',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "微博简介",
    field: 'description',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "微博主页",
    field: 'profileUrl',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "微博头像url",
    field: 'profileImageUrl',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "微博高清头像url",
    field: 'avatarHd',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "微博等级",
    field: 'urank',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "微博会员等级",
    field: 'mbrank',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "微博是否认证",
    field: 'verified',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "微博认证类型",
    field: 'verifiedType',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "微博认证信息",
    field: 'verifiedReason',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '微博用户昵称',
    field: 'screenName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入微博用户昵称!'},
             ];
    },
  },
  {
    label: '微博用户性别',
    field: 'gender',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入微博用户性别!'},
             ];
    },
  },
  {
    label: '微博数',
    field: 'statusesCount',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入微博数!'},
             ];
    },
  },
  {
    label: '粉丝数',
    field: 'followersCount',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入粉丝数!'},
             ];
    },
  },
  {
    label: '关注数',
    field: 'followCount',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入关注数!'},
             ];
    },
  },
  {
    label: '注册时间',
    field: 'registrationTime',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入注册时间!'},
             ];
    },
  },
  {
    label: '阳光信用',
    field: 'sunshine',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入阳光信用!'},
             ];
    },
  },
  {
    label: '生日',
    field: 'birthday',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入生日!'},
             ];
    },
  },
  {
    label: '所在地',
    field: 'location',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入所在地!'},
             ];
    },
  },
  {
    label: '教育经历',
    field: 'education',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入教育经历!'},
             ];
    },
  },
  {
    label: '公司',
    field: 'company',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入公司!'},
             ];
    },
  },
  {
    label: '微博简介',
    field: 'description',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入微博简介!'},
             ];
    },
  },
  {
    label: '微博主页',
    field: 'profileUrl',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入微博主页!'},
             ];
    },
  },
  {
    label: '微博头像url',
    field: 'profileImageUrl',
    component: 'JImageUpload',
    componentProps:{
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入微博头像url!'},
             ];
    },
  },
  {
    label: '微博高清头像url',
    field: 'avatarHd',
    component: 'JImageUpload',
    componentProps:{
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入微博高清头像url!'},
             ];
    },
  },
  {
    label: '微博等级',
    field: 'urank',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入微博等级!'},
             ];
    },
  },
  {
    label: '微博会员等级',
    field: 'mbrank',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入微博会员等级!'},
             ];
    },
  },
  {
    label: '微博是否认证',
    field: 'verified',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入微博是否认证!'},
             ];
    },
  },
  {
    label: '微博认证类型',
    field: 'verifiedType',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入微博认证类型!'},
             ];
    },
  },
  {
    label: '微博认证信息',
    field: 'verifiedReason',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入微博认证信息!'},
             ];
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
