Commit 361b9556 authored by 许佳敏's avatar 许佳敏

Merge branch 'feat-jinfa-0518-member' into 'jinfa-0518'

feat: 完成会员管理金发需求更改 See merge request project/jinfa-admin!1
parents 4cc659ad 55d49c6f
import React, { ReactNode, useState, useRef } from 'react';
import { history, Link } from 'umi';
import {
Card,
Space,
Button,
Menu,
Popconfirm,
Badge,
message,
} from 'antd';
import {
PlusOutlined,
DeleteOutlined,
ClockCircleOutlined,
} from '@ant-design/icons';
......@@ -24,14 +18,6 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import moment from 'moment';
import {
MEMBER_INNER_STATUS_VERIFY_PASSED,
MEMBER_OUTER_STATUS_PLATFORM_VERIFY_PASSED,
MEMBER_INNER_STATUS_VERIFY_NOT_PASSED,
MEMBER_INNER_STATUS_TO_BE_COMMIT,
MEMBER_STATUS_NORMAL,
MEMBER_SOURCE_PLATFORM,
} from '@/constants/const/member';
import { importSchema } from './schema';
import {
MEMBER_STATUS_TAG_MAP,
......@@ -39,7 +25,7 @@ import {
MEMBER_OUTER_STATUS_TYPE,
} from '../constant';
import StatusTag from '../components/StatusTag';
import { getMemberMaintenancePage, getMemberMaintenancePageitems, postMemberMaintenanceDelete, GetMemberMaintenancePageResponseDetail } from '@/services/MemberV2Api';
import { getMemberMaintenancePage, getMemberMaintenancePageitems, GetMemberMaintenancePageResponseDetail } from '@/services/MemberV2Api';
const formActions = createFormActions();
......@@ -64,24 +50,6 @@ const memberMaintain: React.FC<[]> = () => {
return { data: [], totalCount: 0 };
};
const handleDelete = (memberId: number, validateId: number) => {
const mesInstance = message.loading({
content: '正在删除',
duration: 0,
});
postMemberMaintenanceDelete({
memberId,
validateId,
}).then(res => {
if (res.code !== 1000) {
return;
}
ref.current.reload();
}).finally(() => {
mesInstance();
});
};
const defaultColumns: ColumnType<GetMemberMaintenancePageResponseDetail>[] = [
{
title: 'ID',
......@@ -161,59 +129,6 @@ const memberMaintain: React.FC<[]> = () => {
align: 'center',
render: (text, record) => <Badge color={MEMBER_INNER_STATUS_BADGE_COLOR[record.innerStatus] || '#606266'} text={text} />,
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (text: any, record: any) => (
<>
{(
record.innerStatus === MEMBER_INNER_STATUS_VERIFY_PASSED &&
record.outerStatus === MEMBER_OUTER_STATUS_PLATFORM_VERIFY_PASSED
) && (
<Link to={`/memberManage/manage/maintian/frozen?id=${record.memberId}&validateId=${record.validateId}`}>
<Button
type="link"
>
{record.status === MEMBER_STATUS_NORMAL ? '冻结' : '解冻'}
</Button>
</Link>
)}
{/* 平台代录入的会员资料才可以修改、删除 */}
{(
record.source === MEMBER_SOURCE_PLATFORM
&& (
record.innerStatus === MEMBER_INNER_STATUS_TO_BE_COMMIT
|| record.innerStatus === MEMBER_INNER_STATUS_VERIFY_NOT_PASSED
)
) && (
<>
<Button
type="link"
onClick={() =>
history.push(`/memberManage/manage/maintian/edit?id=${record.memberId}&validateId=${record.validateId}`)
}
>
编辑
</Button>
<Popconfirm
title="确定要删除吗?"
okText="是"
cancelText="否"
onConfirm={() => handleDelete(record.memberId, record.validateId)}
>
<Button
type="link"
danger
>
删除
</Button>
</Popconfirm>
</>
)}
</>
),
},
];
const menu = (
......@@ -259,26 +174,6 @@ const memberMaintain: React.FC<[]> = () => {
return {};
};
const controllerBtns = (
<Space>
<Button
type="primary"
onClick={() => history.push(`/memberManage/manage/maintian/add`)}
>
<PlusOutlined />
新建
</Button>
{/* <Button onClick={() => setVisibleModal(true)}>导入</Button>
<Dropdown.Button
overlay={menu}
trigger={['click']}
icon={<DownOutlined />}
>
更多
</Dropdown.Button> */}
</Space>
);
return (
<Card>
<StandardTable
......@@ -292,9 +187,6 @@ const memberMaintain: React.FC<[]> = () => {
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
......
......@@ -17,30 +17,25 @@ export const importSchema: ISchema = {
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: '输入 会员名称 进行搜索',
align: 'flex-start',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component': 'Mega-Layout',
'x-component-props': {
colStyle: {
marginLeft: 20,
},
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: {
memberTypeId: {
......
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