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: 'msgCityId_dictText'
   },
   {
    title: '头像',
    align:"center",
    dataIndex: 'image',
    customRender:render.renderAvatar,
   },
   {
    title: '昵称',
    align:"center",
    dataIndex: 'title'
   },
   {
    title: '标签',
    align:"center",
    dataIndex: 'icon',
    customRender:render.renderAvatar,
   },
   {
    title: '微信用户',
    align:"center",
    dataIndex: 'userId_dictText'
   },
   {
    title: '级别',
    align:"center",
    dataIndex: 'level'
   },
   {
    title: '评分',
    align:"center",
    dataIndex: 'score'
   },
   {
    title: '个人介绍',
    align:"center",
    dataIndex: 'notes'
   },
   {
    title: '官方认证',
    align:"center",
    dataIndex: 'isVip'
   },
   {
    title: '体重',
    align:"center",
    dataIndex: 'kg'
   },
   {
    title: '身高',
    align:"center",
    dataIndex: 'cm'
   },
   {
    title: '地区',
    align:"center",
    dataIndex: 'area'
   },
   {
    title: '城市',
    align:"center",
    dataIndex: 'city'
   },
   {
    title: '区县',
    align:"center",
    dataIndex: 'county'
   },
   {
    title: '实名',
    align:"center",
    dataIndex: 'realOk',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
     },
   },
   {
    title: '性别',
    align:"center",
    dataIndex: 'sex'
   },
   {
    title: '经验',
    align:"center",
    dataIndex: 'experience'
   },
   {
    title: '识别度',
    align:"center",
    dataIndex: 'isSb'
   },
   {
    title: '服务次数',
    align:"center",
    dataIndex: 'isFw'
   },
   {
    title: '收藏次数',
    align:"center",
    dataIndex: 'collectNum'
   },
   {
    title: '个人相册',
    align:"center",
    dataIndex: 'images',
    customRender:render.renderAvatar,
   },
   {
    title: '评价条数',
    align:"center",
    dataIndex: 'pinNum'
   },
   {
    title: '最早可预约时间',
    align:"center",
    dataIndex: 'useTime'
   },
   {
    title: '经度',
    align:"center",
    dataIndex: 'longitude'
   },
   {
    title: '多少公里内免费',
    align:"center",
    dataIndex: 'isKm'
   },
   {
    title: '纬度',
    align:"center",
    dataIndex: 'latitude'
   },
   {
    title: '是否可预约',
    align:"center",
    dataIndex: 'bookable',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
     },
   },
   {
    title: '免费出行',
    align:"center",
    dataIndex: 'isCx',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
     },
   },
   {
    title: '显示距离',
    align:"center",
    dataIndex: 'setKm'
   },
   {
    title: '运营号',
    align:"center",
    dataIndex: 'isTest'
   },
   {
    title: '距离显示开启',
    align:"center",
    dataIndex: 'setKmOpen',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
     },
   },
   {
    title: '健康证',
    align:"center",
    dataIndex: 'healthCertificate',
    customRender:render.renderAvatar,
   },
   {
    title: '营业证',
    align:"center",
    dataIndex: 'businessLicense',
    customRender:render.renderAvatar,
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "昵称",
      field: "title",
      component: 'Input',
      colProps: {span: 6},
 	},
	{
      label: "微信用户",
      field: "userId",
      component: 'JSearchSelect',
      componentProps:{
         dict:"han_hai_member,phone,id"
      },
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '关联城市',
    field: 'msgCityId',
    component: 'JTreeSelect',
    componentProps:{
        dict:"msg_city,name,id",
        pidValue:"0",
    },
  },
  {
    label: '头像',
    field: 'image',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '昵称',
    field: 'title',
    component: 'Input',
  },
  {
    label: '标签',
    field: 'icon',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '微信用户',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"han_hai_member,phone,id"
    },
  },
  {
    label: '级别',
    field: 'level',
    component: 'InputNumber',
  },
  {
    label: '评分',
    field: 'score',
    component: 'InputNumber',
  },
  {
    label: '个人介绍',
    field: 'notes',
    component: 'InputTextArea',//TODO 注意string转换问题
  },
  {
    label: '官方认证',
    field: 'isVip',
    component: 'Input',
  },
  {
    label: '体重',
    field: 'kg',
    component: 'Input',
  },
  {
    label: '身高',
    field: 'cm',
    component: 'Input',
  },
  {
    label: '地区',
    field: 'area',
    component: 'Input',
  },
  {
    label: '城市',
    field: 'city',
    component: 'Input',
  },
  {
    label: '区县',
    field: 'county',
    component: 'Input',
  },
  {
    label: '实名',
    field: 'realOk',
     component: 'JSwitch',
     componentProps:{
     },
  },
  {
    label: '性别',
    field: 'sex',
    component: 'Input',
  },
  {
    label: '经验',
    field: 'experience',
    component: 'Input',
  },
  {
    label: '识别度',
    field: 'isSb',
    component: 'InputNumber',
  },
  {
    label: '服务次数',
    field: 'isFw',
    component: 'InputNumber',
  },
  {
    label: '收藏次数',
    field: 'collectNum',
    component: 'InputNumber',
  },
  {
    label: '个人相册',
    field: 'images',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '评价条数',
    field: 'pinNum',
    component: 'InputNumber',
  },
  {
    label: '最早可预约时间',
    field: 'useTime',
    component: 'Input',
  },
  {
    label: '经度',
    field: 'longitude',
    component: 'Input',
  },
  {
    label: '多少公里内免费',
    field: 'isKm',
    component: 'InputNumber',
  },
  {
    label: '纬度',
    field: 'latitude',
    component: 'Input',
  },
  {
    label: '是否可预约',
    field: 'bookable',
     component: 'JSwitch',
     componentProps:{
     },
  },
  {
    label: '免费出行',
    field: 'isCx',
     component: 'JSwitch',
     componentProps:{
     },
  },
  {
    label: '显示距离',
    field: 'setKm',
    component: 'InputNumber',
  },
  {
    label: '运营号',
    field: 'isTest',
    component: 'InputNumber',
  },
  {
    label: '距离显示开启',
    field: 'setKmOpen',
     component: 'JSwitch',
     componentProps:{
     },
  },
  {
    label: '健康证',
    field: 'healthCertificate',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '营业证',
    field: 'businessLicense',
     component: 'JImageUpload',
     componentProps:{
      },
  },
];
