Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
Scott
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Scott Sun
Scott
Commits
34ecf55d
Commit
34ecf55d
authored
Apr 02, 2021
by
Scott Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
ddfff236
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
33 deletions
+37
-33
template.js
template.js
+37
-33
No files found.
template.js
View file @
34ecf55d
...
...
@@ -107,8 +107,8 @@ try {
if
(
/yes/ig
.
test
(
par
.
auto_save
))
{
GEN
.
checkInout
({
job
:
job
,
mode
:
"out"
});
GEN
.
saveJob
({
job
:
job
});
}
GEN
.
checkInout
({
job
:
job
,
mode
:
"in"
});
}
// 结尾返回 固定写法
var
Return
=
"Done"
...
...
@@ -126,7 +126,7 @@ try {
resultData
.
push
(
tmperr
);
Return
=
{
status
:
Status
,
result_data
:
resultData
};
}
return
Return
_Return_Label_
=
Return
}
catch
(
e
)
{
if
(
GEN
.
STATUS
.
length
>
0
)
{
IKM
.
msg
(
GEN
.
STATUS
.
join
(
"
\n
"
));
...
...
@@ -134,40 +134,44 @@ try {
IKM
.
msg
(
e
);
Status
=
'error'
;
resultData
.
push
({
type
:
"error"
,
title
:
"脚本执行出错!"
,
detail
:
[{
desc
:
_
.
toString
(
e
)
}]
});
return
(
mode
===
"aimdfm"
)
?
{
status
:
Status
,
result_data
:
resultData
}
:
"Error"
;
_Return_Label_
=
(
mode
===
"aimdfm"
)
?
{
status
:
Status
,
result_data
:
resultData
}
:
"Error"
;
}
// 获取层别
// func (Object) ([]string)
function
getLayer
(
props
){
// 获取层
/**
* 获取层别
* @param {Object} 过滤选项
* @returns {Array}
*/
function
getLayer
(
props
)
{
if
(
!
props
)
{
return
}
if
(
!
props
.
context
)
{
props
.
context
=
"board"
props
=
{};
}
var
matrix
=
GEN
.
getMatrix
({
job
:
job
})
return
Object
.
keys
(
matrix
).
reduce
(
function
(
a
,
b
)
{
var
matrix
=
GEN
.
getMatrix
({
job
:
job
});
return
Object
.
keys
(
matrix
).
reduce
(
function
(
a
,
b
)
{
var
info
=
matrix
[
b
];
var
ret
=
true
;
for
(
var
key
in
props
)
{
if
(
info
[
key
])
{
if
(
/string/ig
.
test
(
typeof
props
[
key
])){
var
reg
=
new
RegExp
(
props
[
key
],
"ig"
)
if
(
!
reg
.
test
(
info
[
key
])){
ret
=
false
for
(
var
_key
in
props
)
{
if
(
info
[
_key
])
{
if
(
/object string|object number/ig
.
test
({}.
toString
.
call
(
props
[
_key
])))
{
if
(
props
[
_key
]
!=
info
[
_key
])
{
ret
=
false
;
}
}
if
(
/object RegExp/ig
.
test
({}.
toString
.
call
(
props
[
_key
])))
{
if
(
!
props
[
_key
].
test
(
info
[
_key
]))
{
ret
=
false
;
}
}
if
(
/function/ig
.
test
(
typeof
props
[
key
]))
{
if
(
!
props
[
key
](
info
[
key
]))
{
ret
=
false
if
(
/object function/ig
.
test
({}.
toString
.
call
(
props
[
_key
])))
{
if
(
!
props
[
_key
](
info
[
_key
]))
{
ret
=
false
;
}
}
}
}
if
(
ret
)
{
a
.
push
(
props
.
res
==
"info"
?
info
:
b
)
a
.
push
(
props
.
res
==
"info"
?
info
:
b
);
}
return
a
},[])
return
a
;
},
[]);
}
\ No newline at end of file
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