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.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -74,6 +75,16 @@ public class TapdPlatform extends AbstractIssuePlatform {
JSONObject bug = jsonObject.getJSONObject("Bug"); JSONObject bug = jsonObject.getJSONObject("Bug");
Long created = bug.getLong("created"); Long created = bug.getLong("created");
Issues issues = jsonObject.getObject("Bug", Issues.class); 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); issues.setCreateTime(created);
return issues; return issues;
} }

View File

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

View File

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

View File

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