This commit is contained in:
fit2-zhao 2020-12-16 16:38:03 +08:00
commit 3d1b39e592
6 changed files with 6 additions and 82 deletions

View File

@ -84,9 +84,4 @@ public class ProjectController {
projectService.updateProject(Project);
}
@PostMapping("/search")
public List<ProjectDTO> searchProject(@RequestBody ProjectRequest projectRequest) {
projectRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
return projectService.getProjectList(projectRequest);
}
}

View File

@ -67,16 +67,6 @@ export default {
components: {SearchList, MsCreateTest, MsCreateButton, MsShowAll, MsRecentList, ProjectChange},
data() {
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: {
title: this.$t('load_test.recent'),
url: "/api/recent/5",
@ -101,19 +91,10 @@ export default {
currentProject: ''
}
},
// watch: {
// '$route'(to) {
// this.init();
// },
// },
methods: {
registerEvents() {
ApiEvent.$on(LIST_CHANGE, () => {
// // todo refs
// if (!this.$refs.projectRecent) {
// return;
// }
// this.$refs.projectRecent.recent();
this.$refs.testRecent.recent();
this.$refs.reportRecent.recent();
});
@ -124,17 +105,6 @@ export default {
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() {
this.registerEvents();

View File

@ -1,5 +1,5 @@
<template>
<el-menu class="header-menu" :unique-opened="true" mode="horizontal" default-active="1">
<el-menu class="header-menu" :unique-opened="true" mode="horizontal" default-active="1" router>
<!-- 不激活项目路由-->
<el-menu-item index="1" v-show="false">Placeholder</el-menu-item>
<el-submenu v-permission="['test_manager','test_user','test_viewer']" index="2" popper-class="submenu">
@ -14,21 +14,23 @@
<font-awesome-icon :icon="['fa', 'plus']"/>
<span style="padding-left: 7px;">{{ $t("project.create") }}</span>
</el-menu-item>
<ms-show-all :index="'/setting/project/all'"/>
<el-menu-item :index="'/setting/project/all'">
<font-awesome-icon :icon="['fa', 'list-ul']"/>
<span style="padding-left: 7px;">{{ $t('commons.show_all') }}</span>
</el-menu-item>
</el-submenu>
</el-menu>
</template>
<script>
import SearchList from "@/business/components/common/head/SearchList";
import MsShowAll from "@/business/components/common/head/ShowAll";
export default {
name: "ProjectSwitch",
props: {
projectName: String
},
components: {SearchList, MsShowAll},
components: {SearchList},
data() {
return {
currentProject: this.projectName

View File

@ -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) {
this.items = queryString ? this.searchArray.filter(this.createFilter(queryString)) : this.searchArray;
},

View File

@ -59,16 +59,6 @@ export default {
},
data() {
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: {
title: this.$t('load_test.recent'),
url: "/performance/recent/5",
@ -95,10 +85,6 @@ export default {
registerEvents() {
PerformanceEvent.$on(LIST_CHANGE, () => {
// // todo refs
// if (!this.$refs.projectRecent) {
// return;
// }
// this.$refs.projectRecent.recent();
this.$refs.testRecent.recent();
this.$refs.reportRecent.recent();
});

View File

@ -69,16 +69,6 @@ export default {
testCaseProjectPath: '',
isProjectActivation: true,
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: {
title: this.$t('test_track.recent_case'),
url: "/test/case/recent/5",
@ -126,14 +116,6 @@ export default {
},
init() {
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) {
this.testPlanViewPath = path;
this.reload();
@ -150,10 +132,6 @@ export default {
registerEvents() {
TrackEvent.$on(LIST_CHANGE, () => {
// // todo refs
// if (!this.$refs.projectRecent) {
// return;
// }
// this.$refs.projectRecent.recent();
this.$refs.planRecent.recent();
this.$refs.caseRecent.recent();
});