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",
    sorter: true,
    dataIndex: 'createTime'
   },
   {
    title: '标题',
    align:"center",
    dataIndex: 'title'
   },
   {
    title: '图片',
    align:"center",
    dataIndex: 'image',
    customRender:render.renderAvatar,
   },
   {
    title: '价格',
    align:"center",
    dataIndex: 'price'
   },
   {
    title: '地址',
    align:"center",
    dataIndex: 'address'
   },
   {
    title: '说明',
    align:"center",
    dataIndex: 'titleSub'
   },
   {
    title: '视频',
    align:"center",
    dataIndex: 'iconMp',
    slots: { customRender: 'fileSlot' },
   },
   {
    title: '发布人',
    align:"center",
    dataIndex: 'userId_dictText'
   },
   {
    title: '说明',
    align:"center",
    dataIndex: 'descValue'
   },
   {
    title: '图标',
    align:"center",
    dataIndex: 'logoImage',
    customRender:render.renderAvatar,
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '图片',
    field: 'image',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '星闻内容',
    field: 'details',
    component: 'JCodeEditor', //TODO String后缀暂未添加
  },
  {
    label: '价格',
    field: 'price',
    component: 'InputNumber',
  },
  {
    label: '地址',
    field: 'address',
    component: 'Input',
  },
  {
    label: '说明',
    field: 'titleSub',
    component: 'Input',
  },
  {
    label: '视频',
    field: 'iconMp',
    component: 'JUpload',
    componentProps:{
     },
  },
  {
    label: '发布人',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"han_hai_member,nick_name,id"
    },
  },
  {
    label: '说明',
    field: 'descValue',
    component: 'Input',
  },
  {
    label: '图标',
    field: 'logoImage',
     component: 'JImageUpload',
     componentProps:{
      },
  },
];
