Commit 612cda66 authored by XieZhiXiong's avatar XieZhiXiong

chore: 添加搜索框 Tip 提示

parent 19e7265d
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
export const levelSchema: ISchema = { export const levelSchema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
MEGA_LAYOUI: { MEGA_LAYOUI: {
type: 'object', type: 'object',
'x-component': 'mega-layout', 'x-component': 'mega-layout',
properties: { properties: {
topLayout: { topLayout: {
type: 'object', type: 'object',
'x-component': 'mega-layout', 'x-component': 'mega-layout',
'x-component-props': { 'x-component-props': {
grid: true, grid: true,
}, },
properties: { properties: {
levelTag: { levelTag: {
type: 'string', type: 'string',
'x-component': 'Search', 'x-component': 'Search',
'x-component-props': { 'x-component-props': {
placeholder: '搜索', placeholder: '搜索',
}, tip: '输入 会员等级标签 进行搜索',
}, },
}, },
}, },
[FORM_FILTER_PATH]: { },
type: 'object', [FORM_FILTER_PATH]: {
'x-component': 'flex-layout', type: 'object',
'x-component-props': { 'x-component': 'flex-layout',
rowStyle: { 'x-component-props': {
flexWrap: 'nowrap', rowStyle: {
}, flexWrap: 'nowrap',
colStyle: { },
marginLeft: 20, colStyle: {
}, marginLeft: 20,
}, },
properties: { },
roleName: { properties: {
type: 'string', roleName: {
'x-component': 'Input', type: 'string',
'x-component-props': { 'x-component': 'Input',
placeholder: '角色名称', 'x-component-props': {
allowClear: true, placeholder: '角色名称',
}, allowClear: true,
}, },
submit: { },
'x-component': 'Submit', submit: {
'x-component-props': { 'x-component': 'Submit',
children: '查询', 'x-component-props': {
}, children: '查询',
}, },
}, },
}, },
}, },
}, },
}, },
}; },
};
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { UPLOAD_TYPE } from '@/constants'; import { UPLOAD_TYPE } from '@/constants';
import { PATTERN_MAPS } from '@/constants/regExp'; import { PATTERN_MAPS } from '@/constants/regExp';
export const importSchema: ISchema = { export const importSchema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
mageLayout: { mageLayout: {
type: 'object', type: 'object',
'x-component': 'mega-layout', 'x-component': 'mega-layout',
properties: { properties: {
topLayout: { topLayout: {
type: 'object', type: 'object',
'x-component': 'mega-layout', 'x-component': 'mega-layout',
'x-component-props': { 'x-component-props': {
grid: true, grid: true,
}, },
properties: { properties: {
ctl: { ctl: {
type: 'object', type: 'object',
'x-component': 'Children', 'x-component': 'Children',
'x-component-props': { 'x-component-props': {
children: '{{controllerBtns}}', children: '{{controllerBtns}}',
}, },
}, },
name: { name: {
type: 'string', type: 'string',
'x-component': 'Search', 'x-component': 'Search',
'x-component-props': { 'x-component-props': {
placeholder: '搜索', placeholder: '搜索',
}, tip: '输入 会员名称 进行搜索',
}, },
}, },
}, },
[FORM_FILTER_PATH]: { },
type: 'object', [FORM_FILTER_PATH]: {
'x-component': 'flex-layout', type: 'object',
'x-component-props': { 'x-component': 'flex-layout',
colStyle: { 'x-component-props': {
marginLeft: 20, colStyle: {
}, marginLeft: 20,
}, },
properties: { },
memberTypeId: { properties: {
type: 'string', memberTypeId: {
default: undefined, type: 'string',
enum: [], default: undefined,
'x-component-props': { enum: [],
placeholder: '会员类型(全部)', 'x-component-props': {
allowClear: true, placeholder: '会员类型(全部)',
}, allowClear: true,
}, },
roleId: { },
type: 'string', roleId: {
default: undefined, type: 'string',
enum: [], default: undefined,
'x-component-props': { enum: [],
placeholder: '会员角色(全部)', 'x-component-props': {
allowClear: true, placeholder: '会员角色(全部)',
}, allowClear: true,
}, },
level: { },
type: 'string', level: {
default: undefined, type: 'string',
enum: [], default: undefined,
'x-component-props': { enum: [],
placeholder: '会员等级(全部)', 'x-component-props': {
allowClear: true, placeholder: '会员等级(全部)',
}, allowClear: true,
}, },
source: { },
type: 'string', source: {
default: undefined, type: 'string',
enum: [], default: undefined,
'x-component-props': { enum: [],
placeholder: '申请来源(全部)', 'x-component-props': {
allowClear: true, placeholder: '申请来源(全部)',
}, allowClear: true,
}, },
innerStatus: { },
type: 'string', innerStatus: {
default: undefined, type: 'string',
enum: [], default: undefined,
'x-component-props': { enum: [],
placeholder: '内部状态(全部)', 'x-component-props': {
allowClear: true, placeholder: '内部状态(全部)',
}, allowClear: true,
}, },
outerStatus: { },
type: 'string', outerStatus: {
default: undefined, type: 'string',
enum: [], default: undefined,
'x-component-props': { enum: [],
placeholder: '外部状态(全部)', 'x-component-props': {
allowClear: true, placeholder: '外部状态(全部)',
}, allowClear: true,
}, },
status: { },
type: 'string', status: {
enum: [], type: 'string',
default: undefined, enum: [],
'x-component-props': { default: undefined,
placeholder: '会员状态(全部)', 'x-component-props': {
allowClear: true, placeholder: '会员状态(全部)',
}, allowClear: true,
}, },
'[startDate, endDate]': { },
type: 'string', '[startDate, endDate]': {
default: '', type: 'string',
'x-component': 'dateSelect', default: '',
'x-component-props': { 'x-component': 'dateSelect',
placeholder: '时间范围(全部)', 'x-component-props': {
allowClear: true, placeholder: '时间范围(全部)',
}, allowClear: true,
}, },
submit: { },
'x-component': 'Submit', submit: {
'x-mega-props': { 'x-component': 'Submit',
span: 1, 'x-mega-props': {
}, span: 1,
'x-component-props': { },
children: '查询', 'x-component-props': {
}, children: '查询',
}, },
}, },
}, },
}, },
}, },
}, },
}; },
};
export const auditModalSchema: ISchema = {
type: 'object', export const auditModalSchema: ISchema = {
properties: { type: 'object',
MEGA_LAYOUT: { properties: {
type: 'object', MEGA_LAYOUT: {
'x-component': 'mega-layout', type: 'object',
'x-component-props': { 'x-component': 'mega-layout',
labelAlign: 'top', 'x-component-props': {
}, labelAlign: 'top',
properties: { },
reason: { properties: {
type: 'string', reason: {
title: '会员解冻原因', type: 'string',
'x-component': 'textarea', title: '会员解冻原因',
'x-component-props': { 'x-component': 'textarea',
placeholder: '在此输入你的内容,最长120个字符,60个汉字', 'x-component-props': {
maxLength: 60, placeholder: '在此输入你的内容,最长120个字符,60个汉字',
rows: 5, maxLength: 60,
}, rows: 5,
'x-rules': [ },
{ 'x-rules': [
required: true, {
message: '请填写原因', required: true,
}, message: '请填写原因',
{ },
limitByte: true, // 自定义校验规则 {
maxByte: 120, limitByte: true, // 自定义校验规则
} maxByte: 120,
], }
}, ],
}, },
}, },
}, },
}; },
};
const FIELD_TYPE_MAP = {
'string': 'string', const FIELD_TYPE_MAP = {
'long': 'string', 'string': 'string',
'upload': 'customUpload', 'long': 'string',
}; 'upload': 'customUpload',
};
const getXComponentProps = (type, item) => {
const MAP = { const getXComponentProps = (type, item) => {
'string': { const MAP = {
placeholder: item.fieldRemark, 'string': {
}, placeholder: item.fieldRemark,
'upload': { },
listType: 'card', 'upload': {
action: '/api/file/file/upload', listType: 'card',
data: { fileType: UPLOAD_TYPE }, action: '/api/file/file/upload',
fileList: [], data: { fileType: UPLOAD_TYPE },
onChange: file => console.log(file), fileList: [],
}, onChange: file => console.log(file),
}; },
return MAP[type]; };
}; return MAP[type];
};
const getCompnentValue = (elements: any) => {
const components = {}; const getCompnentValue = (elements: any) => {
for (let item of elements) { const components = {};
for (let item of elements) {
// 先判断是否存在 type,防止不存在的 type 报错
const realType = FIELD_TYPE_MAP[item.fieldType]; // 先判断是否存在 type,防止不存在的 type 报错
if (realType) { const realType = FIELD_TYPE_MAP[item.fieldType];
components[item.fieldName] = { if (realType) {
type: FIELD_TYPE_MAP[item.fieldType], components[item.fieldName] = {
required: item.fieldEmpty === 0, type: FIELD_TYPE_MAP[item.fieldType],
title: item.fieldCNName, required: item.fieldEmpty === 0,
'x-component-props': getXComponentProps(realType, item), title: item.fieldCNName,
}; 'x-component-props': getXComponentProps(realType, item),
} };
} }
return components; }
}; return components;
};
export const initDetailSchema = (props: any) => {
let tabSchema: ISchema = { export const initDetailSchema = (props: any) => {
properties: { let tabSchema: ISchema = {
'tab-1': { properties: {
type: 'object', 'tab-1': {
'x-component': 'TabPane', type: 'object',
'x-component-props': { 'x-component': 'TabPane',
tab: '基本信息', 'x-component-props': {
}, tab: '基本信息',
properties: { },
MEGA_LAYOUT1: { properties: {
type: 'object', MEGA_LAYOUT1: {
'x-component': 'Mega-Layout', type: 'object',
'x-component-props': { 'x-component': 'Mega-Layout',
labelCol: 4, 'x-component-props': {
wrapperCol: 8, labelCol: 4,
labelAlign: 'left', wrapperCol: 8,
}, labelAlign: 'left',
properties: { },
memberTypeId: { properties: {
type: 'string', memberTypeId: {
required: true, type: 'string',
title: '会员类型', required: true,
enum: [], title: '会员类型',
'x-component-props': { enum: [],
placeholder: '请选择', 'x-component-props': {
}, placeholder: '请选择',
}, },
roleId: { },
type: 'string', roleId: {
required: true, type: 'string',
title: '会员角色', required: true,
enum: [], title: '会员角色',
'x-component-props': { enum: [],
placeholder: '请选择', 'x-component-props': {
}, placeholder: '请选择',
'x-props': { },
hasFeedback: true, 'x-props': {
}, hasFeedback: true,
}, },
level: { },
type: 'string', level: {
required: true, type: 'string',
title: '会员等级', required: true,
enum: [], title: '会员等级',
'x-component-props': { enum: [],
placeholder: '请选择', 'x-component-props': {
}, placeholder: '请选择',
'x-props': { },
hasFeedback: true, 'x-props': {
}, hasFeedback: true,
}, },
MEGA_LAYOUT1_1: { },
type: 'object', MEGA_LAYOUT1_1: {
'x-component': 'Mega-Layout', type: 'object',
'x-component-props': { 'x-component': 'Mega-Layout',
label: '注册手机', 'x-component-props': {
required: true, label: '注册手机',
wrapperCol: 24, required: true,
}, wrapperCol: 24,
properties: { },
MEGA_LAYOUT1_1_1: { properties: {
type: 'object', MEGA_LAYOUT1_1_1: {
'x-component': 'mega-layout', type: 'object',
'x-component-props': { 'x-component': 'mega-layout',
grid: true, 'x-component-props': {
full: true, grid: true,
}, full: true,
properties: { },
countryCodeId: { properties: {
type: 'string', countryCodeId: {
enum: [], type: 'string',
'x-component-props': { enum: [],
placeholder: '请选择', 'x-component-props': {
}, placeholder: '请选择',
required: true, },
}, required: true,
phone: { },
type: 'string', phone: {
required: true, type: 'string',
'x-mega-props': { required: true,
span: 2, 'x-mega-props': {
}, span: 2,
'x-component-props': { },
placeholder: '请输入你的手机号码', 'x-component-props': {
maxLength: 11, placeholder: '请输入你的手机号码',
}, maxLength: 11,
'x-rules': [ },
{ 'x-rules': [
pattern: PATTERN_MAPS.phone, {
message: '请输入正确格式的手机号', pattern: PATTERN_MAPS.phone,
}, message: '请输入正确格式的手机号',
], },
}, ],
}, },
}, },
}, },
}, },
email: { },
type: 'string', email: {
title: '邮箱', type: 'string',
'x-component-props': {}, title: '邮箱',
'x-rules': [ 'x-component-props': {},
{ 'x-rules': [
pattern: PATTERN_MAPS.email, {
message: '请输入正确格式的邮箱', pattern: PATTERN_MAPS.email,
}, message: '请输入正确格式的邮箱',
], },
}, ],
}, },
}, },
}, },
}, },
}, },
}; },
};
if (Array.isArray(props)) {
for (let [index, item] of props.entries()) { if (Array.isArray(props)) {
tabSchema.properties![`tab-${index + 2}`] = { for (let [index, item] of props.entries()) {
type: 'object', tabSchema.properties![`tab-${index + 2}`] = {
'x-component': 'TabPane', type: 'object',
'x-component-props': { 'x-component': 'TabPane',
tab: item.groupName, 'x-component-props': {
}, tab: item.groupName,
properties: { },
[`MEGA_LAYOUT${index + 2}`]: { properties: {
type: 'object', [`MEGA_LAYOUT${index + 2}`]: {
'x-component': 'Mega-Layout', type: 'object',
'x-component-props': { 'x-component': 'Mega-Layout',
labelCol: 4, 'x-component-props': {
wrapperCol: 8, labelCol: 4,
labelAlign: 'left', wrapperCol: 8,
}, labelAlign: 'left',
properties: getCompnentValue(item.elements), },
}, properties: getCompnentValue(item.elements),
}, },
}; },
} };
} }
}
let detailSchema: ISchema = {
type: 'object', let detailSchema: ISchema = {
properties: { type: 'object',
tabs: { properties: {
type: 'object', tabs: {
'x-component': 'Tab', type: 'object',
'x-component-props': { 'x-component': 'Tab',
type: 'card', 'x-component-props': {
}, type: 'card',
...tabSchema, },
}, ...tabSchema,
}, },
}; },
const maintianDetailSchema: ISchema = detailSchema; };
return maintianDetailSchema; const maintianDetailSchema: ISchema = detailSchema;
}; return maintianDetailSchema;
};
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
export const auditSchema: ISchema = { export const auditSchema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
MEGA_LAYOUT: { MEGA_LAYOUT: {
type: 'object', type: 'object',
'x-component': 'mega-layout', 'x-component': 'mega-layout',
properties: { properties: {
topLayout: { topLayout: {
type: 'object', type: 'object',
'x-component': 'mega-layout', 'x-component': 'mega-layout',
'x-component-props': { 'x-component-props': {
grid: true, grid: true,
}, },
properties: { properties: {
ctl: { ctl: {
type: 'object', type: 'object',
'x-component': 'Children', 'x-component': 'Children',
'x-component-props': { 'x-component-props': {
children: '{{controllerBtns}}', children: '{{controllerBtns}}',
}, },
}, },
name: { name: {
type: 'string', type: 'string',
'x-component': 'Search', 'x-component': 'Search',
'x-component-props': { 'x-component-props': {
placeholder: '搜索', placeholder: '搜索',
}, tip: '输入 会员名称 进行搜索',
}, },
}, },
}, },
[FORM_FILTER_PATH]: { },
type: 'object', [FORM_FILTER_PATH]: {
'x-component': 'flex-layout', type: 'object',
'x-component-props': { 'x-component': 'flex-layout',
colStyle: { 'x-component-props': {
marginLeft: 20, colStyle: {
}, marginLeft: 20,
}, },
properties: { },
memberTypeId: { properties: {
type: 'string', memberTypeId: {
default: undefined, type: 'string',
enum: [], default: undefined,
'x-component-props': { enum: [],
placeholder: '会员类型(全部)', 'x-component-props': {
allowClear: true, placeholder: '会员类型(全部)',
}, allowClear: true,
}, },
// status: { },
// type: 'string', // status: {
// default: undefined, // type: 'string',
// enum: [], // default: undefined,
// 'x-component-props': { // enum: [],
// placeholder: '会员状态(全部)', // 'x-component-props': {
// allowClear: true, // placeholder: '会员状态(全部)',
// }, // allowClear: true,
// }, // },
roleId: { // },
type: 'string', roleId: {
default: undefined, type: 'string',
enum: [], default: undefined,
'x-component-props': { enum: [],
placeholder: '会员角色(全部)', 'x-component-props': {
allowClear: true, placeholder: '会员角色(全部)',
}, allowClear: true,
}, },
level: { },
type: 'string', level: {
default: undefined, type: 'string',
enum: [], default: undefined,
'x-component-props': { enum: [],
placeholder: '会员等级(全部)', 'x-component-props': {
allowClear: true, placeholder: '会员等级(全部)',
}, allowClear: true,
}, },
source: { },
type: 'string', source: {
default: undefined, type: 'string',
enum: [], default: undefined,
'x-component-props': { enum: [],
placeholder: '申请来源(全部)', 'x-component-props': {
allowClear: true, placeholder: '申请来源(全部)',
}, allowClear: true,
}, },
'[startDate, endDate]': { },
type: 'string', '[startDate, endDate]': {
default: '', type: 'string',
'x-component': 'dateSelect', default: '',
'x-component-props': { 'x-component': 'dateSelect',
placeholder: '时间范围(全部)', 'x-component-props': {
allowClear: true, placeholder: '时间范围(全部)',
}, allowClear: true,
}, },
submit: { },
'x-component': 'Submit', submit: {
'x-mega-props': { 'x-component': 'Submit',
span: 1, 'x-mega-props': {
}, span: 1,
'x-component-props': { },
children: '查询', 'x-component-props': {
}, children: '查询',
}, },
}, },
}, },
}, },
}, },
}, },
}; },
};
export const auditModalSchema: ISchema = {
type: 'object', export const auditModalSchema: ISchema = {
properties: { type: 'object',
MEGA_LAYOUT: { properties: {
type: 'object', MEGA_LAYOUT: {
'x-component': 'mega-layout', type: 'object',
'x-component-props': { 'x-component': 'mega-layout',
labelAlign: 'top', 'x-component-props': {
}, labelAlign: 'top',
properties: { },
agree: { properties: {
type: 'string', agree: {
default: 1, type: 'string',
enum: [ default: 1,
{ label: '审核通过', value: 1 }, enum: [
{ label: '审核不通过', value: 0 }, { label: '审核通过', value: 1 },
], { label: '审核不通过', value: 0 },
'x-component': 'radio', ],
'x-component-props': {}, 'x-component': 'radio',
}, 'x-component-props': {},
reason: { },
type: 'string', reason: {
title: '审核不通过原因', type: 'string',
'x-component': 'textarea', title: '审核不通过原因',
required: true, 'x-component': 'textarea',
'x-component-props': { required: true,
placeholder: '在此输入你的内容,最长120个字符,60个汉字', 'x-component-props': {
rows: 5, placeholder: '在此输入你的内容,最长120个字符,60个汉字',
}, rows: 5,
'x-rules': [ },
{ 'x-rules': [
limitByte: true, // 自定义校验规则 {
maxByte: 120, limitByte: true, // 自定义校验规则
} maxByte: 120,
], }
}, ],
}, },
}, },
}, },
}; },
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment