diff --git a/src/components/userChange.vue b/src/components/userChange.vue index a0d8c3b5..97ae09ff 100644 --- a/src/components/userChange.vue +++ b/src/components/userChange.vue @@ -169,20 +169,20 @@ export default { this.selectProject(item); }); } else { - if (!this.selectedProjectSn) { + if (!this.selectedProjectSn && !this.$store.state.projectSn) { // 加判断是为了在循环中只选中第一个 this.selectedProjectSn = obj.sn; - this.setTreeActive(); // 修改全局projectSn this.$store.commit("setProjectSn", obj.sn); this.$store.commit("setProDetail", obj); } + this.setTreeActive(); } }, // 设置树形的选中项目样式 setTreeActive(){ this.$nextTick(() => { - let activeSn = this.selectedProjectSn || this.$store.state.selectedGroupSn + let activeSn = this.selectedProjectSn || this.$store.state.projectSn if(activeSn){ this.$refs.tree.setCurrentKey(activeSn); } diff --git a/src/views/workSpace/index.vue b/src/views/workSpace/index.vue index a2850f54..8ba69609 100644 --- a/src/views/workSpace/index.vue +++ b/src/views/workSpace/index.vue @@ -16,7 +16,7 @@ frameborder="1" > -
+

暂无数据

@@ -90,29 +90,30 @@ export default { getNewUserAllModulePageApi({ projectSn: this.$store.state.projectSn, moduleType: 7, - userId: this.$store.state.userInfo.userId + userId: this.$store.state.userInfo.userId, }).then((res) => { // 传递的工作流菜单 const responseMenuList = []; let all = res.result.moduleList; - if(all.length == 0) { + if (all.length == 0) { this.workSpaceShow = false; return; } console.log("all", res.result); all.forEach((element, index) => { all[index].operation = false; - res.result.menuList.forEach((element2) => { - if (element2.moduleId == element.moduleId) { + if (element.moduleName == "工作流") { + element.menuList.forEach((element2) => { all[index].operation = true; responseMenuList.push({ menuName: element2.menuName, path: element2.path, icon: element2.icon, }); - } - }); + }); + } }); + console.log(responseMenuList, "我的测试11112222222222"); // 传递的工作流菜单 const defaultMenuList = [ {