import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
//列表数据
export const columns: BasicColumn[] = [
    {
    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: 'priceOrigin'
   },
   {
    title: '优惠价',
    align:"center",
    dataIndex: 'priceDiscount'
   },
   {
    title: '是否下架',
    align:"center",
    dataIndex: 'isDel_dictText'
   },
   {
    title: '关联活动id',
    align:"center",
    dataIndex: 'activityId_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '开始日期',
    field: 'startDate',
    component: 'DatePicker',
  },
  {
    label: '结束日期',
    field: 'endDate',
    component: 'DatePicker',
  },
  {
    label: '原价',
    field: 'priceOrigin',
    component: 'InputNumber',
  },
  {
    label: '优惠价',
    field: 'priceDiscount',
    component: 'InputNumber',
  },
  {
    label: '是否下架',
    field: 'isDel',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"is_true"
     },
  },
  {
    label: '关联活动id',
    field: 'activityId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"studytour_activity,title,id"
     },
  },
];
//子表单数据
//子表表格配置
export const studytourDatePriceColumns: JVxeColumn[] = [
    {
      title: '年龄段id',
      key: 'periodId',
      type: JVxeTypes.select,
      options:[],
      dictCode:"studytour_period,title,id",
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '单人价格',
      key: 'price',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '关联团期id',
      key: 'dateId',
      type: JVxeTypes.selectSearch,
      dictCode:"studytour_activity_date,id,id",
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]
