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
fukai
swifteditor
Commits
f27a4992
Commit
f27a4992
authored
Dec 10, 2018
by
fukai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持sequence检验
parent
b761e01a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletions
+40
-1
SWFPage2.js
src/swift/SWFPage2.js
+0
-0
TagValidater.js
src/swift/TagValidater.js
+40
-1
No files found.
src/swift/SWFPage2.js
View file @
f27a4992
This diff is collapsed.
Click to expand it.
src/swift/TagValidater.js
View file @
f27a4992
import
{
RegMap
}
from
'./TagRegMap'
import
{
RegMap
}
from
'./TagRegMap'
export
function
TagV
(
tag
,
status
,
value
,
tno
,
mty
)
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
,
seqlist
,
countMap
=
{})
{
{
let
regobj
=
RegMap
[
tag
]
let
regobj
=
RegMap
[
tag
]
let
obj
=
value
[
0
]
let
obj
=
value
[
0
]
let
mval
=
value
[
1
]
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
let
errmsg
=
null
if
(
value
.
length
==
3
)
if
(
value
.
length
==
3
)
errmsg
=
value
[
2
]
||
{}
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