Commit 2b904d61 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

🦄 refactor(会员管理): 修改会员管理路由

parent 96ba66a7
......@@ -15,7 +15,7 @@ import { DatePicker } from '@formily/antd-components'
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect'
import StatusTag from '@/components/StatusTag'
import { accountMemberType, accountStatusMap, memberStatusMap } from '../constant'
import LevelBrand from '@/pages/member/components/LevelBrand'
import LevelBrand from '@/pages/memberManage/components/LevelBrand'
import { validatorByte } from '@/utils/regExp'
const formActions = createFormActions();
......
/*
* @Author: XieZhiXiong
* @Date: 2021-06-10 14:30:16
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-10 15:29:04
* @Description: 区域选择单个Select
*/
import React from 'react';
import { Select } from 'antd';
import { SelectProps } from 'antd/lib/select';
interface IProps extends SelectProps<string> {
/**
* 选项
*/
options: {
/**
* 描述
*/
label: string,
/**
* 值
*/
value: any,
}[],
}
const AreaSelectItem = (props: IProps) => {
const {
disabled,
value,
options,
} = props;
const current = options.find((item) => item.value === value);
if (!disabled) {
return (
<Select
style={{
width: '100%',
}}
{...props}
>
{options.map((item) => (
<Select.Option
key={item.value}
value={item.value}
>
{item.label}
</Select.Option>
))}
</Select>
);
}
return (
<div>{current?.label}</div>
);
};
export default AreaSelectItem;
/*
* @Author: XieZhiXiong
* @Date: 2021-06-10 14:30:16
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-10 15:29:04
* @Description: 区域选择单个Select
*/
import React from 'react';
import { Select } from 'antd';
import { SelectProps } from 'antd/lib/select';
interface IProps extends SelectProps<string> {
/**
* 选项
*/
options: {
/**
* 描述
*/
label: string,
/**
* 值
*/
value: any,
}[],
}
const AreaSelectItem = (props: IProps) => {
const {
disabled,
value,
options,
} = props;
const current = options.find((item) => item.value === value);
if (!disabled) {
return (
<Select
style={{
width: '100%',
}}
{...props}
>
{options.map((item) => (
<Select.Option
key={item.value}
value={item.value}
>
{item.label}
</Select.Option>
))}
</Select>
);
}
return (
<div>{current?.label}</div>
);
};
export default AreaSelectItem;
/*
* @Author: XieZhiXiong
* @Date: 2021-06-10 14:27:37
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-10 16:00:07
* @Description: 区域选择
*/
import React, { useState, useEffect } from 'react';
import { Row, Col } from 'antd';
import { PublicApi } from '@/services/api';
import SelectItem from './SelectItem';
function isObj(value) {
return typeof value === 'object';
};
type AreaCodeType = {
/**
* 区域编码
*/
value: string
/**
* 区域名称
*/
label: string
}
const AreaSelect = (props) => {
const {
mutators,
editable,
} = props;
const value = isObj(props.value) ? props.value : {};
const XComponentProps = props.props['x-component-props'] || {};
const SelectProps = {
...XComponentProps,
disabled: !editable || XComponentProps.disabled,
};
const [provinceList, setProvinceList] = useState<AreaCodeType[]>([]);
const [cityList, setCityList] = useState<AreaCodeType[]>([]);
const [districtList, setDistrictList] = useState<AreaCodeType[]>([]);
const [provinceLoading, setProvinceLoading] = useState(false);
const [cityLoading, setCityLoading] = useState(false);
const [districtLoading, setDistrictLoading] = useState(false);
const [provinceValue, setProvinceValue] = useState<string | undefined>('');
const [cityValue, setCityValue] = useState<string | undefined>('');
const [districtValue, setDistrictValue] = useState<string | undefined>('');
const getProvinceList = async () => {
setProvinceLoading(true);
const res = await PublicApi.getMemberAreaProvince();
if (res.code === 1000) {
setProvinceList(res.data.map((item) => ({ label: item.name, value: item.code })));
}
setProvinceLoading(false);
};
const getCityList = async (code?: string) => {
if (!code) {
return;
}
setCityLoading(true);
const res = await PublicApi.getMemberAreaCity({ code });
if (res.code === 1000) {
setCityList(res.data.map((item) => ({ label: item.name, value: item.code })));
}
setCityLoading(false);
};
const getDistrictList = async (code?: string) => {
if (!code) {
return;
}
setDistrictLoading(true);
const res = await PublicApi.getMemberAreaDistrict({ code });
if (res.code === 1000) {
setDistrictList(res.data.map((item) => ({ label: item.name, value: item.code })));
}
setDistrictLoading(false);
};
useEffect(() => {
const {
provinceCode,
cityCode,
districtCode,
} = value;
setProvinceValue(provinceCode);
setCityValue(cityCode);
setDistrictValue(districtCode);
}, [value]);
useEffect(() => {
getProvinceList();
}, []);
useEffect(() => {
getCityList(provinceValue);
}, [provinceValue]);
useEffect(() => {
getDistrictList(cityValue);
}, [cityValue]);
const handleProvinceChange = (next: string) => {
setProvinceValue(next);
setCityValue(undefined);
setCityList([]);
setDistrictList([]);
setDistrictValue(undefined);
mutators.change({ ...value, provinceCode: next, cityCode: undefined, districtCode: undefined });
};
const handleCityChange = (next: string) => {
setCityValue(next);
setDistrictList([]);
setDistrictValue(undefined);
mutators.change({ ...value, cityCode: next, districtCode: undefined });
};
const handleDistrictChange = (next: string) => {
setDistrictValue(next);
mutators.change({ ...value, districtCode: next });
};
return (
<div
style={{
width: '100%',
}}
>
<Row gutter={16}>
<Col span={8}>
<SelectItem
placeholder="- 省 -"
allowClear
{...SelectProps}
value={provinceValue}
options={provinceList}
loading={provinceLoading}
onChange={handleProvinceChange}
/>
</Col>
<Col span={8}>
<SelectItem
placeholder="- 市 -"
allowClear
{...SelectProps}
value={cityValue}
options={cityList}
loading={cityLoading}
onChange={handleCityChange}
/>
</Col>
<Col span={8}>
<SelectItem
placeholder="- 县 / 区 -"
allowClear
{...SelectProps}
value={districtValue}
options={districtList}
loading={districtLoading}
onChange={handleDistrictChange}
/>
</Col>
</Row>
</div>
);
};
AreaSelect.isFieldComponent = true;
export default AreaSelect
/*
* @Author: XieZhiXiong
* @Date: 2021-06-10 14:27:37
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-10 16:00:07
* @Description: 区域选择
*/
import React, { useState, useEffect } from 'react';
import { Row, Col } from 'antd';
import { PublicApi } from '@/services/api';
import SelectItem from './SelectItem';
function isObj(value) {
return typeof value === 'object';
};
type AreaCodeType = {
/**
* 区域编码
*/
value: string
/**
* 区域名称
*/
label: string
}
const AreaSelect = (props) => {
const {
mutators,
editable,
} = props;
const value = isObj(props.value) ? props.value : {};
const XComponentProps = props.props['x-component-props'] || {};
const SelectProps = {
...XComponentProps,
disabled: !editable || XComponentProps.disabled,
};
const [provinceList, setProvinceList] = useState<AreaCodeType[]>([]);
const [cityList, setCityList] = useState<AreaCodeType[]>([]);
const [districtList, setDistrictList] = useState<AreaCodeType[]>([]);
const [provinceLoading, setProvinceLoading] = useState(false);
const [cityLoading, setCityLoading] = useState(false);
const [districtLoading, setDistrictLoading] = useState(false);
const [provinceValue, setProvinceValue] = useState<string | undefined>('');
const [cityValue, setCityValue] = useState<string | undefined>('');
const [districtValue, setDistrictValue] = useState<string | undefined>('');
const getProvinceList = async () => {
setProvinceLoading(true);
const res = await PublicApi.getMemberAreaProvince();
if (res.code === 1000) {
setProvinceList(res.data.map((item) => ({ label: item.name, value: item.code })));
}
setProvinceLoading(false);
};
const getCityList = async (code?: string) => {
if (!code) {
return;
}
setCityLoading(true);
const res = await PublicApi.getMemberAreaCity({ code });
if (res.code === 1000) {
setCityList(res.data.map((item) => ({ label: item.name, value: item.code })));
}
setCityLoading(false);
};
const getDistrictList = async (code?: string) => {
if (!code) {
return;
}
setDistrictLoading(true);
const res = await PublicApi.getMemberAreaDistrict({ code });
if (res.code === 1000) {
setDistrictList(res.data.map((item) => ({ label: item.name, value: item.code })));
}
setDistrictLoading(false);
};
useEffect(() => {
const {
provinceCode,
cityCode,
districtCode,
} = value;
setProvinceValue(provinceCode);
setCityValue(cityCode);
setDistrictValue(districtCode);
}, [value]);
useEffect(() => {
getProvinceList();
}, []);
useEffect(() => {
getCityList(provinceValue);
}, [provinceValue]);
useEffect(() => {
getDistrictList(cityValue);
}, [cityValue]);
const handleProvinceChange = (next: string) => {
setProvinceValue(next);
setCityValue(undefined);
setCityList([]);
setDistrictList([]);
setDistrictValue(undefined);
mutators.change({ ...value, provinceCode: next, cityCode: undefined, districtCode: undefined });
};
const handleCityChange = (next: string) => {
setCityValue(next);
setDistrictList([]);
setDistrictValue(undefined);
mutators.change({ ...value, cityCode: next, districtCode: undefined });
};
const handleDistrictChange = (next: string) => {
setDistrictValue(next);
mutators.change({ ...value, districtCode: next });
};
return (
<div
style={{
width: '100%',
}}
>
<Row gutter={16}>
<Col span={8}>
<SelectItem
placeholder="- 省 -"
allowClear
{...SelectProps}
value={provinceValue}
options={provinceList}
loading={provinceLoading}
onChange={handleProvinceChange}
/>
</Col>
<Col span={8}>
<SelectItem
placeholder="- 市 -"
allowClear
{...SelectProps}
value={cityValue}
options={cityList}
loading={cityLoading}
onChange={handleCityChange}
/>
</Col>
<Col span={8}>
<SelectItem
placeholder="- 县 / 区 -"
allowClear
{...SelectProps}
value={districtValue}
options={districtList}
loading={districtLoading}
onChange={handleDistrictChange}
/>
</Col>
</Row>
</div>
);
};
AreaSelect.isFieldComponent = true;
export default AreaSelect
import React from 'react';
import {
Tabs,
Badge,
} from 'antd';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import MellowCard from '@/components/MellowCard';
import StatusTag from '@/components/StatusTag';
import {
MEMBER_INNER_STATUS_BADGE_COLOR,
MEMBER_OUTER_STATUS_TYPE,
} from '../../constant';
export interface InnerHistoryItem {
createTime?: string,
id?: number,
innerStatus?: number,
innerStatusName?: string,
operation?: string,
operatorJobTitle?: string,
operatorName?: string,
operatorOrgName?: string,
remark?: string,
};
export interface OuterHistoryItem {
createTime?: string,
id?: number,
operation?: string,
operatorRoleName?: string,
outerStatus?: number,
outerStatusName?: string,
remark?: string,
};
interface FlowRecordsProps {
outerHistory?: OuterHistoryItem[];
innerHistory?: InnerHistoryItem[];
};
const FlowRecords: React.FC<FlowRecordsProps> = ({ outerHistory = [], innerHistory = [] }) => {
const outerColumns: EditableColumns<OuterHistoryItem>[] = [
{
title: '序号',
dataIndex: 'index',
align: 'center',
render: (text, record, index) => index + 1,
},
{
title: '操作角色',
dataIndex: 'operatorRoleName',
align: 'center',
},
{
title: '状态',
dataIndex: 'outerStatusName',
align: 'center',
render: (text, record) => (
<StatusTag type={MEMBER_OUTER_STATUS_TYPE[record.outerStatus as number]} title={text} />
),
},
{
title: '操作',
dataIndex: 'operation',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'createTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'remark',
align: 'center',
ellipsis: true,
},
];
const innerColumns: EditableColumns<InnerHistoryItem>[] = [
{
title: '序号',
dataIndex: 'index',
align: 'center',
render: (text, record, index) => index + 1,
},
{
title: '操作人',
dataIndex: 'operatorName',
align: 'center',
},
{
title: '部门',
dataIndex: 'operatorOrgName',
align: 'center',
},
{
title: '职位',
dataIndex: 'operatorJobTitle',
align: 'center',
},
{
title: '状态',
dataIndex: 'innerStatusName',
align: 'center',
render: (text, record) => (
<Badge color={MEMBER_INNER_STATUS_BADGE_COLOR[record.innerStatus as number] || '#606266'} text={text} />
),
},
{
title: '操作',
dataIndex: 'operation',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'createTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'remark',
align: 'center',
ellipsis: true,
},
];
return (
<MellowCard>
<Tabs onChange={() => { }}>
<Tabs.TabPane tab="流转记录" key="1">
<PolymericTable
dataSource={outerHistory}
columns={outerColumns}
loading={false}
pagination={null}
/>
</Tabs.TabPane>
<Tabs.TabPane tab="内部单据流转记录" key="2">
<PolymericTable
dataSource={innerHistory}
columns={innerColumns}
loading={false}
pagination={null}
/>
</Tabs.TabPane>
</Tabs>
</MellowCard>
);
};
import React from 'react';
import {
Tabs,
Badge,
} from 'antd';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import MellowCard from '@/components/MellowCard';
import StatusTag from '@/components/StatusTag';
import {
MEMBER_INNER_STATUS_BADGE_COLOR,
MEMBER_OUTER_STATUS_TYPE,
} from '../../constant';
export interface InnerHistoryItem {
createTime?: string,
id?: number,
innerStatus?: number,
innerStatusName?: string,
operation?: string,
operatorJobTitle?: string,
operatorName?: string,
operatorOrgName?: string,
remark?: string,
};
export interface OuterHistoryItem {
createTime?: string,
id?: number,
operation?: string,
operatorRoleName?: string,
outerStatus?: number,
outerStatusName?: string,
remark?: string,
};
interface FlowRecordsProps {
outerHistory?: OuterHistoryItem[];
innerHistory?: InnerHistoryItem[];
};
const FlowRecords: React.FC<FlowRecordsProps> = ({ outerHistory = [], innerHistory = [] }) => {
const outerColumns: EditableColumns<OuterHistoryItem>[] = [
{
title: '序号',
dataIndex: 'index',
align: 'center',
render: (text, record, index) => index + 1,
},
{
title: '操作角色',
dataIndex: 'operatorRoleName',
align: 'center',
},
{
title: '状态',
dataIndex: 'outerStatusName',
align: 'center',
render: (text, record) => (
<StatusTag type={MEMBER_OUTER_STATUS_TYPE[record.outerStatus as number]} title={text} />
),
},
{
title: '操作',
dataIndex: 'operation',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'createTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'remark',
align: 'center',
ellipsis: true,
},
];
const innerColumns: EditableColumns<InnerHistoryItem>[] = [
{
title: '序号',
dataIndex: 'index',
align: 'center',
render: (text, record, index) => index + 1,
},
{
title: '操作人',
dataIndex: 'operatorName',
align: 'center',
},
{
title: '部门',
dataIndex: 'operatorOrgName',
align: 'center',
},
{
title: '职位',
dataIndex: 'operatorJobTitle',
align: 'center',
},
{
title: '状态',
dataIndex: 'innerStatusName',
align: 'center',
render: (text, record) => (
<Badge color={MEMBER_INNER_STATUS_BADGE_COLOR[record.innerStatus as number] || '#606266'} text={text} />
),
},
{
title: '操作',
dataIndex: 'operation',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'createTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'remark',
align: 'center',
ellipsis: true,
},
];
return (
<MellowCard>
<Tabs onChange={() => { }}>
<Tabs.TabPane tab="流转记录" key="1">
<PolymericTable
dataSource={outerHistory}
columns={outerColumns}
loading={false}
pagination={null}
/>
</Tabs.TabPane>
<Tabs.TabPane tab="内部单据流转记录" key="2">
<PolymericTable
dataSource={innerHistory}
columns={innerColumns}
loading={false}
pagination={null}
/>
</Tabs.TabPane>
</Tabs>
</MellowCard>
);
};
export default FlowRecords;
\ No newline at end of file
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const AddEquity: React.FC = () => {
const { id } = usePageStatus();
return (
<DetailInfo id={id} isEdit />
);
};
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const AddEquity: React.FC = () => {
const { id } = usePageStatus();
return (
<DetailInfo id={id} isEdit />
);
};
export default AddEquity;
\ No newline at end of file
.headerTop {
display: flex;
align-items: center;
font-size: 18px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
&-icon {
width: 48px;
height: 48px;
line-height: 48px;
border-radius: 4px;
border: 1px solid #DFE1E6;
color: #fff;
text-align: center;
background-color: #8777D9;
}
&-level {
color: #303133;
margin: 0 8px 0 12px;
}
&-identity {
width: 72px;
height: 24px;
line-height: 24px;
background-color: #FFEBE6;
border-radius: 4px;
color: #E63F3B;
font-size: 12px;
font-weight: 400;
text-align: center;
}
}
.headerMain {
display: flex;
&-left {
flex: 6;
display: flex;
flex-wrap: wrap;
padding-left: 90px;
&-option {
display: flex;
width: calc(100% / 3);
margin-bottom: 17px;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #909399;
padding-right: 20px;
&:nth-of-type(n + 4) {
margin: 0;
}
div {
flex: 1;
&:nth-last-of-type(1) {
flex: 2;
}
}
}
}
&-right {
flex: 1;
text-align: right;
}
}
.extra {
&-main {
display: flex;
&-content {
position: relative;
flex: 1;
&:nth-last-of-type(1) {
flex: 2.5;
}
}
.left {
display: flex;
align-items: center;
padding: 35px 0 28px 8%;
background: rgba(250, 251, 252, 1);
border-radius: 4px;
.icon {
position: absolute;
left: 0;
top: 0;
width: 72px;
height: 24px;
color: #fff;
background-color: #606266;
border-radius: 4px 0px 4px 0px;
text-align: center;
}
.input {
display: flex;
justify-content: center;
&-main {
position: relative;
width: 328px;
height: 38px;
padding-bottom: 8px;
&::after {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 1px;
background-color: #DFE1E6;
}
// :global {
// .ant-input {
// border: none;
// box-shadow: none;
// background-color: transparent;
// }
// }
&-com {
width: 100%;
height: 100%;
border: 0;
outline: none;
background-color: rgba(0, 0, 0, 0);
font-size: 32px;
font-weight: 500;
color: #303133;
&:focus {
border: none;
box-shadow: none;
background-color: transparent;
}
}
}
}
}
.right {
padding: 27px 40px;
}
}
}
.headerTop {
display: flex;
align-items: center;
font-size: 18px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
&-icon {
width: 48px;
height: 48px;
line-height: 48px;
border-radius: 4px;
border: 1px solid #DFE1E6;
color: #fff;
text-align: center;
background-color: #8777D9;
}
&-level {
color: #303133;
margin: 0 8px 0 12px;
}
&-identity {
width: 72px;
height: 24px;
line-height: 24px;
background-color: #FFEBE6;
border-radius: 4px;
color: #E63F3B;
font-size: 12px;
font-weight: 400;
text-align: center;
}
}
.headerMain {
display: flex;
&-left {
flex: 6;
display: flex;
flex-wrap: wrap;
padding-left: 90px;
&-option {
display: flex;
width: calc(100% / 3);
margin-bottom: 17px;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #909399;
padding-right: 20px;
&:nth-of-type(n + 4) {
margin: 0;
}
div {
flex: 1;
&:nth-last-of-type(1) {
flex: 2;
}
}
}
}
&-right {
flex: 1;
text-align: right;
}
}
.extra {
&-main {
display: flex;
&-content {
position: relative;
flex: 1;
&:nth-last-of-type(1) {
flex: 2.5;
}
}
.left {
display: flex;
align-items: center;
padding: 35px 0 28px 8%;
background: rgba(250, 251, 252, 1);
border-radius: 4px;
.icon {
position: absolute;
left: 0;
top: 0;
width: 72px;
height: 24px;
color: #fff;
background-color: #606266;
border-radius: 4px 0px 4px 0px;
text-align: center;
}
.input {
display: flex;
justify-content: center;
&-main {
position: relative;
width: 328px;
height: 38px;
padding-bottom: 8px;
&::after {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 1px;
background-color: #DFE1E6;
}
// :global {
// .ant-input {
// border: none;
// box-shadow: none;
// background-color: transparent;
// }
// }
&-com {
width: 100%;
height: 100%;
border: 0;
outline: none;
background-color: rgba(0, 0, 0, 0);
font-size: 32px;
font-weight: 500;
color: #303133;
&:focus {
border: none;
box-shadow: none;
background-color: transparent;
}
}
}
}
}
.right {
padding: 27px 40px;
}
}
}
/*
* @Author: XieZhiXiong
* @Date: 2021-01-26 17:27:30
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 17:27:31
* @Description:
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const EquityDetail: React.FC = () => {
const { id } = usePageStatus();
return (
<DetailInfo id={id} />
);
};
/*
* @Author: XieZhiXiong
* @Date: 2021-01-26 17:27:30
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 17:27:31
* @Description:
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const EquityDetail: React.FC = () => {
const { id } = usePageStatus();
return (
<DetailInfo id={id} />
);
};
export default EquityDetail;
\ No newline at end of file
import React, { useRef } from 'react';
import { history } from 'umi';
import { Button, Card, message } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions } from '@formily/antd';
import { Input } from '@formily/antd-components';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import NiceForm from '@/components/NiceForm';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { levelSchema } from './schema';
import { PublicApi } from '@/services/api';
import styles from './index.less';
const formActions = createFormActions();
const fetchData = async (params: any) => {
const res = await PublicApi.getMemberManageLevelPage(params);
if (res.code === 1000) {
return res.data;
}
return { data: [], totalCount: 0 };
};
const MemberLevel: React.FC<[]> = () => {
const ref = useRef<any>({});
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
align: 'center',
},
{
title: '会员等级',
dataIndex: 'level',
align: 'center',
render: (text: any, record: any) => (
<div className={styles[`levelIcon${record.level}`]}></div>
),
},
{
title: '会员等级标签',
dataIndex: 'levelTag',
align: 'center',
key: 'levelTag',
render: (text: any, record: any) => (
<EyePreview
url={`/memberAbility/manage/level/detail?id=${record.id}`}
>
{text}
</EyePreview>
),
},
{
title: '会员等级类型',
dataIndex: 'memberLevelTypeName',
align: 'center',
},
{
title: '升级分值标签',
dataIndex: 'scoreTag',
align: 'center',
},
{
title: '会员角色名称',
dataIndex: 'roleName',
align: 'center',
},
{
title: '角色类型',
dataIndex: 'roleTypeName',
align: 'center',
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
align: 'center',
},
{
title: '升级阈值',
dataIndex: 'point',
align: 'center',
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
render: (text: any, record: any) => (
<StatusSwitch
handleConfirm={() => handleModify(record)}
record={record}
fieldNames="status"
/>
),
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (text: any, record: any) => (
<Button
type="link"
onClick={() =>
history.push(`/memberAbility/manage/level/edit?id=${record.id}`)
}
>
设置
</Button>
),
},
];
// status: 0-无效 1-生效
const handleModify = record => {
const disabled = record.status === 0;
PublicApi.postMemberManageLevelUpdatestatus({
id: record.id,
status: disabled ? 1 : 0,
}, {
ctlType: 'none',
}).then(res => {
if (res.code === 1000) {
const msg = disabled ? '启用成功' : '禁用成功'
message.success(msg);
ref.current.reload();
}
});
};
return (
<Card>
<StandardTable
tableProps={{ rowKey: 'id' }}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
components={{
Input,
}}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
// $('onFieldInputChange', 'levelTag').subscribe(state => {
// ref.current.reload(state.values);
// });
useStateFilterSearchLinkageEffect(
$,
actions,
'levelTag',
FORM_FILTER_PATH,
);
}}
schema={levelSchema}
/>
}
/>
</Card>
);
};
export default MemberLevel;
import React, { useRef } from 'react';
import { history } from 'umi';
import { Button, Card, message } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions } from '@formily/antd';
import { Input } from '@formily/antd-components';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import NiceForm from '@/components/NiceForm';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { levelSchema } from './schema';
import { PublicApi } from '@/services/api';
import styles from './index.less';
const formActions = createFormActions();
const fetchData = async (params: any) => {
const res = await PublicApi.getMemberManageLevelPage(params);
if (res.code === 1000) {
return res.data;
}
return { data: [], totalCount: 0 };
};
const MemberLevel: React.FC<[]> = () => {
const ref = useRef<any>({});
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
align: 'center',
},
{
title: '会员等级',
dataIndex: 'level',
align: 'center',
render: (text: any, record: any) => (
<div className={styles[`levelIcon${record.level}`]}></div>
),
},
{
title: '会员等级标签',
dataIndex: 'levelTag',
align: 'center',
key: 'levelTag',
render: (text: any, record: any) => (
<EyePreview
url={`/memberAbility/manage/level/detail?id=${record.id}`}
>
{text}
</EyePreview>
),
},
{
title: '会员等级类型',
dataIndex: 'memberLevelTypeName',
align: 'center',
},
{
title: '升级分值标签',
dataIndex: 'scoreTag',
align: 'center',
},
{
title: '会员角色名称',
dataIndex: 'roleName',
align: 'center',
},
{
title: '角色类型',
dataIndex: 'roleTypeName',
align: 'center',
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
align: 'center',
},
{
title: '升级阈值',
dataIndex: 'point',
align: 'center',
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
render: (text: any, record: any) => (
<StatusSwitch
handleConfirm={() => handleModify(record)}
record={record}
fieldNames="status"
/>
),
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (text: any, record: any) => (
<Button
type="link"
onClick={() =>
history.push(`/memberAbility/manage/level/edit?id=${record.id}`)
}
>
设置
</Button>
),
},
];
// status: 0-无效 1-生效
const handleModify = record => {
const disabled = record.status === 0;
PublicApi.postMemberManageLevelUpdatestatus({
id: record.id,
status: disabled ? 1 : 0,
}, {
ctlType: 'none',
}).then(res => {
if (res.code === 1000) {
const msg = disabled ? '启用成功' : '禁用成功'
message.success(msg);
ref.current.reload();
}
});
};
return (
<Card>
<StandardTable
tableProps={{ rowKey: 'id' }}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
components={{
Input,
}}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
// $('onFieldInputChange', 'levelTag').subscribe(state => {
// ref.current.reload(state.values);
// });
useStateFilterSearchLinkageEffect(
$,
actions,
'levelTag',
FORM_FILTER_PATH,
);
}}
schema={levelSchema}
/>
}
/>
</Card>
);
};
export default MemberLevel;
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const levelSchema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUI: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
levelTag: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 会员等级标签 进行搜索',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginLeft: 20,
},
},
properties: {
roleName: {
type: 'string',
'x-component': 'Input',
'x-component-props': {
placeholder: '角色名称',
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const levelSchema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUI: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
levelTag: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 会员等级标签 进行搜索',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginLeft: 20,
},
},
properties: {
roleName: {
type: 'string',
'x-component': 'Input',
'x-component-props': {
placeholder: '角色名称',
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
/*
* @Author: XieZhiXiong
* @Date: 2020-07-29 10:44:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 15:50:44
* @Description: 新增会员
*/
import React from 'react';
import MemberForm from './components/MemberForm';
const AddMember: React.FC = () => {
return (
<MemberForm />
);
};
export default AddMember;
/*
* @Author: XieZhiXiong
* @Date: 2020-07-29 10:44:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 15:50:44
* @Description: 新增会员
*/
import React from 'react';
import MemberForm from './components/MemberForm';
const AddMember: React.FC = () => {
return (
<MemberForm />
);
};
export default AddMember;
/*
* @Author: XieZhiXiong
* @Date: 2021-01-26 15:51:08
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 15:51:09
* @Description: 编辑会员
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import MemberForm from './components/MemberForm';
const EditMember: React.FC = () => {
const { id, validateId } = usePageStatus();
return (
<MemberForm id={id} validateId={validateId} isEdit={true} />
);
};
/*
* @Author: XieZhiXiong
* @Date: 2021-01-26 15:51:08
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 15:51:09
* @Description: 编辑会员
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import MemberForm from './components/MemberForm';
const EditMember: React.FC = () => {
const { id, validateId } = usePageStatus();
return (
<MemberForm id={id} validateId={validateId} isEdit={true} />
);
};
export default EditMember;
\ No newline at end of file
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const AuditPr1: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} isEdit />
);
};
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const AuditPr1: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} isEdit />
);
};
export default AuditPr1;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-01-26 16:55:17
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 16:55:18
* @Description:
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const Pr1Detail: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} />
);
};
/*
* @Author: XieZhiXiong
* @Date: 2021-01-26 16:55:17
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 16:55:18
* @Description:
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const Pr1Detail: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} />
);
};
export default Pr1Detail;
\ No newline at end of file
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const AuditPr2: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} isEdit />
);
};
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const AuditPr2: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} isEdit />
);
};
export default AuditPr2;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-01-26 17:03:51
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 17:03:51
* @Description:
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const Pr2Detail: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} />
);
};
/*
* @Author: XieZhiXiong
* @Date: 2021-01-26 17:03:51
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 17:03:51
* @Description:
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const Pr2Detail: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} />
);
};
export default Pr2Detail;
\ No newline at end of file
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const AuditPrComfirm: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} isEdit />
);
};
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const AuditPrComfirm: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} isEdit />
);
};
export default AuditPrComfirm;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-01-26 17:10:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 17:10:09
* @Description:
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const PrComfirmDetail: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} />
);
};
/*
* @Author: XieZhiXiong
* @Date: 2021-01-26 17:10:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 17:10:09
* @Description:
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const PrComfirmDetail: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} />
);
};
export default PrComfirmDetail;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-01-08 15:34:40
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-08 15:34:41
* @Description:
*/
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const auditSchema: 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': '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,
},
},
},
// status: {
// type: 'string',
// default: undefined,
// enum: [],
// 'x-component-props': {
// placeholder: '会员状态(全部)',
// allowClear: true,
// },
// },
roleId: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员角色(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
level: {
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,
},
},
},
innerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
'[startDate, endDate]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '时间范围(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
/*
* @Author: XieZhiXiong
* @Date: 2021-01-08 15:34:40
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-08 15:34:41
* @Description:
*/
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const auditSchema: 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': '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,
},
},
},
// status: {
// type: 'string',
// default: undefined,
// enum: [],
// 'x-component-props': {
// placeholder: '会员状态(全部)',
// allowClear: true,
// },
// },
roleId: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员角色(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
level: {
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,
},
},
},
innerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
'[startDate, endDate]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '时间范围(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
\ No newline at end of file
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const AuditPrSubmit: React.FC = () => {
const { id, validateId } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} isEdit />
);
};
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const AuditPrSubmit: React.FC = () => {
const { id, validateId } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} isEdit />
);
};
export default AuditPrSubmit;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-01-26 16:43:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 16:43:45
* @Description:
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const PrSubmitDetail: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} />
);
};
/*
* @Author: XieZhiXiong
* @Date: 2021-01-26 16:43:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 16:43:45
* @Description:
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo';
const PrSubmitDetail: React.FC = () => {
const { id, validateId, pageStatus } = usePageStatus();
return (
<DetailInfo id={id} validateId={validateId} />
);
};
export default PrSubmitDetail;
\ No newline at end of file
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const auditSchema: 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': '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,
},
},
},
// status: {
// type: 'string',
// default: undefined,
// enum: [],
// 'x-component-props': {
// placeholder: '会员状态(全部)',
// allowClear: true,
// },
// },
roleId: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员角色(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
level: {
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,
},
},
},
'[startDate, endDate]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '时间范围(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
export const auditModalSchema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelAlign: 'top',
},
properties: {
agree: {
type: 'string',
default: 1,
enum: [
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 },
],
'x-component': 'radio',
'x-component-props': {},
},
reason: {
type: 'string',
title: '审核不通过原因',
'x-component': 'textarea',
required: true,
'x-component-props': {
placeholder: '在此输入你的内容,最长120个字符,60个汉字',
rows: 5,
},
'x-rules': [
{
limitByte: true, // 自定义校验规则
maxByte: 120,
}
],
},
},
},
},
};
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const auditSchema: 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': '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,
},
},
},
// status: {
// type: 'string',
// default: undefined,
// enum: [],
// 'x-component-props': {
// placeholder: '会员状态(全部)',
// allowClear: true,
// },
// },
roleId: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员角色(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
level: {
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,
},
},
},
'[startDate, endDate]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '时间范围(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
export const auditModalSchema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelAlign: 'top',
},
properties: {
agree: {
type: 'string',
default: 1,
enum: [
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 },
],
'x-component': 'radio',
'x-component-props': {},
},
reason: {
type: 'string',
title: '审核不通过原因',
'x-component': 'textarea',
required: true,
'x-component-props': {
placeholder: '在此输入你的内容,最长120个字符,60个汉字',
rows: 5,
},
'x-rules': [
{
limitByte: true, // 自定义校验规则
maxByte: 120,
}
],
},
},
},
},
};
......@@ -7,7 +7,7 @@ import EyePreview from '@/components/EyePreview'
import StatusSwitch from '@/components/StatusSwitch'
import { PlusOutlined } from '@ant-design/icons'
import { PublicApi } from '@/services/api'
import LevelBrand from '@/pages/member/components/LevelBrand'
import LevelBrand from '@/pages/memberManage/components/LevelBrand'
const List: React.FC<{}> = () => {
const ref = useRef<any>({})
......
......@@ -14,7 +14,7 @@ import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import Search from '@/components/NiceForm/components/Search'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import Submit from '@/components/NiceForm/components/Submit'
import LevelBrand from '@/pages/member/components/LevelBrand'
import LevelBrand from '@/pages/memberManage/components/LevelBrand'
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect'
import SelectProcesss from './selectProcesss'
import ModalTable from '@/components/ModalTable'
......
......@@ -4,7 +4,7 @@ import { Space, Card, Col, Row } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import ReutrnEle from '@/components/ReturnEle'
import { PublicApi } from '@/services/api'
import LevelBrand from '@/pages/member/components/LevelBrand'
import LevelBrand from '@/pages/memberManage/components/LevelBrand'
import { StandardTable } from 'god'
const RuleDetail:React.FC<{}> = (props) => {
......
......@@ -12,7 +12,7 @@ import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import Search from '@/components/NiceForm/components/Search'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import Submit from '@/components/NiceForm/components/Submit'
import LevelBrand from '@/pages/member/components/LevelBrand'
import LevelBrand from '@/pages/memberManage/components/LevelBrand'
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect'
import SelectProcesss from './selectProcesss'
import ModalTable from '@/components/ModalTable'
......
......@@ -5,7 +5,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'
import ReutrnEle from '@/components/ReturnEle'
import { PublicApi } from '@/services/api'
import EyePreview from '@/components/EyePreview'
import LevelBrand from '@/pages/member/components/LevelBrand'
import LevelBrand from '@/pages/memberManage/components/LevelBrand'
import { StandardTable } from 'god'
const AddRule:React.FC<{}> = (props) => {
......
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