Commit 922c80ee authored by 前端-许佳敏's avatar 前端-许佳敏
parents 7b152a69 7211c71c
...@@ -120,7 +120,7 @@ const MemberRoute = { ...@@ -120,7 +120,7 @@ const MemberRoute = {
key: 'addEquity', key: 'addEquity',
hideInMenu: true, hideInMenu: true,
component: '@/pages/member/memberLevel/addEquity', component: '@/pages/member/memberLevel/addEquity',
} },
] ]
} }
] ]
......
...@@ -4,30 +4,40 @@ const { onFormInit$ } = FormEffectHooks ...@@ -4,30 +4,40 @@ const { onFormInit$ } = FormEffectHooks
/** /**
* @description 处理异步请求的下拉选择 * @description 处理异步请求的下拉选择
* @param name 待处理的表单路径 * @param {sting[]} name 待处理的表单路径
* @param service 触发的异步函数, 需返回一个{label: any, value: any}形式的数组 * @param {func} service 触发的异步函数, 需返回一个 { label: any, value: any }形式的数组
*/ */
export const useAsyncInitSelect = (name: string[], service?: () => Promise<any>) => { export const useAsyncInitSelect = (name: string[], service?: () => Promise<any>) => {
const { dispatch, setFieldState } = createFormActions() const { dispatch, setFieldState } = createFormActions();
const linkage = useLinkageUtils() const linkage = useLinkageUtils();
onFormInit$().subscribe(() => { onFormInit$().subscribe(() => {
setFieldState(name, state => { const nameStr: string = name.toString();
FormPath.setIn(state, 'props.x-props.hasFeedback', true) const formPath: string = `*(${nameStr})`;
})
name.forEach(v => linkage.loaded(v)) setFieldState(formPath, state => {
FormPath.setIn(state, 'props.x-props.hasFeedback', true);
});
linkage.loading(formPath);
service().then(res => { service().then(res => {
name.forEach(v => { if (res.code === 1000) {
linkage.loaded(v) linkage.loaded(formPath);
linkage.enum(v, res[v]) name.forEach(v => {
}) linkage.enum(v, res[v]);
//请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动 });
dispatch('requestAsyncSelect', { // 请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
name, dispatch('requestAsyncSelect', {
payload: res name,
}) payload: res,
});
return;
}
linkage.loaded(formPath);
}).catch(err => { }).catch(err => {
// linkage.loaded(name) linkage.loaded(formPath);
// linkage.enum(name, []) });
})
}) })
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ export enum PageStatus { ...@@ -8,7 +8,7 @@ export enum PageStatus {
} }
export const usePageStatus = () => { export const usePageStatus = () => {
const { preview, id = '' } = history.location.query const { preview, id = '', ...rest } = history.location.query
// 默认预览状态 // 默认预览状态
let pageStatus = PageStatus.PREVIEW let pageStatus = PageStatus.PREVIEW
if (preview === '1') { if (preview === '1') {
...@@ -24,6 +24,7 @@ export const usePageStatus = () => { ...@@ -24,6 +24,7 @@ export const usePageStatus = () => {
return { return {
pageStatus, pageStatus,
id, id,
preview preview,
...rest,
} }
} }
\ No newline at end of file
...@@ -112,6 +112,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => { ...@@ -112,6 +112,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
{titleDom} {titleDom}
</Link> </Link>
)} )}
collapsed={collapsed}
onCollapse={handleMenuCollapse} onCollapse={handleMenuCollapse}
breadcrumbRender={(routers = []) => [ breadcrumbRender={(routers = []) => [
......
...@@ -87,7 +87,7 @@ const AuthDetail: React.FC<PageProps> = (props: any) => { ...@@ -87,7 +87,7 @@ const AuthDetail: React.FC<PageProps> = (props: any) => {
customKey="id" customKey="id"
checkable checkable
actions={treeActions} actions={treeActions}
treeData={treeData} treeData={[]}
handleSelect={handleSelect} handleSelect={handleSelect}
disabled={pageStatus === PageStatus.PREVIEW} disabled={pageStatus === PageStatus.PREVIEW}
/> />
......
...@@ -17,15 +17,15 @@ const { TabPane } = Tabs; ...@@ -17,15 +17,15 @@ const { TabPane } = Tabs;
const { Step } = Steps; const { Step } = Steps;
const MemberDetail: React.FC<{}> = () => { const MemberDetail: React.FC<{}> = () => {
const { pageStatus, id } = usePageStatus(); const { pageStatus, id, validateId } = usePageStatus();
const [hActived, setHActived] = useState('3'); const [hActived, setHActived] = useState('3');
const [detailData, setDetailData] = useState<any>({}); const [detailData, setDetailData] = useState<any>({});
useEffect(() => { useEffect(() => {
const fetchDetailData = async () => { const fetchDetailData = async () => {
const { data } = await PublicApi.getMemberValidateCommitDetail({ const { data } = await PublicApi.getMemberValidateCommitDetail({
memberId: '2', memberId: id,
validateId: '63', validateId: validateId,
}); });
setDetailData(data); setDetailData(data);
}; };
......
...@@ -57,7 +57,7 @@ const memberMaintain: React.FC<[]> = () => { ...@@ -57,7 +57,7 @@ const memberMaintain: React.FC<[]> = () => {
key: 'name', key: 'name',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<EyePreview <EyePreview
url={`/memberCenter/memberAbility/manage/importDetail?id=${record.id}&preview=1`} url={`/memberCenter/memberAbility/manage/importDetail?id=${record.memberId}&validateId=${record.validateId}&preview=1`}
> >
{text} {text}
</EyePreview> </EyePreview>
......
...@@ -46,25 +46,25 @@ export const importSchema: ISchema = { ...@@ -46,25 +46,25 @@ export const importSchema: ISchema = {
properties: { properties: {
memberType: { memberType: {
type: 'string', type: 'string',
default: 0, default: undefined,
enum: [], enum: [],
'x-component-props': {}, 'x-component-props': {},
}, },
roleId: { roleId: {
type: 'string', type: 'string',
default: 0, default: undefined,
enum: [], enum: [],
'x-component-props': {}, 'x-component-props': {},
}, },
level: { level: {
type: 'string', type: 'string',
default: 0, default: undefined,
enum: [], enum: [],
'x-component-props': {}, 'x-component-props': {},
}, },
source: { source: {
type: 'string', type: 'string',
default: 0, default: undefined,
enum: [], enum: [],
'x-component-props': {}, 'x-component-props': {},
}, },
......
.headerTop {
display: flex;
align-items: center;
font-size: 20px;
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: #172B4D;
margin: 0 8px 0 12px;
}
&-identity {
width: 72px;
height: 24px;
line-height: 24px;
background-color: #FFEBE6;
border-radius: 4px;
color: #E63F3B;
font-size: 14px;
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: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #6B778C;
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;
.saveBtn {
color: #fff;
background: @main-color
}
}
}
.extra {
margin-bottom: 48px;
&-main {
display: flex;
&-content {
position: relative;
flex: 1;
height: 104px;
&:nth-last-of-type(1) {
flex: 2.5;
}
}
.left {
display: flex;
justify-content: center;
align-items: center;
.icon {
position: absolute;
left: 0;
top: 0;
width: 72px;
height: 24px;
color: #fff;
background-color: #42526E;
border-radius: 4px 0px 4px 0px;
text-align: center;
}
.input {
display: flex;
justify-content: center;
&-main {
position: relative;
width: 128px;
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: #172B4D;
&:focus {
border: none;
box-shadow: none;
background-color: transparent;
}
}
}
}
}
.right {
padding: 27px 40px;
}
}
}
import React, { ReactNode, useState, useRef } from 'react' import React, { ReactNode, useState, useRef } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Button, Popconfirm, Card, Input, Slider } from 'antd' import { Button, Popconfirm, Card, Input, Slider } from 'antd'
import { ColumnType } from 'antd/lib/table/interface'
import classNames from 'classnames'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PlayCircleOutlined, ContainerOutlined } from '@ant-design/icons' import { PlayCircleOutlined, ContainerOutlined } from '@ant-design/icons'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface' import styles from './addEquity.less'
import './index.less'
const data = [ const data = [
{ {
...@@ -143,69 +144,74 @@ const addEquity: React.FC<[]> = () => { ...@@ -143,69 +144,74 @@ const addEquity: React.FC<[]> = () => {
onBack={() => window.history.back()} onBack={() => window.history.back()}
title={ title={
<> <>
<div className='headerTop'> <div className={styles.headerTop}>
<div className='headerTop-icon'></div> <div className={styles['headerTop-icon']}></div>
<div className='headerTop-level'>钻石会员</div> <div className={styles['headerTop-level']}>钻石会员</div>
<div className='headerTop-identity'>商户会员</div> <div className={styles['headerTop-identity']}>商户会员</div>
</div> </div>
</> </>
} }
content={ content={
<div className='headerMain'> <div className={styles.headerMain}>
<div className='headerMain-left'> <div className={styles['headerMain-left']}>
<div className='headerMain-left-option'> <div className={styles['headerMain-left-option']}>
<div>会员等级:</div> <div>会员等级:</div>
<div>1</div> <div>1</div>
</div> </div>
<div className='headerMain-left-option'> <div className={styles['headerMain-left-option']}>
<div>升级分值标签:</div> <div>升级分值标签:</div>
<div>交易分</div> <div>交易分</div>
</div> </div>
<div className='headerMain-left-option'> <div className={styles['headerMain-left-option']}>
<div>角色类型:</div> <div>角色类型:</div>
<div>服务消费</div> <div>服务消费</div>
</div> </div>
<div className='headerMain-left-option'> <div className={styles['headerMain-left-option']}>
<div>会员等级说明:</div> <div>会员等级说明:</div>
<div>商户所属钻石会员</div> <div>商户所属钻石会员</div>
</div> </div>
<div className='headerMain-left-option'> <div className={styles['headerMain-left-option']}>
<div>会员角色名称:</div> <div>会员角色名称:</div>
<div>采购商</div> <div>采购商</div>
</div> </div>
<div className='headerMain-left-option'> <div className={styles['headerMain-left-option']}>
<div>会员类型:</div> <div>会员类型:</div>
<div>企业会员</div> <div>企业会员</div>
</div> </div>
</div> </div>
<div className='headerMain-right'> <div className={styles['headerMain-right']}>
<Button className='saveBtn' icon={<ContainerOutlined />}>保存</Button> <Button className={styles.saveBtn} icon={<ContainerOutlined />}>保存</Button>
</div> </div>
</div> </div>
} }
> >
<Card> <Card>
<StandardTable <StandardTable
tableProps={{
rowKey: 'id',
pagination: false,
}}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
fetchTableData={(params: any) => fetchData(params)} fetchTableData={(params: any) => fetchData(params)}
controlRender={ controlRender={
<> <>
<div className='extra'> <div className={styles.extra}>
<h3>升级阀值</h3> <h3>升级阀值</h3>
<div className='extra-main'> <div className={styles['extra-main']}>
<div className='extra-main-content left'> <div className={classNames(styles['extra-main-content'], styles.left)}>
<div className='icon'>当前阀值</div> <div className={styles.icon}>当前阀值</div>
<div className='input'> <div className={styles.input}>
<div className='input-main'> <div className={styles['input-main']}>
<Input className='input-main-com' <Input
className={styles['input-main-com']}
value={thresholdValue} value={thresholdValue}
onChange={(e: any) => { e.persist(); setThresholdValue(e.target.value) }} onChange={(e: any) => { e.persist(); setThresholdValue(e.target.value) }}
/> />
</div> </div>
</div> </div>
</div> </div>
<div className='extra-main-content right'> <div className={classNames(styles['extra-main-content'], styles.right)}>
<Slider <Slider
marks={marks} marks={marks}
max={50000} max={50000}
......
...@@ -7,51 +7,6 @@ ...@@ -7,51 +7,6 @@
margin-left: 16px; margin-left: 16px;
} }
.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 : 14px;
font-family : PingFangSC-Regular, PingFang SC;
font-weight : 400;
color : #6B778C;
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;
.saveBtn {
color : #fff;
background: @main-color
}
}
}
.nameCellTitle { .nameCellTitle {
color : @main-color; color : @main-color;
cursor: pointer; cursor: pointer;
...@@ -85,116 +40,7 @@ ...@@ -85,116 +40,7 @@
background-size: 24px 20px; background-size: 24px 20px;
} }
.headerTop {
display : flex;
align-items: center;
font-size : 20px;
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 : #172B4D;
margin: 0 8px 0 12px;
}
&-identity {
width : 72px;
height : 24px;
line-height : 24px;
background-color: #FFEBE6;
border-radius : 4px;
color : #E63F3B;
font-size : 14px;
font-weight : 400;
text-align : center;
}
}
h3 { h3 {
margin-bottom: 20px; margin-bottom: 20px;
}
.extra {
margin-bottom: 48px;
&-main {
display: flex;
&-content {
position: relative;
flex : 1;
height : 104px;
&:nth-last-of-type(1) {
flex: 2.5;
}
}
.left {
display : flex;
justify-content: center;
align-items : center;
.icon {
position : absolute;
left : 0;
top : 0;
width : 72px;
height : 24px;
color : #fff;
background-color: #42526E;
border-radius : 4px 0px 4px 0px;
text-align : center;
}
.input {
display : flex;
justify-content: center;
&-main {
position : relative;
width : 128px;
height : 38px;
padding-bottom: 8px;
&::after {
content : '';
position : absolute;
left : 0;
bottom : 0;
width : 100%;
height : 1px;
background-color: #DFE1E6;
}
&-com {
width : 100%;
height : 100%;
border : 0;
outline : none;
background-color: rgba(0, 0, 0, 0);
font-size : 32px;
font-family : PingFangSC-Medium, PingFang SC;
font-weight : 500;
color : #172B4D;
}
}
}
}
.right {
padding: 27px 40px;
}
}
} }
\ No newline at end of file
...@@ -46,7 +46,7 @@ const MemberLevel: React.FC<[]> = () => { ...@@ -46,7 +46,7 @@ const MemberLevel: React.FC<[]> = () => {
key: 'levelTag', key: 'levelTag',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<EyePreview <EyePreview
url={`/memberCenter/memberAbility/manage/addEquity?id=${record.id}&preview=1`} url={`/memberCenter/memberAbility/manage/level/addEquity?id=${record.id}&preview=1`}
> >
{text} {text}
</EyePreview> </EyePreview>
...@@ -109,7 +109,7 @@ const MemberLevel: React.FC<[]> = () => { ...@@ -109,7 +109,7 @@ const MemberLevel: React.FC<[]> = () => {
<Button <Button
type="link" type="link"
onClick={() => onClick={() =>
history.push(`/memberCenter/memberAbility/manage/addEquity?id=${record.id}`) history.push(`/memberCenter/memberAbility/manage/level/addEquity?id=${record.id}`)
} }
> >
设置 设置
......
...@@ -57,7 +57,7 @@ const memberMaintain: React.FC<[]> = () => { ...@@ -57,7 +57,7 @@ const memberMaintain: React.FC<[]> = () => {
key: 'name', key: 'name',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<EyePreview <EyePreview
url={`/memberCenter/memberAbility/manage/maintainDetail?id=${record.id}&preview=1`} url={`/memberCenter/memberAbility/manage/importDetail?id=${record.memberId}&validateId=${record.validateId}&preview=1`}
> >
{text} {text}
</EyePreview> </EyePreview>
......
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