fix: 先点模块再点脑图,评审脑图不是对应模块的脑图 (#1790)
* fix: 解决冲突 * refactor: 用例评审点击模块展示对应脑图 * refactor: 测试计划用例点击模块展示对应脑图 * fix: 先点模块再点脑图,评审脑图不是对应模块的脑图 * fix: 动态更新模块树 * refactor: 代码规范 Co-authored-by: chenjianxing <jianxing.chen@fit2cloud.com> Co-authored-by: BugKing <wangzhen@fit2cloud.com>
This commit is contained in:
parent
3ae7570bc8
commit
793758ac62
|
@ -1,6 +1,7 @@
|
|||
package io.metersphere.base.mapper.ext;
|
||||
|
||||
import io.metersphere.base.domain.TestCase;
|
||||
import io.metersphere.base.domain.TestCaseWithBLOBs;
|
||||
import io.metersphere.controller.request.BaseQueryRequest;
|
||||
import io.metersphere.track.dto.TestCaseDTO;
|
||||
import io.metersphere.track.request.testcase.QueryTestCaseRequest;
|
||||
|
@ -76,5 +77,5 @@ public interface ExtTestCaseMapper {
|
|||
int getTestPlanPassCase(@Param("planId") String planId);
|
||||
|
||||
|
||||
|
||||
List<TestCaseWithBLOBs> listForMinder(@Param("request") QueryTestCaseRequest request);
|
||||
}
|
||||
|
|
|
@ -416,5 +416,11 @@
|
|||
) as temp
|
||||
</select>
|
||||
|
||||
<select id="listForMinder" resultType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
||||
select
|
||||
id, `name`, node_id, node_path, `type`, `method`, maintainer, priority, prerequisite, remark, steps
|
||||
from test_case
|
||||
<include refid="queryWhereCondition"/>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
@ -11,6 +11,16 @@
|
|||
from test_case_review
|
||||
join project on project.id = test_case_review.project_id
|
||||
left join user on test_case_review.creator = user.id
|
||||
<include refid="queryWhereCondition"/>
|
||||
<if test="request.orders != null and request.orders.size() > 0">
|
||||
order by
|
||||
<foreach collection="request.orders" separator="," item="order">
|
||||
test_case_review.${order.name} ${order.type}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<sql id="queryWhereCondition">
|
||||
<where>
|
||||
<if test="request.name != null">
|
||||
and test_case_review.name like CONCAT('%', #{request.name},'%')
|
||||
|
@ -19,13 +29,7 @@
|
|||
and test_case_review.project_id = #{request.projectId}
|
||||
</if>
|
||||
</where>
|
||||
<if test="request.orders != null and request.orders.size() > 0">
|
||||
order by
|
||||
<foreach collection="request.orders" separator="," item="order">
|
||||
test_case_review.${order.name} ${order.type}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</sql>
|
||||
|
||||
<select id="listByWorkspaceId" resultType="io.metersphere.track.dto.TestCaseReviewDTO"
|
||||
parameterType="io.metersphere.track.request.testreview.QueryCaseReviewRequest">
|
||||
|
@ -91,4 +95,4 @@
|
|||
</foreach>
|
||||
</if>) as temp
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
@ -58,10 +58,10 @@ public class TestCaseController {
|
|||
return testCaseService.listTestCase(request);
|
||||
}
|
||||
|
||||
@GetMapping("/list/detail/{projectId}")
|
||||
public List<TestCaseWithBLOBs> listDetail(@PathVariable String projectId) {
|
||||
checkPermissionService.checkProjectOwner(projectId);
|
||||
return testCaseService.listTestCaseDetail(projectId);
|
||||
@PostMapping("/list/minder")
|
||||
public List<TestCaseWithBLOBs> listDetail(@RequestBody QueryTestCaseRequest request) {
|
||||
checkPermissionService.checkProjectOwner(request.getProjectId());
|
||||
return testCaseService.listTestCaseForMinder(request);
|
||||
}
|
||||
|
||||
/*jenkins项目下所有接口和性能测试用例*/
|
||||
|
|
|
@ -893,12 +893,6 @@ public class TestCaseService {
|
|||
return extTestCaseMapper.list(request);
|
||||
}
|
||||
|
||||
public List<TestCaseWithBLOBs> listTestCaseDetail(String projectId) {
|
||||
TestCaseExample testCaseExample = new TestCaseExample();
|
||||
testCaseExample.createCriteria().andProjectIdEqualTo(projectId);
|
||||
return testCaseMapper.selectByExampleWithBLOBs(testCaseExample);
|
||||
}
|
||||
|
||||
public void minderEdit(TestCaseMinderEditRequest request) {
|
||||
List<TestCaseWithBLOBs> data = request.getData();
|
||||
data.forEach(item -> {
|
||||
|
@ -927,4 +921,8 @@ public class TestCaseService {
|
|||
example.createCriteria().andProjectIdEqualTo(projectId);
|
||||
return testCaseMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public List<TestCaseWithBLOBs> listTestCaseForMinder(QueryTestCaseRequest request) {
|
||||
return extTestCaseMapper.listForMinder(request);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,9 @@ export default {
|
|||
default() {
|
||||
return []
|
||||
}
|
||||
},
|
||||
selectNode: {
|
||||
type: Object,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -53,16 +56,15 @@ export default {
|
|||
data: {
|
||||
text: this.$t('test_track.review_view.all_case'),
|
||||
disable: true,
|
||||
id: "root",
|
||||
path: ""
|
||||
id: 'root',
|
||||
},
|
||||
children: []
|
||||
},
|
||||
"template":"default"
|
||||
template: 'default'
|
||||
},
|
||||
isActive: true,
|
||||
isFullScreen: false,
|
||||
height: ""
|
||||
height: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -71,7 +73,11 @@ export default {
|
|||
watch: {
|
||||
dataMap() {
|
||||
this.$nextTick(() => {
|
||||
this.parse(this.importJson.root, this.treeNodes);
|
||||
if (this.selectNode && this.selectNode.data) {
|
||||
this.handleNodeSelect(this.selectNode);
|
||||
} else {
|
||||
this.parse(this.importJson.root, this.treeNodes);
|
||||
}
|
||||
this.reload();
|
||||
})
|
||||
}
|
||||
|
@ -109,7 +115,6 @@ export default {
|
|||
text: item.name,
|
||||
id: item.id,
|
||||
disable: true,
|
||||
path: root.data.path + "/" + item.name,
|
||||
expandState:"collapse"
|
||||
},
|
||||
}
|
||||
|
@ -125,6 +130,29 @@ export default {
|
|||
},
|
||||
setJsonImport(data) {
|
||||
this.importJson = data;
|
||||
},
|
||||
handleNodeSelect(node) {
|
||||
if (node && node.data) {
|
||||
let nodeData = node.data;
|
||||
let importJson = this.getImportJsonBySelectNode(nodeData);
|
||||
this.parse(importJson.root, nodeData.children);
|
||||
this.setJsonImport(importJson);
|
||||
this.reload();
|
||||
}
|
||||
},
|
||||
getImportJsonBySelectNode(nodeData) {
|
||||
let importJson = {
|
||||
root: {
|
||||
data: {
|
||||
text: nodeData.name,
|
||||
id: nodeData.id,
|
||||
disable: true,
|
||||
},
|
||||
children: []
|
||||
},
|
||||
template: "default"
|
||||
};
|
||||
return importJson;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,10 +28,7 @@
|
|||
<test-case-list
|
||||
v-if="activeDom === 'left'"
|
||||
:checkRedirectID="checkRedirectID"
|
||||
:module-options="moduleOptions"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:isRedirectEdit="isRedirectEdit"
|
||||
:select-parent-nodes="selectParentNodes"
|
||||
:tree-nodes="treeNodes"
|
||||
@testCaseEdit="editTestCase"
|
||||
@testCaseCopy="copyTestCase"
|
||||
|
@ -58,7 +55,6 @@
|
|||
<test-case-edit
|
||||
:currentTestCaseInfo="item.testCaseInfo"
|
||||
@refresh="refreshTable"
|
||||
@setModuleOptions="setModuleOptions"
|
||||
@caseEdit="handleCaseCreateOrEdit($event,'edit')"
|
||||
@caseCreate="handleCaseCreateOrEdit($event,'add')"
|
||||
:read-only="testCaseReadOnly"
|
||||
|
@ -123,12 +119,8 @@ export default {
|
|||
result: {},
|
||||
projects: [],
|
||||
treeNodes: [],
|
||||
selectNodeIds: [],
|
||||
selectParentNodes: [],
|
||||
testCaseReadOnly: true,
|
||||
selectNode: {},
|
||||
condition: {},
|
||||
moduleOptions: [],
|
||||
activeName: 'default',
|
||||
tabs: [],
|
||||
renderComponent:true,
|
||||
|
@ -177,6 +169,15 @@ export default {
|
|||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
},
|
||||
selectNodeIds() {
|
||||
return this.$store.state.testCaseSelectNodeIds;
|
||||
},
|
||||
selectNode() {
|
||||
return this.$store.state.testCaseSelectNode;
|
||||
},
|
||||
moduleOptions() {
|
||||
return this.$store.state.testCaseModuleOptions;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleCommand(e) {
|
||||
|
@ -284,11 +285,8 @@ export default {
|
|||
this.$router.push('/track/case/all');
|
||||
}
|
||||
},
|
||||
nodeChange(node, nodeIds, pNodes) {
|
||||
nodeChange(node) {
|
||||
this.activeName = "default";
|
||||
this.selectNodeIds = nodeIds;
|
||||
this.selectNode = node;
|
||||
this.selectParentNodes = pNodes;
|
||||
},
|
||||
refreshTable() {
|
||||
if ( this.$refs.testCaseList) {
|
||||
|
@ -310,6 +308,15 @@ export default {
|
|||
}
|
||||
},
|
||||
handleCaseSimpleCreate(data, type) {
|
||||
if ('default-module' === data.nodeId) {
|
||||
for (let i = 0; i < this.moduleOptions.length; i++) {
|
||||
let item = this.moduleOptions[i];
|
||||
if (item.path.indexOf('默认模块') > -1) {
|
||||
data.nodeId = item.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.handleCaseCreateOrEdit(data, type);
|
||||
if (this.$refs.minder) {
|
||||
this.$refs.minder.refresh();
|
||||
|
@ -325,15 +332,12 @@ export default {
|
|||
this.testCaseReadOnly = true;
|
||||
},
|
||||
refresh(data) {
|
||||
this.selectNodeIds = [];
|
||||
this.selectParentNodes = [];
|
||||
this.selectNode = {};
|
||||
this.$store.commit('setTestCaseSelectNode', {});
|
||||
this.$store.commit('setTestCaseSelectNodeIds', []);
|
||||
this.refreshTable();
|
||||
this.setTable(data);
|
||||
|
||||
},
|
||||
setTable(data) {
|
||||
console.log(data)
|
||||
for (let index in this.tabs) {
|
||||
let tab = this.tabs[index];
|
||||
if (tab.name === this.activeName) {
|
||||
|
@ -367,9 +371,6 @@ export default {
|
|||
},
|
||||
setCondition(data) {
|
||||
this.condition = data;
|
||||
},
|
||||
setModuleOptions(data) {
|
||||
this.moduleOptions = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,12 +95,15 @@ export default {
|
|||
watch: {
|
||||
treeNodes() {
|
||||
this.getModuleOptions();
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
},
|
||||
moduleOptions() {
|
||||
return this.$store.state.testCaseModuleOptions;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
saveTestCase(saveAs) {
|
||||
|
@ -134,12 +137,12 @@ export default {
|
|||
})
|
||||
},
|
||||
getModuleOptions() {
|
||||
let moduleOptions = [];
|
||||
this.treeNodes.forEach(node => {
|
||||
buildNodePath(node, {path: ''}, moduleOptions);
|
||||
});
|
||||
// let moduleOptions = [];
|
||||
// this.treeNodes.forEach(node => {
|
||||
// buildNodePath(node, {path: ''}, moduleOptions);
|
||||
// });
|
||||
if(this.currentModule!==undefined){
|
||||
moduleOptions.forEach(item => {
|
||||
this.moduleOptions.forEach(item => {
|
||||
if (this.currentModule.id === item.id) {
|
||||
this.currentModule.path = item.path;
|
||||
}
|
||||
|
|
|
@ -277,7 +277,7 @@
|
|||
<script>
|
||||
import {TokenKey, WORKSPACE_ID} from '@/common/js/constants';
|
||||
import MsDialogFooter from '../../../common/components/MsDialogFooter'
|
||||
import {getCurrentUser, handleCtrlSEvent, listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
||||
import {getCurrentUser, getNodePath, handleCtrlSEvent, listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
||||
import {Message} from "element-ui";
|
||||
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
|
||||
import {buildNodePath,buildTree} from "../../../api/definition/model/NodeTree";
|
||||
|
@ -337,7 +337,6 @@ export default {
|
|||
reviewStatus: 'Prepare',
|
||||
},
|
||||
readOnly: false,
|
||||
moduleOptions: [],
|
||||
maintainerOptions: [],
|
||||
testOptions: [],
|
||||
demandOptions: [],
|
||||
|
@ -382,9 +381,6 @@ export default {
|
|||
type: Array
|
||||
},
|
||||
currentTestCaseInfo: {},
|
||||
setModuleOptions: {
|
||||
type: Array
|
||||
},
|
||||
/*readOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
|
@ -401,6 +397,9 @@ export default {
|
|||
projectIds() {
|
||||
return this.$store.state.projectId
|
||||
},
|
||||
moduleOptions() {
|
||||
return this.$store.state.testCaseModuleOptions;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getSelectOptions();
|
||||
|
@ -425,14 +424,14 @@ export default {
|
|||
this.form.nodePath = this.treeNodes[0].path;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
treeNodes() {
|
||||
this.getModuleOptions();
|
||||
},
|
||||
moduleOptions() {
|
||||
this.$emit('setModuleOptions', this.moduleOptions);
|
||||
}
|
||||
},
|
||||
// watch: {
|
||||
// treeNodes() {
|
||||
// this.getModuleOptions();
|
||||
// },
|
||||
// moduleOptions() {
|
||||
// this.$emit('setModuleOptions', this.moduleOptions);
|
||||
// }
|
||||
// },
|
||||
created() {
|
||||
this.loadOptions();
|
||||
this.addListener(); // 添加 ctrl s 监听
|
||||
|
@ -785,6 +784,7 @@ export default {
|
|||
Object.assign(param, this.form);
|
||||
param.steps = JSON.stringify(this.form.steps);
|
||||
param.nodeId = this.form.module;
|
||||
param.nodePath = getNodePath(this.form.module, this.moduleOptions);
|
||||
if (this.projectId) {
|
||||
param.projectId = this.projectId;
|
||||
}
|
||||
|
@ -795,7 +795,7 @@ export default {
|
|||
}
|
||||
param.testId = JSON.stringify(this.form.selected)
|
||||
param.tags = this.form.tags;
|
||||
param.type = 'functional'
|
||||
param.type = 'functional';
|
||||
return param;
|
||||
},
|
||||
getOption(param) {
|
||||
|
@ -856,13 +856,6 @@ export default {
|
|||
this.form.testId = '';
|
||||
this.getTestOptions()
|
||||
},
|
||||
getModuleOptions() {
|
||||
let moduleOptions = [];
|
||||
this.treeNodes.forEach(node => {
|
||||
buildNodePath(node, {path: ''}, moduleOptions);
|
||||
});
|
||||
this.moduleOptions = moduleOptions;
|
||||
},
|
||||
getMaintainerOptions() {
|
||||
let workspaceId = localStorage.getItem(WORKSPACE_ID);
|
||||
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
|
||||
|
@ -889,7 +882,6 @@ export default {
|
|||
}
|
||||
},
|
||||
getSelectOptions() {
|
||||
this.getModuleOptions();
|
||||
this.getMaintainerOptions();
|
||||
this.getTestOptions();
|
||||
if (this.type === 'edit') {
|
||||
|
|
|
@ -281,18 +281,9 @@ export default {
|
|||
}
|
||||
},
|
||||
props: {
|
||||
selectNodeIds: {
|
||||
type: Array
|
||||
},
|
||||
selectParentNodes: {
|
||||
type: Array
|
||||
},
|
||||
treeNodes: {
|
||||
type: Array
|
||||
},
|
||||
moduleOptions: {
|
||||
type: Array
|
||||
},
|
||||
trashEnable: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
@ -302,6 +293,12 @@ export default {
|
|||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
},
|
||||
selectNodeIds() {
|
||||
return this.$store.state.testCaseSelectNodeIds;
|
||||
},
|
||||
moduleOptions() {
|
||||
return this.$store.state.testCaseModuleOptions;
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.$emit('setCondition', this.condition);
|
||||
|
|
|
@ -38,6 +38,7 @@ import TestCaseCreate from "@/business/components/track/case/components/TestCase
|
|||
import TestCaseImport from "@/business/components/track/case/components/TestCaseImport";
|
||||
import MsSearchBar from "@/business/components/common/components/search/MsSearchBar";
|
||||
import {buildTree} from "../../api/definition/model/NodeTree";
|
||||
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
|
||||
|
||||
export default {
|
||||
name: "TestCaseNodeTree",
|
||||
|
@ -119,6 +120,7 @@ export default {
|
|||
this.treeNodes.forEach(node => {
|
||||
buildTree(node, {path: ''});
|
||||
});
|
||||
this.setModuleOptions();
|
||||
if (this.$refs.nodeTree) {
|
||||
this.$refs.nodeTree.filter();
|
||||
}
|
||||
|
@ -167,7 +169,18 @@ export default {
|
|||
this.list();
|
||||
});
|
||||
},
|
||||
setModuleOptions() {
|
||||
let moduleOptions = [];
|
||||
this.treeNodes.forEach(node => {
|
||||
buildNodePath(node, {path: ''}, moduleOptions);
|
||||
});
|
||||
this.$store.commit('setTestCaseModuleOptions', moduleOptions);
|
||||
},
|
||||
nodeChange(node, nodeIds, pNodes) {
|
||||
|
||||
this.$store.commit('setTestCaseSelectNode', node);
|
||||
this.$store.commit('setTestCaseSelectNodeIds', nodeIds);
|
||||
|
||||
this.$emit("nodeSelectEvent", node, nodeIds, pNodes);
|
||||
this.currentModule = node.data;
|
||||
if (node.data.id === 'root') {
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
:tree-nodes="treeNodes"
|
||||
:data-map="dataMap"
|
||||
:tags="tags"
|
||||
:select-node="selectNode"
|
||||
:distinct-tags="tags"
|
||||
@save="save"
|
||||
ref="minder"
|
||||
|
@ -17,6 +18,7 @@ import {
|
|||
getTestCaseDataMap,
|
||||
parseCase, updateNode
|
||||
} from "@/business/components/track/common/minder/minderUtils";
|
||||
import {getNodePath} from "@/common/js/utils";
|
||||
export default {
|
||||
name: "TestCaseMinder",
|
||||
components: {MsModuleMinder},
|
||||
|
@ -38,7 +40,32 @@ name: "TestCaseMinder",
|
|||
condition: Object,
|
||||
projectId: String
|
||||
},
|
||||
computed: {
|
||||
selectNodeIds() {
|
||||
return this.$store.state.testCaseSelectNodeIds;
|
||||
},
|
||||
selectNode() {
|
||||
return this.$store.state.testCaseSelectNode;
|
||||
},
|
||||
moduleOptions() {
|
||||
return this.$store.state.testCaseModuleOptions;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
selectNode() {
|
||||
if (this.$refs.minder) {
|
||||
this.$refs.minder.handleNodeSelect(this.selectNode);
|
||||
}
|
||||
// this.getTestCases();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.selectNode && this.selectNode.data) {
|
||||
if (this.$refs.minder) {
|
||||
let importJson = this.$refs.minder.getImportJsonBySelectNode(this.selectNode.data);
|
||||
this.$refs.minder.setJsonImport(importJson);
|
||||
}
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.getTestCases();
|
||||
})
|
||||
|
@ -46,14 +73,17 @@ name: "TestCaseMinder",
|
|||
methods: {
|
||||
getTestCases() {
|
||||
if (this.projectId) {
|
||||
this.result = this.$get('/test/case/list/detail/' + this.projectId,response => {
|
||||
let param = {
|
||||
projectId: this.projectId,
|
||||
nodeIds: this.selectNodeIds
|
||||
}
|
||||
this.result = this.$post('/test/case/list/minder', param,response => {
|
||||
this.testCase = response.data;
|
||||
this.dataMap = getTestCaseDataMap(this.testCase);
|
||||
});
|
||||
}
|
||||
},
|
||||
save(data) {
|
||||
console.log(data);
|
||||
let saveCases = [];
|
||||
let deleteCases = [];
|
||||
this.buildSaveCase(data.root, saveCases, deleteCases, undefined);
|
||||
|
@ -92,7 +122,7 @@ name: "TestCaseMinder",
|
|||
id: data.id,
|
||||
name: data.text,
|
||||
nodeId: parent ? parent.id : "",
|
||||
nodePath: parent ? parent.path : "",
|
||||
nodePath: getNodePath(parent ? parent.id : '', this.moduleOptions),
|
||||
type: data.type ? data.type : 'functional',
|
||||
method: data.method ? data.method: 'manual',
|
||||
maintainer: data.maintainer,
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
:tags="tags"
|
||||
:distinct-tags="[...tags, $t('test_track.plan.plan_status_prepare')]"
|
||||
@save="save"
|
||||
ref="minder"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
@ -37,11 +38,30 @@ name: "TestPlanMinder",
|
|||
},
|
||||
projectId: String
|
||||
},
|
||||
computed: {
|
||||
selectNode() {
|
||||
return this.$store.state.testPlanViewSelectNode;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.selectNode && this.selectNode.data) {
|
||||
if (this.$refs.minder) {
|
||||
let importJson = this.$refs.minder.getImportJsonBySelectNode(this.selectNode.data);
|
||||
this.$refs.minder.setJsonImport(importJson);
|
||||
}
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.getTestCases();
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
selectNode() {
|
||||
if (this.$refs.minder) {
|
||||
this.$refs.minder.handleNodeSelect(this.selectNode);
|
||||
}
|
||||
// this.getTestCases();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getTestCases() {
|
||||
if (this.projectId) {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
:tags="tags"
|
||||
:distinct-tags="[...tags, $t('test_track.plan.plan_status_prepare')]"
|
||||
@save="save"
|
||||
ref="minder"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
@ -29,23 +30,46 @@ name: "TestReviewMinder",
|
|||
return []
|
||||
}
|
||||
},
|
||||
selectNodeIds: {
|
||||
type: Array
|
||||
},
|
||||
reviewId: {
|
||||
type: String
|
||||
},
|
||||
projectId: String
|
||||
},
|
||||
mounted() {
|
||||
if (this.selectNode && this.selectNode.data) {
|
||||
if (this.$refs.minder) {
|
||||
let importJson = this.$refs.minder.getImportJsonBySelectNode(this.selectNode.data);
|
||||
this.$refs.minder.setJsonImport(importJson);
|
||||
}
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.getTestCases();
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
selectNode() {
|
||||
if (this.$refs.minder) {
|
||||
this.$refs.minder.handleNodeSelect(this.selectNode);
|
||||
}
|
||||
// this.getTestCases();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selectNodeIds() {
|
||||
return this.$store.state.testReviewSelectNodeIds;
|
||||
},
|
||||
selectNode() {
|
||||
return this.$store.state.testReviewSelectNode;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getTestCases() {
|
||||
if (this.projectId) {
|
||||
this.result = this.$post('/test/review/case/list/all', {reviewId: this.reviewId}, response => {
|
||||
let param = {
|
||||
reviewId: this.reviewId,
|
||||
nodeIds: this.selectNodeIds
|
||||
};
|
||||
this.result = this.$post('/test/review/case/list/all', param, response => {
|
||||
this.dataMap = getTestCaseDataMap(response.data, true, (data, item) => {
|
||||
if (item.reviewStatus === 'Pass') {
|
||||
data.resource.push(this.$t('test_track.plan_view.pass'));
|
||||
|
|
|
@ -399,9 +399,6 @@ export default {
|
|||
selectNodeIds: {
|
||||
type: Array
|
||||
},
|
||||
selectParentNodes: {
|
||||
type: Array
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
planId() {
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
:plan-id="planId"
|
||||
:clickType="clickType"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:select-parent-nodes="selectParentNodes"
|
||||
ref="testPlanTestCaseList"/>
|
||||
<test-plan-minder
|
||||
:tree-nodes="treeNodes"
|
||||
|
@ -67,9 +66,9 @@
|
|||
return {
|
||||
result: {},
|
||||
selectNodeIds: [],
|
||||
selectParentNodes: [],
|
||||
treeNodes: [],
|
||||
activeDom: 'left',
|
||||
selectNode: {}
|
||||
}
|
||||
},
|
||||
props: [
|
||||
|
@ -100,7 +99,7 @@
|
|||
methods: {
|
||||
refresh() {
|
||||
this.selectNodeIds = [];
|
||||
this.selectParentNodes = [];
|
||||
this.$store.commit('setTestPlanViewSelectNode', {});
|
||||
this.$refs.testCaseRelevance.search();
|
||||
this.getNodeTreeByPlanId();
|
||||
},
|
||||
|
@ -112,10 +111,12 @@
|
|||
},
|
||||
nodeChange(node, nodeIds, pNodes) {
|
||||
this.selectNodeIds = nodeIds;
|
||||
this.selectParentNodes = pNodes;
|
||||
this.$store.commit('setTestPlanViewSelectNode', node);
|
||||
// 切换node后,重置分页数
|
||||
this.$refs.testPlanTestCaseList.currentPage = 1;
|
||||
this.$refs.testPlanTestCaseList.pageSize = 10;
|
||||
if (this.$refs.testPlanTestCaseList) {
|
||||
this.$refs.testPlanTestCaseList.currentPage = 1;
|
||||
this.$refs.testPlanTestCaseList.pageSize = 10;
|
||||
}
|
||||
},
|
||||
getNodeTreeByPlanId() {
|
||||
if (this.planId) {
|
||||
|
|
|
@ -138,6 +138,11 @@ export default {
|
|||
reviewerOptions: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reload() {
|
||||
this.isStepTableAlive = false;
|
||||
|
@ -180,10 +185,13 @@ export default {
|
|||
if (!this.compareTime(new Date().getTime(), this.form.endTime)) {
|
||||
return false;
|
||||
}
|
||||
this.result = this.$post('/test/case/review/' + this.operationType, param, response => {
|
||||
this.dialogFormVisible = false;
|
||||
this.$router.push('/track/review/view/' + response.data);
|
||||
});
|
||||
param.projectId = this.projectId;
|
||||
if (this.projectId) {
|
||||
this.result = this.$post('/test/case/review/' + this.operationType, param, response => {
|
||||
this.dialogFormVisible = false;
|
||||
this.$router.push('/track/review/view/' + response.data);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -209,11 +217,14 @@ export default {
|
|||
return false;
|
||||
}
|
||||
|
||||
this.result = this.$post('/test/case/review/' + this.operationType, param, () => {
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
this.dialogFormVisible = false;
|
||||
this.$emit("refresh");
|
||||
});
|
||||
param.projectId = this.projectId;
|
||||
if (this.projectId) {
|
||||
this.result = this.$post('/test/case/review/' + this.operationType, param, () => {
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
this.dialogFormVisible = false;
|
||||
this.$emit("refresh");
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
@openTestReviewRelevanceDialog="openTestReviewRelevanceDialog"
|
||||
@refresh="refresh"
|
||||
:review-id="reviewId"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:select-parent-nodes="selectParentNodes"
|
||||
:clickType="clickType"
|
||||
ref="testPlanTestCaseList"/>
|
||||
<test-review-minder
|
||||
|
@ -63,8 +61,8 @@ export default {
|
|||
result: {},
|
||||
testReviews: [],
|
||||
currentReview: {},
|
||||
selectNodeIds: [],
|
||||
selectParentNodes: [],
|
||||
// selectNodeIds: [],
|
||||
// selectParentNodes: [],
|
||||
treeNodes: [],
|
||||
isMenuShow: true,
|
||||
activeDom: 'left',
|
||||
|
@ -88,14 +86,14 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
refresh() {
|
||||
this.selectNodeIds = [];
|
||||
this.selectParentNodes = [];
|
||||
this.$store.commit('setTestReviewSelectNode', {});
|
||||
this.$store.commit('setTestReviewSelectNodeIds', []);
|
||||
this.$refs.testReviewRelevance.search();
|
||||
this.getNodeTreeByReviewId();
|
||||
},
|
||||
nodeChange(node, nodeIds, pNodes) {
|
||||
this.selectNodeIds = nodeIds;
|
||||
this.selectParentNodes = pNodes;
|
||||
this.$store.commit('setTestReviewSelectNode', node);
|
||||
this.$store.commit('setTestReviewSelectNodeIds', nodeIds);
|
||||
},
|
||||
getNodeTreeByReviewId() {
|
||||
if (this.reviewId) {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
:select-ids="new Set(Array.from(this.selectRows).map(row => row.id))" @refresh="initTableData"/>
|
||||
|
||||
<el-table
|
||||
v-loading="result.loading"
|
||||
class="adjust-table"
|
||||
border
|
||||
@select-all="handleSelectAll"
|
||||
|
@ -277,12 +278,6 @@ export default {
|
|||
reviewId: {
|
||||
type: String
|
||||
},
|
||||
selectNodeIds: {
|
||||
type: Array
|
||||
},
|
||||
selectParentNodes: {
|
||||
type: Array
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
reviewId() {
|
||||
|
@ -292,6 +287,11 @@ export default {
|
|||
this.search();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selectNodeIds() {
|
||||
return this.$store.state.testReviewSelectNodeIds;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.refreshTableAndReview();
|
||||
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
|
||||
|
|
|
@ -376,3 +376,13 @@ export function publicKeyEncrypt(input, publicKey) {
|
|||
|
||||
return jsencrypt.encrypt(input);
|
||||
}
|
||||
|
||||
export function getNodePath(id, moduleOptions) {
|
||||
for (let i = 0; i < moduleOptions.length; i++) {
|
||||
let item = moduleOptions[i];
|
||||
if (id === item.id) {
|
||||
return item.path;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
const getters = {
|
||||
isNewVersion: state => state.versionSwitch === 'new',
|
||||
isOldVersion: state => state.versionSwitch === 'old'
|
||||
isOldVersion: state => state.versionSwitch === 'old',
|
||||
// getTestCaseNodePath(state, nodeId) {
|
||||
// for (const index in state.moduleOptions) {
|
||||
// let item = state.moduleOptions[index];
|
||||
// if (nodeId === item.id) {
|
||||
// return item.path;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
export default getters
|
||||
|
|
|
@ -11,7 +11,17 @@ const state = {
|
|||
test: {},
|
||||
versionSwitch: "new",
|
||||
isReadOnly: true,
|
||||
theme: undefined
|
||||
theme: undefined,
|
||||
|
||||
testCaseSelectNode: {},
|
||||
testCaseSelectNodeIds: [],
|
||||
testCaseModuleOptions: [],
|
||||
|
||||
testReviewSelectNode: {},
|
||||
testReviewSelectNodeIds: [],
|
||||
testReviewModuleOptions: [],
|
||||
|
||||
testPlanViewSelectNode: {}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,16 @@ const mutations = {
|
|||
setTest: (state, test) => state.test = test,
|
||||
clearTest: state => state.test = {},
|
||||
setVersionSwitch: (state, value) => state.versionSwitch = value,
|
||||
setTheme: (state, value) => state.theme = value
|
||||
setTheme: (state, value) => state.theme = value,
|
||||
|
||||
setTestCaseSelectNode: (state, value) => state.testCaseSelectNode = value,
|
||||
setTestCaseSelectNodeIds: (state, value) => state.testCaseSelectNodeIds = value,
|
||||
setTestCaseModuleOptions: (state, value) => state.testCaseModuleOptions = value,
|
||||
|
||||
setTestReviewSelectNode: (state, value) => state.testReviewSelectNode = value,
|
||||
setTestReviewSelectNodeIds: (state, value) => state.testReviewSelectNodeIds = value,
|
||||
setTestReviewModuleOptions: (state, value) => state.testReviewModuleOptions = value,
|
||||
setTestPlanViewSelectNode: (state, value) => state.testPlanViewSelectNode = value,
|
||||
}
|
||||
|
||||
export default mutations;
|
||||
|
|
Loading…
Reference in New Issue