@farris/bef
Advanced tools
Comparing version 0.0.10-201811141525 to 0.0.11-201811211455
{ | ||
"version": "0.0.10-201811141525", | ||
"version": "0.0.11-201811211455", | ||
"license": "MIT", | ||
@@ -20,3 +20,3 @@ "author": { | ||
}, | ||
"_id": "@farris/bef@0.0.10-201811141525" | ||
"_id": "@farris/bef@0.0.10-201811091513" | ||
} |
@@ -6,3 +6,3 @@ "use strict"; | ||
* @Last Modified by: Witt | ||
* @Last Modified time: 2018-11-08 18:45:35 | ||
* @Last Modified time: 2018-11-18 16:15:47 | ||
*/ | ||
@@ -197,2 +197,12 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
var entityDataCopy = Object.assign({}, entityData); | ||
// 临时处理多余字段 | ||
var ngFields = devkit_1.FieldMetadataUtil.getNgFields(entityType); | ||
var simpleDataFields = Array.from(Object.keys(ngFields)); | ||
var ngObjects = devkit_1.FieldMetadataUtil.getNgObjects(entityType); | ||
var objectDataFields = Array.from(Object.keys(ngObjects)); | ||
Object.keys(entityDataCopy).forEach(function (key) { | ||
if (simpleDataFields.indexOf(key) < 0 && objectDataFields.indexOf(key) < 0) { | ||
delete entityDataCopy[key]; | ||
} | ||
}); | ||
delete entityDataCopy[primaryKey]; | ||
@@ -199,0 +209,0 @@ // @todo:临时删除关联对象的变更,关联对象变更需要完整对象,待重构 |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"BefChangeBuilder":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Type","line":26,"character":34,"arguments":[{"__symbolic":"reference","module":"@farris/devkit","name":"Entity","line":26,"character":39}]}]}],"build":[{"__symbolic":"method"}],"buildChangeDetail":[{"__symbolic":"method"}],"addAddChangeDetail":[{"__symbolic":"method"}],"addRemoveChangeDetail":[{"__symbolic":"method"}],"createEmptyChangeDetail":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"BefChangeBuilder":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Type","line":27,"character":34,"arguments":[{"__symbolic":"reference","module":"@farris/devkit","name":"Entity","line":27,"character":39}]}]}],"build":[{"__symbolic":"method"}],"buildChangeDetail":[{"__symbolic":"method"}],"addAddChangeDetail":[{"__symbolic":"method"}],"addRemoveChangeDetail":[{"__symbolic":"method"}],"createEmptyChangeDetail":[{"__symbolic":"method"}]}}}}] |
@@ -27,4 +27,18 @@ import { HttpClient } from '@angular/common/http'; | ||
/** | ||
* -------------------------------------------------------------------------------- | ||
* @todo: 新API | ||
* -------------------------------------------------------------------------------- | ||
*/ | ||
/** | ||
* 获取实体集合 | ||
*/ | ||
getEntities(filter: any[], sort: any[], pageSize: number, pageIndex: number): Observable<T[]>; | ||
/** | ||
* -------------------------------------------------------------------------------- | ||
* @todo: 已过期,待删除 | ||
* -------------------------------------------------------------------------------- | ||
*/ | ||
/** | ||
* 获取实体集合 | ||
*/ | ||
getList(): Observable<T[]>; | ||
@@ -31,0 +45,0 @@ /** |
@@ -16,3 +16,3 @@ "use strict"; | ||
* @Last Modified by: Witt | ||
* @Last Modified time: 2018-10-27 13:52:00 | ||
* @Last Modified time: 2018-11-16 16:47:57 | ||
* | ||
@@ -62,8 +62,78 @@ * @todo | ||
/** | ||
* -------------------------------------------------------------------------------- | ||
* @todo: 新API | ||
* -------------------------------------------------------------------------------- | ||
*/ | ||
/** | ||
* 获取实体集合 | ||
*/ | ||
/** | ||
* -------------------------------------------------------------------------------- | ||
* @todo: 新API | ||
* -------------------------------------------------------------------------------- | ||
*/ | ||
/** | ||
* 获取实体集合 | ||
*/ | ||
BefRepository.prototype.getEntities = /** | ||
* -------------------------------------------------------------------------------- | ||
* @todo: 新API | ||
* -------------------------------------------------------------------------------- | ||
*/ | ||
/** | ||
* 获取实体集合 | ||
*/ | ||
function (filter, sort, pageSize, pageIndex) { | ||
var _this = this; | ||
// 清空Value为空的表达式,并将最后一个Relation设置为0 | ||
var filterWithValue = filter.filter(function (filterItem) { | ||
return filterItem.Value && filterItem.Value !== '' && filterItem.Value !== 'null'; | ||
}); | ||
if (filterWithValue.length > 0) { | ||
filterWithValue[filterWithValue.length - 1].Relation = 0; | ||
} | ||
var entityFilter = { | ||
FilterConditions: filter, | ||
SortConditions: sort, | ||
IsUsePagination: pageSize === 0 ? false : true, | ||
Pagination: { | ||
PageIndex: pageIndex, | ||
PageSize: pageSize, | ||
PageCount: 0, | ||
TotalCount: 0 | ||
} | ||
}; | ||
var result$ = this.restService.query(entityFilter); | ||
return result$.pipe(map_1.map(function (listData) { | ||
var entities = []; | ||
listData.forEach(function (data) { | ||
var entity = _this.buildEntity(data); | ||
entities.push(entity); | ||
}); | ||
_this.entityCollection.loadEntities(entities); | ||
return entities; | ||
})); | ||
}; | ||
/** | ||
* -------------------------------------------------------------------------------- | ||
* @todo: 已过期,待删除 | ||
* -------------------------------------------------------------------------------- | ||
*/ | ||
/** | ||
* 获取实体集合 | ||
*/ | ||
/** | ||
* -------------------------------------------------------------------------------- | ||
* @todo: 已过期,待删除 | ||
* -------------------------------------------------------------------------------- | ||
*/ | ||
/** | ||
* 获取实体集合 | ||
*/ | ||
BefRepository.prototype.getList = /** | ||
* -------------------------------------------------------------------------------- | ||
* @todo: 已过期,待删除 | ||
* -------------------------------------------------------------------------------- | ||
*/ | ||
/** | ||
* 获取实体集合 | ||
@@ -70,0 +140,0 @@ */ |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"BefRepository":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@farris/devkit","name":"Repository","line":35,"character":55},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":34,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":58,"character":5},"arguments":[{"__symbolic":"reference","module":"./tokens","name":"BE_SERVER_URI_TOKEN","line":58,"character":12}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":57,"character":16},{"__symbolic":"reference","name":"string"}]}],"createRestService":[{"__symbolic":"method"}],"getList":[{"__symbolic":"method"}],"getById":[{"__symbolic":"method"}],"updateById":[{"__symbolic":"method"}],"lockById":[{"__symbolic":"method"}],"create":[{"__symbolic":"method"}],"createByPath":[{"__symbolic":"method"}],"append":[{"__symbolic":"method"}],"appendByPath":[{"__symbolic":"method"}],"appendEntityByPath":[{"__symbolic":"method"}],"removeById":[{"__symbolic":"method"}],"removeByIds":[{"__symbolic":"method"}],"removeByPath":[{"__symbolic":"method"}],"removeEntityByPath":[{"__symbolic":"method"}],"updateChangesById":[{"__symbolic":"method"}],"updateChangesByPath":[{"__symbolic":"method"}],"updateAllChanges":[{"__symbolic":"method"}],"applyChanges":[{"__symbolic":"method"}],"applyChangesById":[{"__symbolic":"method"}],"cancelChanges":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"BefRepository":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@farris/devkit","name":"Repository","line":35,"character":55},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":34,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":58,"character":5},"arguments":[{"__symbolic":"reference","module":"./tokens","name":"BE_SERVER_URI_TOKEN","line":58,"character":12}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":57,"character":16},{"__symbolic":"reference","name":"string"}]}],"createRestService":[{"__symbolic":"method"}],"getEntities":[{"__symbolic":"method"}],"getList":[{"__symbolic":"method"}],"getById":[{"__symbolic":"method"}],"updateById":[{"__symbolic":"method"}],"lockById":[{"__symbolic":"method"}],"create":[{"__symbolic":"method"}],"createByPath":[{"__symbolic":"method"}],"append":[{"__symbolic":"method"}],"appendByPath":[{"__symbolic":"method"}],"appendEntityByPath":[{"__symbolic":"method"}],"removeById":[{"__symbolic":"method"}],"removeByIds":[{"__symbolic":"method"}],"removeByPath":[{"__symbolic":"method"}],"removeEntityByPath":[{"__symbolic":"method"}],"updateChangesById":[{"__symbolic":"method"}],"updateChangesByPath":[{"__symbolic":"method"}],"updateAllChanges":[{"__symbolic":"method"}],"applyChanges":[{"__symbolic":"method"}],"applyChangesById":[{"__symbolic":"method"}],"cancelChanges":[{"__symbolic":"method"}]}}}}] |
@@ -35,3 +35,3 @@ import { HttpClient } from '@angular/common/http'; | ||
*/ | ||
query(): Observable<any>; | ||
query(entityFilter?: any): Observable<any>; | ||
/** | ||
@@ -38,0 +38,0 @@ * 数据检索 |
@@ -6,3 +6,3 @@ "use strict"; | ||
* @Last Modified by: Witt | ||
* @Last Modified time: 2018-11-07 21:58:44 | ||
* @Last Modified time: 2018-11-15 16:08:42 | ||
*/ | ||
@@ -48,4 +48,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
*/ | ||
function () { | ||
return this.request(this.baseUri, 'GET'); | ||
function (entityFilter) { | ||
var url = this.baseUri; | ||
if (entityFilter) { | ||
var entityFilterJson = JSON.stringify(entityFilter); | ||
url = url + "?entityFilter=" + entityFilterJson; | ||
} | ||
return this.request(url, 'GET'); | ||
}; | ||
@@ -52,0 +57,0 @@ /** |
@@ -6,3 +6,3 @@ "use strict"; | ||
* @Last Modified by: Witt | ||
* @Last Modified time: 2018-11-08 19:01:46 | ||
* @Last Modified time: 2018-11-19 18:53:11 | ||
*/ | ||
@@ -40,4 +40,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
var frmSessionId; | ||
if (this.storageStrategy === 'localStorage') { | ||
frmSessionId = window.localStorage.getItem('frmSessionId'); | ||
var storageStrategy = this.storageStrategy; | ||
storageStrategy = 'localStorage'; | ||
if (storageStrategy === 'localStorage') { | ||
frmSessionId = window.sessionStorage.getItem('FRM_SESSION_ID'); | ||
} | ||
@@ -62,4 +64,6 @@ else { | ||
function (frmSessionId) { | ||
if (this.storageStrategy === 'localStorage') { | ||
window.localStorage.setItem('frmSessionId', frmSessionId); | ||
var storageStrategy = this.storageStrategy; | ||
storageStrategy = 'localStorage'; | ||
if (storageStrategy === 'localStorage') { | ||
window.sessionStorage.setItem('FRM_SESSION_ID', frmSessionId); | ||
} | ||
@@ -103,4 +107,13 @@ else { | ||
var beSessionId; | ||
if (this.storageStrategy === 'localStorage') { | ||
beSessionId = window.localStorage.getItem('beSessionId'); | ||
var storageStrategy = this.storageStrategy; | ||
storageStrategy = 'localStorage'; | ||
if (storageStrategy === 'localStorage') { | ||
var beSessionKey = 'BE_SESSION_ID'; | ||
var beSessionsJson = window.sessionStorage.getItem(beSessionKey); | ||
if (beSessionsJson) { | ||
var beSessionsObj = JSON.parse(beSessionsJson); | ||
if (beSessionsObj) { | ||
beSessionId = beSessionsObj[this.beSessionUri]; | ||
} | ||
} | ||
} | ||
@@ -125,4 +138,14 @@ else { | ||
function (beSessionId) { | ||
if (this.storageStrategy === 'localStorage') { | ||
window.localStorage.setItem('beSessionId', beSessionId); | ||
var storageStrategy = this.storageStrategy; | ||
storageStrategy = 'localStorage'; | ||
if (storageStrategy === 'localStorage') { | ||
// 写入SessionStorage | ||
var beSessionKey = "BE_SESSION_ID"; | ||
var beSessionsJson = window.sessionStorage.getItem(beSessionKey); | ||
var beSessionsObj = {}; | ||
if (beSessionsJson) { | ||
beSessionsObj = JSON.parse(beSessionsJson); | ||
} | ||
beSessionsObj[this.beSessionUri] = beSessionId; | ||
window.sessionStorage.setItem(beSessionKey, JSON.stringify(beSessionsObj)); | ||
} | ||
@@ -129,0 +152,0 @@ else { |
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
2739632
21068