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: 'createTime'
   },
   {
    title: '提交用户',
    align:"center",
    dataIndex: 'userId_dictText'
   },
   {
    title: '内容图片',
    align:"center",
    dataIndex: 'imageUrl',
    customRender:render.renderAvatar,
   },
   {
    title: '语音图片',
    align:"center",
    dataIndex: 'voiceUrl',
    slots: { customRender: 'fileSlot' },
   },
   {
    title: '类型',
    align:"center",
    dataIndex: 'type_dictText'
   },
   {
    title: '审核状态',
    align:"center",
    dataIndex: 'status_dictText'
   },
   {
    title: '推荐商品',
    align:"center",
    dataIndex: 'shopId_dictText'
   },
   {
    title: '是否支付',
    align:"center",
    dataIndex: 'isPay',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
     },
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '提交用户',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"han_hai_member,nick_name,id"
    },
  },
  {
    label: '内容图片',
    field: 'imageUrl',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '语音图片',
    field: 'voiceUrl',
    component: 'JUpload',
    componentProps:{
     },
  },
  {
    label: '类型',
    field: 'type',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"is_xc"
     },
  },
  {
    label: '审核状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"order_type"
     },
  },
  {
    label: '推荐商品',
    field: 'shopId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"common_shop,name,id"
    },
  },
  {
    label: '是否支付',
    field: 'isPay',
     component: 'JSwitch',
     componentProps:{
     },
  },
];
