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: 'orderId'
   },
   {
    title: '商品编号',
    align:"center",
    dataIndex: 'goodsId'
   },
   {
    title: '规格编号',
    align:"center",
    dataIndex: 'skuId'
   },
   {
    title: '商品名',
    align:"center",
    dataIndex: 'goodsName'
   },
   {
    title: '商品图',
    align:"center",
    dataIndex: 'goodsPic',
    customRender:render.renderAvatar,
   },
   {
    title: '规格',
    align:"center",
    dataIndex: 'sku'
   },
   {
    title: '押金',
    align:"center",
    dataIndex: 'depositPrice'
   },
   {
    title: '租金',
    align:"center",
    dataIndex: 'rentPrice'
   },
   {
    title: '水洗费用',
    align:"center",
    dataIndex: 'washPrice'
   },
   {
    title: '优惠金额',
    align:"center",
    dataIndex: 'discountPrice'
   },
   {
    title: '是否删除',
    align:"center",
    dataIndex: 'delFlag_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '订单编号',
    field: 'orderId',
    component: 'Input',
  },
  {
    label: '商品编号',
    field: 'goodsId',
    component: 'Input',
  },
  {
    label: '规格编号',
    field: 'skuId',
    component: 'Input',
  },
  {
    label: '商品名',
    field: 'goodsName',
    component: 'Input',
  },
  {
    label: '商品图',
    field: 'goodsPic',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '规格',
    field: 'sku',
    component: 'Input',
  },
  {
    label: '押金',
    field: 'depositPrice',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入押金!'},
          ];
     },
  },
  {
    label: '租金',
    field: 'rentPrice',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入租金!'},
          ];
     },
  },
  {
    label: '水洗费用',
    field: 'washPrice',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入水洗费用!'},
          ];
     },
  },
  {
    label: '优惠金额',
    field: 'discountPrice',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入优惠金额!'},
          ];
     },
  },
  {
    label: '是否删除',
    field: 'delFlag',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"is_delete"
     },
  },
];
