|
@@ -56,7 +56,8 @@
|
|
import {
|
|
import {
|
|
selectProject,
|
|
selectProject,
|
|
selectOrangaized,
|
|
selectOrangaized,
|
|
- refresh
|
|
|
|
|
|
+ refresh,
|
|
|
|
+ selectIdentity
|
|
} from '@/httpApi/loginRegister'
|
|
} from '@/httpApi/loginRegister'
|
|
import {
|
|
import {
|
|
getOrganizationDetailById
|
|
getOrganizationDetailById
|
|
@@ -100,14 +101,21 @@
|
|
this.visible = true;
|
|
this.visible = true;
|
|
},
|
|
},
|
|
submit() {
|
|
submit() {
|
|
|
|
+ this.$loading();
|
|
let indentity = this.project.projectListIdentity.find(node => node.id === this.indentityId);
|
|
let indentity = this.project.projectListIdentity.find(node => node.id === this.indentityId);
|
|
if (this.indentityId == 6 || this.indentityId == 3) {
|
|
if (this.indentityId == 6 || this.indentityId == 3) {
|
|
getOrganizationDetailById(this.project.organizationId).then(res => {
|
|
getOrganizationDetailById(this.project.organizationId).then(res => {
|
|
if (res.state) {
|
|
if (res.state) {
|
|
this.$store.dispatch('app/changeOrganization', res.data);
|
|
this.$store.dispatch('app/changeOrganization', res.data);
|
|
selectOrangaized(res.data).then(res => {
|
|
selectOrangaized(res.data).then(res => {
|
|
- if (res.state) this.chageProject(indentity);
|
|
|
|
|
|
+ if (res.state) {
|
|
|
|
+ this.chageProject(indentity);
|
|
|
|
+ } else {
|
|
|
|
+ this.$loading.close();
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
+ } else {
|
|
|
|
+ this.$loading.close();
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
@@ -119,10 +127,12 @@
|
|
if (res.state) {
|
|
if (res.state) {
|
|
let user = res.data;
|
|
let user = res.data;
|
|
this.$store.dispatch('app/changeIdentity', indentity);
|
|
this.$store.dispatch('app/changeIdentity', indentity);
|
|
|
|
+ selectIdentity(indentity.id);
|
|
this.$store.dispatch('projectBase/changeProject', this.project);
|
|
this.$store.dispatch('projectBase/changeProject', this.project);
|
|
localStorage.setItem('projectId', this.project.id);
|
|
localStorage.setItem('projectId', this.project.id);
|
|
this.$store.dispatch('app/changeUser', user);
|
|
this.$store.dispatch('app/changeUser', user);
|
|
- if (this.indentityId === 3 || user.userId === 1) {
|
|
|
|
|
|
+ if (this.indentityId === 3 || user.userId === 1) {
|
|
|
|
+ this.$loading.close();
|
|
this.$store.dispatch('app/changeMenuData', user.resource ? JSON.parse(user.resource) :
|
|
this.$store.dispatch('app/changeMenuData', user.resource ? JSON.parse(user.resource) :
|
|
[]);
|
|
[]);
|
|
setComment(user.menu ? user.menu : JSON.stringify([]));
|
|
setComment(user.menu ? user.menu : JSON.stringify([]));
|
|
@@ -137,7 +147,8 @@
|
|
identityId: this.indentityId,
|
|
identityId: this.indentityId,
|
|
type: this.project.type
|
|
type: this.project.type
|
|
}).then(node => {
|
|
}).then(node => {
|
|
- if (node.state) {
|
|
|
|
|
|
+ if (node.state) {
|
|
|
|
+ this.$loading.close();
|
|
let role = node.data[0] || {};
|
|
let role = node.data[0] || {};
|
|
this.$store.dispatch('app/changeMenuData', role
|
|
this.$store.dispatch('app/changeMenuData', role
|
|
.resource ? JSON.parse(role.resource) : []);
|
|
.resource ? JSON.parse(role.resource) : []);
|
|
@@ -150,11 +161,13 @@
|
|
})
|
|
})
|
|
this.$message.success('切换成功');
|
|
this.$message.success('切换成功');
|
|
} else {
|
|
} else {
|
|
|
|
+ this.$loading.close();
|
|
this.$message.error('切换失败');
|
|
this.$message.error('切换失败');
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
+ this.$loading.close();
|
|
this.$message.error('切换失败');
|
|
this.$message.error('切换失败');
|
|
}
|
|
}
|
|
});
|
|
});
|