Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
xiaofang li
MeterSphere
Commits
92db1a08
"README.md" did not exist on "097ab72e2b2b6d59fbc12bd8a2849876c38cca0e"
Commit
92db1a08
authored
3 years ago
by
fit2-zhao
Committed by
fit2-zhao
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
refactor(接口自动化): 部分冗余代码优化
parent
861ddfec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
+6
-32
...ss/components/api/automation/scenario/EditApiScenario.vue
with
6 additions
and
32 deletions
+6
-32
frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
+
6
-
32
View file @
92db1a08
...
...
@@ -803,6 +803,7 @@ export default {
if
(
!
item
.
hashTree
)
{
item
.
hashTree
=
[];
}
this
.
resetResourceId
(
item
.
hashTree
);
item
.
enable
===
undefined
?
item
.
enable
=
true
:
item
.
enable
;
if
(
this
.
selectedTreeNode
!==
undefined
)
{
this
.
selectedTreeNode
.
hashTree
.
push
(
item
);
...
...
@@ -1234,29 +1235,13 @@ export default {
this
.
envResult
.
loading
=
false
;
})
},
shrinkTreeNode
()
{
//改变每个节点的状态
for
(
let
i
in
this
.
scenarioDefinition
)
{
if
(
this
.
scenarioDefinition
[
i
])
{
if
(
this
.
expandedStatus
&&
this
.
expandedNode
.
indexOf
(
this
.
scenarioDefinition
[
i
].
resourceId
)
===
-
1
)
{
this
.
expandedNode
.
push
(
this
.
scenarioDefinition
[
i
].
resourceId
);
}
if
(
this
.
stepSize
<
35
)
{
this
.
scenarioDefinition
[
i
].
active
=
this
.
expandedStatus
;
}
if
(
this
.
scenarioDefinition
[
i
].
hashTree
&&
this
.
scenarioDefinition
[
i
].
hashTree
.
length
>
0
)
{
this
.
changeNodeStatus
(
this
.
scenarioDefinition
[
i
].
hashTree
);
}
}
}
},
changeNodeStatus
(
nodes
)
{
for
(
let
i
in
nodes
)
{
if
(
nodes
[
i
])
{
if
(
this
.
expandedStatus
)
{
this
.
expandedNode
.
push
(
nodes
[
i
].
resourceId
);
}
if
(
this
.
stepSize
<
35
)
{
if
(
this
.
stepSize
<
35
||
!
this
.
expandedStatus
)
{
nodes
[
i
].
active
=
this
.
expandedStatus
;
}
if
(
nodes
[
i
].
hashTree
!=
undefined
&&
nodes
[
i
].
hashTree
.
length
>
0
)
{
...
...
@@ -1268,25 +1253,14 @@ export default {
openExpansion
()
{
this
.
expandedNode
=
[];
this
.
expandedStatus
=
true
;
this
.
shrinkTreeNode
(
);
this
.
changeNodeStatus
(
this
.
scenarioDefinition
);
},
closeExpansion
()
{
this
.
expandedStatus
=
false
;
this
.
expandedNode
=
[];
this
.
shrinkTreeNode
(
);
this
.
changeNodeStatus
(
this
.
scenarioDefinition
);
this
.
reload
();
},
stepNode
()
{
//改变每个节点的状态
for
(
let
i
in
this
.
scenarioDefinition
)
{
if
(
this
.
scenarioDefinition
[
i
])
{
this
.
scenarioDefinition
[
i
].
enable
=
this
.
stepEnable
;
if
(
this
.
scenarioDefinition
[
i
].
hashTree
&&
this
.
scenarioDefinition
[
i
].
hashTree
.
length
>
0
)
{
this
.
stepStatus
(
this
.
scenarioDefinition
[
i
].
hashTree
);
}
}
}
},
stepStatus
(
nodes
)
{
for
(
let
i
in
nodes
)
{
if
(
nodes
[
i
])
{
...
...
@@ -1299,11 +1273,11 @@ export default {
},
enableAll
()
{
this
.
stepEnable
=
true
;
this
.
step
Node
(
);
this
.
step
Status
(
this
.
scenarioDefinition
);
},
disableAll
()
{
this
.
stepEnable
=
false
;
this
.
step
Node
(
);
this
.
step
Status
(
this
.
scenarioDefinition
);
},
handleScroll
()
{
let
stepInfo
=
this
.
$refs
.
stepInfo
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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