This commit is contained in:
fit2-zhao 2020-12-02 19:23:05 +08:00
commit b7a472a08c
4 changed files with 48 additions and 15 deletions

View File

@ -21,6 +21,7 @@ import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
@ -74,6 +75,16 @@ public class TapdPlatform extends AbstractIssuePlatform {
JSONObject bug = jsonObject.getJSONObject("Bug");
Long created = bug.getLong("created");
Issues issues = jsonObject.getObject("Bug", Issues.class);
// 获取工作流中缺陷状态名称
String workflow = "https://api.tapd.cn/workflows/status_map?workspace_id=" + projectId + "&system=bug";
ResultHolder resultHolder = call(workflow);
String workflowJson = JSON.toJSONString(resultHolder.getData());
if (!StringUtils.equals(Boolean.FALSE.toString(), workflowJson)) {
Map map = (Map) JSONObject.parse(workflowJson);
issues.setStatus((String) map.get(issues.getStatus()));
}
issues.setCreateTime(created);
return issues;
}

View File

@ -88,7 +88,6 @@ export default {
},
selectModule(data) {
this.currentModule = data;
this.$refs.apiScenarioList.search(data);
},
saveScenario(data) {
this.setTabLabel(data);

View File

@ -6,15 +6,10 @@
</template>
<el-table ref="scenarioTable" border :data="tableData" class="adjust-table" @select-all="select" @select="select">
<el-table-column width="100">
<template v-slot:header="{row}">
<el-dropdown id="select" size="small" split-button @command="handleCommand">
<el-checkbox @change="selectAllChange"></el-checkbox>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="table">{{ $t('api_test.automation.scenario.select_table') }}</el-dropdown-item>
<el-dropdown-item command="all">{{ $t('api_test.automation.scenario.select_all') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-table-column type="selection"/>
<el-table-column width="40" :resizable="false" align="center">
<template v-slot:default="{row}">
<show-more-btn :is-show="isSelect(row)" :buttons="buttons" :size="selection.length"/>
</template>
</el-table-column>
<el-table-column prop="name" :label="$t('api_test.automation.scenario_name')" width="200"
@ -56,10 +51,11 @@
<script>
import MsTableHeader from "@/business/components/common/components/MsTableHeader";
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
export default {
name: "MsApiScenarioList",
components: {MsTablePagination, MsTableHeader},
components: {ShowMoreBtn, MsTablePagination, MsTableHeader},
props: {
currentProject: Object,
currentModule: Object,
@ -69,11 +65,27 @@ export default {
result: {},
condition: {},
selectAll: false,
selection: [],
tableData: [],
currentPage: 1,
pageSize: 10,
total: 0,
buttons: [
{
name: this.$t('api_test.automation.batch_add_plan'), handleClick: this.handleBatchAddCase
}, {
name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleBatchExecute
}
],
}
},
watch: {
currentProject() {
this.search();
},
currentModule() {
this.search();
},
},
methods: {
search() {
@ -110,12 +122,23 @@ export default {
this.selectAll = true;
break
}
},
handleBatchAddCase() {
},
handleBatchExecute() {
},
selectAllChange() {
this.handleCommand("table");
},
select(selection) {
console.log(selection)
this.selection = selection.map(s => s.id);
console.log(this.selection)
},
isSelect(row) {
console.log(this.selection.includes(row.id))
return this.selection.includes(row.id)
},
edit(row) {
this.$emit('edit', row);
@ -152,7 +175,5 @@ export default {
</script>
<style scoped>
#select >>> .el-button-group > .el-button:first-child {
padding: 7px 15px;
}
</style>

View File

@ -561,6 +561,8 @@ export default {
execute: "执行",
copy: "复制",
remove: "删除",
batch_add_plan: "批量添加到测试计划",
batch_execute: "批量执行",
scenario: {
principal: "责任人",
select_principal: "请选择责任人",