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
e9cb8c77
Commit
e9cb8c77
authored
Aug 20, 2021
by
fukai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持SEQ可选输入
parent
f622cba3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletions
+39
-1
SWFPage2.js
src/swift/SWFPage2.js
+0
-0
TagValidater.js
src/swift/TagValidater.js
+39
-1
No files found.
src/swift/SWFPage2.js
View file @
e9cb8c77
This diff is collapsed.
Click to expand it.
src/swift/TagValidater.js
View file @
e9cb8c77
import
{
RegMap
}
from
'./TagRegMap'
export
function
TagV
(
tag
,
status
,
value
,
tno
,
mty
,
t111
)
export
function
isTagValueEmpty
(
tag
,
tagValue
)
{
let
obj
=
tagValue
[
0
]
let
regobj
=
RegMap
[
tag
]
for
(
let
key
in
regobj
)
{
if
(
obj
[
key
])
return
false
}
return
true
}
export
function
TagV
(
tag
,
status
,
value
,
tno
,
mty
,
t111
,
seqlist
,
countMap
=
{})
{
let
regobj
=
RegMap
[
tag
]
let
obj
=
value
[
0
]
let
mval
=
value
[
1
]
//计算状态 status,是否是必填的,要参考所在序列是否是必填,上一层序列计数,来决定当前序列是否必填
if
(
seqlist
&&
seqlist
.
length
&&
status
==
'M'
&&
isTagValueEmpty
(
tag
,
value
))
{
let
curseq
=
seqlist
[
seqlist
.
length
-
1
]
let
curcnt
=
countMap
[
curseq
.
seqlist
]
||
0
if
(
curseq
.
status
==
'O'
&&
curcnt
==
0
)
{
status
=
'O'
}
else
if
(
curseq
.
status
==
'M'
&&
curcnt
==
0
)
{
//验证上层是否有计数为O,且上层计数
for
(
let
i
=
seqlist
.
length
-
2
;
i
>=
0
;
i
--
)
{
let
itemseq
=
seqlist
[
i
]
let
itemcnt
=
countMap
[
itemseq
.
seqlist
]
||
0
if
(
itemcnt
>
0
)
break
if
(
itemseq
.
status
==
'O'
&&
itemcnt
==
0
)
status
=
'O'
}
}
}
let
errmsg
=
null
if
(
value
.
length
==
3
)
errmsg
=
value
[
2
]
||
{}
...
...
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