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: 'pic',
    customRender:render.renderAvatar,
   },
   {
    title: '客户姓名',
    align:"center",
    dataIndex: 'userName'
   },
   {
    title: '客户手机号',
    align:"center",
    dataIndex: 'userPhone'
   },
   {
    title: '用户地址',
    align:"center",
    dataIndex: 'userAddress'
   },
   {
    title: '用户Id',
    align:"center",
    dataIndex: 'userId'
   },
   {
    title: '店铺id',
    align:"center",
    dataIndex: 'shopId'
   },
   {
    title: '租赁时间',
    align:"center",
    dataIndex: 'leaseTime'
   },
   {
    title: '缴纳费用',
    align:"center",
    dataIndex: 'payFee'
   },
   {
    title: '押金',
    align:"center",
    dataIndex: 'deposit'
   },
   {
    title: '水洗费用',
    align:"center",
    dataIndex: 'washPay'
   },
   {
    title: '水洗费用',
    align:"center",
    dataIndex: 'rentPay'
   },
   {
    title: '支付金额',
    align:"center",
    dataIndex: 'orderPay'
   },
   {
    title: '状态 0已下单 1进行中 2已完成 3已退款',
    align:"center",
    dataIndex: 'status_dictText'
   },
   {
    title: '类型 0水洗 1租赁 2破损 3退货',
    align:"center",
    dataIndex: 'type_dictText'
   },
   {
    title: '是否删除 0否 1是',
    align:"center",
    dataIndex: 'delFlag_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '商品图片',
    field: 'pic',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '客户姓名',
    field: 'userName',
    component: 'Input',
  },
  {
    label: '客户手机号',
    field: 'userPhone',
    component: 'Input',
  },
  {
    label: '用户地址',
    field: 'userAddress',
    component: 'Input',
  },
  {
    label: '用户Id',
    field: 'userId',
    component: 'Input',
  },
  {
    label: '店铺id',
    field: 'shopId',
    component: 'Input',
  },
  {
    label: '租赁时间',
    field: 'leaseTime',
    component: 'Input',
  },
  {
    label: '缴纳费用',
    field: 'payFee',
    component: 'InputNumber',
  },
  {
    label: '押金',
    field: 'deposit',
    component: 'InputNumber',
  },
  {
    label: '水洗费用',
    field: 'washPay',
    component: 'InputNumber',
  },
  {
    label: '水洗费用',
    field: 'rentPay',
    component: 'InputNumber',
  },
  {
    label: '支付金额',
    field: 'orderPay',
    component: 'InputNumber',
  },
  {
    label: '状态 0已下单 1进行中 2已完成 3已退款',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:""
     },
  },
  {
    label: '类型 0水洗 1租赁 2破损 3退货',
    field: 'type',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:""
     },
  },
  {
    label: '是否删除 0否 1是',
    field: 'delFlag',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:""
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否删除 0否 1是!'},
          ];
     },
  },
];
