refactor: 删除无用代码
This commit is contained in:
parent
0b38df4576
commit
62b02eeb81
|
@ -84,9 +84,4 @@ public class ProjectController {
|
||||||
projectService.updateProject(Project);
|
projectService.updateProject(Project);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/search")
|
|
||||||
public List<ProjectDTO> searchProject(@RequestBody ProjectRequest projectRequest) {
|
|
||||||
projectRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
|
||||||
return projectService.getProjectList(projectRequest);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,16 +67,6 @@ export default {
|
||||||
components: {SearchList, MsCreateTest, MsCreateButton, MsShowAll, MsRecentList, ProjectChange},
|
components: {SearchList, MsCreateTest, MsCreateButton, MsShowAll, MsRecentList, ProjectChange},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
projectRecent: {
|
|
||||||
title: this.$t('project.recent'),
|
|
||||||
url: "/project/recent/5",
|
|
||||||
index: function (item) {
|
|
||||||
return '/api/test/list/' + item.id;
|
|
||||||
},
|
|
||||||
router: function (item) {
|
|
||||||
return {name: 'ApiTestList', params: {projectId: item.id, projectName: item.name}}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
testRecent: {
|
testRecent: {
|
||||||
title: this.$t('load_test.recent'),
|
title: this.$t('load_test.recent'),
|
||||||
url: "/api/recent/5",
|
url: "/api/recent/5",
|
||||||
|
@ -101,19 +91,10 @@ export default {
|
||||||
currentProject: ''
|
currentProject: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// watch: {
|
|
||||||
// '$route'(to) {
|
|
||||||
// this.init();
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
methods: {
|
methods: {
|
||||||
registerEvents() {
|
registerEvents() {
|
||||||
ApiEvent.$on(LIST_CHANGE, () => {
|
ApiEvent.$on(LIST_CHANGE, () => {
|
||||||
// // todo 这里偶尔会有 refs 为空的情况
|
// // todo 这里偶尔会有 refs 为空的情况
|
||||||
// if (!this.$refs.projectRecent) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// this.$refs.projectRecent.recent();
|
|
||||||
this.$refs.testRecent.recent();
|
this.$refs.testRecent.recent();
|
||||||
this.$refs.reportRecent.recent();
|
this.$refs.reportRecent.recent();
|
||||||
});
|
});
|
||||||
|
@ -124,17 +105,6 @@ export default {
|
||||||
this.isRouterAlive = true;
|
this.isRouterAlive = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// init() {
|
|
||||||
// let path = this.$route.path;
|
|
||||||
// if (path.indexOf("/api/test/list") >= 0 && !!this.$route.params.projectId) {
|
|
||||||
// this.apiTestProjectPath = path;
|
|
||||||
// //不激活项目菜单栏
|
|
||||||
// this.isProjectActivation = false;
|
|
||||||
// this.reload();
|
|
||||||
// } else {
|
|
||||||
// this.isProjectActivation = true;
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.registerEvents();
|
this.registerEvents();
|
||||||
|
|
|
@ -76,13 +76,6 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
search() {
|
|
||||||
if (hasRoles(ROLE_TEST_VIEWER, ROLE_TEST_USER, ROLE_TEST_MANAGER)) {
|
|
||||||
this.result = this.$post("/project/search", {name: this.searchString},response => {
|
|
||||||
this.items = response.data;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
query(queryString) {
|
query(queryString) {
|
||||||
this.items = queryString ? this.searchArray.filter(this.createFilter(queryString)) : this.searchArray;
|
this.items = queryString ? this.searchArray.filter(this.createFilter(queryString)) : this.searchArray;
|
||||||
},
|
},
|
||||||
|
|
|
@ -59,16 +59,6 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
projectRecent: {
|
|
||||||
title: this.$t('project.recent'),
|
|
||||||
url: "/project/recent/5",
|
|
||||||
index(item) {
|
|
||||||
return '/performance/test/' + item.id;
|
|
||||||
},
|
|
||||||
router(item) {
|
|
||||||
return {name: 'perPlan', params: {projectId: item.id, projectName: item.name}}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
testRecent: {
|
testRecent: {
|
||||||
title: this.$t('load_test.recent'),
|
title: this.$t('load_test.recent'),
|
||||||
url: "/performance/recent/5",
|
url: "/performance/recent/5",
|
||||||
|
@ -95,10 +85,6 @@ export default {
|
||||||
registerEvents() {
|
registerEvents() {
|
||||||
PerformanceEvent.$on(LIST_CHANGE, () => {
|
PerformanceEvent.$on(LIST_CHANGE, () => {
|
||||||
// // todo 这里偶尔会有 refs 为空的情况
|
// // todo 这里偶尔会有 refs 为空的情况
|
||||||
// if (!this.$refs.projectRecent) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// this.$refs.projectRecent.recent();
|
|
||||||
this.$refs.testRecent.recent();
|
this.$refs.testRecent.recent();
|
||||||
this.$refs.reportRecent.recent();
|
this.$refs.reportRecent.recent();
|
||||||
});
|
});
|
||||||
|
|
|
@ -69,16 +69,6 @@ export default {
|
||||||
testCaseProjectPath: '',
|
testCaseProjectPath: '',
|
||||||
isProjectActivation: true,
|
isProjectActivation: true,
|
||||||
currentProject: '',
|
currentProject: '',
|
||||||
projectRecent: {
|
|
||||||
title: this.$t('project.recent'),
|
|
||||||
url: "/project/recent/5",
|
|
||||||
index: function (item) {
|
|
||||||
return '/track/case/' + item.id;
|
|
||||||
},
|
|
||||||
router: function (item) {
|
|
||||||
return {name: 'testCase', params: {projectId: item.id, projectName: item.name}}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
caseRecent: {
|
caseRecent: {
|
||||||
title: this.$t('test_track.recent_case'),
|
title: this.$t('test_track.recent_case'),
|
||||||
url: "/test/case/recent/5",
|
url: "/test/case/recent/5",
|
||||||
|
@ -126,14 +116,6 @@ export default {
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
let path = this.$route.path;
|
let path = this.$route.path;
|
||||||
// if (path.indexOf("/track/case") >= 0 && !!this.$route.params.projectId) {
|
|
||||||
// this.testCaseProjectPath = path;
|
|
||||||
// //不激活项目菜单栏
|
|
||||||
// this.isProjectActivation = false;
|
|
||||||
// this.reload();
|
|
||||||
// } else {
|
|
||||||
// this.isProjectActivation = true;
|
|
||||||
// }
|
|
||||||
if (path.indexOf("/track/plan/view") >= 0) {
|
if (path.indexOf("/track/plan/view") >= 0) {
|
||||||
this.testPlanViewPath = path;
|
this.testPlanViewPath = path;
|
||||||
this.reload();
|
this.reload();
|
||||||
|
@ -150,10 +132,6 @@ export default {
|
||||||
registerEvents() {
|
registerEvents() {
|
||||||
TrackEvent.$on(LIST_CHANGE, () => {
|
TrackEvent.$on(LIST_CHANGE, () => {
|
||||||
// // todo 这里偶尔会有 refs 为空的情况
|
// // todo 这里偶尔会有 refs 为空的情况
|
||||||
// if (!this.$refs.projectRecent) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// this.$refs.projectRecent.recent();
|
|
||||||
this.$refs.planRecent.recent();
|
this.$refs.planRecent.recent();
|
||||||
this.$refs.caseRecent.recent();
|
this.$refs.caseRecent.recent();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue