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: 'mkUrl'
   },
   {
    title: '测试图片',
    align:"center",
    dataIndex: 'testImage',
    customRender:render.renderAvatar,
   },
   {
    title: '测试地址',
    align:"center",
    dataIndex: 'testUrl'
   },
   {
    title: '开关',
    align:"center",
    dataIndex: 'isOpen',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
     },
   },
   {
    title: '排序',
    align:"center",
    dataIndex: 'sort'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '图片',
    field: 'image',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '设计图地址',
    field: 'mkUrl',
    component: 'Input',
  },
  {
    label: '测试图片',
    field: 'testImage',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '测试地址',
    field: 'testUrl',
    component: 'Input',
  },
  {
    label: '开关',
    field: 'isOpen',
     component: 'JSwitch',
     componentProps:{
     },
  },
  {
    label: '排序',
    field: 'sort',
    component: 'InputNumber',
  },
];
