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: '用户id',
    align:"center",
    dataIndex: 'userId'
   },
   {
    title: '收获详细地址',
    align:"center",
    dataIndex: 'address'
   },
   {
    title: '收货手机号',
    align:"center",
    dataIndex: 'phone'
   },
   {
    title: '城市',
    align:"center",
    dataIndex: 'city'
   },
   {
    title: '经度',
    align:"center",
    dataIndex: 'latitude'
   },
   {
    title: '纬度',
    align:"center",
    dataIndex: 'longitude'
   },
   {
    title: '是否默认地址 0非默认 1默认',
    align:"center",
    dataIndex: 'defaultFlag'
   },
   {
    title: '收货人',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '禁用0不禁用 1禁用',
    align:"center",
    dataIndex: 'isDisable'
   },
   {
    title: '删除标识0-正常,1-已删除',
    align:"center",
    dataIndex: 'delFlag'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户id',
    field: 'userId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入用户id!'},
          ];
     },
  },
  {
    label: '收获详细地址',
    field: 'address',
    component: 'Input',
  },
  {
    label: '收货手机号',
    field: 'phone',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入收货手机号!'},
          ];
     },
  },
  {
    label: '城市',
    field: 'city',
    component: 'Input',
  },
  {
    label: '经度',
    field: 'latitude',
    component: 'Input',
  },
  {
    label: '纬度',
    field: 'longitude',
    component: 'Input',
  },
  {
    label: '是否默认地址 0非默认 1默认',
    field: 'defaultFlag',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否默认地址 0非默认 1默认!'},
          ];
     },
  },
  {
    label: '收货人',
    field: 'name',
    component: 'Input',
  },
  {
    label: '禁用0不禁用 1禁用',
    field: 'isDisable',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入禁用0不禁用 1禁用!'},
          ];
     },
  },
  {
    label: '删除标识0-正常,1-已删除',
    field: 'delFlag',
    component: 'InputNumber',
  },
];
