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: 'price'
   },
   {
    title: '销售量',
    align:"center",
    dataIndex: 'sales'
   },
   {
    title: '商品详情',
    align:"center",
    dataIndex: 'details',
    slots: { customRender: 'htmlSlot' },
   },
   {
    title: '所属分类',
    align:"center",
    dataIndex: 'categoryId_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '商品名称',
    field: 'title',
    component: 'Input',
  },
  {
    label: '商品图片',
    field: 'image',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '商品价格',
    field: 'price',
    component: 'InputNumber',
  },
  {
    label: '销售量',
    field: 'sales',
    component: 'InputNumber',
  },
  {
    label: '商品详情',
    field: 'details',
    component: 'JCodeEditor', //TODO String后缀暂未添加
  },
  {
    label: '所属分类',
    field: 'categoryId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"teambuy_category,name,id"
     },
  },
];
