Commit f7717d7d authored by XieZhiXiong's avatar XieZhiXiong

feat: 展示 资质文件

parent 0269a9e1
...@@ -6,59 +6,66 @@ ...@@ -6,59 +6,66 @@
* @Description: 会员公司资质 * @Description: 会员公司资质
*/ */
import React from 'react'; import React from 'react';
import { Descriptions } from 'antd'; // import { Descriptions } from 'antd';
import {
createFormActions,
} from '@formily/antd';
import { DatePicker, Checkbox } from '@formily/antd-components';
import { normalizeFiledata } from '@/utils';
import NiceForm from '@/components/NiceForm';
import MellowCard, { MellowCardProps } from '@/components/MellowCard'; import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import styles from './index.less'; import { schema } from './schema';
import QualitiesUpload from '../QualitiesUpload';
import QualitiesUploadFormItem from '../QualitiesUploadFormItem';
// import styles from './index.less';
interface IProps extends MellowCardProps {} export type ValueType = {
/**
* 文件url
*/
url: string,
/**
* 文件名称
*/
name: string,
/**
* 到期日
*/
expireDay: string,
/**
* 有效期
*/
permanent: number,
}
interface IProps extends MellowCardProps {
/**
* 数据
*/
dataSource: ValueType[],
}
const formActions = createFormActions();
const MemberDocQualification: React.FC<IProps> = (props: IProps) => { const MemberDocQualification: React.FC<IProps> = (props: IProps) => {
const { ...rest } = props; const { dataSource = [], ...rest } = props;
const qualities = (
Array.isArray(dataSource)
? dataSource.map((item) => ({
file: item.url ? [normalizeFiledata(item.url)] : [],
expireDay: item.expireDay,
permanent: item.permanent === 1 ? [item.permanent] : [],
}))
: []
);
return ( return (
<MellowCard <MellowCard
title="资质证明" title="资质证明"
{...rest} {...rest}
> >
<ul className={styles.qualification}> {/* <ul className={styles.qualification}>
<li className={styles['qualification-item']}>
<div className={styles['qualification-item-wrap']}>
<div className={styles['qualification-item-left']}>
</div>
<div className={styles['qualification-item-right']}>
<Descriptions column={1}>
<Descriptions.Item label="到期日">2022-10-01</Descriptions.Item>
<Descriptions.Item label="有效期" style={{ paddingBottom: 0 }}>长期有效</Descriptions.Item>
</Descriptions>
</div>
</div>
</li>
<li className={styles['qualification-item']}>
<div className={styles['qualification-item-wrap']}>
<div className={styles['qualification-item-left']}>
</div>
<div className={styles['qualification-item-right']}>
<Descriptions column={1}>
<Descriptions.Item label="到期日">2022-10-01</Descriptions.Item>
<Descriptions.Item label="有效期" style={{ paddingBottom: 0 }}>长期有效</Descriptions.Item>
</Descriptions>
</div>
</div>
</li>
<li className={styles['qualification-item']}>
<div className={styles['qualification-item-wrap']}>
<div className={styles['qualification-item-left']}>
</div>
<div className={styles['qualification-item-right']}>
<Descriptions column={1}>
<Descriptions.Item label="到期日">2022-10-01</Descriptions.Item>
<Descriptions.Item label="有效期" style={{ paddingBottom: 0 }}>长期有效</Descriptions.Item>
</Descriptions>
</div>
</div>
</li>
<li className={styles['qualification-item']}> <li className={styles['qualification-item']}>
<div className={styles['qualification-item-wrap']}> <div className={styles['qualification-item-wrap']}>
<div className={styles['qualification-item-left']}> <div className={styles['qualification-item-left']}>
...@@ -72,20 +79,26 @@ const MemberDocQualification: React.FC<IProps> = (props: IProps) => { ...@@ -72,20 +79,26 @@ const MemberDocQualification: React.FC<IProps> = (props: IProps) => {
</div> </div>
</div> </div>
</li> </li>
<li className={styles['qualification-item']}> </ul> */}
<div className={styles['qualification-item-wrap']}> <NiceForm
<div className={styles['qualification-item-left']}> previewPlaceholder="' '"
initialValues={{
qualities,
}}
components={{
DatePicker,
Checkbox,
CheckboxGroup: Checkbox.Group,
QualitiesUpload,
QualitiesUploadFormItem,
}}
effects={() => {
</div> }}
<div className={styles['qualification-item-right']}> actions={formActions}
<Descriptions column={1}> schema={schema}
<Descriptions.Item label="到期日">2022-10-01</Descriptions.Item> editable={false}
<Descriptions.Item label="有效期" style={{ paddingBottom: 0 }}>长期有效</Descriptions.Item> />
</Descriptions>
</div>
</div>
</li>
</ul>
</MellowCard> </MellowCard>
); );
}; };
......
/*
* @Author: XieZhiXiong
* @Date: 2021-06-07 15:11:27
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-07 15:18:25
* @Description:
*/
import { ISchema } from '@formily/antd';
export const schema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
properties: {
qualities: {
type: 'string',
'x-component': 'QualitiesUploadFormItem',
'x-component-props': {
colSpan: 24,
},
},
},
},
},
};
\ No newline at end of file
...@@ -167,6 +167,7 @@ const MemberPrVerifyChange1Detail: React.FC<{}> = () => { ...@@ -167,6 +167,7 @@ const MemberPrVerifyChange1Detail: React.FC<{}> = () => {
{/* 资质证明 */} {/* 资质证明 */}
<Col span={24}> <Col span={24}>
<MemberDocQualification <MemberDocQualification
dataSource={memberInfo?.qualities}
id="qualificationInfo" id="qualificationInfo"
/> />
</Col> </Col>
......
...@@ -209,6 +209,7 @@ const MemberPrVerifyChange1Verify: React.FC<{}> = () => { ...@@ -209,6 +209,7 @@ const MemberPrVerifyChange1Verify: React.FC<{}> = () => {
{/* 资质证明 */} {/* 资质证明 */}
<Col span={24}> <Col span={24}>
<MemberDocQualification <MemberDocQualification
dataSource={memberInfo?.qualities}
id="qualificationInfo" id="qualificationInfo"
/> />
</Col> </Col>
......
...@@ -167,6 +167,7 @@ const MemberPrVerifyChange2Detail: React.FC<{}> = () => { ...@@ -167,6 +167,7 @@ const MemberPrVerifyChange2Detail: React.FC<{}> = () => {
{/* 资质证明 */} {/* 资质证明 */}
<Col span={24}> <Col span={24}>
<MemberDocQualification <MemberDocQualification
dataSource={memberInfo?.qualities}
id="qualificationInfo" id="qualificationInfo"
/> />
</Col> </Col>
......
...@@ -209,6 +209,7 @@ const MemberPrVerifyChange2Verify: React.FC<{}> = () => { ...@@ -209,6 +209,7 @@ const MemberPrVerifyChange2Verify: React.FC<{}> = () => {
{/* 资质证明 */} {/* 资质证明 */}
<Col span={24}> <Col span={24}>
<MemberDocQualification <MemberDocQualification
dataSource={memberInfo?.qualities}
id="qualificationInfo" id="qualificationInfo"
/> />
</Col> </Col>
......
...@@ -167,6 +167,7 @@ const MemberPrVerifyChangeConfirmDetail: React.FC<{}> = () => { ...@@ -167,6 +167,7 @@ const MemberPrVerifyChangeConfirmDetail: React.FC<{}> = () => {
{/* 资质证明 */} {/* 资质证明 */}
<Col span={24}> <Col span={24}>
<MemberDocQualification <MemberDocQualification
dataSource={memberInfo?.qualities}
id="qualificationInfo" id="qualificationInfo"
/> />
</Col> </Col>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-26 10:26:37 * @Date: 2021-05-26 10:26:37
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 14:28:21 * @LastEditTime: 2021-06-07 15:35:44
* @Description: 确认会员变更 * @Description: 确认会员变更
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -209,6 +209,7 @@ const MemberPrVerifyChangeConfirmVerify: React.FC<{}> = () => { ...@@ -209,6 +209,7 @@ const MemberPrVerifyChangeConfirmVerify: React.FC<{}> = () => {
{/* 资质证明 */} {/* 资质证明 */}
<Col span={24}> <Col span={24}>
<MemberDocQualification <MemberDocQualification
dataSource={memberInfo?.qualities}
id="qualificationInfo" id="qualificationInfo"
/> />
</Col> </Col>
......
...@@ -54,7 +54,7 @@ export type ValueType = { ...@@ -54,7 +54,7 @@ export type ValueType = {
/** /**
* 有效期 * 有效期
*/ */
permanent: number, permanent: number[],
} }
interface IProps { interface IProps {
...@@ -87,9 +87,9 @@ const UploadQualificationsDrawer: React.FC<IProps> = (props: IProps) => { ...@@ -87,9 +87,9 @@ const UploadQualificationsDrawer: React.FC<IProps> = (props: IProps) => {
} }
}; };
const handleSubmit = (values: { channelLevel: ValueType[] }) => { const handleSubmit = (values: { qualities: ValueType[] }) => {
if (onSubmit) { if (onSubmit) {
onSubmit(values.channelLevel); onSubmit(values.qualities);
} }
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-06-01 20:04:02 * @Date: 2021-06-01 20:04:02
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 09:48:03 * @LastEditTime: 2021-06-07 15:11:08
* @Description: * @Description:
*/ */
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
...@@ -14,7 +14,7 @@ export const schema: ISchema = { ...@@ -14,7 +14,7 @@ export const schema: ISchema = {
type: 'object', type: 'object',
'x-component': 'Mega-Layout', 'x-component': 'Mega-Layout',
properties: { properties: {
channelLevel: { qualities: {
type: 'string', type: 'string',
'x-component': 'QualitiesUploadFormItem', 'x-component': 'QualitiesUploadFormItem',
'x-component-props': { 'x-component-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