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: 'userId_dictText'
   },
   {
    title: '审核状态',
    align:"center",
    dataIndex: 'isState'
   },
   {
    title: '发布人名称',
    align:"center",
    dataIndex: 'userName'
   },
   {
    title: '发布人头像',
    align:"center",
    dataIndex: 'userImage',
    customRender:render.renderAvatar,
   },
   {
    title: '浏览量',
    align:"center",
    dataIndex: 'browseNum'
   },
   {
    title: '评论量',
    align:"center",
    dataIndex: 'commentNum'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "发布人",
      field: "userId",
      component: 'JSearchSelect',
      componentProps:{
         dict:"han_hai_member,nick_name,id"
      },
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '标题',
    field: 'title',
    component: 'InputTextArea',//TODO 注意string转换问题
  },
  {
    label: '图片',
    field: 'image',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '发布人',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"han_hai_member,nick_name,id"
    },
  },
  {
    label: '审核状态',
    field: 'isState',
    component: 'InputNumber',
  },
  {
    label: '发布人名称',
    field: 'userName',
    component: 'Input',
  },
  {
    label: '发布人头像',
    field: 'userImage',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '浏览量',
    field: 'browseNum',
    component: 'InputNumber',
  },
  {
    label: '评论量',
    field: 'commentNum',
    component: 'InputNumber',
  },
];
