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: 'title'
   },
   {
    title: '主图',
    align:"center",
    dataIndex: 'image',
    customRender:render.renderAvatar,
   },
   {
    title: '规格',
    align:"center",
    dataIndex: 'sku'
   },
   {
    title: '类型0体验1常规',
    align:"center",
    dataIndex: 'type'
   },
   {
    title: '价格',
    align:"center",
    dataIndex: 'price'
   },
   {
    title: '原价',
    align:"center",
    dataIndex: 'oldPrice'
   },
   {
    title: '限购数量',
    align:"center",
    dataIndex: 'num'
   },
   {
    title: '标签',
    align:"center",
    dataIndex: 'skuIcon'
   },
   {
    title: '分类标识',
    align:"center",
    dataIndex: 'classId_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '主图',
    field: 'image',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '规格',
    field: 'sku',
    component: 'Input',
  },
  {
    label: '类型0体验1常规',
    field: 'type',
    component: 'InputNumber',
  },
  {
    label: '价格',
    field: 'price',
    component: 'InputNumber',
  },
  {
    label: '原价',
    field: 'oldPrice',
    component: 'InputNumber',
  },
  {
    label: '限购数量',
    field: 'num',
    component: 'InputNumber',
  },
  {
    label: '标签',
    field: 'skuIcon',
    component: 'Input',
  },
  {
    label: '详情',
    field: 'details',
    component: 'JCodeEditor', //TODO String后缀暂未添加
  },
  {
    label: '分类标识',
    field: 'classId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"title"
    },
  },
];
