Merge remote-tracking branch 'origin/master'

This commit is contained in:
wenyann 2021-03-18 13:54:36 +08:00
commit cf5688fc4e
23 changed files with 216 additions and 112 deletions

View File

@ -32,7 +32,7 @@ public class RestControllerExceptionHandler {
@ExceptionHandler(SQLException.class) @ExceptionHandler(SQLException.class)
public ResultHolder sqlExceptionHandler(HttpServletRequest request, HttpServletResponse response, MSException e) { public ResultHolder sqlExceptionHandler(HttpServletRequest request, HttpServletResponse response, SQLException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()); response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
return ResultHolder.error("SQL error happened, please check logs."); return ResultHolder.error("SQL error happened, please check logs.");
} }

View File

@ -8,4 +8,5 @@ import lombok.Setter;
public class DemandDTO { public class DemandDTO {
private String id; private String id;
private String name; private String name;
private String platform;
} }

View File

@ -102,7 +102,7 @@ public abstract class AbstractIssuePlatform implements IssuesPlatform {
* *
* @return 其他平台和本地项目绑定的属性值 * @return 其他平台和本地项目绑定的属性值
*/ */
abstract String getProjectId(); abstract String getProjectId(String projectId);
protected boolean isIntegratedPlatform(String orgId, String platform) { protected boolean isIntegratedPlatform(String orgId, String platform) {
IntegrationRequest request = new IntegrationRequest(); IntegrationRequest request = new IntegrationRequest();

View File

@ -103,7 +103,7 @@ public class JiraPlatform extends AbstractIssuePlatform {
String auth = EncryptUtils.base64Encoding(account + ":" + password); String auth = EncryptUtils.base64Encoding(account + ":" + password);
String testCaseId = issuesRequest.getTestCaseId(); String testCaseId = issuesRequest.getTestCaseId();
String jiraKey = getProjectId(); String jiraKey = getProjectId(null);
if (StringUtils.isBlank(jiraKey)) { if (StringUtils.isBlank(jiraKey)) {
@ -200,7 +200,10 @@ public class JiraPlatform extends AbstractIssuePlatform {
} }
@Override @Override
String getProjectId() { String getProjectId(String projectId) {
if (StringUtils.isNotBlank(projectId)) {
return projectService.getProjectById(projectId).getJiraKey();
}
TestCaseWithBLOBs testCase = testCaseService.getTestCase(testCaseId); TestCaseWithBLOBs testCase = testCaseService.getTestCase(testCaseId);
Project project = projectService.getProjectById(testCase.getProjectId()); Project project = projectService.getProjectById(testCase.getProjectId());
return project.getJiraKey(); return project.getJiraKey();

View File

@ -66,7 +66,7 @@ public class LocalPlatform extends AbstractIssuePlatform {
} }
@Override @Override
String getProjectId() { String getProjectId(String projectId) {
return null; return null;
} }

View File

@ -36,7 +36,7 @@ public class TapdPlatform extends AbstractIssuePlatform {
@Override @Override
public List<Issues> getIssue() { public List<Issues> getIssue() {
List<Issues> list = new ArrayList<>(); List<Issues> list = new ArrayList<>();
String tapdId = getProjectId(); String tapdId = getProjectId("");
TestCaseIssuesExample example = new TestCaseIssuesExample(); TestCaseIssuesExample example = new TestCaseIssuesExample();
example.createCriteria().andTestCaseIdEqualTo(testCaseId); example.createCriteria().andTestCaseIdEqualTo(testCaseId);
@ -67,18 +67,22 @@ public class TapdPlatform extends AbstractIssuePlatform {
@Override @Override
public List<DemandDTO> getDemandList(String projectId) { public List<DemandDTO> getDemandList(String projectId) {
System.out.println(projectId);
List<DemandDTO> demandList = new ArrayList<>(); List<DemandDTO> demandList = new ArrayList<>();
String url = "https://api.tapd.cn/stories?workspace_id=" + projectId; try {
ResultHolder call = call(url); String url = "https://api.tapd.cn/stories?workspace_id=" + getProjectId(projectId);
String listJson = JSON.toJSONString(call.getData()); ResultHolder call = call(url);
JSONArray jsonArray = JSON.parseArray(listJson); String listJson = JSON.toJSONString(call.getData());
System.out.println(jsonArray); JSONArray jsonArray = JSON.parseArray(listJson);
for (int i = 0; i < jsonArray.size(); i++) { for (int i = 0; i < jsonArray.size(); i++) {
JSONObject o = jsonArray.getJSONObject(i); JSONObject o = jsonArray.getJSONObject(i);
DemandDTO demand = o.getObject("Story", DemandDTO.class); DemandDTO demand = o.getObject("Story", DemandDTO.class);
demandList.add(demand); demand.setPlatform(IssuesManagePlatform.Tapd.name());
demandList.add(demand);
}
} catch (Exception e) {
LogUtil.error(e.getMessage());
} }
return demandList; return demandList;
} }
@ -111,7 +115,7 @@ public class TapdPlatform extends AbstractIssuePlatform {
public void addIssue(IssuesRequest issuesRequest) { public void addIssue(IssuesRequest issuesRequest) {
String url = "https://api.tapd.cn/bugs"; String url = "https://api.tapd.cn/bugs";
String testCaseId = issuesRequest.getTestCaseId(); String testCaseId = issuesRequest.getTestCaseId();
String tapdId = getProjectId(); String tapdId = getProjectId("");
if (StringUtils.isBlank(tapdId)) { if (StringUtils.isBlank(tapdId)) {
MSException.throwException("未关联Tapd 项目ID"); MSException.throwException("未关联Tapd 项目ID");
@ -172,7 +176,7 @@ public class TapdPlatform extends AbstractIssuePlatform {
@Override @Override
public List<PlatformUser> getPlatformUser() { public List<PlatformUser> getPlatformUser() {
List<PlatformUser> users = new ArrayList<>(); List<PlatformUser> users = new ArrayList<>();
String projectId = getProjectId(); String projectId = getProjectId("");
String url = "https://api.tapd.cn/workspaces/users?workspace_id=" + projectId; String url = "https://api.tapd.cn/workspaces/users?workspace_id=" + projectId;
ResultHolder call = call(url); ResultHolder call = call(url);
String listJson = JSON.toJSONString(call.getData()); String listJson = JSON.toJSONString(call.getData());
@ -186,7 +190,10 @@ public class TapdPlatform extends AbstractIssuePlatform {
} }
@Override @Override
String getProjectId() { String getProjectId(String projectId) {
if (StringUtils.isNotBlank(projectId)) {
return projectService.getProjectById(projectId).getTapdId();
}
TestCaseWithBLOBs testCase = testCaseService.getTestCase(testCaseId); TestCaseWithBLOBs testCase = testCaseService.getTestCase(testCaseId);
Project project = projectService.getProjectById(testCase.getProjectId()); Project project = projectService.getProjectById(testCase.getProjectId());
return project.getTapdId(); return project.getTapdId();

View File

@ -48,7 +48,10 @@ public class ZentaoPlatform extends AbstractIssuePlatform {
} }
@Override @Override
String getProjectId() { String getProjectId(String projectId) {
if (StringUtils.isNotBlank(projectId)) {
return projectService.getProjectById(projectId).getZentaoId();
}
TestCaseWithBLOBs testCase = testCaseService.getTestCase(testCaseId); TestCaseWithBLOBs testCase = testCaseService.getTestCase(testCaseId);
Project project = projectService.getProjectById(testCase.getProjectId()); Project project = projectService.getProjectById(testCase.getProjectId());
return project.getZentaoId(); return project.getZentaoId();
@ -88,7 +91,39 @@ public class ZentaoPlatform extends AbstractIssuePlatform {
@Override @Override
public List<DemandDTO> getDemandList(String projectId) { public List<DemandDTO> getDemandList(String projectId) {
return null; //getTestStories
List<DemandDTO> list = new ArrayList<>();
try {
String session = login();
String key = getProjectId(projectId);
HttpEntity<MultiValueMap> requestEntity = new HttpEntity<>(new HttpHeaders());
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> responseEntity = restTemplate.exchange(url + "api-getModel-story-getProductStories-productID={key}?zentaosid=" + session,
HttpMethod.POST, requestEntity, String.class, key);
String body = responseEntity.getBody();
JSONObject obj = JSONObject.parseObject(body);
LogUtil.info("project story" + key + obj);
if (obj != null) {
JSONObject data = obj.getJSONObject("data");
String s = JSON.toJSONString(data);
Map<String, Object> map = JSONArray.parseObject(s, Map.class);
Collection<Object> values = map.values();
values.forEach(v -> {
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(v));
DemandDTO demandDTO = new DemandDTO();
demandDTO.setId(jsonObject.getString("id"));
demandDTO.setName(jsonObject.getString("title"));
demandDTO.setPlatform(IssuesManagePlatform.Zentao.name());
list.add(demandDTO);
});
}
} catch (Exception e) {
LogUtil.error("get zentao bug fail " + e.getMessage());
}
return list;
} }
private Issues getZentaoIssues(String bugId) { private Issues getZentaoIssues(String bugId) {
@ -135,7 +170,7 @@ public class ZentaoPlatform extends AbstractIssuePlatform {
public void addIssue(IssuesRequest issuesRequest) { public void addIssue(IssuesRequest issuesRequest) {
String session = login(); String session = login();
String projectId = getProjectId(); String projectId = getProjectId(null);
if (StringUtils.isBlank(projectId)) { if (StringUtils.isBlank(projectId)) {
MSException.throwException("add zentao bug fail, project zentao id is null"); MSException.throwException("add zentao bug fail, project zentao id is null");
@ -279,7 +314,7 @@ public class ZentaoPlatform extends AbstractIssuePlatform {
public List<ZentaoBuild> getBuilds() { public List<ZentaoBuild> getBuilds() {
String session = login(); String session = login();
String projectId = getProjectId(); String projectId = getProjectId(null);
HttpHeaders httpHeaders = new HttpHeaders(); HttpHeaders httpHeaders = new HttpHeaders();
HttpEntity<MultiValueMap> requestEntity = new HttpEntity<>(httpHeaders); HttpEntity<MultiValueMap> requestEntity = new HttpEntity<>(httpHeaders);
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();

View File

@ -32,9 +32,7 @@ public class DemandService {
public List<DemandDTO> getDemandList(String projectId) { public List<DemandDTO> getDemandList(String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId); Project project = projectMapper.selectByPrimaryKey(projectId);
SessionUser user = SessionUtils.getUser(); SessionUser user = SessionUtils.getUser();
/*
String orgId = "88aceecf-5764-4094-96a9-f82bd52e77ad";
*/
String orgId = user.getLastOrganizationId(); String orgId = user.getLastOrganizationId();
boolean tapd = issuesService.isIntegratedPlatform(orgId, IssuesManagePlatform.Tapd.toString()); boolean tapd = issuesService.isIntegratedPlatform(orgId, IssuesManagePlatform.Tapd.toString());
boolean jira = issuesService.isIntegratedPlatform(orgId, IssuesManagePlatform.Jira.toString()); boolean jira = issuesService.isIntegratedPlatform(orgId, IssuesManagePlatform.Jira.toString());
@ -48,7 +46,6 @@ public class DemandService {
if (StringUtils.isNotBlank(tapdId)) { if (StringUtils.isNotBlank(tapdId)) {
platforms.add(IssuesManagePlatform.Tapd.name()); platforms.add(IssuesManagePlatform.Tapd.name());
} }
issueRequest.setProjectId(tapdId);
} }
if (jira) { if (jira) {
@ -56,7 +53,6 @@ public class DemandService {
if (StringUtils.isNotBlank(jiraKey)) { if (StringUtils.isNotBlank(jiraKey)) {
platforms.add(IssuesManagePlatform.Jira.name()); platforms.add(IssuesManagePlatform.Jira.name());
} }
issueRequest.setProjectId(jiraKey);
} }
if (zentao) { if (zentao) {
@ -64,13 +60,14 @@ public class DemandService {
if (StringUtils.isNotBlank(zentaoId)) { if (StringUtils.isNotBlank(zentaoId)) {
platforms.add(IssuesManagePlatform.Zentao.name()); platforms.add(IssuesManagePlatform.Zentao.name());
} }
issueRequest.setProjectId(zentaoId);
} }
List<AbstractIssuePlatform> platformList = IssueFactory.createPlatforms(platforms, issueRequest); List<AbstractIssuePlatform> platformList = IssueFactory.createPlatforms(platforms, issueRequest);
platformList.forEach(platform -> { platformList.forEach(platform -> {
List<DemandDTO> demand = platform.getDemandList(issueRequest.getProjectId()); List<DemandDTO> demand = platform.getDemandList(projectId);
list.addAll(demand); list.addAll(demand);
}); });
return list; return list;
} }
} }

View File

@ -731,6 +731,9 @@ public class TestCaseService {
public void minderEdit(TestCaseMinderEditRequest request) { public void minderEdit(TestCaseMinderEditRequest request) {
List<TestCaseWithBLOBs> data = request.getData(); List<TestCaseWithBLOBs> data = request.getData();
data.forEach(item -> { data.forEach(item -> {
if (StringUtils.isBlank(item.getNodeId()) || item.getNodeId().equals("root")) {
item.setNodeId("");
}
item.setProjectId(request.getProjectId()); item.setProjectId(request.getProjectId());
if (StringUtils.isBlank(item.getId()) || item.getId().length() < 20) { if (StringUtils.isBlank(item.getId()) || item.getId().length() < 20) {
item.setId(UUID.randomUUID().toString()); item.setId(UUID.randomUUID().toString());

@ -1 +1 @@
Subproject commit efd6af73b7c5cc53cd4515772000bc1436c49837 Subproject commit adefde265ff12d4ea909353c3f46008f8a8e17e7

View File

@ -1,23 +1,25 @@
<template> <template>
<el-card class="api-component"> <el-card>
<div class="header" @click="active(data)"> <div class="header" @click="active(data)">
<slot name="beforeHeaderLeft"> <slot name="beforeHeaderLeft">
<div v-if="data.index" class="el-step__icon is-text" style="margin-right: 10px;" :style="{'color': color, 'background-color': backgroundColor}"> <div v-if="data.index" class="el-step__icon is-text" style="margin-right: 10px;" :style="{'color': color, 'background-color': backgroundColor}">
<div class="el-step__icon-inner">{{data.index}}</div> <div class="el-step__icon-inner">{{data.index}}</div>
</div> </div>
<el-tag class="ms-left-buttion" size="small" :style="{'color': color, 'background-color': backgroundColor}">{{title}}</el-tag> <el-tag class="ms-left-btn" size="small" :style="{'color': color, 'background-color': backgroundColor}">{{title}}</el-tag>
<el-tag size="mini" v-if="data.method">{{data.method}}</el-tag> <el-tag size="mini" v-if="data.method">{{data.method}}</el-tag>
</slot> </slot>
<span @click.stop> <span>
<slot name="headerLeft"> <slot name="headerLeft">
<i class="icon el-icon-arrow-right" :class="{'is-active': data.active}" <i class="icon el-icon-arrow-right" :class="{'is-active': data.active}"
@click="active(data)" v-if="data.type!='scenario' && !isMax "/> @click="active(data)" v-if="data.type!='scenario' && data.type!='JmeterElement' && !isMax " @click.stop/>
<el-input :draggable="draggable" v-if="isShowInput && isShowNameInput" size="mini" v-model="data.name" class="name-input" <span @click.stop v-if="isShowInput && isShowNameInput">
@blur="isShowInput = false" :placeholder="$t('commons.input_name')" ref="nameEdit" :disabled="data.disabled"/> <el-input :draggable="draggable" size="mini" v-model="data.name" class="name-input"
<span v-else> @blur="isShowInput = false" :placeholder="$t('commons.input_name')" ref="nameEdit" :disabled="data.disabled"/>
</span>
<span :class="isMax?'ms-step-name':'scenario-name'" v-else>
{{data.name}} {{data.name}}
<i class="el-icon-edit" style="cursor:pointer" @click="editName" v-tester v-if="data.referenced!='REF' && !data.disabled"/> <i class="el-icon-edit" style="cursor:pointer" @click="editName" v-tester v-if="data.referenced!='REF' && !data.disabled" @click.stop/>
</span> </span>
</slot> </slot>
<slot name="behindHeaderLeft" v-if="!isMax"></slot> <slot name="behindHeaderLeft" v-if="!isMax"></slot>
@ -159,7 +161,8 @@
margin-right: 5px; margin-right: 5px;
} }
.ms-left-buttion { .ms-left-btn {
font-size: 13px;
margin-right: 15px; margin-right: 15px;
} }
@ -173,15 +176,24 @@
margin-right: 10px; margin-right: 10px;
} }
.node-title { .ms-step-name {
display: inline-block; display: inline-block;
margin: 0px; font-size: 13px;
margin: 0 5px;
overflow-x: hidden; overflow-x: hidden;
padding-bottom: 0; padding-bottom: 0;
text-overflow: ellipsis; text-overflow: ellipsis;
vertical-align: middle; vertical-align: middle;
white-space: nowrap; white-space: nowrap;
width: 100px; width: 180px;
}
.scenario-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 13px;
width: 100%;
} }
/deep/ .el-step__icon { /deep/ .el-step__icon {

View File

@ -275,7 +275,6 @@
} }
} }
} }
this.request.active = true; this.request.active = true;
this.loading = true; this.loading = true;
this.runData = []; this.runData = [];
@ -295,6 +294,7 @@
this.request.requestResult = data; this.request.requestResult = data;
this.request.result = undefined; this.request.result = undefined;
this.loading = false; this.loading = false;
this.$emit('refReload',this.request,this.node);
}, },
reload() { reload() {
this.loading = true this.loading = true

View File

@ -124,14 +124,14 @@
this.$emit('copyRow', row, node); this.$emit('copyRow', row, node);
}, },
openScenario(data){ openScenario(data) {
this.$emit('openScenario', data); this.$emit('openScenario', data);
}, },
suggestClick(node) { suggestClick(node) {
this.$emit('suggestClick', node); this.$emit('suggestClick', node);
}, },
refReload() { refReload(data, node) {
this.$emit('refReload'); this.$emit('refReload', data, node);
} }
} }
} }

View File

@ -5,21 +5,32 @@
<ms-aside-container> <ms-aside-container>
<!-- 场景步骤内容 --> <!-- 场景步骤内容 -->
<div v-loading="loading"> <div v-loading="loading">
<el-tree node-key="resourceId" :props="props" :data="scenarioDefinition" <el-tree node-key="resourceId"
:props="props"
:data="scenarioDefinition"
:default-expanded-keys="expandedNode" :default-expanded-keys="expandedNode"
:expand-on-click-node="false" :expand-on-click-node="false"
highlight-current highlight-current
@node-expand="nodeExpand" @node-expand="nodeExpand"
@node-collapse="nodeCollapse" @node-collapse="nodeCollapse"
:allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" v-if="!loading" draggable> :allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" v-if="!loading" draggable>
<span class="custom-tree-node father" slot-scope="{ node, data}"> <span class="custom-tree-node father" slot-scope="{ node, data}">
<!-- 步骤组件--> <!-- 步骤组件-->
<ms-component-config :isMax="true" :type="data.type" :scenario="data" :response="response" :currentScenario="currentScenario" <ms-component-config
:currentEnvironmentId="currentEnvironmentId" :node="node" :project-list="projectList" :env-map="projectEnvMap" :isMax="true"
@remove="remove" @copyRow="copyRow" @suggestClick="suggestClick" @refReload="refReload" @openScenario="openScenario"/> :type="data.type"
</span> :scenario="data"
:response="response"
:currentScenario="currentScenario"
:currentEnvironmentId="currentEnvironmentId"
:node="node"
:project-list="projectList"
:env-map="projectEnvMap"
@remove="remove" @copyRow="copyRow"
@suggestClick="suggestClick"
@refReload="refReload" @openScenario="openScenario"/>
</span>
</el-tree> </el-tree>
<div @click="fabClick"> <div @click="fabClick">
<vue-fab id="fab" mainBtnColor="#783887" size="small" :global-options="globalOptions" <vue-fab id="fab" mainBtnColor="#783887" size="small" :global-options="globalOptions"
:click-auto-close="false"> :click-auto-close="false">
@ -39,41 +50,41 @@
</div> </div>
</ms-aside-container> </ms-aside-container>
<ms-main-container> <ms-main-container v-if="!loading">
<!-- 第一层当前节点内容--> <!-- 第一层当前节点内容-->
<ms-component-config :isMax="false" <ms-component-config
:showBtn="false" :isMax="false"
:type="selectedTreeNode.type" :showBtn="false"
:scenario="selectedTreeNode" :type="selectedTreeNode.type"
:response="response" :scenario="selectedTreeNode"
:currentScenario="currentScenario" :response="response"
:currentEnvironmentId="currentEnvironmentId" :currentScenario="currentScenario"
:node="selectedNode" :currentEnvironmentId="currentEnvironmentId"
:project-list="projectList" :node="selectedNode"
:env-map="projectEnvMap" :project-list="projectList"
:draggable="false" :env-map="projectEnvMap"
@remove="remove" @copyRow="copyRow" @suggestClick="suggestClick" @refReload="refReload" @openScenario="openScenario" :draggable="false"
v-if="selectedTreeNode && selectedNode"/> @remove="remove" @copyRow="copyRow" @suggestClick="suggestClick" @refReload="refReload" @openScenario="openScenario"
v-if="selectedTreeNode && selectedNode"/>
<!-- 请求下还有的子步骤--> <!-- 请求下还有的子步骤-->
<div v-if="selectedTreeNode && selectedTreeNode.hashTree && showNode(selectedTreeNode)"> <div v-if="selectedTreeNode && selectedTreeNode.hashTree && showNode(selectedTreeNode)">
<div v-for="item in selectedTreeNode.hashTree" :key="item.id" class="ms-col-one"> <div v-for="item in selectedTreeNode.hashTree" :key="item.id" class="ms-col-one">
<ms-component-config :showBtn="false" <ms-component-config
:isMax="false" :showBtn="false"
:type="item.type" :isMax="false"
:scenario="item" :type="item.type"
:response="response" :scenario="item"
:currentScenario="currentScenario" :response="response"
:currentEnvironmentId="currentEnvironmentId" :currentScenario="currentScenario"
:project-list="projectList" :currentEnvironmentId="currentEnvironmentId"
:env-map="projectEnvMap" :project-list="projectList"
:draggable="false" :env-map="projectEnvMap"
@remove="remove" @copyRow="copyRow" @suggestClick="suggestClick" :draggable="false"
@refReload="refReload" @openScenario="openScenario" @remove="remove" @copyRow="copyRow" @suggestClick="suggestClick"
v-if="selectedTreeNode && selectedNode"/> @refReload="refReload" @openScenario="openScenario"
v-if="selectedTreeNode && selectedNode"/>
</div> </div>
</div> </div>
</ms-main-container> </ms-main-container>
</ms-container> </ms-container>
@ -224,6 +235,11 @@
this.operatingElements = ELEMENTS.get("ALL"); this.operatingElements = ELEMENTS.get("ALL");
this.projectEnvMap = this.envMap; this.projectEnvMap = this.envMap;
}, },
watch: {
envMap() {
this.projectEnvMap = this.envMap;
}
},
directives: {OutsideClick}, directives: {OutsideClick},
computed: { computed: {
buttons() { buttons() {
@ -866,8 +882,7 @@
this.currentScenario.apiScenarioModuleId = this.currentModule.id; this.currentScenario.apiScenarioModuleId = this.currentModule.id;
} }
this.currentScenario.projectId = this.projectId; this.currentScenario.projectId = this.projectId;
} },
,
runRefresh() { runRefresh() {
this.debugVisible = true; this.debugVisible = true;
this.loading = false; this.loading = false;
@ -900,7 +915,9 @@
setProjectEnvMap(projectEnvMap) { setProjectEnvMap(projectEnvMap) {
this.projectEnvMap = projectEnvMap; this.projectEnvMap = projectEnvMap;
}, },
refReload() { refReload(data,node) {
this.selectedTreeNode = data;
this.selectedNode = node;
this.initProjectIds(); this.initProjectIds();
this.reload(); this.reload();
}, },

View File

@ -43,6 +43,14 @@
position: relative; position: relative;
} }
.scenario-aside {
position: relative;
border-radius: 4px;
border: 1px solid #EBEEF5;
box-sizing: border-box;
}
.hiddenBottom i { .hiddenBottom i {
margin-left: -2px; margin-left: -2px;
} }

View File

@ -96,6 +96,15 @@ export default {
}, },
parse(root, children) { parse(root, children) {
root.children = []; root.children = [];
if (root.data.id === 'root') {
// nodeId
let rootChildData = this.dataMap.get("");
if (rootChildData) {
rootChildData.forEach((dataNode) => {
root.children.push(dataNode);
})
}
}
// //
let dataNodes = this.dataMap.get(root.data.id); let dataNodes = this.dataMap.get(root.data.id);
if (dataNodes) { if (dataNodes) {

View File

@ -93,7 +93,7 @@ import MsTablePagination from "../../common/pagination/TablePagination";
import MsContainer from "../../common/components/MsContainer"; import MsContainer from "../../common/components/MsContainer";
import MsMainContainer from "../../common/components/MsMainContainer"; import MsMainContainer from "../../common/components/MsMainContainer";
import MsPerformanceReportStatus from "./PerformanceReportStatus"; import MsPerformanceReportStatus from "./PerformanceReportStatus";
import {getCurrentProjectID} from "../../../../common/js/utils"; import {getCurrentProjectID} from "@/common/js/utils";
import MsTableOperatorButton from "../../common/components/MsTableOperatorButton"; import MsTableOperatorButton from "../../common/components/MsTableOperatorButton";
import ReportTriggerModeItem from "../../common/tableItem/ReportTriggerModeItem"; import ReportTriggerModeItem from "../../common/tableItem/ReportTriggerModeItem";
import {REPORT_CONFIGS} from "../../common/components/search/search-components"; import {REPORT_CONFIGS} from "../../common/components/search/search-components";
@ -104,7 +104,7 @@ import {_filter, _sort} from "@/common/js/tableUtils";
export default { export default {
name: "PerformanceTestReport", name: "PerformanceTestReportList",
components: { components: {
MsTableHeader, MsTableHeader,
ReportTriggerModeItem, ReportTriggerModeItem,
@ -186,10 +186,6 @@ export default {
this.multipleSelection = val; this.multipleSelection = val;
}, },
handleEdit(report) { handleEdit(report) {
if (report.status === "Starting") {
this.$info(this.$t('report.being_generated'))
return false
}
this.$router.push({ this.$router.push({
path: '/performance/report/view/' + report.id path: '/performance/report/view/' + report.id
}) })

View File

@ -46,10 +46,10 @@
</el-form-item> </el-form-item>
<br> <br>
<el-form-item :label="$t('load_test.rps_limit')"> <el-form-item :label="$t('load_test.rps_limit')">
<el-switch v-model="threadGroup.rpsLimitEnable" @change="calculateTotalChart()"/> <el-switch v-model="threadGroup.rpsLimitEnable" :disabled="true" @change="calculateTotalChart()"/>
&nbsp; &nbsp;
<el-input-number <el-input-number
:disabled="true " :disabled="true"
v-model="threadGroup.rpsLimit" v-model="threadGroup.rpsLimit"
@change="calculateChart(threadGroup)" @change="calculateChart(threadGroup)"
:min="1" :min="1"
@ -101,7 +101,7 @@
</el-form-item> </el-form-item>
<br> <br>
<el-form-item :label="$t('load_test.rps_limit')"> <el-form-item :label="$t('load_test.rps_limit')">
<el-switch v-model="threadGroup.rpsLimitEnable" @change="calculateTotalChart()"/> <el-switch v-model="threadGroup.rpsLimitEnable" :disabled="true" @change="calculateTotalChart()"/>
&nbsp; &nbsp;
<el-input-number <el-input-number
:disabled="true || !threadGroup.rpsLimitEnable" :disabled="true || !threadGroup.rpsLimitEnable"

View File

@ -4,7 +4,7 @@ const PerformanceTest = () => import('@/business/components/performance/Performa
const PerformanceTestHome = () => import('@/business/components/performance/home/PerformanceTestHome') const PerformanceTestHome = () => import('@/business/components/performance/home/PerformanceTestHome')
const EditPerformanceTest = () => import('@/business/components/performance/test/EditPerformanceTest') const EditPerformanceTest = () => import('@/business/components/performance/test/EditPerformanceTest')
const PerformanceTestList = () => import('@/business/components/performance/test/PerformanceTestList') const PerformanceTestList = () => import('@/business/components/performance/test/PerformanceTestList')
const PerformanceTestReport = () => import('@/business/components/performance/report/PerformanceTestReport') const PerformanceTestReportList = () => import('@/business/components/performance/report/PerformanceTestReportList')
const PerformanceChart = () => import('@/business/components/performance/report/components/PerformanceChart') const PerformanceChart = () => import('@/business/components/performance/report/components/PerformanceChart')
const PerformanceReportView = () => import('@/business/components/performance/report/PerformanceReportView') const PerformanceReportView = () => import('@/business/components/performance/report/PerformanceReportView')
@ -51,7 +51,7 @@ export default {
{ {
path: "report/:type", path: "report/:type",
name: "perReport", name: "perReport",
component: PerformanceTestReport component: PerformanceTestReportList
}, },
{ {
path: "chart", path: "chart",

View File

@ -67,7 +67,7 @@
v-model="threadGroup.rpsLimit" v-model="threadGroup.rpsLimit"
@change="calculateChart(threadGroup)" @change="calculateChart(threadGroup)"
:min="1" :min="1"
:max="500" :max="99999"
size="mini"/> size="mini"/>
</el-form-item> </el-form-item>
<br> <br>
@ -112,7 +112,7 @@
:disabled="isReadOnly" :disabled="isReadOnly"
v-model="threadGroup.iterateNum" v-model="threadGroup.iterateNum"
:min="1" :min="1"
:max="10000" :max="9999999"
@change="calculateChart(threadGroup)" @change="calculateChart(threadGroup)"
size="mini"/> size="mini"/>
</el-form-item> </el-form-item>
@ -124,7 +124,7 @@
:disabled="isReadOnly || !threadGroup.rpsLimitEnable" :disabled="isReadOnly || !threadGroup.rpsLimitEnable"
v-model="threadGroup.rpsLimit" v-model="threadGroup.rpsLimit"
:min="1" :min="1"
:max="500" :max="99999"
size="mini"/> size="mini"/>
</el-form-item> </el-form-item>
<br> <br>

View File

@ -136,12 +136,12 @@
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="关联需求" :label-width="formLabelWidth" prop="demandId"> <el-form-item label="关联需求" :label-width="formLabelWidth" prop="demandId">
<el-select filterable :disabled="readOnly" v-model="form.demandId" <el-select filterable :disabled="readOnly" v-model="form.demandId" @visible-change="visibleChange"
:placeholder="$t('test_track.case.input_type')" class="ms-case-input"> :placeholder="$t('test_track.case.input_type')" class="ms-case-input">
<el-option <el-option
v-for="item in demandOptions" v-for="item in demandOptions"
:key="item.id" :key="item.id"
:label="item.name" :label="item.platform + ': '+item.name"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@ -761,18 +761,31 @@ export default {
}); });
} }
}, },
visibleChange(flag) {
if (flag) {
this.getDemandOptions()
}
},
getDemandOptions() { getDemandOptions() {
this.projectId = getCurrentProjectID() if (this.demandOptions.length === 0) {
this.result = this.$get("demand/list/" + this.projectId, response => { this.projectId = getCurrentProjectID();
this.demandOptions = response.data; this.result = {loading : true};
this.demandOptions.unshift({id: 'other', name: this.$t('test_track.case.other')}) this.$get("demand/list/" + this.projectId).then(response => {
}); this.demandOptions = response.data.data;
this.demandOptions.unshift({id: 'other', name: this.$t('test_track.case.other'), platform: 'Other'})
this.result = {loading : false};
}).catch(() => {
this.result = {loading : false};
})
}
}, },
getSelectOptions() { getSelectOptions() {
this.getModuleOptions(); this.getModuleOptions();
this.getMaintainerOptions(); this.getMaintainerOptions();
this.getTestOptions(); this.getTestOptions();
// this.getDemandOptions() if (this.type === 'edit') {
this.getDemandOptions();
}
}, },
resetForm() { resetForm() {

View File

@ -47,9 +47,9 @@ name: "TestCaseMinder",
} }
}, },
save(data) { save(data) {
console.log(this.dataMap);
let saveCases = []; let saveCases = [];
this.buildSaveCase(data.root, saveCases, undefined); this.buildSaveCase(data.root, saveCases, undefined);
console.log(saveCases);
let param = { let param = {
projectId: this.projectId, projectId: this.projectId,
data: saveCases data: saveCases
@ -72,6 +72,9 @@ name: "TestCaseMinder",
}, },
_buildSaveCase(node, saveCases, parent) { _buildSaveCase(node, saveCases, parent) {
let data = node.data; let data = node.data;
if (!data.text) {
return;
}
let isChange = false; let isChange = false;
let testCase = { let testCase = {
id: data.id, id: data.id,
@ -81,7 +84,7 @@ name: "TestCaseMinder",
type: data.type ? data.type : 'functional', type: data.type ? data.type : 'functional',
method: data.method ? data.method: 'manual', method: data.method ? data.method: 'manual',
maintainer: data.maintainer, maintainer: data.maintainer,
priority: 'P' + data.priority, priority: 'P' + (data.priority ? data.priority : 0),
}; };
if (data.changed) isChange = true; if (data.changed) isChange = true;
let steps = []; let steps = [];

@ -1 +1 @@
Subproject commit f2781219889c2f993436bcc3ea90038f588fa73e Subproject commit d3c3ba983502dc9864db88645af392e36004f301