Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
3d1b39e592
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
},
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue