Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
xiaofang li
MeterSphere
Commits
309aac73
Commit
309aac73
authored
3 years ago
by
chenjianxing
Committed by
BugKing
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
refactor: 场景跨项目导入导出置空所属项目
parent
dc674611
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
backend/src/main/java/io/metersphere/api/dto/automation/parse/MsScenarioParser.java
+9
-0
...etersphere/api/dto/automation/parse/MsScenarioParser.java
frontend/src/business/components/api/definition/components/body/ApiBody.vue
+10
-5
...ess/components/api/definition/components/body/ApiBody.vue
frontend/src/business/components/common/components/table/MsTable.vue
+1
-1
...c/business/components/common/components/table/MsTable.vue
frontend/src/common/js/tableUtils.js
+3
-1
frontend/src/common/js/tableUtils.js
with
23 additions
and
7 deletions
+23
-7
backend/src/main/java/io/metersphere/api/dto/automation/parse/MsScenarioParser.java
+
9
-
0
View file @
309aac73
...
...
@@ -70,6 +70,10 @@ public class MsScenarioParser extends MsAbstractParser<ScenarioImport> {
if
(
scenarioDefinition
!=
null
)
{
JSONArray
hashTree
=
scenarioDefinition
.
getJSONArray
(
"hashTree"
);
setCopy
(
hashTree
);
JSONObject
environmentMap
=
scenarioDefinition
.
getJSONObject
(
"environmentMap"
);
if
(
environmentMap
!=
null
)
{
scenarioDefinition
.
put
(
"environmentMap"
,
new
HashMap
<>());
}
item
.
setScenarioDefinition
(
JSONObject
.
toJSONString
(
scenarioDefinition
));
}
}
...
...
@@ -93,6 +97,11 @@ public class MsScenarioParser extends MsAbstractParser<ScenarioImport> {
if
(
StringUtils
.
isNotBlank
(
referenced
)
&&
StringUtils
.
equals
(
referenced
,
"REF"
))
{
object
.
put
(
"referenced"
,
"Copy"
);
}
object
.
put
(
"projectId"
,
""
);
JSONObject
environmentMap
=
object
.
getJSONObject
(
"environmentMap"
);
if
(
environmentMap
!=
null
)
{
object
.
put
(
"environmentMap"
,
new
HashMap
<>());
}
if
(
CollectionUtils
.
isNotEmpty
(
object
.
getJSONArray
(
"hashTree"
)))
{
setCopy
(
object
.
getJSONArray
(
"hashTree"
));
}
...
...
This diff is collapsed.
Click to expand it.
frontend/src/business/components/api/definition/components/body/ApiBody.vue
+
10
-
5
View file @
309aac73
...
...
@@ -106,15 +106,20 @@
};
},
watch
:
{
'
body.format
'
()
{
'
body.format
'
(
oldValue
,
newValue
)
{
if
(
!
oldValue
)
{
return
;
}
const
MsConvert
=
new
Convert
();
if
(
this
.
body
.
format
===
'
JSON-SCHEMA
'
)
{
this
.
body
.
jsonSchema
=
MsConvert
.
format
(
JSON
.
parse
(
this
.
body
.
raw
));
}
else
{
MsConvert
.
schemaToJsonStr
(
this
.
body
.
jsonSchema
,
(
result
)
=>
{
this
.
$set
(
this
.
body
,
'
raw
'
,
result
);
this
.
reloadCodeEdit
();
});
if
(
this
.
body
.
jsonSchema
)
{
MsConvert
.
schemaToJsonStr
(
this
.
body
.
jsonSchema
,
(
result
)
=>
{
this
.
$set
(
this
.
body
,
'
raw
'
,
result
);
this
.
reloadCodeEdit
();
});
}
}
}
},
...
...
This diff is collapsed.
Click to expand it.
frontend/src/business/components/common/components/table/MsTable.vue
+
1
-
1
View file @
309aac73
...
...
@@ -82,7 +82,7 @@ export default {
},
props
:
{
screenHeight
:
{
type
:
Number
,
type
:
[
String
,
Number
]
,
default
:
400
,
},
selectNodeIds
:
{
...
...
This diff is collapsed.
Click to expand it.
frontend/src/common/js/tableUtils.js
+
3
-
1
View file @
309aac73
...
...
@@ -4,7 +4,9 @@ export function _handleSelectAll(component, selection, tableData, selectRows, co
if
(
selection
.
length
>
0
)
{
if
(
selection
.
length
===
1
)
{
selection
.
hashTree
=
[];
selectRows
.
add
(
selection
[
0
]);
tableData
.
forEach
(
item
=>
{
component
.
$set
(
item
,
"
showMore
"
,
true
);
});
}
else
{
tableData
.
forEach
(
item
=>
{
item
.
hashTree
=
[];
...
...
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
Menu
Projects
Groups
Snippets
Help