|
|
|
@ -16,6 +16,10 @@ export interface User {
|
|
|
|
|
poolNameList?: Array<Area>;
|
|
|
|
|
createBy: string;
|
|
|
|
|
}
|
|
|
|
|
export interface FactoryCode {
|
|
|
|
|
factoryCode?: string;
|
|
|
|
|
poolName?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Module({
|
|
|
|
|
dynamic: true,
|
|
|
|
@ -28,6 +32,7 @@ class SessionService extends VuexModule {
|
|
|
|
|
* 当前登录用户
|
|
|
|
|
*/
|
|
|
|
|
user: User | null = null;
|
|
|
|
|
factory: FactoryCode | null = null;
|
|
|
|
|
factoryCode: string;
|
|
|
|
|
//factoryCode: factoryCode | null = null;
|
|
|
|
|
Version = '';
|
|
|
|
@ -85,10 +90,17 @@ class SessionService extends VuexModule {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get FactoryCode(): any {
|
|
|
|
|
if (this.factoryCode === null) {
|
|
|
|
|
if (this.factory === null) {
|
|
|
|
|
return null;
|
|
|
|
|
} else {
|
|
|
|
|
return this.factoryCode;
|
|
|
|
|
return this.factory.factoryCode;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
get PoolName(): any {
|
|
|
|
|
if (this.factory === null) {
|
|
|
|
|
return null;
|
|
|
|
|
} else {
|
|
|
|
|
return this.factory.poolName;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
@ -141,6 +153,13 @@ class SessionService extends VuexModule {
|
|
|
|
|
return this.user;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
get getFactory(): FactoryCode {
|
|
|
|
|
if (this.factory === null) {
|
|
|
|
|
throw new Error('当前无选择工厂');
|
|
|
|
|
} else {
|
|
|
|
|
return this.factory;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 登录
|
|
|
|
|
@Action({ rawError: true })
|
|
|
|
@ -175,8 +194,8 @@ class SessionService extends VuexModule {
|
|
|
|
|
this.user = user;
|
|
|
|
|
}
|
|
|
|
|
@Mutation
|
|
|
|
|
setfactoryCode(factoryCode): void {
|
|
|
|
|
this.factoryCode = factoryCode;
|
|
|
|
|
setFactory(factory: FactoryCode): void {
|
|
|
|
|
this.factory = factory;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 保存工作区信息
|
|
|
|
|