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: 'isOpen',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
     },
   },
   {
    title: '加油站名称',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '微信',
    align:"center",
    dataIndex: 'wx'
   },
   {
    title: '打印次数',
    align:"center",
    dataIndex: 'num'
   },
   {
    title: '几号汽油',
    align:"center",
    dataIndex: 'title'
   },
   {
    title: '加油折扣',
    align:"center",
    dataIndex: 'preferential'
   },
   {
    title: '电话',
    align:"center",
    dataIndex: 'phone'
   },
   {
    title: '单价',
    align:"center",
    dataIndex: 'price'
   },
   {
    title: '管理员微信',
    align:"center",
    dataIndex: 'userId_dictText'
   },
   {
    title: '打印机',
    align:"center",
    dataIndex: 'printerId_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "加油站名称",
      field: "name",
      component: 'Input',
      colProps: {span: 6},
 	},
	{
      label: "管理员微信",
      field: "userId",
      component: 'JSearchSelect',
      componentProps:{
         dict:"han_hai_member,nick_name,id"
      },
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '是否启用',
    field: 'isOpen',
     component: 'JSwitch',
     componentProps:{
     },
  },
  {
    label: '加油站名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '微信',
    field: 'wx',
    component: 'Input',
  },
  {
    label: '打印次数',
    field: 'num',
    component: 'InputNumber',
  },
  {
    label: '几号汽油',
    field: 'title',
    component: 'Input',
  },
  {
    label: '加油折扣',
    field: 'preferential',
    component: 'InputNumber',
  },
  {
    label: '电话',
    field: 'phone',
    component: 'Input',
  },
  {
    label: '单价',
    field: 'price',
    component: 'InputNumber',
  },
  {
    label: '管理员微信',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"han_hai_member,nick_name,id"
    },
  },
  {
    label: '打印机',
    field: 'printerId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"cheer_printer,name,id"
    },
  },
];
