Commit f0d9f677 authored by XieZhiXiong's avatar XieZhiXiong

chore: 隔绝样式影响、补充属性

parent ecbf0961
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-08-05 14:54:18 * @Date: 2021-08-05 14:54:18
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-07 16:36:14 * @LastEditTime: 2021-08-10 16:42:18
* @Description: * @Description:
*/ */
import React from 'react'; import React from 'react';
...@@ -20,7 +20,7 @@ const AddressRadioGroupFormilyItem = connect()((props) => { ...@@ -20,7 +20,7 @@ const AddressRadioGroupFormilyItem = connect()((props) => {
...rest ...rest
} = props; } = props;
return ( return (
<div style={{ flex: 1 }}> <div style={{ flex: 1, overflow: 'hidden' }}>
<AddressRadioGroup <AddressRadioGroup
addressType={addressType} addressType={addressType}
isDefault={isDefault} isDefault={isDefault}
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
&-input { &-input {
flex: 1; flex: 1;
overflow: hidden;
} }
&-action { &-action {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-08-05 10:28:06 * @Date: 2021-08-05 10:28:06
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-10 10:20:55 * @LastEditTime: 2021-08-10 16:55:26
* @Description: 地址选择 FormItem * @Description: 地址选择 FormItem
*/ */
import React, { useState, useEffect, useMemo, useRef } from 'react'; import React, { useState, useEffect, useMemo, useRef } from 'react';
...@@ -148,7 +148,7 @@ const AddressSelect: React.FC<IProps> = (props) => { ...@@ -148,7 +148,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
triggerChange(undefined); triggerChange(undefined);
} }
if (isDefaultAddress && defaultItem) { if (isDefaultAddress && defaultItem && !disabled) {
const { shipperName, receiverName, ...rest } = defaultItem; const { shipperName, receiverName, ...rest } = defaultItem;
const next = { const next = {
name: shipperName || receiverName, name: shipperName || receiverName,
...@@ -427,12 +427,17 @@ const AddressSelect: React.FC<IProps> = (props) => { ...@@ -427,12 +427,17 @@ const AddressSelect: React.FC<IProps> = (props) => {
}} }}
> >
<div className={styles['address-select']}> <div className={styles['address-select']}>
<div className={styles['address-select-input']}>
<Select <Select
options={options} options={options}
value={value?.id} value={value?.id}
onChange={handleSelectChange} onChange={handleSelectChange}
disabled={disabled} disabled={disabled}
style={{
width: '100%',
}}
/> />
</div>
<Button <Button
onClick={() => handleVisibleDrawer(true)} onClick={() => handleVisibleDrawer(true)}
className={styles['address-select-action']} className={styles['address-select-action']}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-08-05 14:02:46 * @Date: 2021-08-05 14:02:46
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-10 14:05:13 * @LastEditTime: 2021-08-10 16:58:04
* @Description: * @Description:
*/ */
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
...@@ -14,6 +14,13 @@ export const createSchema = (addressType = 2): ISchema => { ...@@ -14,6 +14,13 @@ export const createSchema = (addressType = 2): ISchema => {
return { return {
type: 'object', type: 'object',
properties: { properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: false,
},
properties: {
ADDRESS_LIST: { ADDRESS_LIST: {
type: 'object', type: 'object',
'x-component': 'FlagBox', 'x-component': 'FlagBox',
...@@ -57,6 +64,7 @@ export const createSchema = (addressType = 2): ISchema => { ...@@ -57,6 +64,7 @@ export const createSchema = (addressType = 2): ISchema => {
type: 'object', type: 'object',
'x-component': 'mega-layout', 'x-component': 'mega-layout',
'x-component-props': { 'x-component-props': {
full: false,
labelCol: 4, labelCol: 4,
wrapperCol: 20, wrapperCol: 20,
labelAlign: 'left', labelAlign: 'left',
...@@ -237,5 +245,7 @@ export const createSchema = (addressType = 2): ISchema => { ...@@ -237,5 +245,7 @@ export const createSchema = (addressType = 2): ISchema => {
}, },
}, },
}, },
}
},
}; };
}; };
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-08-05 11:26:43 * @Date: 2021-08-05 11:26:43
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-05 11:30:21 * @LastEditTime: 2021-08-10 16:49:14
* @Description: * @Description:
*/ */
import React from 'react'; import React from 'react';
...@@ -15,12 +15,16 @@ const CustomAddressSelect = connect()((props) => { ...@@ -15,12 +15,16 @@ const CustomAddressSelect = connect()((props) => {
value, value,
onChange, onChange,
addressType, addressType,
isDefault,
disabled,
...rest ...rest
} = props; } = props;
return ( return (
<div style={{ flex: 1 }}> <div style={{ flex: 1, overflow: 'hidden' }}>
<AddressSelect <AddressSelect
addressType={addressType} addressType={addressType}
isDefault={isDefault}
disabled={disabled}
value={value} value={value}
onChange={onChange} onChange={onChange}
{...rest} {...rest}
......
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