Commit e362615e authored by XieZhiXiong's avatar XieZhiXiong

chore: 完善 入库资料 相关

parent a475898a
@import '~antd/es/style/themes/default.less';
.add-btn {
width: 175px;
height: 120px;
text-align: center;
vertical-align: top;
background-color: @descriptions-bg;
border: 1px dashed @border-color-base;
border-radius: @border-radius-base;
cursor: pointer;
transition: border-color 0.3s;
&:hover {
background-color: @descriptions-bg;
}
}
\ No newline at end of file
......@@ -2,17 +2,19 @@
* @Author: XieZhiXiong
* @Date: 2021-06-01 16:13:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 18:56:22
* @LastEditTime: 2021-06-07 14:56:46
* @Description: 资质证明上传组件
*/
import React from 'react';
import { Row, Col, Button } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { ArrayList } from '@formily/react-shared-components';
import { Schema, SchemaField } from '@formily/antd';
import { toArr, FormPath } from '@formily/shared';
import {
UPLOAD_TYPE,
} from '@/constants';
import styles from './index.less';
const schema = new Schema({
type: 'object',
......@@ -101,7 +103,13 @@ const Qualifications = (props) => {
))}
{editable && (
<Col {...span}>
<Button onClick={onAdd}>+</Button>
<Button
onClick={onAdd}
type="dashed"
className={styles['add-btn']}
>
<PlusOutlined />
</Button>
</Col>
)}
</Row>
......
@import '~antd/es/style/themes/default.less';
.add-btn {
width: 175px;
height: 120px;
text-align: center;
vertical-align: top;
background-color: @descriptions-bg;
border: 1px dashed @border-color-base;
border-radius: @border-radius-base;
cursor: pointer;
transition: border-color 0.3s;
&:hover {
background-color: @descriptions-bg;
}
}
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-06-01 16:13:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-07 14:56:46
* @Description: 资质证明上传组件
*/
import React from 'react';
import { Row, Col, Button } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { ArrayList } from '@formily/react-shared-components';
import { Schema, SchemaField } from '@formily/antd';
import { toArr, FormPath } from '@formily/shared';
import {
UPLOAD_TYPE,
} from '@/constants';
import styles from './index.less';
const schema = new Schema({
type: 'object',
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
full: true,
columns: 2,
},
properties: {
file: {
type: 'string',
'x-component': 'QualitiesUpload',
'x-component-props': {
action: '/api/file/file/upload/prefix',
data: {
fileType: UPLOAD_TYPE,
prefix: 'member_qualifications_',
},
accept: '.doc, .docx, .xls, .xlsx, .pot, .pps, .vsd, .wps, .dps, .pdf, .txt, .png, .jpg, .rar, .zip',
},
},
MEGA_LAYOUT2: {
type: 'object',
'x-component': 'Mega-Layout',
properties: {
expireDay: {
type: 'string',
title: '到期日',
'x-component': 'DatePicker',
},
permanent: {
type: 'string',
title: '有效期',
'x-component': 'CheckboxGroup',
enum: [
{ label: '长期有效', value: 1 },
]
},
},
},
},
}
},
});
const Qualifications = (props) => {
const {
value,
className,
editable,
path,
mutators,
// schema,
} = props;
const { colSpan } = (props.props['x-component-props'] || {});
const onAdd = () => mutators.push(schema.getEmptyValue())
const span = colSpan ? {
span: colSpan,
} : {
sm: 12,
md: 8,
lg: 8,
};
return (
<ArrayList value={value}>
<Row
gutter={{ sm: 44, md: 88, lg: 88 }}
style={{
width: '100%',
}}
>
{toArr(value).map((item, index) => (
<Col key={index} {...span}>
<SchemaField
path={FormPath.parse(path).concat(index)}
schema={schema}
/>
</Col>
))}
{editable && (
<Col {...span}>
<Button
onClick={onAdd}
type="dashed"
className={styles['add-btn']}
>
<PlusOutlined />
</Button>
</Col>
)}
</Row>
</ArrayList>
);
};
Qualifications.isFieldComponent = true;
export default Qualifications;
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-01 18:16:21
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-01 20:45:09
* @LastEditTime: 2021-06-07 14:41:38
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -19,29 +19,31 @@ export type GroupItem = {
elements: ElementType[],
};
export const schema = (groups: GroupItem[]): ISchema => ({
type: 'object',
properties: {
...(
(groups || []).map((item) => ({
type: 'object',
'x-component': 'CardBox',
'x-component-props': {
title: item.groupName,
},
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 20,
labelAlign: 'left',
},
properties: createMemberSchema(item.elements),
export const schema = (groups: GroupItem[]): ISchema => {
const depositSchema: ISchema = {
type: 'object',
properties: {},
};
(groups || []).forEach((item, index) => {
depositSchema.properties[`CARD_BOX_${index}`] = {
type: 'object',
'x-component': 'CardBox',
'x-component-props': {
title: item.groupName,
},
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 20,
labelAlign: 'left',
},
properties: createMemberSchema(item.elements),
},
}))
) as any,
},
});
\ No newline at end of file
},
};
});
return depositSchema;
};
\ No newline at end of file
......@@ -17,7 +17,7 @@ import { DatePicker, Checkbox } from '@formily/antd-components'
import NiceForm from '@/components/NiceForm';
import { schema } from './schema';
import QualitiesUpload from '../../../components/QualitiesUpload';
import QualificationUploadFormItem from '../../../components/QualificationUploadFormItem';
import QualitiesUploadFormItem from '../../../components/QualitiesUploadFormItem';
export type FileType = {
/**
......@@ -121,7 +121,7 @@ const UploadQualificationsDrawer: React.FC<IProps> = (props: IProps) => {
Checkbox,
CheckboxGroup: Checkbox.Group,
QualitiesUpload,
QualificationUploadFormItem,
QualitiesUploadFormItem,
}}
effects={() => {
......
......@@ -16,7 +16,7 @@ export const schema: ISchema = {
properties: {
channelLevel: {
type: 'string',
'x-component': 'QualificationUploadFormItem',
'x-component': 'QualitiesUploadFormItem',
'x-component-props': {
colSpan: 24,
},
......
......@@ -26,7 +26,7 @@ import ComingAgreement from './components/ComingAgreement';
import RegisterInfo from './components/RegisterInfo';
import SubmitSuccess from './components/SubmitSuccess';
import QualitiesUpload from '../../components/QualitiesUpload';
import QualificationUploadFormItem from '../../components/QualificationUploadFormItem';
import QualitiesUploadFormItem from '../../components/QualitiesUploadFormItem';
type ValueType = {
step3: { [key: string]: any },
......@@ -320,7 +320,7 @@ const MemberQueryApplyMember: React.FC = () => {
CheckboxGroup: Checkbox.Group,
DatePicker,
QualitiesUpload,
QualificationUploadFormItem,
QualitiesUploadFormItem,
}}
expressionScope={{
currenStep,
......
......@@ -144,7 +144,7 @@ const schema = (groups: GroupItem[], validateId?: number): ISchema => {
properties: {
qualities: {
type: 'array',
'x-component': 'QualificationUploadFormItem',
'x-component': 'QualitiesUploadFormItem',
},
},
},
......
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