@farris/bef
Advanced tools
Comparing version 0.0.10-201811081028 to 0.0.10-201811081920
@@ -0,0 +0,0 @@ function __export(m) { |
@@ -0,0 +0,0 @@ export * from './services/types'; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"version": "0.0.10-201811081028", | ||
"version": "0.0.10-201811081920", | ||
"license": "MIT", | ||
@@ -4,0 +4,0 @@ "author": { |
@@ -0,0 +0,0 @@ import { Type } from '@angular/core'; |
@@ -6,3 +6,3 @@ "use strict"; | ||
* @Last Modified by: Witt | ||
* @Last Modified time: 2018-10-31 08:38:55 | ||
* @Last Modified time: 2018-11-08 18:45:35 | ||
*/ | ||
@@ -75,9 +75,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
var _a = entity_util_1.EntityUtil.getPropInfo(parentEntityType, propName), propType = _a.propType, propEntityType = _a.propEntityType; | ||
// 不支持主键变更,忽略 | ||
// @todo:应该在Entity上处理,临时兼容 | ||
var primaryKey = entity_util_1.EntityUtil.getPrimaryKey(parentEntityType); | ||
if (propName === primaryKey) { | ||
return "continue"; | ||
} | ||
if (propType === 'NgField') { | ||
// 不支持主键变更,忽略 | ||
var primaryKey = entity_util_1.EntityUtil.getPrimaryKey(parentEntityType); | ||
if (propName === primaryKey) { | ||
return "continue"; | ||
} | ||
if (modification.type !== devkit_1.ModifyType.ValueChange) { | ||
@@ -93,10 +92,24 @@ throw Error('简单类型的属性上不支持ValueChange类型之外的变更'); | ||
// 判断是否已经存在,如果不存在则创建,如果存在则继续遍历 | ||
var dataId = paths[i + 1].split(':')[1]; | ||
// const dataId = paths[i + 1].split(':')[1]; | ||
// let changeDetail = parentChangeDetail.ChangeInfo[propName]; | ||
// if (!changeDetail) { | ||
// changeDetail = this.createEmptyChangeDetail(ChangeDetailType.Modify, dataId); | ||
// parentChangeDetail.ChangeInfo[propName] = changeDetail; | ||
// } | ||
// parentChangeDetail = <ChangeDetail>changeDetail; | ||
// parentEntityType = propEntityType; | ||
var childPropName = paths[i + 2]; | ||
// 检查该值对象是否已经存在变更,不存在先创建 | ||
var changeDetail = parentChangeDetail.ChangeInfo[propName]; | ||
if (!changeDetail) { | ||
changeDetail = this_1.createEmptyChangeDetail(types_1.ChangeDetailType.Modify, dataId); | ||
parentChangeDetail.ChangeInfo[propName] = changeDetail; | ||
var childId = paths[i + 1].split(':')[1]; | ||
var childIdName = paths[i + 1].split(':')[0]; | ||
changeDetail = {}; | ||
changeDetail[childIdName] = childId; | ||
} | ||
parentChangeDetail = changeDetail; | ||
parentEntityType = propEntityType; | ||
changeDetail[childPropName] = modification.value; | ||
parentChangeDetail.ChangeInfo[propName] = changeDetail; | ||
// BE中值对象已经是最后一级,不需要再往后遍历 | ||
parentChangeDetail = null; | ||
parentEntityType = null; | ||
} | ||
@@ -103,0 +116,0 @@ else if (propType === 'NgList') { |
@@ -0,0 +0,0 @@ import { Repository } from '@farris/devkit'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { HttpClient } from '@angular/common/http'; |
@@ -13,3 +13,3 @@ "use strict"; | ||
/* | ||
* @Author: Witt | ||
* @Author: Sagi, Lucas, Witt | ||
* @Date: 2018-10-11 17:34:26 | ||
@@ -16,0 +16,0 @@ * @Last Modified by: Witt |
@@ -0,0 +0,0 @@ import { HttpClient } from '@angular/common/http'; |
@@ -6,3 +6,3 @@ "use strict"; | ||
* @Last Modified by: Witt | ||
* @Last Modified time: 2018-10-23 11:53:23 | ||
* @Last Modified time: 2018-11-07 21:58:44 | ||
*/ | ||
@@ -243,3 +243,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
return this.sessionService.getBeSessionId().pipe(switchMap_1.switchMap(function (sessionId) { | ||
options.headers = new http_1.HttpHeaders({ 'SessionId': sessionId }); | ||
if (options.headers) { | ||
options.headers = options.headers.append('SessionId', sessionId); | ||
} | ||
else { | ||
options.headers = new http_1.HttpHeaders({ 'SessionId': sessionId }); | ||
} | ||
return _this.httpClient.request(method, url, options); | ||
@@ -246,0 +251,0 @@ })); |
@@ -5,2 +5,6 @@ import { HttpClient } from '@angular/common/http'; | ||
/** | ||
* 存储策略 | ||
*/ | ||
private storageStrategy; | ||
/** | ||
* http客户端 | ||
@@ -34,2 +38,6 @@ */ | ||
/** | ||
* 设置FrmSessionId | ||
*/ | ||
setFrmSessionId(frmSessionId: string): void; | ||
/** | ||
* 获取FrmSessionId | ||
@@ -43,2 +51,6 @@ */ | ||
/** | ||
* 设置BeSessionId | ||
*/ | ||
setBeSessionId(beSessionId: string): void; | ||
/** | ||
* 创建BeSessionId | ||
@@ -45,0 +57,0 @@ */ |
@@ -6,3 +6,3 @@ "use strict"; | ||
* @Last Modified by: Witt | ||
* @Last Modified time: 2018-10-30 14:29:52 | ||
* @Last Modified time: 2018-11-08 19:01:46 | ||
* @todo 待重构 | ||
@@ -22,2 +22,6 @@ */ | ||
function BefSessionService(httpClient, serverUri, beUri) { | ||
/** | ||
* 存储策略 | ||
*/ | ||
this.storageStrategy = 'memory'; | ||
this.httpClient = httpClient; | ||
@@ -37,3 +41,9 @@ this.frmSessionUri = serverUri + "/api/runtime/sys/v1.0/login-states/UserLogin"; | ||
function () { | ||
var frmSessionId = window.localStorage.getItem('frmSessionId'); | ||
var frmSessionId; | ||
if (this.storageStrategy === 'localStorage') { | ||
frmSessionId = window.localStorage.getItem('frmSessionId'); | ||
} | ||
else { | ||
frmSessionId = this.frmSessionId; | ||
} | ||
if (frmSessionId) { | ||
@@ -45,2 +55,19 @@ return of_1.of(frmSessionId); | ||
/** | ||
* 设置FrmSessionId | ||
*/ | ||
/** | ||
* 设置FrmSessionId | ||
*/ | ||
BefSessionService.prototype.setFrmSessionId = /** | ||
* 设置FrmSessionId | ||
*/ | ||
function (frmSessionId) { | ||
if (this.storageStrategy === 'localStorage') { | ||
window.localStorage.setItem('frmSessionId', frmSessionId); | ||
} | ||
else { | ||
this.frmSessionId = frmSessionId; | ||
} | ||
}; | ||
/** | ||
* 获取FrmSessionId | ||
@@ -55,5 +82,6 @@ */ | ||
function () { | ||
var _this = this; | ||
console.log('----------createFrmSession----------'); | ||
var body = { | ||
UserName: 'admin', | ||
UserName: 'jiwt', | ||
PassWord: 'aaaaaa', | ||
@@ -64,3 +92,3 @@ Language: 'zh-CHS', | ||
return this.httpClient.post(this.frmSessionUri, body).pipe(map_1.map(function (data) { | ||
window.localStorage.setItem('frmSessionId', data.sessionId); | ||
_this.setFrmSessionId(data.sessionId); | ||
return data.sessionId; | ||
@@ -79,3 +107,9 @@ })); | ||
function () { | ||
var beSessionId = window.localStorage.getItem('beSessionId'); | ||
var beSessionId; | ||
if (this.storageStrategy === 'localStorage') { | ||
beSessionId = window.localStorage.getItem('beSessionId'); | ||
} | ||
else { | ||
beSessionId = this.beSessionId; | ||
} | ||
if (beSessionId) { | ||
@@ -87,2 +121,19 @@ return of_1.of(beSessionId); | ||
/** | ||
* 设置BeSessionId | ||
*/ | ||
/** | ||
* 设置BeSessionId | ||
*/ | ||
BefSessionService.prototype.setBeSessionId = /** | ||
* 设置BeSessionId | ||
*/ | ||
function (beSessionId) { | ||
if (this.storageStrategy === 'localStorage') { | ||
window.localStorage.setItem('beSessionId', beSessionId); | ||
} | ||
else { | ||
this.beSessionId = beSessionId; | ||
} | ||
}; | ||
/** | ||
* 创建BeSessionId | ||
@@ -105,3 +156,3 @@ */ | ||
}), tap_1.tap(function (beSessionId) { | ||
window.localStorage.setItem('beSessionId', beSessionId); | ||
_this.setBeSessionId(beSessionId); | ||
})); | ||
@@ -108,0 +159,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"BefSessionService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":16,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":47,"character":26},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}],"getFrmSessionId":[{"__symbolic":"method"}],"createFrmSessionId":[{"__symbolic":"method"}],"getBeSessionId":[{"__symbolic":"method"}],"createBeSession":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"BefSessionService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":16,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":52,"character":26},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}],"getFrmSessionId":[{"__symbolic":"method"}],"setFrmSessionId":[{"__symbolic":"method"}],"createFrmSessionId":[{"__symbolic":"method"}],"getBeSessionId":[{"__symbolic":"method"}],"setBeSessionId":[{"__symbolic":"method"}],"createBeSession":[{"__symbolic":"method"}]}}}}] |
@@ -0,0 +0,0 @@ declare class EntityUtil { |
@@ -0,0 +0,0 @@ "use strict"; |
import { InjectionToken } from '@angular/core'; | ||
declare const BE_SERVER_URI_TOKEN: InjectionToken<string>; | ||
export { BE_SERVER_URI_TOKEN }; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -27,3 +27,5 @@ /** | ||
DataId: string; | ||
[key: string]: number | string | boolean | null | ChangeDetail | ChangeDetail[]; | ||
[key: string]: number | string | boolean | null | ChangeDetail | ChangeDetail[] | { | ||
[key: string]: any; | ||
}; | ||
} | ||
@@ -30,0 +32,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2699893
20711