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: 'goodsName'
   },
   {
    title: '商品图片',
    align:"center",
    dataIndex: 'image'
   },
   {
    title: '商品价格',
    align:"center",
    dataIndex: 'price'
   },
   {
    title: '浏览量',
    align:"center",
    dataIndex: 'views'
   },
   {
    title: '品牌',
    align:"center",
    dataIndex: 'brand'
   },
   {
    title: '时间',
    align:"center",
    dataIndex: 'goodsTime',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '公里数',
    align:"center",
    dataIndex: 'mileage'
   },
   {
    title: '型号',
    align:"center",
    dataIndex: 'model'
   },
   {
    title: '详情',
    align:"center",
    dataIndex: 'detail'
   },
   {
    title: '库存',
    align:"center",
    dataIndex: 'inventory'
   },
   {
    title: '车辆照片(前)',
    align:"center",
    dataIndex: 'imageFront'
   },
   {
    title: '车辆照片(后)',
    align:"center",
    dataIndex: 'imageBack'
   },
   {
    title: '车辆照片(左)',
    align:"center",
    dataIndex: 'imageLeft'
   },
   {
    title: '车辆照片(右)',
    align:"center",
    dataIndex: 'imageRight'
   },
   {
    title: '车辆照片(驾驶室)',
    align:"center",
    dataIndex: 'imageCab'
   },
   {
    title: '联系人',
    align:"center",
    dataIndex: 'userName'
   },
   {
    title: '联系人电话',
    align:"center",
    dataIndex: 'phone'
   },
   {
    title: '所在区域',
    align:"center",
    dataIndex: 'area'
   },
   {
    title: '关联商品类型id',
    align:"center",
    dataIndex: 'cartypeId_dictText'
   },
   {
    title: '关联二级分类id',
    align:"center",
    dataIndex: 'categorytwoId_dictText'
   },
   {
    title: '关联用户id',
    align:"center",
    dataIndex: 'userId_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '商品名称',
    field: 'goodsName',
    component: 'Input',
  },
  {
    label: '商品图片',
    field: 'image',
    component: 'Input',
  },
  {
    label: '商品价格',
    field: 'price',
    component: 'InputNumber',
  },
  {
    label: '浏览量',
    field: 'views',
    component: 'InputNumber',
  },
  {
    label: '品牌',
    field: 'brand',
    component: 'Input',
  },
  {
    label: '时间',
    field: 'goodsTime',
    component: 'DatePicker',
  },
  {
    label: '公里数',
    field: 'mileage',
    component: 'InputNumber',
  },
  {
    label: '型号',
    field: 'model',
    component: 'Input',
  },
  {
    label: '详情',
    field: 'detail',
    component: 'Input',
  },
  {
    label: '库存',
    field: 'inventory',
    component: 'InputNumber',
  },
  {
    label: '车辆照片(前)',
    field: 'imageFront',
    component: 'Input',
  },
  {
    label: '车辆照片(后)',
    field: 'imageBack',
    component: 'Input',
  },
  {
    label: '车辆照片(左)',
    field: 'imageLeft',
    component: 'Input',
  },
  {
    label: '车辆照片(右)',
    field: 'imageRight',
    component: 'Input',
  },
  {
    label: '车辆照片(驾驶室)',
    field: 'imageCab',
    component: 'Input',
  },
  {
    label: '联系人',
    field: 'userName',
    component: 'Input',
  },
  {
    label: '联系人电话',
    field: 'phone',
    component: 'Input',
  },
  {
    label: '所在区域',
    field: 'area',
    component: 'Input',
  },
  {
    label: '关联商品类型id',
    field: 'cartypeId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"carrent_type,name,id"
     },
  },
  {
    label: '关联二级分类id',
    field: 'categorytwoId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"carrent_categorytwo,name,id"
     },
  },
  {
    label: '关联用户id',
    field: 'userId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"han_hai_member,nick_name,id"
     },
  },
];
