fix: 解决冲突
This commit is contained in:
parent
f2e8340be1
commit
1bef9ff84b
|
@ -11,4 +11,6 @@ public interface ExtIssuesMapper {
|
||||||
List<IssuesDao> getIssuesByCaseId(@Param("request") IssuesRequest issuesRequest);
|
List<IssuesDao> getIssuesByCaseId(@Param("request") IssuesRequest issuesRequest);
|
||||||
|
|
||||||
List<IssuesDao> getIssuesByProjectId(@Param("request") IssuesRequest issuesRequest);
|
List<IssuesDao> getIssuesByProjectId(@Param("request") IssuesRequest issuesRequest);
|
||||||
|
|
||||||
|
List<IssuesDao> getRelateIssues(@Param("request") IssuesRequest request);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,17 @@
|
||||||
<include refid="queryWhereCondition"/>
|
<include refid="queryWhereCondition"/>
|
||||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
|
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getRelateIssues" resultType="io.metersphere.base.domain.IssuesDao">
|
||||||
|
select issues.id, issues.title, issues.project_id, issues.create_time, issues.update_time,
|
||||||
|
issues.description, issues.status, issues.platform, issues.custom_fields,
|
||||||
|
issues.lastmodify
|
||||||
|
from issues
|
||||||
|
left join
|
||||||
|
test_case_issues on issues.id = test_case_issues.issues_id
|
||||||
|
<include refid="queryWhereCondition"/>
|
||||||
|
and test_case_issues.issues_id is null
|
||||||
|
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
|
||||||
|
</select>
|
||||||
|
|
||||||
<sql id="queryWhereCondition">
|
<sql id="queryWhereCondition">
|
||||||
<where>
|
<where>
|
||||||
|
|
|
@ -17,15 +17,11 @@ public class TestCaseExcelData {
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private String nodePath;
|
private String nodePath;
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private String type;
|
|
||||||
@ExcelIgnore
|
|
||||||
private String maintainer;
|
private String maintainer;
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private String priority;
|
private String priority;
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private String tags;
|
private String tags;
|
||||||
// @ExcelIgnore
|
|
||||||
// private String method;
|
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private String prerequisite;
|
private String prerequisite;
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package io.metersphere.excel.domain;
|
package io.metersphere.excel.domain;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
import io.metersphere.excel.annotation.NotRequired;
|
import io.metersphere.excel.annotation.NotRequired;
|
||||||
|
@ -34,11 +35,6 @@ public class TestCaseExcelDataCn extends TestCaseExcelData {
|
||||||
@Pattern(regexp = "^(?!.*//).*$", message = "{incorrect_format}")
|
@Pattern(regexp = "^(?!.*//).*$", message = "{incorrect_format}")
|
||||||
private String nodePath;
|
private String nodePath;
|
||||||
|
|
||||||
@NotBlank(message = "{cannot_be_null}")
|
|
||||||
@ExcelProperty("用例类型")
|
|
||||||
@Pattern(regexp = "(^functional$)|(^performance$)|(^api$)", message = "{test_case_type_validate}")
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
@NotBlank(message = "{cannot_be_null}")
|
@NotBlank(message = "{cannot_be_null}")
|
||||||
@ExcelProperty("维护人")
|
@ExcelProperty("维护人")
|
||||||
private String maintainer;
|
private String maintainer;
|
||||||
|
|
|
@ -34,11 +34,6 @@ public class TestCaseExcelDataTw extends TestCaseExcelData {
|
||||||
@Pattern(regexp = "^(?!.*//).*$", message = "{incorrect_format}")
|
@Pattern(regexp = "^(?!.*//).*$", message = "{incorrect_format}")
|
||||||
private String nodePath;
|
private String nodePath;
|
||||||
|
|
||||||
@NotBlank(message = "{cannot_be_null}")
|
|
||||||
@ExcelProperty("用例類型")
|
|
||||||
@Pattern(regexp = "(^functional$)|(^performance$)|(^api$)", message = "{test_case_type_validate}")
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
@NotBlank(message = "{cannot_be_null}")
|
@NotBlank(message = "{cannot_be_null}")
|
||||||
@ExcelProperty("維護人")
|
@ExcelProperty("維護人")
|
||||||
private String maintainer;
|
private String maintainer;
|
||||||
|
|
|
@ -35,11 +35,6 @@ public class TestCaseExcelDataUs extends TestCaseExcelData {
|
||||||
@Pattern(regexp = "^(?!.*//).*$", message = "{incorrect_format}")
|
@Pattern(regexp = "^(?!.*//).*$", message = "{incorrect_format}")
|
||||||
private String nodePath;
|
private String nodePath;
|
||||||
|
|
||||||
@NotBlank(message = "{cannot_be_null}")
|
|
||||||
@ExcelProperty("Type")
|
|
||||||
@Pattern(regexp = "(^functional$)|(^performance$)|(^api$)", message = "{test_case_type_validate}")
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
@NotBlank(message = "{cannot_be_null}")
|
@NotBlank(message = "{cannot_be_null}")
|
||||||
@ExcelProperty("Maintainer")
|
@ExcelProperty("Maintainer")
|
||||||
private String maintainer;
|
private String maintainer;
|
||||||
|
|
|
@ -32,6 +32,12 @@ public class IssuesController {
|
||||||
return PageUtils.setPageInfo(page, issuesService.list(request));
|
return PageUtils.setPageInfo(page, issuesService.list(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/list/relate/{goPage}/{pageSize}")
|
||||||
|
public Pager<List<IssuesDao>> relateList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody IssuesRequest request) {
|
||||||
|
Page<List<Issues>> page = PageHelper.startPage(goPage, pageSize, true);
|
||||||
|
return PageUtils.setPageInfo(page, issuesService.relateList(request));
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@MsAuditLog(module = "track_bug", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#issuesRequest)", msClass = IssuesService.class)
|
@MsAuditLog(module = "track_bug", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#issuesRequest)", msClass = IssuesService.class)
|
||||||
public void addIssues(@RequestBody IssuesUpdateRequest issuesRequest) {
|
public void addIssues(@RequestBody IssuesUpdateRequest issuesRequest) {
|
||||||
|
|
|
@ -22,4 +22,9 @@ public class TestCaseIssuesController {
|
||||||
public List<TestCaseDTO> list(@RequestBody IssuesRelevanceRequest request) {
|
public List<TestCaseDTO> list(@RequestBody IssuesRelevanceRequest request) {
|
||||||
return testCaseIssueService.list(request);
|
return testCaseIssueService.list(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/relate")
|
||||||
|
public void relate(@RequestBody IssuesRelevanceRequest request) {
|
||||||
|
testCaseIssueService.relate(request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,8 @@ public class IssuesRelevanceRequest {
|
||||||
*/
|
*/
|
||||||
private String issuesId;
|
private String issuesId;
|
||||||
|
|
||||||
|
private String caseId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当选择关联全部用例时把加载条件送到后台,从后台查询
|
* 当选择关联全部用例时把加载条件送到后台,从后台查询
|
||||||
*/
|
*/
|
||||||
|
@ -25,5 +27,7 @@ public class IssuesRelevanceRequest {
|
||||||
*/
|
*/
|
||||||
private List<String> testCaseIds = new ArrayList<>();
|
private List<String> testCaseIds = new ArrayList<>();
|
||||||
|
|
||||||
|
private List<String> issueIds;
|
||||||
|
|
||||||
private Boolean checked;
|
private Boolean checked;
|
||||||
}
|
}
|
||||||
|
|
|
@ -423,4 +423,8 @@ public class IssuesService {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<IssuesDao> relateList(IssuesRequest request) {
|
||||||
|
return extIssuesMapper.getRelateIssues(request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import io.metersphere.base.mapper.IssuesMapper;
|
||||||
import io.metersphere.base.mapper.TestCaseIssuesMapper;
|
import io.metersphere.base.mapper.TestCaseIssuesMapper;
|
||||||
import io.metersphere.track.dto.TestCaseDTO;
|
import io.metersphere.track.dto.TestCaseDTO;
|
||||||
import io.metersphere.track.request.issues.IssuesRelevanceRequest;
|
import io.metersphere.track.request.issues.IssuesRelevanceRequest;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
@ -13,6 +14,7 @@ import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@ -58,4 +60,30 @@ public class TestCaseIssueService {
|
||||||
.map(TestCaseIssues::getTestCaseId)
|
.map(TestCaseIssues::getTestCaseId)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void relate(IssuesRelevanceRequest request) {
|
||||||
|
if (StringUtils.isNotBlank(request.getCaseId())) {
|
||||||
|
List<String> issueIds = request.getIssueIds();
|
||||||
|
if (!CollectionUtils.isEmpty(issueIds)) {
|
||||||
|
issueIds.forEach(issueId -> {
|
||||||
|
create(request.getCaseId(), issueId);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (StringUtils.isNotBlank(request.getIssuesId())) {
|
||||||
|
List<String> caseIds = request.getTestCaseIds();
|
||||||
|
if (!CollectionUtils.isEmpty(caseIds)) {
|
||||||
|
caseIds.forEach(caseId -> {
|
||||||
|
create(caseId, request.getIssuesId());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void create(String caseId, String issueId) {
|
||||||
|
TestCaseIssues testCaseIssues = new TestCaseIssues();
|
||||||
|
testCaseIssues.setId(UUID.randomUUID().toString());
|
||||||
|
testCaseIssues.setTestCaseId(caseId);
|
||||||
|
testCaseIssues.setIssuesId(issueId);
|
||||||
|
testCaseIssuesMapper.insert(testCaseIssues);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,102 @@
|
||||||
|
<template>
|
||||||
|
<ms-edit-dialog
|
||||||
|
:visible.sync="visible"
|
||||||
|
:title="'关联缺陷'"
|
||||||
|
@confirm="save"
|
||||||
|
ref="relevanceDialog">
|
||||||
|
<ms-table
|
||||||
|
v-loading="page.result.loading"
|
||||||
|
:data="page.data"
|
||||||
|
:condition="page.condition"
|
||||||
|
:total="total"
|
||||||
|
:page-size.sync="page.pageSize"
|
||||||
|
:show-select-all="false"
|
||||||
|
@handlePageChange="getIssues"
|
||||||
|
@refresh="getIssues"
|
||||||
|
ref="table">
|
||||||
|
|
||||||
|
<ms-table-column
|
||||||
|
:label="$t('test_track.issue.id')"
|
||||||
|
prop="id">
|
||||||
|
</ms-table-column>
|
||||||
|
|
||||||
|
<ms-table-column
|
||||||
|
:label="$t('test_track.issue.title')"
|
||||||
|
prop="title">
|
||||||
|
</ms-table-column>
|
||||||
|
|
||||||
|
<ms-table-column
|
||||||
|
:label="$t('test_track.issue.status')"
|
||||||
|
prop="status">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<span>{{ issueStatusMap[scope.row.status] ? issueStatusMap[scope.row.status] : scope.row.status }}</span>
|
||||||
|
</template>
|
||||||
|
</ms-table-column>
|
||||||
|
|
||||||
|
<ms-table-column
|
||||||
|
:label="$t('test_track.issue.platform')"
|
||||||
|
prop="platform">
|
||||||
|
</ms-table-column>
|
||||||
|
|
||||||
|
<issue-description-table-item/>
|
||||||
|
|
||||||
|
</ms-table>
|
||||||
|
|
||||||
|
<ms-table-pagination :change="getIssues" :current-page.sync="page.currentPage" :page-size.sync="page.pageSize" :total="page.total"/>
|
||||||
|
|
||||||
|
</ms-edit-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import MsEditDialog from "@/business/components/common/components/MsEditDialog";
|
||||||
|
import MsTable from "@/business/components/common/components/table/MsTable";
|
||||||
|
import MsTableColumn from "@/business/components/common/components/table/Ms-table-column";
|
||||||
|
import {getRelateIssues, testCaseIssueRelate} from "@/network/Issue";
|
||||||
|
import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDescriptionTableItem";
|
||||||
|
import {ISSUE_STATUS_MAP} from "@/common/js/table-constants";
|
||||||
|
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
|
||||||
|
import {getPageInfo} from "@/common/js/tableUtils";
|
||||||
|
export default {
|
||||||
|
name: "IssueRelateList",
|
||||||
|
components: {MsTablePagination, IssueDescriptionTableItem, MsTableColumn, MsTable, MsEditDialog},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
page: getPageInfo(),
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
issueStatusMap() {
|
||||||
|
return ISSUE_STATUS_MAP;
|
||||||
|
},
|
||||||
|
projectId() {
|
||||||
|
return this.$store.state.projectId;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: ['caseId'],
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
this.getIssues();
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
getIssues() {
|
||||||
|
this.page.condition.projectId = this.projectId;
|
||||||
|
this.page.result = getRelateIssues(this.page);
|
||||||
|
},
|
||||||
|
save() {
|
||||||
|
let param = {};
|
||||||
|
param.caseId = this.caseId;
|
||||||
|
param.issueIds = Array.from(this.$refs.table.selectRows).map(i => i.id);
|
||||||
|
param.caseId = this.caseId;
|
||||||
|
testCaseIssueRelate(param, () => {
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refresh');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -1,6 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-button class="add-btn" :disabled="readOnly" type="primary" size="mini" @click="appIssue">{{ $t('test_track.issue.add_issue') }}</el-button>
|
<el-button class="add-btn" :disabled="readOnly" type="primary" size="mini" @click="appIssue">{{ $t('test_track.issue.add_issue') }}</el-button>
|
||||||
|
<el-button class="add-btn" :disabled="readOnly" type="primary" size="mini" @click="relateIssue">{{ $t('test_track.case.relate_issue') }}</el-button>
|
||||||
<el-tooltip class="item" effect="dark"
|
<el-tooltip class="item" effect="dark"
|
||||||
:content="$t('test_track.issue.platform_tip')"
|
:content="$t('test_track.issue.platform_tip')"
|
||||||
placement="right">
|
placement="right">
|
||||||
|
@ -61,6 +62,7 @@
|
||||||
</ms-table>
|
</ms-table>
|
||||||
|
|
||||||
<test-plan-issue-edit :case-id="caseId" @refresh="getIssues" ref="issueEdit"/>
|
<test-plan-issue-edit :case-id="caseId" @refresh="getIssues" ref="issueEdit"/>
|
||||||
|
<IssueRelateList :case-id="caseId" @refresh="getIssues" ref="issueRelate"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -70,9 +72,10 @@ import MsTable from "@/business/components/common/components/table/MsTable";
|
||||||
import MsTableColumn from "@/business/components/common/components/table/Ms-table-column";
|
import MsTableColumn from "@/business/components/common/components/table/Ms-table-column";
|
||||||
import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDescriptionTableItem";
|
import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDescriptionTableItem";
|
||||||
import {ISSUE_STATUS_MAP} from "@/common/js/table-constants";
|
import {ISSUE_STATUS_MAP} from "@/common/js/table-constants";
|
||||||
|
import IssueRelateList from "@/business/components/track/case/components/IssueRelateList";
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseIssueRelate",
|
name: "TestCaseIssueRelate",
|
||||||
components: {IssueDescriptionTableItem, MsTableColumn, MsTable, TestPlanIssueEdit},
|
components: {IssueRelateList, IssueDescriptionTableItem, MsTableColumn, MsTable, TestPlanIssueEdit},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
issues: [],
|
issues: [],
|
||||||
|
@ -100,6 +103,13 @@ export default {
|
||||||
}
|
}
|
||||||
this.$refs.issueEdit.open();
|
this.$refs.issueEdit.open();
|
||||||
},
|
},
|
||||||
|
relateIssue() {
|
||||||
|
if (!this.caseId) {
|
||||||
|
this.$warning(this.$t('api_test.automation.save_case_info'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$refs.issueRelate.open();
|
||||||
|
},
|
||||||
closeIssue(row) {
|
closeIssue(row) {
|
||||||
if (row.status === 'closed') {
|
if (row.status === 'closed') {
|
||||||
this.$success(this.$t('test_track.issue.close_success'));
|
this.$success(this.$t('test_track.issue.close_success'));
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<el-main v-loading="result.loading" class="container">
|
<el-main v-loading="result.loading" class="container" :style="isPlan ? '' : 'height: calc(100vh - 62px)'">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-form :model="form" :rules="rules" label-position="right" label-width="140px" ref="form">
|
<el-form :model="form" :rules="rules" label-position="right" label-width="140px" ref="form">
|
||||||
|
|
||||||
|
@ -264,9 +264,6 @@ export default {
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
.container {
|
|
||||||
height: calc(100vh - 62px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.filed-list {
|
.filed-list {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
|
|
|
@ -3,16 +3,16 @@
|
||||||
<el-card>
|
<el-card>
|
||||||
|
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="getIssues" @create="handleCreate"
|
<ms-table-header :is-tester-permission="true" :condition.sync="page.condition" @search="getIssues" @create="handleCreate"
|
||||||
:create-tip="$t('test_track.issue.create_issue')" :title="$t('test_track.issue.issue_list')" :tip="$t('issue.search_name')" :have-search="false"/>
|
:create-tip="$t('test_track.issue.create_issue')" :title="$t('test_track.issue.issue_list')" :tip="$t('issue.search_name')" :have-search="false"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<ms-table
|
<ms-table
|
||||||
v-loading="result.loading"
|
v-loading="page.result.loading"
|
||||||
:data="tableData"
|
:data="page.data"
|
||||||
:condition="condition"
|
:condition="page.condition"
|
||||||
:total="total"
|
:total="page.total"
|
||||||
:page-size.sync="pageSize"
|
:page-size.sync="page.pageSize"
|
||||||
:operators="operators"
|
:operators="operators"
|
||||||
:show-select-all="false"
|
:show-select-all="false"
|
||||||
@handlePageChange="getIssues"
|
@handlePageChange="getIssues"
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
|
|
||||||
</ms-table>
|
</ms-table>
|
||||||
|
|
||||||
<ms-table-pagination :change="getIssues" :current-page.sync="currentPage" :page-size.sync="pageSize" :total="total"/>
|
<ms-table-pagination :change="getIssues" :current-page.sync="page.currentPage" :page-size.sync="page.pageSize" :total="page.total"/>
|
||||||
|
|
||||||
<issue-edit @refresh="getIssues" ref="issueEdit"/>
|
<issue-edit @refresh="getIssues" ref="issueEdit"/>
|
||||||
|
|
||||||
|
@ -74,6 +74,8 @@ import {
|
||||||
import MsTableHeader from "@/business/components/common/components/MsTableHeader";
|
import MsTableHeader from "@/business/components/common/components/MsTableHeader";
|
||||||
import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDescriptionTableItem";
|
import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDescriptionTableItem";
|
||||||
import IssueEdit from "@/business/components/track/issue/IssueEdit";
|
import IssueEdit from "@/business/components/track/issue/IssueEdit";
|
||||||
|
import {getIssues} from "@/network/Issue";
|
||||||
|
import {getPageInfo} from "@/common/js/tableUtils";
|
||||||
export default {
|
export default {
|
||||||
name: "CustomFieldList",
|
name: "CustomFieldList",
|
||||||
components: {
|
components: {
|
||||||
|
@ -83,12 +85,7 @@ export default {
|
||||||
MsTablePagination, MsTableButton, MsTableOperators, MsTableColumn, MsTable},
|
MsTablePagination, MsTableButton, MsTableOperators, MsTableColumn, MsTable},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData: [],
|
page: getPageInfo(),
|
||||||
condition: {},
|
|
||||||
total: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
currentPage: 1,
|
|
||||||
result: {},
|
|
||||||
operators: [
|
operators: [
|
||||||
{
|
{
|
||||||
tip: this.$t('commons.edit'), icon: "el-icon-edit",
|
tip: this.$t('commons.edit'), icon: "el-icon-edit",
|
||||||
|
@ -131,31 +128,8 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getIssues() {
|
getIssues() {
|
||||||
this.condition.projectId = this.projectId;
|
this.page.condition.projectId = this.projectId;
|
||||||
this.result = this.$post('issues/list/' + this.currentPage + '/' + this.pageSize,
|
this.page.result = getIssues(this.page);
|
||||||
this.condition, (response) => {
|
|
||||||
let data = response.data;
|
|
||||||
this.total = data.itemCount;
|
|
||||||
this.tableData = data.listObject;
|
|
||||||
for (let i = 0; i < this.tableData.length; i++) {
|
|
||||||
if (this.tableData[i]) {
|
|
||||||
if (this.tableData[i].platform !== 'Local') {
|
|
||||||
this.result = this.$post("issues/get/platform/issue", this.tableData[i]).then(response => {
|
|
||||||
let issues = response.data.data;
|
|
||||||
if (issues) {
|
|
||||||
this.$set(this.tableData[i], "title", issues.title ? issues.title : "--");
|
|
||||||
this.$set(this.tableData[i], "description", issues.description ? issues.description : "--");
|
|
||||||
this.$set(this.tableData[i], "status", issues.status ? issues.status : 'delete');
|
|
||||||
}
|
|
||||||
}).catch(() => {
|
|
||||||
this.$set(this.tableData[i], "title", "--");
|
|
||||||
this.$set(this.tableData[i], "description", "--");
|
|
||||||
this.$set(this.tableData[i], "status", "--");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
handleEdit(data) {
|
handleEdit(data) {
|
||||||
this.$refs.issueEdit.open(data);
|
this.$refs.issueEdit.open(data);
|
||||||
|
@ -171,7 +145,7 @@ export default {
|
||||||
this.$refs.issueEdit.open(copyData);
|
this.$refs.issueEdit.open(copyData);
|
||||||
},
|
},
|
||||||
handleDelete(data) {
|
handleDelete(data) {
|
||||||
this.result = this.$get('issues/delete/' + data.id, () => {
|
this.page.result = this.$get('issues/delete/' + data.id, () => {
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.$success(this.$t('commons.delete_success'));
|
||||||
this.getIssues();
|
this.getIssues();
|
||||||
});
|
});
|
||||||
|
|
|
@ -192,3 +192,13 @@ export function deepClone(source) {
|
||||||
return targetObj;
|
return targetObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getPageInfo() {
|
||||||
|
return {
|
||||||
|
total: 0,
|
||||||
|
pageSize: 10,
|
||||||
|
currentPage: 1,
|
||||||
|
result: {},
|
||||||
|
data: [],
|
||||||
|
condition: {},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
import {post} from "@/common/js/ajax";
|
||||||
|
import {getPageDate} from "@/network/network-utils";
|
||||||
|
|
||||||
|
export function buildIssues(data, page) {
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
if (data[i]) {
|
||||||
|
if (data[i].platform !== 'Local') {
|
||||||
|
page.result = buildPlatformIssue(data[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
page.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getIssues(page) {
|
||||||
|
return post('issues/list/' + page.currentPage + '/' + page.pageSize, page.condition, (response) => {
|
||||||
|
let data = getPageDate(response, page);
|
||||||
|
buildIssues(data, page);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function buildPlatformIssue(data) {
|
||||||
|
return post("issues/get/platform/issue", data).then(response => {
|
||||||
|
let issues = response.data.data;
|
||||||
|
if (issues) {
|
||||||
|
data.title = issues.title ? issues.title : '--';
|
||||||
|
data.description = issues.description ? issues.description : '--';
|
||||||
|
data.status = issues.status ? issues.status : 'delete';
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
data.title = '--';
|
||||||
|
data.description = '--';
|
||||||
|
data.status = '--';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function testCaseIssueRelate(param, success) {
|
||||||
|
return post('test/case/issues/relate', param, (response) => {
|
||||||
|
if (success) {
|
||||||
|
success(response);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRelateIssues(page) {
|
||||||
|
return post('issues/list/relate/' + page.currentPage + '/' + page.pageSize, page.condition, (response) => {
|
||||||
|
let data = getPageDate(response, page);
|
||||||
|
buildIssues(data, page);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
export function getPageDate(response, page) {
|
||||||
|
let data = response.data;
|
||||||
|
page.total = data.itemCount;
|
||||||
|
return data.listObject;
|
||||||
|
}
|
Loading…
Reference in New Issue