Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swifteditor
Overview
Overview
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
daixuan
swifteditor
Commits
8441d951
Commit
8441d951
authored
Aug 20, 2021
by
fukai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
渤海版本更新
parent
b64d0e9d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
209 additions
and
36 deletions
+209
-36
ie-lt10-support.js
src/entries/ie-lt10-support.js
+0
-0
index.html
src/entries/index.html
+5
-3
index.js
src/routes/index.js
+1
-0
swift_action.js
src/store/modules/swift/swift_action.js
+4
-0
swift_reducer.js
src/store/modules/swift/swift_reducer.js
+3
-0
swift_state.js
src/store/modules/swift/swift_state.js
+1
-0
types.js
src/store/types.js
+1
-0
LeadPage.js
src/swift/LeadPage.js
+50
-14
PreView.js
src/swift/PreView.js
+2
-4
SWFPage2.js
src/swift/SWFPage2.js
+100
-10
TagHelpTxtMap.js
src/swift/TagHelpTxtMap.js
+6
-0
TagValidater.js
src/swift/TagValidater.js
+11
-2
T20.js
src/swift/Tags/T20.js
+24
-2
TemplateSave.js
src/swift/TemplateSave.js
+1
-1
No files found.
src/entries/ie-lt10-support.js
0 → 100644
View file @
8441d951
This diff is collapsed.
Click to expand it.
src/entries/index.html
View file @
8441d951
...
...
@@ -14,8 +14,10 @@
<!--[if lt IE 10]>
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.5.7/es5-shim.min.js,es5-shim/4.5.7/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
<![endif]-->
<script
src=
"./ie-lt10-support.js"
></script>
<script>
window
.
serviceURL
=
"
http://127.0.0.1:8080/webeditor
/service"
;
window
.
serviceURL
=
"
.
/service"
;
window
.
CUR
=
[
'AUD'
,
'CHF'
,
...
...
@@ -33,8 +35,8 @@
'USD'
,
'SGD'
];
window
.
BANK_LOGIC_ADDRESS
=
"
NYCBCNS
0AXXX"
window
.
BANK_BIC
=
"
NYCBCNS
0XXX"
window
.
BANK_LOGIC_ADDRESS
=
"
CHBHHKH
0AXXX"
window
.
BANK_BIC
=
"
CHBHHKH
0XXX"
</script>
<script
src=
"./common.js"
></script>
<script
src=
"./index.js"
></script>
...
...
src/routes/index.js
View file @
8441d951
...
...
@@ -33,6 +33,7 @@ const Routes = ({ history }) =>
<
Route
path
=
"swift/:action/:mctid/:key"
component
=
{
SWFPage
}
/
>
<
Route
path
=
"swift/:action/:mctid/:key/:rcvbic"
component
=
{
SWFPage
}
/
>
<
Route
path
=
"swift/:action/:mctid/:key/:sndbic/:rcvbic"
component
=
{
SWFPage
}
/
>
<
Route
path
=
"swift/:action/:mctid/:key/:gentyp"
component
=
{
SWFPage
}
/
>
<
Route
path
=
"app"
component
=
{
App
}
/
>
<
Route
path
=
"preview/:kind"
component
=
{
Preview
}
/
>
<
Route
path
=
"result/:kind"
component
=
{
Result
}
/
>
...
...
src/store/modules/swift/swift_action.js
View file @
8441d951
...
...
@@ -6,6 +6,10 @@ export function updateTreeValue()
return
{
type
:
types
.
SWIFT_UPDATE_TREE_VALUE
}
}
export
function
updateGenTyp
(
gen_typ_info
)
{
return
{
type
:
types
.
SWIFT_UPDATE_GEN_TYP
,
payload
:{
gen_typ_info
}}
}
export
function
updateRcvBic
(
rcv_bic_info
)
{
return
{
type
:
types
.
SWIFT_UPDATE_RCV_BIC
,
payload
:{
rcv_bic_info
}}
...
...
src/store/modules/swift/swift_reducer.js
View file @
8441d951
...
...
@@ -17,6 +17,9 @@ export default createReducer(initialState, {
},
[
`
${
types
.
SWIFT_STORE_TEMPLATE
}
`
]:
(
state
)
=>
state
,
[
`
${
types
.
SWIFT_STORE_MESSAGE
}
`
]:
(
state
)
=>
state
,
[
`
${
types
.
SWIFT_UPDATE_GEN_TYP
}
`
]:
(
state
,{
gen_typ_info
})
=>
{
return
objectAssign
({},
state
,{
gen_typ_info
})
},
[
`
${
types
.
SWIFT_UPDATE_RCV_BIC
}
`
]:
(
state
,{
rcv_bic_info
})
=>
{
return
objectAssign
({},
state
,{
rcv_bic_info
})
},
...
...
src/store/modules/swift/swift_state.js
View file @
8441d951
const
InitState
=
{
swift_message
:
""
,
gen_typ_info
:{
gen_typ
:
''
,
err_msg
:
''
},
rcv_bic_info
:{
rcv_bic
:
''
,
err_msg
:
''
},
snd_bic_info
:{
snd_bic
:
''
,
err_msg
:
''
},
swift_message_tree
:
null
,
...
...
src/store/types.js
View file @
8441d951
...
...
@@ -29,6 +29,7 @@ export default keyMirror({
SWIFT_STORE_MESSAGE
:
null
,
SWIFT_UPDATE_RCV_BIC
:
null
,
SWIFT_UPDATE_SND_BIC
:
null
,
SWIFT_UPDATE_GEN_TYP
:
null
,
SWIFT_INIT_TREE_VALUE
:
null
,
SWIFT_UPDATE_SWIFT_MESSAGE
:
null
,
...
...
src/swift/LeadPage.js
View file @
8441d951
...
...
@@ -12,72 +12,108 @@ const Step = Steps.Step;
export
const
mty
=
[
{
mty
:
"mt101"
,
desp
:
"MT 101 Request for Transfer"
},
{
mty
:
"mt103"
,
desp
:
"MT 103 Single Customer Credit Transfer"
},
{
mty
:
"mt190"
,
desp
:
"MT 190 Advice of Charges, Interest and Other Adjustments"
},
{
mty
:
"mt191"
,
desp
:
"MT 191 Request for Payment of Charges, Interest and Other Expenses"
},
{
mty
:
"mt192"
,
desp
:
"MT 192 Request for Cancellation"
},
{
mty
:
"mt195"
,
desp
:
"MT 195 Queries"
},
{
mty
:
"mt196"
,
desp
:
"MT 196 Answers"
},
{
mty
:
"mt198"
,
desp
:
"MT 198 Proprietary Message"
},
{
mty
:
"mt199"
,
desp
:
"MT 199 Free Format Message"
},
{
mty
:
"mt202"
,
desp
:
"MT 202 General Financial Institution Transfer"
},
{
mty
:
"mt202COV"
,
desp
:
"MT 202 COV General Financial Institution Transfer"
},
{
mty
:
"mt210"
,
desp
:
"MT 210 Notice to Receive"
},
{
mty
:
"mt292"
,
desp
:
"MT 292 Request for Cancellation"
},
{
mty
:
"mt295"
,
desp
:
"MT 295 Queries"
},
{
mty
:
"mt296"
,
desp
:
"MT 296 Answers"
},
{
mty
:
"mt298"
,
desp
:
"MT 298 Proprietary Message"
},
{
mty
:
"mt299"
,
desp
:
"MT 299 Free Format Message"
},
{
mty
:
"mt300"
,
desp
:
"MT 300 Foreign Exchange Confirmation"
},
{
mty
:
"mt305"
,
desp
:
"MT 305 Foreign Currency Option Confirmation"
},
//
{mty:"mt305",desp:"MT 305 Foreign Currency Option Confirmation"},
{
mty
:
"mt320"
,
desp
:
"MT 320 Fixed Loan/Deposit Confirmation"
},
{
mty
:
"mt360"
,
desp
:
"MT 360 Single Currency Interest Rate Derivative Confirmation"
},
{
mty
:
"mt
400"
,
desp
:
"MT 400 Advice of Payment
"
},
//
{mty:"mt360",desp:"MT 360 Single Currency Interest Rate Derivative Confirmation"},
{
mty
:
"mt
399"
,
desp
:
"MT 399 Free Format Message
"
},
{
mty
:
"mt400"
,
desp
:
"MT 400 Advice of Payment"
},
{
mty
:
"mt410"
,
desp
:
"MT 410 Acknowledgement"
},
{
mty
:
"mt412"
,
desp
:
"MT 412 Acknowledgement"
},
{
mty
:
"mt420"
,
desp
:
"MT 420 Tracer"
},
{
mty
:
"mt422"
,
desp
:
"MT 422 Advice of Fate and Request for Instructions"
},
{
mty
:
"mt499"
,
desp
:
"MT 499 Free Format Message"
},
/*
{mty:"mt535",desp:"MT 535 Statement of Holdings"},
{mty:"mt536",desp:"MT 536 Statement of Transactions"},
{mty:"mt537",desp:"MT 537 Statement of Pending Transactions"},
{mty:"mt538",desp:"MT 538 Statement of Intra-Position Advices"},
{mty:"mt540",desp:"MT 540 Receive Free"},
{mty:"mt541",desp:"MT 541 Receive Against Payment"},
{mty:"mt542",desp:"MT 542 Deliver Free"},
{mty:"mt543",desp:"MT 543 Deliver Against Payment"},
{mty:"mt544",desp:"MT 544 Receive Free Confirmation"},
{mty:"mt545",desp:"MT 545 Receive Against Payment Confirmation"},
{mty:"mt546",desp:"MT 546 Deliver Free Confirmation"},
{mty:"mt547",desp:"MT 547 Deliver Against Payment Confirmation"},
{mty:"mt548",desp:"MT 548 Settlement Status and Processing Advice"},
{mty:"mt564",desp:"MT 564 Corporate Action Notification"},
{mty:"mt565",desp:"MT 565 Corporate Action Instruction"},
{mty:"mt566",desp:"MT 566 Corporate Action Confirmation"},
{mty:"mt567",desp:"MT 567 Corporate Action Status and Processing Advice"},
*/
{
mty
:
"mt592"
,
desp
:
"MT 592 Request for Cancellation"
},
{
mty
:
"mt595"
,
desp
:
"MT 595 Queries"
},
{
mty
:
"mt596"
,
desp
:
"MT 596 Answers"
},
{
mty
:
"mt598"
,
desp
:
"MT 598 Proprietary Message"
},
{
mty
:
"mt599"
,
desp
:
"MT 599 Free Format Message"
},
/*
{mty:"mt600",desp:"MT 600 Commodity Trade Confirmation"},
{mty:"mt605",desp:"MT 605 Commodity Notice to Receive"},
{mty:"mt607",desp:"MT 607 Commodity Credit Advice"},
{mty:"mt620",desp:"MT 620 Commodity Fixed Loan/Deposit Confirmation"},
*/
{
mty
:
"mt700"
,
desp
:
"MT 700 Issue of a Documentary Credit"
},
{
mty
:
"mt701"
,
desp
:
"MT 701 General Financial Institution Transfer"
},
{
mty
:
"mt707"
,
desp
:
"MT 707 Amendment to a Documentary Credit"
},
{
mty
:
"mt710"
,
desp
:
"MT 710 Advice of a Third Bank's or a Non-Bank's Documentary Credit"
},
{
mty
:
"mt711"
,
desp
:
"MT 711 Advice of a Third Bank's or a Non-Bank's Documentary Credit"
},
{
mty
:
"mt720"
,
desp
:
"MT 720 Transfer of a Documentary Credit"
},
{
mty
:
"mt721"
,
desp
:
"MT 721 Transfer of a Documentary Credit"
},
{
mty
:
"mt730"
,
desp
:
"MT 730 Acknowledgement"
},
{
mty
:
"mt732"
,
desp
:
"MT 732 Advice of Discharge"
},
{
mty
:
"mt734"
,
desp
:
"MT 734 Advice of Refusal"
},
{
mty
:
"mt740"
,
desp
:
"MT 740 Authorisation to Reimburse"
},
{
mty
:
"mt742"
,
desp
:
"MT 742 Reimbursement Claim"
},
{
mty
:
"mt747"
,
desp
:
"MT 747 Amendment to an Authorisation to Reimburse"
},
{
mty
:
"mt750"
,
desp
:
"MT 750 Advice of Discrepancy"
},
{
mty
:
"mt752"
,
desp
:
"MT 752 Authorisation to Pay, Accept or Negotiate"
},
{
mty
:
"mt754"
,
desp
:
"MT 754 Advice of Payment/Acceptance/Negotiation"
},
{
mty
:
"mt756"
,
desp
:
"MT 756 Advice of Reimbursement or Payment"
},
{
mty
:
"mt759"
,
desp
:
"MT 759 Ancillary Trade Structured Message"
},
{
mty
:
"mt760"
,
desp
:
"MT 760 Guarantee/Standby Letter of Credit"
},
{
mty
:
"mt767"
,
desp
:
"MT 767 Guarantee/Standby Letter of Credit Amendment"
},
{
mty
:
"mt768"
,
desp
:
"MT 768 Acknowledgement of a Guarantee/Standby Message"
},
{
mty
:
"mt769"
,
desp
:
"MT 769 Advice of Reduction or Release"
},
{
mty
:
"mt799"
,
desp
:
"MT 799 Free Format Message"
},
{
mty
:
"mt940"
,
desp
:
"MT 940 Customer Statement Message"
},
{
mty
:
"mt950"
,
desp
:
"MT 950 Statement Message"
},
{
mty
:
"mt995"
,
desp
:
"MT 995 Queries"
},
{
mty
:
"mt996"
,
desp
:
"MT 996 Answers"
},
{
mty
:
"mt998"
,
desp
:
"MT 998 Proprietary Message"
},
{
mty
:
"mt999"
,
desp
:
"MT 999 Free Format Message"
},
{
mty
:
"mt1000"
,
desp
:
"MT 1000 TEST"
},
//
{mty:"mt1000",desp:"MT 1000 TEST"},
]
// const columns = [{
...
...
src/swift/PreView.js
View file @
8441d951
...
...
@@ -4,14 +4,12 @@ import {connect} from 'react-redux';
import
{
Input
,
Table
,
Steps
,
Row
,
Col
,
Button
}
from
'antd'
import
{
updateTreeValue
,
updateRcvBic
,
initSwiftMessageTree
,
updateSwiftMessage
}
from
'../store/modules/swift/swift_action'
;
const
Step
=
Steps
.
Step
;
class
PreView
extends
Component
{
render
()
{
return
(
<
div
>
return
(
<
div
>
<
Row
style
=
{{
marginTop
:
'3em'
}}
>
<
Col
span
=
{
3
}
/
>
<
Col
span
=
{
18
}
>
...
...
@@ -39,7 +37,7 @@ const Step = Steps.Step;
<
/Col
>
<
Col
span
=
{
18
}
>
{
/*onChange={e=>this.props.actions.updateSwiftMessage(e.target.value)}*/
}
<
Input
type
=
"textarea"
readOnly
=
"readonly"
value
=
{
this
.
props
.
value
}
rows
=
{
20
}
cols
=
{
50
}
/
>
<
Input
type
=
"textarea"
readOnly
=
"readonly"
value
=
{
this
.
props
.
value
}
rows
=
{
this
.
props
.
value
.
split
(
'
\
n'
).
length
>=
20
?
this
.
props
.
value
.
split
(
'
\
n'
).
length
:
20
}
cols
=
{
50
}
/
>
<
/Col
>
<
Col
span
=
{
3
}
>
<
/Col
>
...
...
src/swift/SWFPage2.js
View file @
8441d951
import
React
,{
Component
}
from
'react'
import
{
bindActionCreators
}
from
'redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
updateTreeValue
,
updateRcvBic
,
updateSndBic
,
initSwiftMessageTree
,
updateSwiftMessage
}
from
'../store/modules/swift/swift_action'
;
import
{
updateTreeValue
,
updateRcvBic
,
updateSndBic
,
updateGenTyp
,
initSwiftMessageTree
,
updateSwiftMessage
}
from
'../store/modules/swift/swift_action'
;
import
ServiceAPI
from
'./ServiceAPI'
import
MessageValidater
from
'./MessageValidater'
...
...
@@ -37,7 +37,7 @@ export class SWFPage extends Component
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
rcv_bic
:
props
.
rcv_bic
,
rcv_bic_msg
:
''
}
this
.
state
=
{
rcv_bic
:
props
.
rcv_bic
,
rcv_bic_msg
:
''
,
gen_typ
:
props
.
gen_typ
,
gen_typ_msg
:
''
}
}
...
...
@@ -92,6 +92,7 @@ export class SWFPage extends Component
this
.
validateAllMessage
(
tags
,
crs
)
let
rcv_bic_err_msg
=
validateRCV_BIC
(
this
.
props
.
rcv_bic_info
.
rcv_bic
)
let
snd_bic_err_msg
=
validateRCV_BIC
(
this
.
props
.
snd_bic_info
.
snd_bic
)
let
gen_typ_err_msg
=
validateGEN_TYP
(
this
.
props
.
gen_typ_info
.
gen_typ
)
if
(
rcv_bic_err_msg
||
crs
.
hasError
)
{
...
...
@@ -99,6 +100,7 @@ export class SWFPage extends Component
notification
.
error
({
description
:
'输入存在错误,请按照提示检查!'
,
message
:
'错误'
})
this
.
props
.
actions
.
updateSndBic
({
snd_bic
:
this
.
props
.
snd_bic_info
.
snd_bic
,
err_msg
:
snd_bic_err_msg
?
snd_bic_err_msg
.
replace
(
"收"
,
"发"
):
''
})
this
.
props
.
actions
.
updateRcvBic
({
rcv_bic
:
this
.
props
.
rcv_bic_info
.
rcv_bic
,
err_msg
:
rcv_bic_err_msg
})
this
.
props
.
actions
.
updateGenTyp
({
gen_typ
:
this
.
props
.
gen_typ_info
.
gen_typ
,
err_msg
:
gen_typ_err_msg
})
this
.
props
.
actions
.
updateTreeValue
()
//滚动至第一个错误位置
setTimeout
(()
=>
{
...
...
@@ -134,19 +136,31 @@ export class SWFPage extends Component
else
{
// message = `{1:${getLogicAdress(this.props.snd_bic_info.snd_bic)}0000000000}{2:I${this.props.params.key.substring(2)}${getLogicAdress(this.props.rcv_bic_info.rcv_bic)}N}{4:\r\n${message}\r\n}`
let
gpistr
=
':121:ID for UUID generation: TRNPAY3
\
r
\
n'
let
gentyp
=
this
.
props
.
gen_typ_info
.
gen_typ
let
mty
=
this
.
props
.
extra
.
msgtyp
.
substring
(
2
)
mty
=
mty
.
toUpperCase
()
if
(
mty
!=
'103'
&&
mty
!=
'202'
&&
mty
!=
'202COV'
)
gpistr
=
''
let
s119
=
''
let
header3
=
''
let
header3_rtgs
=
''
if
(
mty
==
'202COV'
)
{
mty
=
'202'
//s119=':119:COV\r\n' 锦州
s119
=
'{119:COV}'
header3
=
`{3:
${
s119
}
}`
}
if
(
gentyp
==
'RTGS'
)
{
header3_rtgs
=
`{103:HKT}`
}
if
(
s119
||
header3_rtgs
){
header3
=
`{3:
${
s119
}${
header3_rtgs
}
}`
}
//锦州 message = `:MT:${mty}\r\n:IO:${this.props.rcv_bic_info.rcv_bic}\r\n:II:${this.props.snd_bic_info.snd_bic}\r\n:MP:N\r\n${s119}${gpistr}:EOH:\r\n${message}\r\n-\r\n`
//南商
message
=
`{1:F01
${
window
.
BANK_LOGIC_ADDRESS
}
0000000000}{2:I
${
mty
}${
getLogicAdress
(
this
.
props
.
rcv_bic_info
.
rcv_bic
)}
N}
${
header3
}
{4:\r\n
${
message
}
\r\n-}`
...
...
@@ -224,6 +238,7 @@ export class SWFPage extends Component
data
=
JSON
.
parse
(
data
)
this
.
props
.
actions
.
updateRcvBic
({
rcv_bic
:
data
.
rcv_bic_info
.
rcv_bic
})
this
.
props
.
actions
.
updateGenTyp
({
gen_typ
:
data
.
gen_typ_info
.
gen_typ
})
let
tree
=
data
.
swift_message_tree
this
.
props
.
actions
.
initSwiftMessageTree
(
tree
);
}).
catch
(
err
=>
{
...
...
@@ -262,9 +277,9 @@ export class SWFPage extends Component
saveTemp
=
()
=>
{
//存储报文模板
const
{
swift_message
,
rcv_bic_info
,
snd_bic_info
,
swift_message_tree
,
extra
}
=
this
.
props
const
{
swift_message
,
rcv_bic_info
,
snd_bic_info
,
gen_typ_info
,
swift_message_tree
,
extra
}
=
this
.
props
let
json
=
{
swift_message
,
rcv_bic_info
,
snd_bic_info
,
swift_message_tree
,
extra
swift_message
,
rcv_bic_info
,
snd_bic_info
,
gen_typ_info
,
swift_message_tree
,
extra
}
let
jsonStr
=
JSON
.
stringify
(
json
)
return
jsonStr
...
...
@@ -315,6 +330,13 @@ export class SWFPage extends Component
this
.
props
.
actions
.
updateSndBic
({
snd_bic
:
sndbic
})
}
let
gentyp
=
this
.
props
.
params
.
gentyp
if
(
!
gentyp
||
gentyp
!=
'NONE'
)
{
if
(
!
this
.
props
.
swift_message_tree
)
this
.
props
.
actions
.
updateGenTyp
({
gen_typ
:
gentyp
})
}
this
.
isdirect
=
false
}
else
if
(
action
==
'redit'
||
action
==
'redit2'
)
...
...
@@ -330,16 +352,21 @@ export class SWFPage extends Component
}
render
()
{
const
{
swift_message
,
rcv_bic_info
,
snd_bic_info
,
swift_message_tree
}
=
this
.
props
const
{
swift_message
,
rcv_bic_info
,
snd_bic_info
,
gen_typ_info
,
swift_message_tree
}
=
this
.
props
if
(
!
swift_message_tree
)
{
return
<
div
style
=
{{
textAlign
:
'center'
}}
><
Spin
size
=
"large"
/><
/div
>
}
let
tags
=
swift_message_tree
.
Tags
;
let
title
=
swift_message_tree
.
Title
gen_typ_info
.
gen_typ
=
gen_typ_info
.
gen_typ
?
gen_typ_info
.
gen_typ
:
"SWIFT"
const
mty
=
this
.
props
.
params
.
mty
||
this
.
props
.
extra
.
msgtyp
let
flag1
=
(
this
.
props
.
params
.
rcvbic
&&
this
.
props
.
params
.
rcvbic
!=
'NONE'
)
||
this
.
props
.
params
.
action
==
'redit'
||
this
.
props
.
params
.
action
==
'redit2'
let
flag2
=
(
this
.
props
.
params
.
sndbic
&&
this
.
props
.
params
.
sndbic
!=
'NONE'
)
||
this
.
props
.
params
.
action
==
'redit'
||
this
.
props
.
params
.
action
==
'redit2'
let
mty1
=
this
.
props
.
extra
.
msgtyp
.
substring
(
2
)
mty1
=
mty1
.
toUpperCase
()
return
(
<
div
>
<
Row
style
=
{{
marginTop
:
'3em'
}}
>
<
Col
span
=
{
3
}
/
>
...
...
@@ -362,7 +389,15 @@ export class SWFPage extends Component
<
/Col
>
<
Col
span
=
{
3
}
/
>
<
/Row
>
<
Row
style
=
{{
marginTop
:
"3em"
}}
>
<
Row
style
=
{{
marginTop
:
"3em"
}}
>
<
Col
span
=
{
3
}
>
<
/Col
>
<
Col
span
=
{
8
}
>
<
GENTYP
disableflag
=
{
mty1
==
"103"
||
mty1
==
"202"
?
""
:
"disabled"
}
flag
=
{
false
}
gen_typ
=
{
gen_typ_info
.
gen_typ
}
err_msg
=
{
gen_typ_info
.
err_msg
}
onChange
=
{(
val
,
msg
)
=>
{
gen_typ_info
.
gen_typ
=
val
;
gen_typ_info
.
err_msg
=
msg
}}
/
>
<
/Col
>
<
/Row
>
<
Row
style
=
{{}}
>
<
Col
span
=
{
3
}
>
<
/Col
>
<
Col
span
=
{
8
}
>
...
...
@@ -447,15 +482,15 @@ export class SWFPage extends Component
}
const
mapStateToProps
=
(
state
)
=>
{
const
{
swift_message
,
rcv_bic_info
,
snd_bic_info
,
swift_message_tree
,
extra
}
=
state
.
swift
;
const
{
swift_message
,
rcv_bic_info
,
snd_bic_info
,
gen_typ_info
,
swift_message_tree
,
extra
}
=
state
.
swift
;
return
{
swift_message
,
rcv_bic_info
,
snd_bic_info
,
swift_message_tree
,
extra
swift_message
,
rcv_bic_info
,
snd_bic_info
,
gen_typ_info
,
swift_message_tree
,
extra
};
};
function
mapDispatchToProps
(
dispatch
)
{
return
{
actions
:
bindActionCreators
({
updateTreeValue
,
updateRcvBic
,
updateSndBic
,
initSwiftMessageTree
,
updateSwiftMessage
},
dispatch
)
actions
:
bindActionCreators
({
updateTreeValue
,
updateRcvBic
,
updateSndBic
,
updateGenTyp
,
initSwiftMessageTree
,
updateSwiftMessage
},
dispatch
)
};
}
...
...
@@ -473,6 +508,61 @@ function validateRCV_BIC(val)
return
err_msg
}
function
validateGEN_TYP
(
val
)
{
let
err_msg
=
""
if
(
!
val
)
err_msg
=
'请输入报文类型'
return
err_msg
}
class
GENTYP
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
gen_typ
:
props
.
gen_typ
,
err_msg
:
this
.
props
.
err_msg
}
}
onChange
=
val
=>
{
if
((
!
val
&&
!
this
.
state
.
gen_typ
)
||
val
==
this
.
state
.
gen_typ
)
return
let
err_msg
=
validateGEN_TYP
(
val
)
this
.
props
.
onChange
(
val
,
err_msg
)
this
.
setState
({
gen_typ
:
val
,
err_msg
})
}
componentWillReceiveProps
(
nextProps
)
{
this
.
setState
({
gen_typ
:
nextProps
.
gen_typ
,
err_msg
:
nextProps
.
err_msg
})
}
render
()
{
return
(
<
FormItem
help
=
{
this
.
state
.
err_msg
}
validateStatus
=
{
this
.
state
.
err_msg
?
'error'
:
null
}
label
=
"报文类型"
required
{...
formItemLayout
}
>
{
this
.
props
.
flag
?
<
p
style
=
{{
fontWeight
:
'bolder'
,
fontSize
:
'1.2em'
,
paddingBottom
:
'0em'
,
paddingLeft
:
'1em'
,
borderBottom
:
'1px solid #37b8f2'
}}
>
{
this
.
state
.
gen_typ
}
<
/p
>
:
<
Select
allowClear
=
{
false
}
value
=
{
this
.
state
.
gen_typ
}
style
=
{{
width
:
"100%"
}}
placeholder
=
"报文类型"
onChange
=
{
this
.
onChange
}
disabled
=
{
this
.
props
.
disableflag
}
>
<
Option
value
=
"SWIFT"
>
SWIFT
<
/Option
>
<
Option
value
=
"RTGS"
>
RTGS
<
/Option
>
<
/Select
>
}
<
/FormItem>
)
}
}
class
SNDBIC
extends
Component
{
constructor
(
props
)
{
...
...
src/swift/TagHelpTxtMap.js
0 → 100644
View file @
8441d951
const
TagHelpTxtMap
=
{
T22C
:
"4位大写字母+2位大写字母或数字+4位数字+4位大写字母+2位大写字母或数字"
,
T14S
:
"eg:EUR2/1000/GBLO"
}
export
{
TagHelpTxtMap
}
src/swift/TagValidater.js
View file @
8441d951
import
{
RegMap
}
from
'./TagRegMap'
import
{
TagHelpTxtMap
}
from
'./TagHelpTxtMap'
export
function
isTagValueEmpty
(
tag
,
tagValue
)
{
...
...
@@ -113,7 +114,12 @@ export function TagV(tag,status,value,tno,mty,seqlist,countMap={})
if
(
!
new
RegExp
(
`^
${
reg
.
reg
}
$`
).
test
(
val
))
{
errmsg
[
key
]
=
"请输入正确的格式"
if
(
TagHelpTxtMap
[
tag
])
errmsg
[
key
]
=
"请输入正确的格式:"
+
TagHelpTxtMap
[
tag
]
else
errmsg
[
key
]
=
"请输入正确的格式"
}
continue
}
...
...
@@ -154,7 +160,10 @@ export function TagV(tag,status,value,tno,mty,seqlist,countMap={})
if
(
!
new
RegExp
(
`^
${
reg
.
reg
}
$`
).
test
(
val
))
{
errmsg
[
key
]
=
"请输入正确的格式"
if
(
TagHelpTxtMap
[
tag
])
errmsg
[
key
]
=
"请输入正确的格式:"
+
TagHelpTxtMap
[
tag
]
else
errmsg
[
key
]
=
"请输入正确的格式"
}
}
}
...
...
src/swift/Tags/T20.js
View file @
8441d951
import
React
,{
Component
}
from
'react'
import
{
Form
,
Input
,
DatePicker
,
Row
,
Col
,
Button
,
Icon
,
Select
}
from
'antd'
;
const
FormItem
=
Form
.
Item
;
import
moment
from
'moment'
import
{
Random
}
from
"random-js"
const
FormItem
=
Form
.
Item
;
const
random
=
new
Random
();
export
default
class
T20
extends
Component
{
...
...
@@ -18,13 +21,32 @@ export default class T20 extends Component
render
()
{
let
day
=
new
Date
()
let
dayWrapper
=
moment
(
day
)
let
mty
=
this
.
props
.
mty
.
substring
(
2
).
substring
(
0
,
3
)
let
ref
=
"BW"
+
mty
+
dayWrapper
.
format
(
"X"
)
+
random
.
string
(
1
);
//console.log("ref-->"+ref)
if
(
this
.
props
.
value
){
}
else
{
this
.
props
.
onValue
([{
s1
:
ref
},
ref
])
}
let
value
=
this
.
props
.
value
//console.log("value-->"+value)
let
mval
=
value
&&
value
.
length
?
value
[
1
]
:
''
let
errmsg
=
value
&&
value
.
length
==
3
?
value
[
2
]:{}
//console.log("value-->"+value)
value
=
value
&&
value
.
length
?
value
[
0
]
:
{}
//console.log("value-->"+value)
//console.log("value s1-->"+value.s1)
return
(
<
Row
>
<
Col
span
=
{
21
}
>
<
FormItem
...
...
@@ -32,7 +54,7 @@ export default class T20 extends Component
help
=
{
errmsg
.
s1
}
validateStatus
=
{
errmsg
.
s1
?
'error'
:
null
}
>
<
Input
maxLength
=
{
16
}
value
=
{
value
.
s1
}
placeholder
=
{
this
.
props
.
desp
}
style
=
{{
'imeMode'
:
'disabled'
}}
onChange
=
{
e
=>
this
.
onChange
(
e
.
target
.
value
)}
/
>
<
Input
maxLength
=
{
16
}
value
=
{
value
.
s1
}
defaultValue
=
{
ref
}
placeholder
=
{
this
.
props
.
desp
}
style
=
{{
'imeMode'
:
'disabled'
}}
onChange
=
{
e
=>
this
.
onChange
(
e
.
target
.
value
)}
/
>
<
/FormItem
>
<
/Col
>
...
...
src/swift/TemplateSave.js
View file @
8441d951
...
...
@@ -135,7 +135,7 @@ class TempForm extends Component{
label
=
"模板名称"
hasFeedback
>
<
Input
name
=
"nam"
{...
nameProps
}
type
=
"text"
maxLength
=
{
10
}
placeholder
=
"
onBlur 与 onChange 相结合
"
/>
<
Input
name
=
"nam"
{...
nameProps
}
type
=
"text"
maxLength
=
{
10
}
placeholder
=
"
请填写模板名称
"
/>
<
/FormItem
>
<
FormItem
{...
formItemLayout
}
...
...
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