Commit a02a7950 authored by XieZhiXiong's avatar XieZhiXiong
parents 9d4ed63f 756cd9f5
This diff is collapsed.
...@@ -9,7 +9,7 @@ import { SaveOutlined } from '@ant-design/icons'; ...@@ -9,7 +9,7 @@ import { SaveOutlined } from '@ant-design/icons';
import { useLinkEnumEffect } from '@/components/NiceForm/linkages/linkEnum'; import { useLinkEnumEffect } from '@/components/NiceForm/linkages/linkEnum';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'; import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import styles from './index.less'; import styles from './index.less';
import { getManageAreaAll, getManageCountryAreaGetTelCode } from '@/services/ManageV2Api'; import { getManageAreaAll, getManageAreaByPcode, getManageCountryAreaGetTelCode } from '@/services/ManageV2Api';
const formActions = createFormActions(); const formActions = createFormActions();
const { const {
...@@ -161,7 +161,7 @@ const AddressForm: React.FC<AddressFormProps> = (props: any) => { ...@@ -161,7 +161,7 @@ const AddressForm: React.FC<AddressFormProps> = (props: any) => {
}} }}
effects={($, { setFieldState, setFieldValue }) => { effects={($, { setFieldState, setFieldValue }) => {
$('onFormMount').subscribe(async () => { $('onFormMount').subscribe(async () => {
await getManageAreaAll().then(res => { await getManageAreaByPcode({pcode: ''}).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
const { data } = res; const { data } = res;
addressData.current = data addressData.current = data
......
...@@ -362,3 +362,167 @@ export const receiverAddress: ISchema = { ...@@ -362,3 +362,167 @@ export const receiverAddress: ISchema = {
} }
} }
} }
export const SHIPPER_ADDRESS__ISCHEMA: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 6,
wrapperCol: 16,
labelAlign: 'left',
},
properties: {
'shipperName': {
type: 'string',
title: '发货人',
'x-rules': [
{
required: true,
message: '请输入发货人',
},
{
limitByte: true, // 自定义校验规则
maxByte: 20,
}
]
},
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
label: '{{AddressLabel}}',
wrapperCol: 24,
},
properties: {
MEGA_LAYOUT1_1: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
columns: 4
},
properties: {
'provinceCode': {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '-省份/直辖市-',
},
},
'cityCode': {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '-市-',
},
},
'districtCode': {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '-区-',
},
},
'streetCode': {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '-街道-',
},
}
// provinceCode: {
// type: 'string',
// enum: [],
// 'x-component-props': {
// placeholder: '-省份/直辖市-',
// },
// 'x-linkages': [
// {
// type: 'value:linkage',
// condition: '{{!!$self.value}}',
// origin: 'provinceCode',
// target: 'cityCode',
// },
// ],
// required: true,
// },
// cityCode: {
// type: 'string',
// enum: [],
// 'x-component-props': {
// placeholder: '-市-',
// },
// 'x-linkages': [
// {
// type: 'value:linkage',
// condition: '{{!!$self.value}}',
// origin: 'cityCode',
// target: 'districtCode',
// },
// ],
// required: true,
// },
// districtCode: {
// type: 'string',
// enum: [],
// 'x-component-props': {
// placeholder: '-区-',
// },
// required: true,
// },
}
},
}
},
'address': {
type: 'string',
title: '详细地址',
'x-component': 'TextArea',
'x-rules': [
{
required: true,
message: '请输入详细地址',
},
{
limitByte: true, // 自定义校验规则
maxByte: 60,
}
]
},
'postalCode': {
type: 'string',
title: '邮编',
'x-component-props': {},
'x-rules': [
{
limitByte: true, // 自定义校验规则
maxByte: 20,
}
]
},
'tel': {
type: 'string',
title: '电话号码',
'x-component-props': {
placeholder: '请输入你的电话号码',
},
'x-rules': [
{
pattern: PATTERN_MAPS.tel,
message: '请输入正确格式的电话号码',
},
],
},
'isDefault': {
title: '是否默认',
'x-component': 'Switch'
}
}
}
}
}
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