BusinessWallet.data.ts 2.7 KB
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '用户ID',
    align:"center",
    dataIndex: 'userId'
   },
   {
    title: '用户姓名',
    align:"center",
    dataIndex: 'userName'
   },
   {
    title: '用户手机号',
    align:"center",
    dataIndex: 'userPhone'
   },
   {
    title: '钱包类型',
    align:"center",
    dataIndex: 'walletCode'
   },
   {
    title: '金额',
    align:"center",
    dataIndex: 'amount'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
     {
      label: "用户姓名",
      field: "userName",
      component: 'Input', //TODO 范围查询
      //colProps: {span: 6},
	},
     {
      label: "用户手机号",
      field: "userPhone",
      component: 'Input', //TODO 范围查询
      //colProps: {span: 6},
	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户ID',
    field: 'userId',
    component: 'Input',
  },
  {
    label: '用户姓名',
    field: 'userName',
    component: 'Input',
  },
  {
    label: '用户手机号',
    field: 'userPhone',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: false},
                 { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'},
          ];
     },
  },
  {
    label: '钱包类型',
    field: 'walletCode',
    component: 'Input',
  },
  {
    label: '金额',
    field: 'amount',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: false},
                 { pattern: /^-?\d+$/, message: '请输入整数!'},
          ];
     },
  },
	// TODO 主键隐藏字段,目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  userId: {title: '用户ID',order: 0,view: 'text', type: 'string',},
  userName: {title: '用户姓名',order: 1,view: 'text', type: 'string',},
  userPhone: {title: '用户手机号',order: 2,view: 'text', type: 'string',},
  walletCode: {title: '钱包类型',order: 3,view: 'text', type: 'string',},
  amount: {title: '金额',order: 4,view: 'number', type: 'number',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
  return formSchema;
}