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: 'name'
   },
   {
    title: '手机号码',
    align:"center",
    dataIndex: 'phone'
   },
   {
    title: '开始日期',
    align:"center",
    dataIndex: 'startDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '结束日期',
    align:"center",
    dataIndex: 'endDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '活动天数',
    align:"center",
    dataIndex: 'dayNum'
   },
   {
    title: '原价',
    align:"center",
    dataIndex: 'priceOrigin'
   },
   {
    title: '优惠价',
    align:"center",
    dataIndex: 'priceDiscount'
   },
   {
    title: '优惠券优惠金额',
    align:"center",
    dataIndex: 'discount'
   },
   {
    title: '支付金额',
    align:"center",
    dataIndex: 'payAmount'
   },
   {
    title: '支付时间',
    align:"center",
    dataIndex: 'payTime'
   },
   {
    title: '关联优惠券id',
    align:"center",
    dataIndex: 'couponId'
   },
   {
    title: '发票类型',
    align:"center",
    dataIndex: 'receiptId_dictText'
   },
   {
    title: '订单状态',
    align:"center",
    dataIndex: 'status_dictText'
   },
   {
    title: '活动标题',
    align:"center",
    dataIndex: 'activityTitle'
   },
   {
    title: '活动简介',
    align:"center",
    dataIndex: 'activityBrief'
   },
   {
    title: '活动标签',
    align:"center",
    dataIndex: 'activityTag'
   },
   {
    title: '关联活动',
    align:"center",
    dataIndex: 'activityId_dictText'
   },
   {
    title: '关联用户',
    align:"center",
    dataIndex: 'userId_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '真实姓名',
    field: 'name',
    component: 'Input',
  },
  {
    label: '手机号码',
    field: 'phone',
    component: 'Input',
  },
  {
    label: '开始日期',
    field: 'startDate',
    component: 'DatePicker',
  },
  {
    label: '结束日期',
    field: 'endDate',
    component: 'DatePicker',
  },
  {
    label: '活动天数',
    field: 'dayNum',
    component: 'InputNumber',
  },
  {
    label: '原价',
    field: 'priceOrigin',
    component: 'InputNumber',
  },
  {
    label: '优惠价',
    field: 'priceDiscount',
    component: 'InputNumber',
  },
  {
    label: '优惠券优惠金额',
    field: 'discount',
    component: 'InputNumber',
  },
  {
    label: '支付金额',
    field: 'payAmount',
    component: 'InputNumber',
  },
  {
    label: '支付时间',
    field: 'payTime',
    component: 'Input',
  },
  {
    label: '关联优惠券id',
    field: 'couponId',
    component: 'Input',
  },
  {
    label: '发票类型',
    field: 'receiptId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"receipt_type"
     },
  },
  {
    label: '订单状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"order_status"
     },
  },
  {
    label: '活动标题',
    field: 'activityTitle',
    component: 'Input',
  },
  {
    label: '活动简介',
    field: 'activityBrief',
    component: 'Input',
  },
  {
    label: '活动标签',
    field: 'activityTag',
    component: 'Input',
  },
  {
    label: '关联活动',
    field: 'activityId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"studytour_activity,title,id"
    },
  },
  {
    label: '关联用户',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"han_hai_member,nick_name,id"
    },
  },
];
