Commit 3b6d9014 authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加 公共schame、columns

parent f0f1b91d
/*
* @Author: XieZhiXiong
* @Date: 2021-05-26 10:22:53
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-26 10:23:44
* @Description:
*/
import React from 'react';
import { Badge } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import {
MEMBER_INNER_STATUS_BADGE_COLOR,
MEMBER_OUTER_STATUS_TYPE,
} from '../../constant';
import StatusTag from '../../components/StatusTag';
/**
*
* @param target string 会员详情路径前缀
* @returns Table Columns
*/
const columns = (target = '/memberCenter/memberAbility/manage/memberPrSubmit/detail'): ColumnType<any>[] => ([
{
title: '会员ID/名称',
dataIndex: 'memberId',
render: (text, record) => (
<>
<div>
{text}
</div>
<EyePreview
url={`${target}?id=${record.memberId}&validateId=${record.validateId}`}
>
{record.name}
</EyePreview>
</>
),
},
{
title: '会员类型',
filters: [],
dataIndex: 'memberTypeName',
align: 'center',
},
{
title: '会员角色',
filters: [],
dataIndex: 'roleName',
align: 'center',
},
{
title: '外部状态',
dataIndex: 'outerStatusName',
align: 'center',
render: (text, record) => (
<StatusTag type={MEMBER_OUTER_STATUS_TYPE[record.outerStatus]} title={text} />
),
},
{
title: '内部状态',
dataIndex: 'innerStatusName',
align: 'center',
render: (text, record) => <Badge color={MEMBER_INNER_STATUS_BADGE_COLOR[record.innerStatus]} text={text} />,
},
]);
export default columns;
/*
* @Author: XieZhiXiong
* @Date: 2021-05-26 10:21:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-26 10:22:15
* @Description:
*/
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
const verifyChangeShema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 会员名称 进行搜索',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
colStyle: {
marginLeft: 20,
},
},
properties: {
memberTypeId: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员类型(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
roleId: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员角色(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
export default verifyChangeShema;
\ No newline at end of file
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