Commit a3da2db9 authored by XieZhiXiong's avatar XieZhiXiong

feat: 对接完毕 会员规则流程配置 相关

parent 90e8fd53
...@@ -6,13 +6,11 @@ ...@@ -6,13 +6,11 @@
* @Description: 新建会员管理流程规则 * @Description: 新建会员管理流程规则
*/ */
import React from 'react'; import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import FlowRuleForm from './components/FlowRuleForm'; import FlowRuleForm from './components/FlowRuleForm';
const MemberFlowRuleAdd: React.FC = () => { const MemberFlowRuleAdd: React.FC = () => {
const { id, validateId } = usePageStatus();
return ( return (
<FlowRuleForm id={id} validateId={validateId} isEdit /> <FlowRuleForm isEdit />
); );
}; };
......
...@@ -2,27 +2,45 @@ ...@@ -2,27 +2,45 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-28 15:24:56 * @Date: 2021-05-28 15:24:56
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 15:24:57 * @LastEditTime: 2021-06-01 14:44:31
* @Description: * @Description:
*/ */
import React from 'react'; import React from 'react';
import { Popconfirm, Button } from 'antd'; import { Popconfirm, Button, Row, Col } from 'antd';
import theme from '../../../../../../../../config/lingxi.theme.config';
import PolymericTable from '@/components/PolymericTable'; import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface'; import { EditableColumns } from '@/components/PolymericTable/interface';
import ComingCtl, { ValueType as ComingCtlValueType } from '../ComingCtl';
import Search from '../Search';
const ComingConfigTable = (props) => {
const {
value = [],
mutators,
editable,
} = props;
const { roleId } = (props.props['x-component-props'] || {});
const handleDelete = (id: number) => {
const newData = [...value];
const index = newData.findIndex((item) => item.id === id);
if (index !== -1) {
newData.splice(index, 1);
}
mutators.change(newData);
};
const ComingConfigTable = () => {
const columns: EditableColumns[] = [ const columns: EditableColumns[] = [
{ {
title: 'ID', title: 'ID',
dataIndex: 'id', dataIndex: 'id',
align: 'center',
}, },
{ {
title: '中文名称', title: '中文名称',
dataIndex: 'name', dataIndex: 'fieldLocalName',
}, },
{ {
title: '分组信息', title: '分组名称',
dataIndex: 'groupName', dataIndex: 'groupName',
}, },
{ {
...@@ -30,51 +48,63 @@ const ComingConfigTable = () => { ...@@ -30,51 +48,63 @@ const ComingConfigTable = () => {
dataIndex: 'option', dataIndex: 'option',
width: '20%', width: '20%',
align: 'center', align: 'center',
render: (text: any, record: any) => ( render: (_, record: any) => (
<> <>
<Popconfirm {editable && (
title="确定要删除吗?" <Popconfirm
okText="是" title="确定要删除吗?"
cancelText="否" okText="是"
onConfirm={() => {}} cancelText="否"
> onConfirm={() => handleDelete(record.id)}
<Button
type="link"
danger
> >
删除 <Button
</Button> type="link"
</Popconfirm> danger
>
删除
</Button>
</Popconfirm>
)}
</> </>
), ),
}, },
]; ];
const handleConfirm = (value: ComingCtlValueType[]) => {
mutators.change(value);
};
return ( return (
<PolymericTable <>
rowKey="id" <Row
dataSource={[ justify="space-between"
{ style={{
id: 1, marginBottom: theme['@margin-md'],
name: '企业名称', }}
groupName: '营业执照信息', >
}, <Col span={16}>
{ <ComingCtl
id: 2, value={value}
name: '住所', roleId={roleId}
groupName: '营业执照信息', onConfirm={handleConfirm}
}, isCanAdd={editable}
{ />
id: 3, </Col>
name: '企业类型', <Col span={6}>
groupName: '营业执照信息', <Search value={''} onChange={() => {}} onSearch={() => {}} />
}, </Col>
]} </Row>
columns={columns} <PolymericTable
loading={false} rowKey="id"
pagination={null} dataSource={value}
/> columns={columns}
loading={false}
pagination={null}
/>
</>
); );
}; };
ComingConfigTable.isFieldComponent = true;
export default ComingConfigTable; export default ComingConfigTable;
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-28 15:19:56 * @Date: 2021-05-28 15:19:56
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 15:48:37 * @LastEditTime: 2021-06-01 14:47:01
* @Description: 入库资料操作组 * @Description: 入库资料操作组
*/ */
import React, { useState, useRef } from 'react'; import React, { useState, useRef, useEffect } from 'react';
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import { Space, Button, Drawer } from 'antd'; import { Space, Button, Drawer } from 'antd';
import { StandardTable } from 'god'; import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions, useSchemaProps } from '@formily/antd'; import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'; import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
...@@ -18,45 +18,52 @@ import querySchema from './schema'; ...@@ -18,45 +18,52 @@ import querySchema from './schema';
const formActions = createFormActions(); const formActions = createFormActions();
const fetchListData = async (params: any) => { export type ValueType = {
const payload = { ...params }; /**
const res = await PublicApi.getMemberAbilitySubPage(payload); * 注册资料Id
if (res.code === 1000) { */
// return res.data; id: number,
return { /**
data: [ * 中文名称
{ */
validateId: 1, fieldLocalName: string,
id: 1, /**
roleName: '白银会员', * 中文名称
roleType: '白银会员2', */
}, groupName: string,
{
validateId: 2,
id: 2,
roleName: '白银会员3',
roleType: '白银会员3',
},
{
validateId: 3,
id: 3,
roleName: '白银会员4',
roleType: '白银会员4',
},
],
totalCount: 3,
};
}
return [];
}; };
const ComingCtl: React.FC = () => { interface IProps {
/**
* 角色id
*/
roleId: number,
/**
* 点击确认事件触发
*/
onConfirm: (value: ValueType[]) => void,
/**
* 值
*/
value?: ValueType[],
/**
* 是否可新增的
*/
isCanAdd?: boolean,
}
const ComingCtl = (props: IProps) => {
const {
roleId,
onConfirm,
value,
isCanAdd,
} = props;
const [visibleDrawer, setVisibleDrawer] = useState(false); const [visibleDrawer, setVisibleDrawer] = useState(false);
const ref = useRef<any>({}); const ref = useRef<any>({});
const schemaProps = useSchemaProps(); const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'id' });
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'validateId' });
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
...@@ -64,42 +71,64 @@ const ComingCtl: React.FC = () => { ...@@ -64,42 +71,64 @@ const ComingCtl: React.FC = () => {
dataIndex: 'id', dataIndex: 'id',
}, },
{ {
title: '会员角色', title: '中文名称',
dataIndex: 'roleName', dataIndex: 'fieldLocalName',
},
{
title: '角色类型',
dataIndex: 'roleType',
}, },
{ {
title: '会员类型', title: '分组名称',
dataIndex: 'memberTypeName', dataIndex: 'groupName',
},
{
title: '业务类型',
dataIndex: 'memberTypeName',
}, },
]; ];
const fetchListData = async (params: any) => {
if (!roleId) {
return {};
}
const payload = { ...params, roleId };
const res = await PublicApi.getMemberProcessRuleConfigPage(payload);
if (res.code === 1000) {
return res.data;
}
return {};
};
useEffect(() => {
if (ref && ref.current && ref.current.reload){
ref.current.reload({ roleId });
}
}, [props.roleId]);
useEffect(() => {
if ('value' in props) {
// 同步
RowCtl.setSelectRow(value);
RowCtl.setSelectedRowKeys(value.map((item) => item.id));
}
}, [value]);
const handleVisibleDrawer = (flag: boolean) => { const handleVisibleDrawer = (flag: boolean) => {
setVisibleDrawer(!!flag); setVisibleDrawer(!!flag);
}; };
const handleConfirm = () => { const handleConfirm = () => {
console.log('RowCtlRowCtlRowCtl', RowCtl); if (onConfirm) {
// props.mutators.change([]); onConfirm(RowCtl.selectRow);
handleVisibleDrawer(false);
}
}; };
return ( return (
<div> <div>
<Space size="middle"> <Space size="middle">
<Button {isCanAdd && (
type="primary" <Button
icon={<PlusOutlined />} type="primary"
onClick={() => handleVisibleDrawer(true)} icon={<PlusOutlined />}
> onClick={() => handleVisibleDrawer(true)}
新建入库资料 >
</Button> 新建入库资料
</Button>
)}
<Button> <Button>
预览入库资料 预览入库资料
</Button> </Button>
...@@ -127,7 +156,7 @@ const ComingCtl: React.FC = () => { ...@@ -127,7 +156,7 @@ const ComingCtl: React.FC = () => {
> >
<StandardTable <StandardTable
tableProps={{ tableProps={{
rowKey: 'validateId', rowKey: 'id',
}} }}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
...@@ -149,4 +178,8 @@ const ComingCtl: React.FC = () => { ...@@ -149,4 +178,8 @@ const ComingCtl: React.FC = () => {
); );
}; };
ComingCtl.defaultProps = {
isCanAdd: false,
};
export default ComingCtl; export default ComingCtl;
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-28 11:20:47 * @Date: 2021-05-28 11:20:47
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 14:59:42 * @LastEditTime: 2021-06-01 13:58:17
* @Description: 流程列表 Form Item * @Description: 流程列表 Form Item
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
import { CaretDownOutlined, CaretUpOutlined } from '@ant-design/icons'; import { CaretDownOutlined, CaretUpOutlined } from '@ant-design/icons';
import classNames from 'classnames'; import classNames from 'classnames';
import StatusTag, { StatusTagProps } from '@/components/StatusTag'; import StatusTag, { StatusTagProps } from '@/components/StatusTag';
import styles from './index.less'; import styles from './index.less';
interface AddressItem { interface ListItem {
/** /**
* 数据id * 数据id
*/ */
...@@ -19,11 +19,11 @@ interface AddressItem { ...@@ -19,11 +19,11 @@ interface AddressItem {
/** /**
* 标题 * 标题
*/ */
title: string; processName: string;
/** /**
* 流程 * 流程
*/ */
flow: string; processTypeName: string;
/** /**
* 描述 * 描述
*/ */
...@@ -34,11 +34,11 @@ interface IProps extends Pick<StatusTagProps, 'type'> { ...@@ -34,11 +34,11 @@ interface IProps extends Pick<StatusTagProps, 'type'> {
/** /**
* 值 * 值
*/ */
value: AddressItem; value: string;
/** /**
* 列表数据 * 列表数据
*/ */
dataSource: AddressItem[]; dataSource: ListItem[];
/** /**
* 默认展示的条数,默认值 3 * 默认展示的条数,默认值 3
*/ */
...@@ -77,7 +77,7 @@ const FlowListFormItem = (props: IProps) => { ...@@ -77,7 +77,7 @@ const FlowListFormItem = (props: IProps) => {
const handleSelectItem = record => { const handleSelectItem = record => {
if (onChange && !disabled) { if (onChange && !disabled) {
onChange(record); onChange(record.id);
} }
}; };
...@@ -87,18 +87,18 @@ const FlowListFormItem = (props: IProps) => { ...@@ -87,18 +87,18 @@ const FlowListFormItem = (props: IProps) => {
{showDataSource.map(item => ( {showDataSource.map(item => (
<li <li
className={classNames(styles['list-item'], { className={classNames(styles['list-item'], {
[styles.active]: item.id === (value && value.id), [styles.active]: item.id === value,
[styles.disabled]: disabled, [styles.disabled]: disabled,
[styles.hide]: readOnly && item.id !== (value && value.id), [styles.hide]: readOnly && item.id !== value,
})} })}
onClick={() => handleSelectItem(item)} onClick={() => handleSelectItem(item)}
key={item.id} key={item.id}
> >
<div className={styles['list-item-head']}> <div className={styles['list-item-head']}>
<div className={styles['list-item-title']}> <div className={styles['list-item-title']}>
{item.title} {item.processName}
</div> </div>
<StatusTag title={item.flow} type={type} /> <StatusTag title={item.processTypeName} type={type} />
</div> </div>
<div className={styles['list-item-desc']}> <div className={styles['list-item-desc']}>
{item.description} {item.description}
......
...@@ -2,69 +2,73 @@ ...@@ -2,69 +2,73 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-27 17:12:55 * @Date: 2021-05-27 17:12:55
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 11:16:25 * @LastEditTime: 2021-06-01 14:52:18
* @Description: 适用会员角色 Form Item * @Description: 适用会员角色 Form Item
*/ */
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import { Button, Descriptions, Drawer } from 'antd'; import { Button, Descriptions, Drawer, message } from 'antd';
import { import {
PlusOutlined, PlusOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import { StandardTable } from 'god'; import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions, useSchemaProps } from '@formily/antd'; import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'; import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import querySchema from './schema'; import querySchema from './schema';
import styles from './index.less'; import styles from './index.less';
export type ValueType = {
/**
* 角色id
*/
roleId: number,
/**
* 角色名称
*/
roleName: string,
/**
* 角色类型
*/
roleTypeName: string,
/**
* 会员类型
*/
memberTypeName: string,
/**
* 业务类型
*/
businessTypeName: string,
};
const formActions = createFormActions(); const formActions = createFormActions();
const fetchListData = async (params: any) => { const fetchListData = async (params: any) => {
const payload = { ...params }; const payload = { ...params };
const res = await PublicApi.getMemberAbilitySubPage(payload); const res = await PublicApi.getMemberProcessRuleRolePage(payload);
if (res.code === 1000) { if (res.code === 1000) {
// return res.data; return res.data;
return {
data: [
{
validateId: 1,
id: 1,
roleName: '白银会员',
roleType: '白银会员2',
},
{
validateId: 2,
id: 2,
roleName: '白银会员3',
roleType: '白银会员3',
},
{
validateId: 3,
id: 3,
roleName: '白银会员4',
roleType: '白银会员4',
},
],
totalCount: 3,
};
} }
return []; return [];
}; };
const MemberRoleFormItem = (props) => { const MemberRoleFormItem = (props) => {
const {
value,
mutators,
editable,
} = props;
const [visibleDrawer, setVisibleDrawer] = useState(false); const [visibleDrawer, setVisibleDrawer] = useState(false);
const ref = useRef<any>({}); const ref = useRef<any>({});
const schemaProps = useSchemaProps(); const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'roleId', type: 'radio' });
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'validateId', type: 'radio' });
const columns: ColumnType<any>[] = [ const columns: ColumnType<ValueType>[] = [
{ {
title: 'ID', title: 'ID',
dataIndex: 'id', dataIndex: 'roleId',
}, },
{ {
title: '会员角色', title: '会员角色',
...@@ -72,7 +76,7 @@ const MemberRoleFormItem = (props) => { ...@@ -72,7 +76,7 @@ const MemberRoleFormItem = (props) => {
}, },
{ {
title: '角色类型', title: '角色类型',
dataIndex: 'roleType', dataIndex: 'roleTypeName',
}, },
{ {
title: '会员类型', title: '会员类型',
...@@ -80,7 +84,7 @@ const MemberRoleFormItem = (props) => { ...@@ -80,7 +84,7 @@ const MemberRoleFormItem = (props) => {
}, },
{ {
title: '业务类型', title: '业务类型',
dataIndex: 'memberTypeName', dataIndex: 'businessTypeName',
}, },
]; ];
...@@ -90,7 +94,11 @@ const MemberRoleFormItem = (props) => { ...@@ -90,7 +94,11 @@ const MemberRoleFormItem = (props) => {
const handleConfirm = () => { const handleConfirm = () => {
console.log('RowCtlRowCtlRowCtl', RowCtl); console.log('RowCtlRowCtlRowCtl', RowCtl);
// props.mutators.change([]); if (!RowCtl.selectRow.length) {
message.warning('请选择会员角色');
}
mutators.change(RowCtl.selectRow[0]);
handleVisibleDrawer(false);
}; };
return ( return (
...@@ -100,16 +108,17 @@ const MemberRoleFormItem = (props) => { ...@@ -100,16 +108,17 @@ const MemberRoleFormItem = (props) => {
icon={<PlusOutlined />} icon={<PlusOutlined />}
className={styles['memberRole-action']} className={styles['memberRole-action']}
onClick={() => handleVisibleDrawer(true)} onClick={() => handleVisibleDrawer(true)}
disabled={!editable}
block block
> >
选择 选择
</Button> </Button>
<div className={styles['memberRole-stamp']}> <div className={styles['memberRole-stamp']}>
<Descriptions column={1}> <Descriptions column={1}>
<Descriptions.Item label="会员角色" labelStyle={{ width: 104 }}>供应商</Descriptions.Item> <Descriptions.Item label="会员角色" labelStyle={{ width: 104 }}>{value?.roleName || ''}</Descriptions.Item>
<Descriptions.Item label="角色类型" labelStyle={{ width: 104 }}>服务消费者</Descriptions.Item> <Descriptions.Item label="角色类型" labelStyle={{ width: 104 }}>{value?.roleTypeName || ''}</Descriptions.Item>
<Descriptions.Item label="企业类型" labelStyle={{ width: 104 }}>企业会员</Descriptions.Item> <Descriptions.Item label="会员类型" labelStyle={{ width: 104 }}>{value?.memberTypeName || ''}</Descriptions.Item>
<Descriptions.Item label="业务类型" labelStyle={{ width: 104 }}>商品销售</Descriptions.Item> <Descriptions.Item label="业务类型" labelStyle={{ width: 104 }}>{value?.businessTypeName || ''}</Descriptions.Item>
</Descriptions> </Descriptions>
</div> </div>
...@@ -135,7 +144,7 @@ const MemberRoleFormItem = (props) => { ...@@ -135,7 +144,7 @@ const MemberRoleFormItem = (props) => {
> >
<StandardTable <StandardTable
tableProps={{ tableProps={{
rowKey: 'validateId', rowKey: 'roleId',
}} }}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
......
...@@ -2,14 +2,51 @@ ...@@ -2,14 +2,51 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-28 15:06:41 * @Date: 2021-05-28 15:06:41
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 15:15:47 * @LastEditTime: 2021-06-01 10:59:23
* @Description: 平台注册资料 * @Description: 平台注册资料
*/ */
import React from 'react'; import React, { useState, useEffect } from 'react';
import { Row, Col, Descriptions, Checkbox, Tooltip } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api';
import theme from '../../../../../../../../config/lingxi.theme.config';
import PolymericTable from '@/components/PolymericTable'; import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface'; import { EditableColumns } from '@/components/PolymericTable/interface';
import Search from '../Search';
const PAGE_SIZE = 10;
interface FetchListParams {
/**
* 角色id
*/
roleId?: number,
/**
* 当前页
*/
current?: number,
/**
* 当前页数
*/
pageSize?: number,
}
interface IProps {
/**
* 角色id
*/
roleId: number,
}
const PlatformConfigTable = (props: IProps) => {
const {
roleId,
} = props;
const [page, setPage] = useState(1);
const [size, setSize] = useState(PAGE_SIZE);
const [loading, setLoading] = useState(false);
const [data, setData] = useState({ data: [], totalCount: 0 });
const PlatformConfigTable = () => {
const columns: EditableColumns[] = [ const columns: EditableColumns[] = [
{ {
title: 'ID', title: 'ID',
...@@ -18,7 +55,7 @@ const PlatformConfigTable = () => { ...@@ -18,7 +55,7 @@ const PlatformConfigTable = () => {
}, },
{ {
title: '中文名称', title: '中文名称',
dataIndex: 'name', dataIndex: 'fieldLocalName',
}, },
{ {
title: '分组信息', title: '分组信息',
...@@ -26,30 +63,80 @@ const PlatformConfigTable = () => { ...@@ -26,30 +63,80 @@ const PlatformConfigTable = () => {
}, },
]; ];
const getMemberProcessRuleRoleConfigPage = async (params?: FetchListParams) => {
if (!roleId) {
return;
}
setLoading(true);
const res = await PublicApi.getMemberProcessRuleRoleConfigPage({
roleId: `${roleId}`,
current: `${params?.current || page}`,
pageSize: `${params?.pageSize || size}`,
});
if (res.code === 1000) {
setData(res.data);
}
setLoading(false);
};
useEffect(() => {
getMemberProcessRuleRoleConfigPage();
}, [props.roleId]);
const handlePaginationChange = (current: number, pageSize: number) => {
setPage(current);
setSize(pageSize);
getMemberProcessRuleRoleConfigPage({
current,
pageSize,
});
};
return ( return (
<PolymericTable <>
rowKey="id" <Row
dataSource={[ justify="space-between"
{ style={{
id: 1, marginBottom: theme['@margin-md'],
name: '企业名称', }}
groupName: '营业执照信息', >
}, <Col span={16}>
{ <Descriptions column={1} colon={false}>
id: 2, <Descriptions.Item
name: '住所', label={(
groupName: '营业执照信息', <div style={{ display: 'flex', alignItems: 'center' }}>
}, 平台注册资料
{ <Tooltip title="会员在平台注册时已填写的资料">
id: 3, <QuestionCircleOutlined
name: '企业类型', style={{ margin: '0 3px', cursor: 'default', marginLeft: 3 }}
groupName: '营业执照信息', size={16}
}, />
]} </Tooltip>
columns={columns} </div>
loading={false} )}
pagination={null} labelStyle={{ width: 180 }}
/> >
<Checkbox checked disabled>使用平台注册资料(默认)</Checkbox>
</Descriptions.Item>
</Descriptions>
</Col>
<Col span={6}>
<Search value={''} onChange={() => {}} onSearch={() => {}} />
</Col>
</Row>
<PolymericTable
rowKey="id"
dataSource={data.data}
columns={columns}
loading={loading}
pagination={{
current: page,
pageSize: size,
total: data.totalCount,
}}
onPaginationChange={handlePaginationChange}
/>
</>
); );
}; };
......
/*
* @Author: XieZhiXiong
* @Date: 2021-05-31 16:24:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-31 16:24:45
* @Description:
*/
import { useBusinessEffects } from './useBusinessEffects';
import { PublicApi } from '@/services/api';
export const createEffects = (context, actions) => {
const { setFieldState } = actions;
useBusinessEffects(context, actions);
// 查询入库流程、变更流程列表
PublicApi.getMemberProcessRuleBaseList().then(res => {
if (res.code === 1000) {
setFieldState('depositoryProcessId', state => {
state.props['x-component-props'].dataSource = res.data.filter((item) => item.processType === 1);
});
setFieldState('changedProcessId', state => {
state.props['x-component-props'].dataSource = res.data.filter((item) => item.processType === 2);
});
}
});
};
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-05-31 16:24:22
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-01 14:39:50
* @Description:
*/
import { FormEffectHooks, FormPath, ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd';
const {
onFieldValueChange$,
onFieldInputChange$,
} = FormEffectHooks;
export const useBusinessEffects = (context, actions: (ISchemaFormActions | ISchemaFormAsyncActions)) => {
const { setFieldState, setFieldValue } = actions;
// 适用会员联动 平台注册资料
onFieldValueChange$('memberRole').subscribe(fieldState => {
const { value } = fieldState;
setFieldState('*(platformConfigTable,configIds)', state => {
state.props['x-component-props'].roleId = value?.roleId || 0;
});
});
// 适用会员联动 平台注册资料
onFieldInputChange$('memberRole').subscribe(fieldState => {
// 清空
setFieldValue('configIds', []);
});
}
\ No newline at end of file
...@@ -2,37 +2,30 @@ ...@@ -2,37 +2,30 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-27 16:13:05 * @Date: 2021-05-27 16:13:05
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 15:14:38 * @LastEditTime: 2021-06-01 14:56:14
* @Description: * @Description:
*/ */
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect } from 'react';
import { history, Prompt } from 'umi'; import { history, Prompt } from 'umi';
import { Button, Card, Spin, Tooltip, message } from 'antd'; import { Button, Card, Spin, Tooltip, message } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined, QuestionCircleOutlined } from '@ant-design/icons'; import { SaveOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd'; import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { Checkbox } from '@formily/antd-components'; import { Checkbox } from '@formily/antd-components';
import { merge } from 'rxjs';
import { usePageStatus } from '@/hooks/usePageStatus';
import ReutrnEle from '@/components/ReturnEle'; import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetMemberAbilitySubGetResponse } from '@/services/MemberApi'; import { GetMemberProcessRuleGetResponse } from '@/services/MemberV2Api';
import formSchema from './schema'; import formSchema from './schema';
import { createEffects } from './effects';
import MemberRoleFormItem from './components/MemberRoleFormItem'; import MemberRoleFormItem from './components/MemberRoleFormItem';
import FlowListFormItem from './components/FlowListFormItem'; import FlowListFormItem from './components/FlowListFormItem';
import Search from './components/Search'; import Search from './components/Search';
import PlatformConfigTable from './components/PlatformConfigTable'; import PlatformConfigTable from './components/PlatformConfigTable';
import ComingCtl from './components/ComingCtl';
import ComingConfigTable from './components/ComingConfigTable'; import ComingConfigTable from './components/ComingConfigTable';
const formActions = createFormActions(); const formActions = createFormActions();
const { const {
onFieldValueChange$,
onFieldInputChange$,
onFormInputChange$, onFormInputChange$,
} = FormEffectHooks; } = FormEffectHooks;
...@@ -42,10 +35,6 @@ interface MemberFormProps { ...@@ -42,10 +35,6 @@ interface MemberFormProps {
*/ */
id?: number; id?: number;
/** /**
* 数据 审核id
*/
validateId?: number;
/**
* 是否可编辑的 * 是否可编辑的
*/ */
isEdit?: boolean, isEdit?: boolean,
...@@ -53,17 +42,47 @@ interface MemberFormProps { ...@@ -53,17 +42,47 @@ interface MemberFormProps {
const FlowRuleForm: React.FC<MemberFormProps> = ({ const FlowRuleForm: React.FC<MemberFormProps> = ({
id, id,
validateId,
isEdit = false, isEdit = false,
}) => { }) => {
const areaRef = useRef<any[]>([]) const [ruleInfo, setRuleInfo] = useState<GetMemberProcessRuleGetResponse>();
const [memberItems, setMemberItems] = useState<any>({});
const [submitLoading, setSubmitLoading] = useState(false); const [submitLoading, setSubmitLoading] = useState(false);
const [infoLoading, setInfoLoading] = useState(false); const [infoLoading, setInfoLoading] = useState(false);
const [unsaved, setUnsaved] = useState(false); const [unsaved, setUnsaved] = useState(false);
const getDetailedInfo = async () => { const getDetailedInfo = async () => {
if (!id) {
return;
}
setInfoLoading(true);
const res = await PublicApi.getMemberProcessRuleGet({
id: `${id}`,
});
if (res.code !== 1000) {
return;
}
const {
roleId,
roleName,
roleTypeName,
memberTypeName,
businessTypeName,
details,
...rest
} = res.data;
setRuleInfo({
memberRole: {
roleName,
businessTypeName,
memberTypeName,
roleId,
roleTypeName,
},
configIds: details,
...rest,
});
setInfoLoading(false);
}; };
useEffect(() => { useEffect(() => {
...@@ -72,42 +91,24 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({ ...@@ -72,42 +91,24 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({
const handleSubmit = (values: any) => { const handleSubmit = (values: any) => {
const { const {
memberTypeId, memberRole,
roleId, configIds,
level, usePlatformConfig,
countryCodeId,
phone,
email,
channelLevel,
channelTypeId,
areas = [],
remark,
outerStatus,
status,
statusName,
...rest ...rest
} = values; } = values;
const filtered = areas.filter(item => item.pcode || item.ccode); console.log('values', values);
if (!id && !isEdit) { if (!id && isEdit) {
setSubmitLoading(true); setSubmitLoading(true);
const msg = message.loading({ const msg = message.loading({
content: '正在添加,请稍候...', content: '正在添加,请稍候...',
duration: 0, duration: 0,
}); });
PublicApi.postMemberAbilitySubAdd({ PublicApi.postMemberProcessRuleAdd({
memberTypeId, roleId: memberRole.roleId,
roleId, configIds: configIds.map((item) => item.id),
level, ...rest,
countryCodeId,
phone,
email,
channelTypeId,
areas: filtered,
remark,
detail: rest,
}, { }, {
timeout: 0, timeout: 0,
}).then(res => { }).then(res => {
...@@ -122,28 +123,19 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({ ...@@ -122,28 +123,19 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({
msg(); msg();
setSubmitLoading(false); setSubmitLoading(false);
}); });
return; return;
} }
if (id && validateId && isEdit) { if (id && isEdit) {
setSubmitLoading(true); setSubmitLoading(true);
const msg = message.loading({ const msg = message.loading({
content: '正在保存,请稍候...', content: '正在保存,请稍候...',
duration: 0, duration: 0,
}); });
PublicApi.postMemberAbilitySubUpdate({ PublicApi.postMemberProcessRuleUpdate({
memberId: id, id,
validateId, roleId: memberRole.roleId,
memberTypeId, configIds: configIds.map((item) => item.id),
roleId, ...rest,
level,
countryCodeId,
phone,
email,
channelTypeId,
areas: filtered,
remark,
detail: rest,
}, { }, {
timeout: 0, timeout: 0,
}).then(res => { }).then(res => {
...@@ -161,24 +153,6 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({ ...@@ -161,24 +153,6 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({
} }
}; };
const createRichTextUtils = () => {
return {
text(...args) {
return React.createElement('span', {}, ...args)
},
help(text, offset = 3) {
return React.createElement(
Tooltip,
{ title: text },
<QuestionCircleOutlined
style={{ margin: '0 3px', cursor: 'default', marginLeft: offset }}
size={16}
/>
)
},
}
}
return ( return (
<Spin spinning={infoLoading}> <Spin spinning={infoLoading}>
<PageHeaderWrapper <PageHeaderWrapper
...@@ -187,38 +161,37 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({ ...@@ -187,38 +161,37 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({
}} }}
onBack={() => history.goBack()} onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />} backIcon={<ReutrnEle description="返回" />}
title={!id ? '新增会员管理流程规则' : '编辑会员管理流程规则会员'} title={!id ? isEdit ? '新增会员管理流程规则' : '查看会员管理流程规则' : '编辑会员管理流程规则会员'}
extra={[ extra={[
<Button (isEdit ? (
key="1" <Button
type="primary" key="1"
icon={<SaveOutlined />} type="primary"
loading={submitLoading} icon={<SaveOutlined />}
// onClick={() => formActions.submit()} loading={submitLoading}
> onClick={() => formActions.submit()}
保存 >
</Button>, 保存
</Button>
) : null),
]} ]}
> >
<Card> <Card>
<NiceForm <NiceForm
onSubmit={handleSubmit} onSubmit={handleSubmit}
actions={formActions} actions={formActions}
initialValues={{}} initialValues={ruleInfo}
components={{ components={{
MemberRoleFormItem, MemberRoleFormItem,
FlowListFormItem, FlowListFormItem,
MySearch: Search, MySearch: Search,
ComingCtl,
Checkbox, Checkbox,
CheckboxGroup: Checkbox.Group CheckboxGroup: Checkbox.Group,
}} PlatformConfigTable,
expressionScope={{ ComingConfigTable,
...createRichTextUtils(),
PlatformConfigTable: <PlatformConfigTable />,
ComingConfigTable: <ComingConfigTable />,
}} }}
effects={($, actions) => { effects={($, actions) => {
createEffects($, actions);
onFormInputChange$().subscribe(() => { onFormInputChange$().subscribe(() => {
if (!unsaved) { if (!unsaved) {
setUnsaved(true); setUnsaved(true);
...@@ -238,7 +211,6 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({ ...@@ -238,7 +211,6 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({
FlowRuleForm.defaultProps = { FlowRuleForm.defaultProps = {
id: 0, id: 0,
validateId: 0,
isEdit: false, isEdit: false,
}; };
......
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-27 16:13:26 * @Date: 2021-05-27 16:13:26
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 15:45:23 * @LastEditTime: 2021-06-01 14:18:51
* @Description: * @Description:
*/ */
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { PATTERN_MAPS } from '@/constants/regExp';
const formSchema: ISchema = { const formSchema: ISchema = {
type: 'object', type: 'object',
...@@ -41,8 +40,14 @@ const formSchema: ISchema = { ...@@ -41,8 +40,14 @@ const formSchema: ISchema = {
'x-component-props': { 'x-component-props': {
placeholder: '请输入', placeholder: '请输入',
}, },
'x-rules': [
{
limitByte: true, // 自定义校验规则
maxByte: 48,
}
],
}, },
roleId: { memberRole: {
type: 'string', type: 'string',
required: true, required: true,
title: '适用会员角色', title: '适用会员角色',
...@@ -71,32 +76,13 @@ const formSchema: ISchema = { ...@@ -71,32 +76,13 @@ const formSchema: ISchema = {
labelAlign: 'left', labelAlign: 'left',
}, },
properties: { properties: {
comingRule: { depositoryProcessId: {
type: 'string', type: 'string',
required: true, required: true,
title: '流程选择', title: '流程选择',
'x-component': 'FlowListFormItem', 'x-component': 'FlowListFormItem',
'x-component-props': { 'x-component-props': {
dataSource: [ dataSource: [],
{
id: 1,
title: 'XGG1',
flow: '会员入库流程',
description: '1-确认入库',
},
{
id: 2,
title: 'XGG1',
flow: '会员入库流程',
description: '1-确认入库',
},
{
id: 3,
title: 'XGG1',
flow: '会员入库流程',
description: '1-确认入库',
},
],
type: 'success', type: 'success',
}, },
}, },
...@@ -111,39 +97,42 @@ const formSchema: ISchema = { ...@@ -111,39 +97,42 @@ const formSchema: ISchema = {
tab: '平台注册资料', tab: '平台注册资料',
}, },
properties: { properties: {
MEGA_LAYOUT1: { // MEGA_LAYOUT1: {
type: 'object', // type: 'object',
'x-component': 'Mega-Layout', // 'x-component': 'Mega-Layout',
'x-component-props': { // 'x-component-props': {
labelCol: 8, // labelCol: 8,
wrapperCol: 10, // wrapperCol: 10,
labelAlign: 'left', // labelAlign: 'left',
grid: true, // grid: true,
}, // },
properties: { // properties: {
usePlatformConfig: { // usePlatformConfig: {
type: 'string', // type: 'string',
title: "{{ text('平台注册资料', help('会员在平台注册时已填写的资料')) }}", // title: "{{ text('平台注册资料', help('会员在平台注册时已填写的资料')) }}",
'x-component': 'CheckboxGroup', // 'x-component': 'CheckboxGroup',
default: '1', // default: '1',
enum: [ // enum: [
{ label: '使用平台注册资料(默认)', value: '1' }, // { label: '使用平台注册资料(默认)', value: '1' },
] // ],
}, // 'x-component-props': {
searchPlatformConfig: { // disabled: true,
type: 'object', // },
'x-component': 'MySearch', // },
'x-component-props': { // searchPlatformConfig: {
placeholder: '搜索', // type: 'object',
}, // 'x-component': 'MySearch',
}, // 'x-component-props': {
}, // placeholder: '搜索',
}, // },
// },
// },
// },
platformConfigTable: { platformConfigTable: {
type: 'object', type: 'object',
'x-component': 'Children', 'x-component': 'PlatformConfigTable',
'x-component-props': { 'x-component-props': {
children: '{{PlatformConfigTable}}', roleId: 0,
}, },
}, },
}, },
...@@ -155,31 +144,11 @@ const formSchema: ISchema = { ...@@ -155,31 +144,11 @@ const formSchema: ISchema = {
tab: '入库资料', tab: '入库资料',
}, },
properties: { properties: {
MEGA_LAYOUT1: { configIds: {
type: 'object', type: 'string',
'x-component': 'Mega-Layout', 'x-component': 'ComingConfigTable',
'x-component-props': {
grid: true,
},
properties: {
comingCtl: {
type: 'object',
'x-component': 'ComingCtl',
},
searchComingConfig: {
type: 'object',
'x-component': 'MySearch',
'x-component-props': {
placeholder: '搜索',
},
},
},
},
comingConfigTable: {
type: 'object',
'x-component': 'Children',
'x-component-props': { 'x-component-props': {
children: '{{ComingConfigTable}}',
}, },
}, },
}, },
...@@ -200,38 +169,13 @@ const formSchema: ISchema = { ...@@ -200,38 +169,13 @@ const formSchema: ISchema = {
labelAlign: 'left', labelAlign: 'left',
}, },
properties: { properties: {
changeRule: { changedProcessId: {
type: 'string', type: 'string',
required: true, required: true,
title: '流程选择', title: '流程选择',
'x-component': 'FlowListFormItem', 'x-component': 'FlowListFormItem',
'x-component-props': { 'x-component-props': {
dataSource: [ dataSource: [],
{
id: 1,
title: 'XGG1',
flow: '会员表更流程',
description: '1-确认入库',
},
{
id: 2,
title: 'XGG1',
flow: '会员表更流程',
description: '1-确认入库',
},
{
id: 3,
title: 'XGG1',
flow: '会员表更流程',
description: '1-确认入库',
},
{
id: 4,
title: 'XGG4',
flow: '会员表更流程',
description: '1-确认入库',
},
],
type: 'warning', type: 'warning',
}, },
}, },
......
...@@ -10,9 +10,9 @@ import { usePageStatus } from '@/hooks/usePageStatus'; ...@@ -10,9 +10,9 @@ import { usePageStatus } from '@/hooks/usePageStatus';
import FlowRuleForm from './components/FlowRuleForm'; import FlowRuleForm from './components/FlowRuleForm';
const MemberFlowRuleDetail: React.FC = () => { const MemberFlowRuleDetail: React.FC = () => {
const { id, validateId } = usePageStatus(); const { id } = usePageStatus();
return ( return (
<FlowRuleForm id={id} validateId={validateId} /> <FlowRuleForm id={id} />
); );
}; };
......
...@@ -6,11 +6,13 @@ ...@@ -6,11 +6,13 @@
* @Description: 编辑会员管理流程规则 * @Description: 编辑会员管理流程规则
*/ */
import React from 'react'; import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import FlowRuleForm from './components/FlowRuleForm'; import FlowRuleForm from './components/FlowRuleForm';
const MemberFlowRuleEdit: React.FC = () => { const MemberFlowRuleEdit: React.FC = () => {
const { id } = usePageStatus();
return ( return (
<FlowRuleForm isEdit /> <FlowRuleForm id={id} isEdit />
); );
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-27 16:01:23 * @Date: 2021-05-27 16:01:23
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-27 16:46:02 * @LastEditTime: 2021-06-01 14:35:51
* @Description: 会员管理流程规则配置 * @Description: 会员管理流程规则配置
*/ */
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
...@@ -21,22 +21,11 @@ import { StandardTable } from 'god'; ...@@ -21,22 +21,11 @@ import { StandardTable } from 'god';
import moment from 'moment'; import moment from 'moment';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions } from '@formily/antd'; import { createFormActions } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import {
MEMBER_OUTER_STATUS_UNCOMMITTED,
MEMBER_OUTER_STATUS_FAILED,
} from '@/constants/member';
import EyePreview from '@/components/EyePreview'; import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import StatusSwitch from '@/components/StatusSwitch'; import StatusSwitch from '@/components/StatusSwitch';
import StatusTag from '../components/StatusTag';
import { querySchema } from './schema'; import { querySchema } from './schema';
import { coverColFiltersItem } from '../utils';
import { MEMBER_OUTER_STATUS_TYPE } from '../constant';
import styles from './index.less';
const formActions = createFormActions(); const formActions = createFormActions();
...@@ -50,7 +39,7 @@ const fetchListData = async (params: any) => { ...@@ -50,7 +39,7 @@ const fetchListData = async (params: any) => {
if (endDate) { if (endDate) {
payload.endDate = moment(+endDate).format('YYYY-MM-DD'); payload.endDate = moment(+endDate).format('YYYY-MM-DD');
} }
const res = await PublicApi.getMemberAbilitySubPage(payload); const res = await PublicApi.getMemberProcessRulePage(payload);
if (res.code === 1000) { if (res.code === 1000) {
return res.data; return res.data;
...@@ -61,14 +50,13 @@ const fetchListData = async (params: any) => { ...@@ -61,14 +50,13 @@ const fetchListData = async (params: any) => {
const MemberFlowRule: React.FC<[]> = () => { const MemberFlowRule: React.FC<[]> = () => {
const ref = useRef<any>({}); const ref = useRef<any>({});
const handleDelete = (memberId: number, validateId: number) => { const handleDelete = (id: number) => {
const mesInstance = message.loading({ const mesInstance = message.loading({
content: '正在删除', content: '正在删除',
duration: 0, duration: 0,
}); });
PublicApi.postMemberAbilitySubDelete({ PublicApi.postMemberProcessRuleDelete({
memberId, id,
validateId,
}).then(res => { }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
return; return;
...@@ -78,23 +66,25 @@ const MemberFlowRule: React.FC<[]> = () => { ...@@ -78,23 +66,25 @@ const MemberFlowRule: React.FC<[]> = () => {
mesInstance(); mesInstance();
}); });
}; };
const handleCommit = (memberId: number, validateId: number) => { const handleModify = (id: number, status: number) => {
PublicApi.postMemberAbilitySubCommit({ const mesInstance = message.loading({
memberId, content: '正在修改',
validateId, duration: 0,
});
PublicApi.postMemberProcessRuleUpdateStatus({
id,
status: status === 0 ? 1 : 0,
}).then(res => { }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
return; return;
} }
ref.current.reload(); ref.current.reload();
}).finally(() => {
mesInstance();
}); });
}; };
const handleModify = record => {
};
const defaultColumns: ColumnType<any>[] = [ const defaultColumns: ColumnType<any>[] = [
{ {
title: 'ID', title: 'ID',
...@@ -102,11 +92,11 @@ const MemberFlowRule: React.FC<[]> = () => { ...@@ -102,11 +92,11 @@ const MemberFlowRule: React.FC<[]> = () => {
}, },
{ {
title: '流程规则名称', title: '流程规则名称',
dataIndex: 'name ', dataIndex: 'ruleName',
render: (text, record) => ( render: (text, record) => (
<> <>
<EyePreview <EyePreview
url={`/memberCenter/memberAbility/ruleConfiguration/memberFlowRule/detail?id=${record.memberId}&validateId=${record.validateId}`} url={`/memberCenter/memberAbility/ruleConfiguration/memberFlowRule/detail?id=${record.id}`}
> >
{text} {text}
</EyePreview> </EyePreview>
...@@ -119,7 +109,7 @@ const MemberFlowRule: React.FC<[]> = () => { ...@@ -119,7 +109,7 @@ const MemberFlowRule: React.FC<[]> = () => {
}, },
{ {
title: '角色类型', title: '角色类型',
dataIndex: 'roleName', dataIndex: 'roleTypeName',
}, },
{ {
title: '会员类型', title: '会员类型',
...@@ -127,7 +117,7 @@ const MemberFlowRule: React.FC<[]> = () => { ...@@ -127,7 +117,7 @@ const MemberFlowRule: React.FC<[]> = () => {
}, },
{ {
title: '业务类型', title: '业务类型',
dataIndex: 'memberTypeName', dataIndex: 'businessTypeName',
}, },
{ {
title: '操作时间', title: '操作时间',
...@@ -135,12 +125,12 @@ const MemberFlowRule: React.FC<[]> = () => { ...@@ -135,12 +125,12 @@ const MemberFlowRule: React.FC<[]> = () => {
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'outerStatusName', dataIndex: 'status',
filters: [], filters: [],
render: (text, record) => ( render: (_, record) => (
<StatusSwitch <StatusSwitch
fieldNames="state" fieldNames="status"
handleConfirm={() => handleModify(record)} handleConfirm={() => handleModify(record.id, record.status)}
record={record} record={record}
/> />
), ),
...@@ -155,7 +145,7 @@ const MemberFlowRule: React.FC<[]> = () => { ...@@ -155,7 +145,7 @@ const MemberFlowRule: React.FC<[]> = () => {
<Button <Button
type="link" type="link"
onClick={() => onClick={() =>
history.push(`/memberCenter/memberAbility/ruleConfiguration/memberFlowRule/edit?id=${record.memberId}&validateId=${record.validateId}`) history.push(`/memberCenter/memberAbility/ruleConfiguration/memberFlowRule/edit?id=${record.id}`)
} }
> >
编辑 编辑
...@@ -164,7 +154,7 @@ const MemberFlowRule: React.FC<[]> = () => { ...@@ -164,7 +154,7 @@ const MemberFlowRule: React.FC<[]> = () => {
title="确定要删除吗?" title="确定要删除吗?"
okText="是" okText="是"
cancelText="否" cancelText="否"
onConfirm={() => handleDelete(record.memberId, record.validateId)} onConfirm={() => handleDelete(record.id)}
> >
<Button <Button
type="link" type="link"
...@@ -200,7 +190,7 @@ const MemberFlowRule: React.FC<[]> = () => { ...@@ -200,7 +190,7 @@ const MemberFlowRule: React.FC<[]> = () => {
<Card> <Card>
<StandardTable <StandardTable
tableProps={{ tableProps={{
rowKey: 'validateId', rowKey: 'id',
}} }}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
......
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