Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
c6e4d127
Commit
c6e4d127
authored
Mar 08, 2022
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改门店管理新增
parent
90240028
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
24 deletions
+44
-24
index.tsx
src/components/AddressSelect/components/AreaSelect/index.tsx
+15
-12
portalSystem.ts
src/locales/zh-CN/system/portalSystem.ts
+3
-3
add.tsx
src/pages/authConfig/portalSystem/add.tsx
+1
-1
address.tsx
src/pages/authConfig/portalSystem/components/address.tsx
+21
-4
basicLayout.tsx
src/pages/authConfig/portalSystem/components/basicLayout.tsx
+2
-2
delivery.ts
...ges/authConfig/portalSystem/components/schema/delivery.ts
+1
-1
dispatch.ts
...ges/authConfig/portalSystem/components/schema/dispatch.ts
+1
-1
No files found.
src/components/AddressSelect/components/AreaSelect/index.tsx
View file @
c6e4d127
...
...
@@ -16,18 +16,14 @@ interface AreaSelectProps {
* 选择触发改变
*/
onChange
?:
(
value
:
AreaSelectValueType
[])
=>
void
,
/**
* 到街道默认为 3
* TODO: 因为澳门只有到市
*/
MAX
:
number
}
const
MAX
=
3
;
// 到街道
const
AreaSelect
:
React
.
FC
<
AreaSelectProps
>
=
(
props
)
=>
{
const
{
value
,
onChange
,
MAX
=
3
}
=
props
;
const
[
innerValues
,
setInnerValues
]
=
useState
<
AreaSelectValueType
[]
>
([]);
...
...
@@ -43,6 +39,15 @@ const AreaSelect: React.FC<AreaSelectProps> = (props) => {
}
};
const
handleResetChang
=
(
newInnerValues
:
AreaSelectValueType
[],
index
:
number
)
=>
{
let
i
=
index
+
1
;
while
(
i
<
newInnerValues
.
length
)
{
newInnerValues
[
i
]
=
undefined
;
i
++
;
}
newInnerValues
=
newInnerValues
.
filter
(
Boolean
);
}
const
handleSelectChange
=
(
value
:
AreaSelectValueType
,
index
:
number
)
=>
{
let
newInnerValues
=
[...
innerValues
];
...
...
@@ -50,13 +55,11 @@ const AreaSelect: React.FC<AreaSelectProps> = (props) => {
// 如果是清空操作,则把当前层级之后的 选项 及 值 也清空
if
(
!
value
)
{
let
i
=
index
+
1
;
while
(
i
<
newInnerValues
.
length
)
{
newInnerValues
[
i
]
=
undefined
;
i
++
;
}
newInnerValues
=
newInnerValues
.
filter
(
Boolean
);
handleResetChang
(
newInnerValues
,
index
)
triggerChange
([]);
}
else
{
handleResetChang
(
newInnerValues
,
index
)
setInnerValues
(
newInnerValues
);
}
// 全部选择了才触发 onChange
...
...
src/locales/zh-CN/system/portalSystem.ts
View file @
c6e4d127
...
...
@@ -14,7 +14,7 @@ export default {
'portalSystem.shi'
:
'是'
,
'portalSystem.fou'
:
'否'
,
'portalSystem.chaxun'
:
'查询'
,
'portalSystem.menhuguanlixiangqing'
:
'门
户
管理详情'
,
'portalSystem.menhuguanlixiangqing'
:
'门
店
管理详情'
,
'portalSystem.jibenxinxi'
:
'基本信息'
,
'portalSystem.mendianLOGO'
:
'门店LOGO'
,
'portalSystem.lianxixinxi'
:
'联系信息'
,
...
...
@@ -29,9 +29,9 @@ export default {
'portalSystem.bianjimendian'
:
'编辑门店'
,
'portalSystem.xinzengmendian'
:
'新增门店'
,
'portalSystem.baocun'
:
'保存'
,
'portalSystem.menhudaima'
:
'门
户
代码'
,
'portalSystem.menhudaima'
:
'门
店
代码'
,
'portalSystem.qingshuru'
:
'请输入'
,
'portalSystem.qingshurumenhudaima'
:
'请输入门
户
代码'
,
'portalSystem.qingshurumenhudaima'
:
'请输入门
店
代码'
,
'portalSystem.qingshumendianmingcheng'
:
'请输门店名称'
,
'portalSystem.qingxuanzeshengshiqu'
:
'请选择省/市/区'
,
'portalSystem.qingtianxiexiangxidizhi'
:
'请填写详细地址,路名、门牌号等'
,
...
...
src/pages/authConfig/portalSystem/add.tsx
View file @
c6e4d127
...
...
@@ -190,7 +190,7 @@ const PortalSystemAdded = (props) => {
</
Form
>
}
/>
<
Prompt
when=
{
unsaved
}
message=
"{intl.formatMessage({id: 'dealAbility.ninhaiyouweibaocundenei'})}"
/>
<
Prompt
when=
{
unsaved
}
message=
{
intl
.
formatMessage
({
id
:
'dealAbility.ninhaiyouweibaocundenei'
})
}
/>
</
Context
.
Provider
>
)
}
...
...
src/pages/authConfig/portalSystem/components/address.tsx
View file @
c6e4d127
import
React
,
{
Fragment
,
useContext
,
useEffect
,
useMemo
,
useState
}
from
'react'
;
import
CardLayout
from
'@/pages/transaction/components/card'
import
{
Button
,
Col
,
Radio
,
Row
,
Drawer
,
Empty
}
from
'antd'
;
import
{
Button
,
Col
,
Radio
,
Row
,
Drawer
,
Empty
,
Modal
}
from
'antd'
;
import
style
from
'./index.less'
;
import
{
DeleteOutlined
,
EditOutlined
}
from
'@ant-design/icons'
;
import
{
DeleteOutlined
,
EditOutlined
,
ExclamationCircleOutlined
}
from
'@ant-design/icons'
;
import
{
DELIVERY_SCHEMA
}
from
'./schema/delivery'
;
import
{
DISPATCH_SCHEMA
}
from
'./schema/dispatch'
;
import
NiceForm
from
'@/components/NiceForm'
;
...
...
@@ -110,6 +110,7 @@ const AddressLayout: React.FC<addressProps> = (props: addressProps) => {
}
const
area
=
(
areaSelect
)
=>
{
const
[
province
,
city
,
district
,
street
]
=
areaSelect
;
let
newObj
:
addressInfo
=
{};
...
...
@@ -139,10 +140,26 @@ const AddressLayout: React.FC<addressProps> = (props: addressProps) => {
onChange
(
params
,
type
)
}
const
handleColse
=
()
=>
{
if
(
unsaved
)
{
Modal
.
confirm
({
title
:
'提示'
,
icon
:
<
ExclamationCircleOutlined
/>,
content
:
'您还有未保存的内容,是否确定要离开?'
,
onOk
()
{
setVisible
(
false
);
setUnsaved
(
false
)
},
});
}
else
{
setVisible
(
false
)
}
}
const
renderFooter
=
()
=>
{
return
(
<
div
style=
{
{
textAlign
:
'right'
}
}
>
<
Button
style=
{
{
marginRight
:
8
}
}
>
<
Button
style=
{
{
marginRight
:
8
}
}
onClick=
{
()
=>
handleColse
()
}
>
取消
</
Button
>
<
Button
type=
"primary"
onClick=
{
()
=>
addressSchemaAction
.
submit
()
}
>
...
...
@@ -252,7 +269,7 @@ const AddressLayout: React.FC<addressProps> = (props: addressProps) => {
width=
{
600
}
destroyOnClose
closable
onClose=
{
()
=>
setVisible
(
false
)
}
onClose=
{
()
=>
handleColse
(
)
}
footer=
{
renderFooter
()
}
>
<
NiceForm
...
...
src/pages/authConfig/portalSystem/components/basicLayout.tsx
View file @
c6e4d127
...
...
@@ -32,10 +32,10 @@ const BasicLayout: React.FC<BasicProps> = (props: BasicProps) => {
<
Row
gutter=
{
[
48
,
24
]
}
>
<
Col
span=
{
12
}
>
<
Form
.
Item
label=
{
intl
.
formatMessage
({
id
:
'portalSystem.menhudaima'
,
defaultMessage
:
'门
户
代码'
})
}
label=
{
intl
.
formatMessage
({
id
:
'portalSystem.menhudaima'
,
defaultMessage
:
'门
店
代码'
})
}
name=
'code'
rules=
{
[
{
required
:
true
,
message
:
intl
.
formatMessage
({
id
:
'portalSystem.qingshurumenhudaima'
,
defaultMessage
:
'请输入门
户
代码'
})
},
{
required
:
true
,
message
:
intl
.
formatMessage
({
id
:
'portalSystem.qingshurumenhudaima'
,
defaultMessage
:
'请输入门
店
代码'
})
},
{
validator
:
(
rule
,
value
,
callback
)
=>
validatorByte
(
rule
,
value
,
callback
,
12
)
}
]
}
>
<
Input
placeholder=
{
intl
.
formatMessage
({
id
:
'portalSystem.qingshuru'
,
defaultMessage
:
'请输入'
})
}
/>
...
...
src/pages/authConfig/portalSystem/components/schema/delivery.ts
View file @
c6e4d127
...
...
@@ -25,7 +25,7 @@ export const DELIVERY_SCHEMA: ISchema = {
},
{
limitByte
:
true
,
maxByte
:
2
0
maxByte
:
4
0
}
]
},
...
...
src/pages/authConfig/portalSystem/components/schema/dispatch.ts
View file @
c6e4d127
...
...
@@ -26,7 +26,7 @@ export const DISPATCH_SCHEMA: ISchema = {
},
{
limitByte
:
true
,
maxByte
:
2
0
maxByte
:
4
0
}
]
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment