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
259a7303
Commit
259a7303
authored
5 years ago
by
fukai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交锦州报文编辑
parent
3d59efbf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
26 deletions
+88
-26
SWFPage2.js
src/swift/SWFPage2.js
+51
-19
TagValidater.js
src/swift/TagValidater.js
+37
-7
No files found.
src/swift/SWFPage2.js
View file @
259a7303
...
@@ -15,7 +15,7 @@ import TagSet from "./Tags"
...
@@ -15,7 +15,7 @@ import TagSet from "./Tags"
import
{
DeepCopy
,
getLogicAdress
}
from
'./Utils'
import
{
DeepCopy
,
getLogicAdress
}
from
'./Utils'
import
{
TagV
}
from
'./TagValidater'
import
{
TagV
,
SwitchType
}
from
'./TagValidater'
import
GPIConfig
from
'../constants/GPIConfig'
import
GPIConfig
from
'../constants/GPIConfig'
import
YBIC
from
'./Tags/YBIC'
import
YBIC
from
'./Tags/YBIC'
...
@@ -57,7 +57,7 @@ export class SWFPage extends Component
...
@@ -57,7 +57,7 @@ export class SWFPage extends Component
{
{
item
.
tagValue
=
[{},
''
,{}]
item
.
tagValue
=
[{},
''
,{}]
}
}
if
(
!
TagV
(
"T"
+
item
.
tag
,
item
.
status
,
item
.
tagValue
,
item
.
tno
,
mty
))
if
(
!
TagV
(
"T"
+
item
.
tag
,
item
.
status
,
item
.
tagValue
,
item
.
tno
,
mty
,
this
.
props
.
params
.
t111
||
this
.
props
.
extra
.
reload_t111
))
{
{
rs
.
hasError
=
true
rs
.
hasError
=
true
console
.
log
(
item
.
tag
)
console
.
log
(
item
.
tag
)
...
@@ -114,9 +114,9 @@ export class SWFPage extends Component
...
@@ -114,9 +114,9 @@ export class SWFPage extends Component
if
(
gpi
.
t121
.
value
)
if
(
gpi
.
t121
.
value
)
{
{
let
val
=
gpi
.
t121
.
value
let
val
=
gpi
.
t121
.
value
if
(
val
!=
autogenerate
&&
!
/^
[
0-9a-zA-Z
]{8}
-
[
0-9a-zA-Z
]{4}
-
[
0-9a-zA-Z
]{4}
-
[
0-9a-zA-Z
]{
16
}
$/
.
test
(
val
))
if
(
val
!=
autogenerate
&&
!
/^
[
0-9a-zA-Z
]{8}
-
[
0-9a-zA-Z
]{4}
-
[
0-9a-zA-Z
]{4}
-
[
0-9a-zA-Z
]{
4}
-
[
0-9a-zA-Z
]{12
}
$/
.
test
(
val
))
{
{
t121_errmsg
=
"xxxxxxxx-xxxx-xxxx-xxxx
xxxxxxxxxxxx(8-4-4-16
)"
t121_errmsg
=
"xxxxxxxx-xxxx-xxxx-xxxx
-xxxxxxxxxxxx(8-4-4-4-12
)"
}
}
}
}
}
}
...
@@ -153,18 +153,19 @@ export class SWFPage extends Component
...
@@ -153,18 +153,19 @@ export class SWFPage extends Component
}
}
this
.
joinMessage
(
tags
,
arr
)
this
.
joinMessage
(
tags
,
arr
)
let
message
=
arr
.
join
(
'
\
r
\
n'
).
replace
(
/
[\r\n]{1,2}
/g
,
'
\
r
\
n'
)
let
message
=
arr
.
join
(
'
\
r
\
n'
).
replace
(
/
[\r\n]{1,2}
/g
,
'
\
r
\
n'
)
if
(
this
.
props
.
extra
.
tdheaders
)
// if(this.props.extra.tdheaders)
{
// {
message
=
`
${
this
.
props
.
extra
.
tdheaders
}
:EOH:\r\n
${
message
}
\r\n-\r\n`
// message = `${this.props.extra.tdheaders}:EOH:\r\n${message}\r\n-\r\n`
}
// }
else
if
(
this
.
props
.
extra
.
headers
)
// else
{
// if(this.props.extra.headers)
message
=
`
${
this
.
props
.
extra
.
headers
}
{4:\r\n
${
message
}
`
// {
}
// message= `${this.props.extra.headers}{4:\r\n${message}`
else
{
// }
// 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}`
// 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
gpistr
=
':121:ID for UUID generation: TRNPAY3
\
r
\
n'
let
mty
=
this
.
props
.
params
.
key
.
substring
(
2
)
let
mty
=
this
.
props
.
extra
.
msgtyp
.
substring
(
2
)
mty
=
mty
.
toUpperCase
()
mty
=
mty
.
toUpperCase
()
if
(
mty
!=
'103'
&&
mty
!=
'202'
&&
mty
!=
'202COV'
)
if
(
mty
!=
'103'
&&
mty
!=
'202'
&&
mty
!=
'202COV'
)
gpistr
=
''
gpistr
=
''
...
@@ -183,7 +184,7 @@ export class SWFPage extends Component
...
@@ -183,7 +184,7 @@ export class SWFPage extends Component
if
(
gpi
.
t111
.
value
)
if
(
gpi
.
t111
.
value
)
t111str
=
':111:'
+
gpi
.
t111
.
value
+
"
\
r
\
n"
t111str
=
':111:'
+
gpi
.
t111
.
value
+
"
\
r
\
n"
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
${
t111str
}${
s119
}${
gpistr
}
:EOH:\r\n
${
message
}
\r\n-\r\n`
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
${
t111str
}${
s119
}${
gpistr
}
:EOH:\r\n
${
message
}
\r\n-\r\n`
}
//
}
console
.
log
(
message
)
console
.
log
(
message
)
this
.
props
.
actions
.
updateSwiftMessage
(
message
)
this
.
props
.
actions
.
updateSwiftMessage
(
message
)
...
@@ -299,15 +300,38 @@ export class SWFPage extends Component
...
@@ -299,15 +300,38 @@ export class SWFPage extends Component
if
(
data
.
t111
)
if
(
data
.
t111
)
{
{
gpiconf
.
inited
=
true
gpiconf
.
inited
=
true
gpiconf
.
t111
.
visible
=
true
gpiconf
.
t111
.
value
=
data
.
t111
gpiconf
.
t111
.
value
=
data
.
t111
}
}
if
(
data
.
t121
)
if
(
data
.
t121
)
{
{
gpiconf
.
inited
=
true
gpiconf
.
inited
=
true
gpiconf
.
t121
.
visible
=
true
gpiconf
.
t121
.
value
=
data
.
t121
gpiconf
.
t121
.
value
=
data
.
t121
}
}
if
(
gpiconf
.
inited
)
if
(
gpiconf
.
inited
)
this
.
props
.
actions
.
initGpiConf
(
gpiconf
)
this
.
props
.
actions
.
initGpiConf
(
gpiconf
)
if
(
data
.
t111
)
{
let
tno
=
0
if
(
this
.
mty
==
'mt199'
)
tno
=
3
else
if
(
this
.
mty
==
'mt192'
)
tno
=
4
else
if
(
this
.
mty
==
'mt196'
)
tno
=
3
else
if
(
this
.
mty
==
'mt299'
)
tno
=
3
let
tagValue
=
undefined
let
tag
=
undefined
if
(
tno
&&
tree
.
length
>=
tno
)
{
tagValue
=
tree
[
tno
-
1
].
tagValue
tag
=
tree
[
tno
-
1
].
tag
}
let
t111_type
=
SwitchType
(
this
.
props
.
extra
.
msgtyp
,
data
.
t111
,
tag
,
tagValue
)
this
.
props
.
extra
.
reload_t111
=
t111_type
}
this
.
props
.
actions
.
initSwiftMessageTree
({
Tags
:
tree
,
Title
:
data
.
title
});
this
.
props
.
actions
.
initSwiftMessageTree
({
Tags
:
tree
,
Title
:
data
.
title
});
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
log
(
err
)
console
.
log
(
err
)
...
@@ -375,6 +399,7 @@ export class SWFPage extends Component
...
@@ -375,6 +399,7 @@ export class SWFPage extends Component
}
}
render
()
render
()
{
{
const
{
swift_message
,
rcv_bic_info
,
snd_bic_info
,
swift_message_tree
,
gpi
}
=
this
.
props
const
{
swift_message
,
rcv_bic_info
,
snd_bic_info
,
swift_message_tree
,
gpi
}
=
this
.
props
...
@@ -385,6 +410,13 @@ export class SWFPage extends Component
...
@@ -385,6 +410,13 @@ export class SWFPage extends Component
let
tags
=
swift_message_tree
.
Tags
;
let
tags
=
swift_message_tree
.
Tags
;
let
title
=
swift_message_tree
.
Title
let
title
=
swift_message_tree
.
Title
const
mty
=
this
.
props
.
params
.
mty
||
this
.
props
.
extra
.
msgtyp
const
mty
=
this
.
props
.
params
.
mty
||
this
.
props
.
extra
.
msgtyp
if
(
mty
==
'mt192'
&&
(
this
.
props
.
params
.
t111
==
'zf'
||
this
.
props
.
extra
.
reload_t111
==
'zf'
))
{
if
(
tags
.
length
>=
4
)
{
tags
[
3
].
status
=
'M'
}
}
let
flag1
=
(
this
.
props
.
params
.
rcvbic
&&
this
.
props
.
params
.
rcvbic
!=
'NONE'
)
||
this
.
props
.
params
.
action
==
'redit'
||
this
.
props
.
params
.
action
==
'redit2'
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
flag2
=
(
this
.
props
.
params
.
sndbic
&&
this
.
props
.
params
.
sndbic
!=
'NONE'
)
||
this
.
props
.
params
.
action
==
'redit'
||
this
.
props
.
params
.
action
==
'redit2'
return
(
<
div
>
return
(
<
div
>
...
@@ -495,7 +527,7 @@ export class SWFPage extends Component
...
@@ -495,7 +527,7 @@ export class SWFPage extends Component
<
/Col
>
<
/Col
>
<
Col
span
=
{
1
}
style
=
{{
textAlign
:
'center'
}}
><
span
style
=
{{
fontWeight
:
'bolder'
}}
>
{
"NO."
}
<
/span></
Col
>
<
Col
span
=
{
1
}
style
=
{{
textAlign
:
'center'
}}
><
span
style
=
{{
fontWeight
:
'bolder'
}}
>
{
"NO."
}
<
/span></
Col
>
<
/Row
>
<
/Row
>
<
SWFMessage
t111
=
{
this
.
props
.
params
.
t111
}
action
=
{
this
.
props
.
params
.
action
}
enLock
=
{
this
.
props
.
params
.
action
==
'redit'
}
updateTreeValue
=
{
this
.
props
.
actions
.
updateTreeValue
}
pattern
=
{
tags
}
ref
=
{
ref
=>
this
.
swfmsg
=
ref
}
mty
=
{
mty
}
/
>
<
SWFMessage
t111
=
{
this
.
props
.
params
.
t111
||
this
.
props
.
extra
.
reload_t111
}
action
=
{
this
.
props
.
params
.
action
}
enLock
=
{
this
.
props
.
params
.
action
==
'redit'
}
updateTreeValue
=
{
this
.
props
.
actions
.
updateTreeValue
}
pattern
=
{
tags
}
ref
=
{
ref
=>
this
.
swfmsg
=
ref
}
mty
=
{
mty
}
/
>
<
/Col
>
<
/Col
>
<
Col
span
=
{
3
}
><
/Col
>
<
Col
span
=
{
3
}
><
/Col
>
...
@@ -654,9 +686,9 @@ class T121 extends Component{
...
@@ -654,9 +686,9 @@ class T121 extends Component{
{
{
err_msg
=
"请填写UETR!"
err_msg
=
"请填写UETR!"
}
}
if
(
val
&&
val
!=
autogenerate
&&
!
/^
[
0-9a-zA-Z
]{8}
-
[
0-9a-zA-Z
]{4}
-
[
0-9a-zA-Z
]{4}
-
[
0-9a-zA-Z
]{
16
}
$/
.
test
(
val
))
if
(
val
&&
val
!=
autogenerate
&&
!
/^
[
0-9a-zA-Z
]{8}
-
[
0-9a-zA-Z
]{4}
-
[
0-9a-zA-Z
]{4}
-
[
0-9a-zA-Z
]{
4}
-
[
0-9a-zA-Z
]{12
}
$/
.
test
(
val
))
{
{
err_msg
=
"xxxxxxxx-xxxx-xxxx-xxxx
xxxxxxxxxxxx(8-4-4-16
)"
err_msg
=
"xxxxxxxx-xxxx-xxxx-xxxx
-xxxxxxxxxxxx(8-4-4-4-12
)"
}
}
this
.
props
.
onChange
(
val
,
err_msg
)
this
.
props
.
onChange
(
val
,
err_msg
)
this
.
setState
({
value
:
val
,
err_msg
})
this
.
setState
({
value
:
val
,
err_msg
})
...
@@ -678,7 +710,7 @@ class T121 extends Component{
...
@@ -678,7 +710,7 @@ class T121 extends Component{
help
=
{
this
.
state
.
err_msg
||
"点击右侧按钮,可由系统自动生成UETR"
}
help
=
{
this
.
state
.
err_msg
||
"点击右侧按钮,可由系统自动生成UETR"
}
validateStatus
=
{
this
.
state
.
err_msg
?
'error'
:
"tip"
}
validateStatus
=
{
this
.
state
.
err_msg
?
'error'
:
"tip"
}
label
=
"UETR"
required
=
{
this
.
props
.
required
}
>
label
=
"UETR"
required
=
{
this
.
props
.
required
}
>
<
Input
style
=
{
sty
}
addonAfter
=
{
<
Button
type
=
"primary"
size
=
"small"
icon
=
"circle-o-down"
title
=
"系统自动生成"
onClick
=
{
this
.
autoClick
}
/>} readOnly={this.props.read} placeholder="UETR:xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx
(
8-4-4-16
)
" maxLength=
{35
}
onChange={this.onChange} value={this.state.value} /
>
<
Input
style
=
{
sty
}
addonAfter
=
{
<
Button
type
=
"primary"
size
=
"small"
icon
=
"circle-o-down"
title
=
"系统自动生成"
onClick
=
{
this
.
autoClick
}
/>} placeholder="UETR:xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx
(
8-4-4-4-12
)
" maxLength=
{36
}
onChange={this.onChange} value={this.state.value} /
>
<
/FormItem>
<
/FormItem>
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/swift/TagValidater.js
View file @
259a7303
...
@@ -347,7 +347,7 @@ function gpiValidate(mty,t111,tag,tno,value){
...
@@ -347,7 +347,7 @@ function gpiValidate(mty,t111,tag,tno,value){
//暂时屏蔽
//暂时屏蔽
// let first = lines[1]
// let first = lines[1]
// if(!/^\/[A-Z]{4}\/([A-Z0-9]{4})?$/.test(first))
// if(!/^\/[A-Z
0-9
]{4}\/([A-Z0-9]{4})?$/.test(first))
// {
// {
// msg = '请在第二行填写正确的状态码——"/状态码/子状态码"'
// msg = '请在第二行填写正确的状态码——"/状态码/子状态码"'
// errors.s1 = msg
// errors.s1 = msg
...
@@ -400,7 +400,7 @@ function gpiValidate(mty,t111,tag,tno,value){
...
@@ -400,7 +400,7 @@ function gpiValidate(mty,t111,tag,tno,value){
errors
.
s1
=
msg
errors
.
s1
=
msg
return
msg
return
msg
}
}
if
(
i
==
0
&&
/^
\d{10}\+\d{4}
/
.
test
(
lines
[
i
]))
if
(
i
==
0
&&
!
/^
\/\/\d{10}\+\d{4}
$
/
.
test
(
lines
[
i
]))
{
{
msg
=
'第一行请填写固定的日期和时间偏量'
msg
=
'第一行请填写固定的日期和时间偏量'
errors
.
s1
=
msg
errors
.
s1
=
msg
...
@@ -411,7 +411,7 @@ function gpiValidate(mty,t111,tag,tno,value){
...
@@ -411,7 +411,7 @@ function gpiValidate(mty,t111,tag,tno,value){
//暂时屏蔽
//暂时屏蔽
// let first = lines[1]
// let first = lines[1]
// if(!/^\/[A-Z]{4}\/([A-Z0-9]{4})?$/.test(first))
// if(!/^\/[A-Z
0-9
]{4}\/([A-Z0-9]{4})?$/.test(first))
// {
// {
// msg = '请在第二行填写正确的状态码——"/状态码/子状态码"'
// msg = '请在第二行填写正确的状态码——"/状态码/子状态码"'
// errors.s1 = msg
// errors.s1 = msg
...
@@ -454,7 +454,7 @@ function gpiValidate(mty,t111,tag,tno,value){
...
@@ -454,7 +454,7 @@ function gpiValidate(mty,t111,tag,tno,value){
{
{
let
first
=
lines
[
0
]
let
first
=
lines
[
0
]
if
(
!
/^
\/[
A-Z
]{4}\/([
A-Z
]{4})?
$/
.
test
(
first
))
if
(
!
/^
\/[
A-Z
0-9
]{4}\/([
A-Z0-9
]{4})?
$/
.
test
(
first
))
{
{
msg
=
'请在第一行填写正确的状态码——"状态码/子状态码"'
msg
=
'请在第一行填写正确的状态码——"状态码/子状态码"'
errors
.
s1
=
msg
errors
.
s1
=
msg
...
@@ -485,7 +485,7 @@ function gpiValidate(mty,t111,tag,tno,value){
...
@@ -485,7 +485,7 @@ function gpiValidate(mty,t111,tag,tno,value){
{
{
let
first
=
lines
[
0
]
let
first
=
lines
[
0
]
if
(
!
/^
\/[
A-Z
]{4}\/([
A-Z
]{4})?
$/
.
test
(
first
))
if
(
!
/^
\/[
A-Z
0-9
]{4}\/([
A-Z0-9
]{4})?
$/
.
test
(
first
))
{
{
msg
=
'请在第一行填写正确的状态码——"/状态码/子状态码"'
msg
=
'请在第一行填写正确的状态码——"/状态码/子状态码"'
errors
.
s1
=
msg
errors
.
s1
=
msg
...
@@ -600,4 +600,34 @@ const PDCR = [
...
@@ -600,4 +600,34 @@ const PDCR = [
"PTNA"
,
"PTNA"
,
"RQDA"
,
"RQDA"
,
"INDM"
,
"INDM"
,
]
]
\ No newline at end of file
export
function
SwitchType
(
mty
,
t111
,
tag
,
value
){
if
(
!
t111
)
return
if
(
t111
==
'001'
)
return
'fk'
let
mval
=
undefined
if
(
value
&&
value
.
length
&&
value
.
length
>
1
)
mval
=
value
[
1
]
if
(
!
mval
)
return
let
lines
=
mval
.
split
(
/
[\r\n]{1,2}
/g
)
let
first
=
lines
[
0
]
//判断第一行的码
if
(
!
/^
\/[
A-Z0-9
]{4}\/([
A-Z0-9
]{4})?
$/
.
test
(
first
))
{
return
}
let
firstCode
=
first
.
substring
(
1
,
5
)
let
subCode
=
first
.
substring
(
6
)
if
(
mt196_199
.
indexOf
(
firstCode
)
>
-
1
)
return
'zffk'
if
(
mt192_199
.
indexOf
(
firstCode
)
>
-
1
)
return
'zf'
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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