Commit 05ff23e4 authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加公用 colmns、schame

parent 0a5d4c23
/*
* @Author: XieZhiXiong
* @Date: 2021-05-24 11:30:15
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-25 14:20:54
* @Description: 审核入库相关公用 columns
*/
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';
import styles from '../styles.less';
/**
*
* @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: 'sourceName',
align: 'center',
render: (text, record) => (
<>
<div>{text}</div>
<div className={styles.description}>{record.registerTime}</div>
</>
),
},
{
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-25 14:21:16
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-25 14:32:13
* @Description:
*/
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
const verifyComingSchema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入 会员名称 进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
},
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,
},
},
},
source: {
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 verifyComingSchema;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-05-24 10:53:49
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-24 10:53:49
* @Description: 审核入库相关公用schema
*/
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
const verifyComingSchema: 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,
},
},
},
source: {
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 verifyComingSchema;
\ No newline at end of file
@import '~antd/es/style/themes/default.less';
.description {
color: @text-color-secondary;
}
\ 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