@farris/bef
Advanced tools
Comparing version 0.0.12-20211026084402-dev to 0.0.12-20211125133355-dev
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@ecp-caf/caf-common"),require("date-fns"),require("rxjs"),require("rxjs/operators"),require("rxjs/operators/map"),require("@angular/core"),require("@angular/common/http"),require("@farris/devkit")):"function"==typeof define&&define.amd?define("@farris/bef",["exports","@ecp-caf/caf-common","date-fns","rxjs","rxjs/operators","rxjs/operators/map","@angular/core","@angular/common/http","@farris/devkit"],t):t((e.farris=e.farris||{},e.farris.bef={}),e.cafCommon,e.dateFns,e.rxjs,e.rxjs.operators,e.rxjs["operators/map"],e.ng.core,e.ng.common.http,e.devkit)}(this,function(e,t,r,b,d,s,i,h,I){"use strict";var S=(n.Added="Added",n.Modify="Modify",n.Deleted="Deleted",n);function n(){}var y=new i.InjectionToken("@farris/be BE_SERVER_URL"),a=new i.InjectionToken("@farris/be BE_SESSION_HANDLING_STRATEGY_TOKEN"),C=(o.getPropInfo=function(e,t){var n,r,o,i=I.FieldMetadataUtil.getNgFields(e);Object.keys(i).forEach(function(e){e===t&&(n="NgField",r=null,o=i[e])});var a=I.FieldMetadataUtil.getNgObjects(e);Object.keys(a).forEach(function(e){e===t&&(n="NgObject",r=a[e].type,o=a[e])});var s=I.FieldMetadataUtil.getNgList(e);Object.keys(s).forEach(function(e){e===t&&(n="NgList",r=s[e].type,o=s[e])});var p=I.FieldMetadataUtil.getNgDynamic(e);return Object.keys(p).forEach(function(e){e===t&&(n="NgDynamic",r=p[e].type,o=p[e])}),{propType:n,propEntityType:r,propMetadata:o}},o.getPrimaryKey=function(e){var t=I.FieldMetadataUtil.getPrimaryFieldMetadata(e);return t?t.dataField:""},o.isObjectProp=function(e,t){var n=!1,r=I.FieldMetadataUtil.getNgObjects(e);return Object.keys(r).forEach(function(e){e===t&&(n=!0)}),n},o.isDynamicProp=function(e,t){var n=!1,r=I.FieldMetadataUtil.getNgDynamic(e);return Object.keys(r).forEach(function(e){e===t&&(n=!0)}),n},o.appendInitialData=function(e,t){var n=Object.assign({},t);delete n.id,delete n.parentID,e.initialData=n},o);function o(){}var p=(u.prototype.build=function(e){var t=this;return this.changeDetail={ChangeType:S.Modify,ChangeInfo:{DataId:""}},e.forEach(function(e){t.buildChangeDetail(e)}),this.changeDetail},u.prototype.buildChangeDetail=function(l){var d=l.path.concat();this.changeDetail.ChangeInfo.DataId||(this.changeDetail.ChangeInfo.DataId=d[0].split(":")[1]);for(var f=this.changeDetail,g=this.entityType,e=function(e){var t=v.getChangeInfo(f),n=d[e],r=C.getPropInfo(g,n),o=r.propType,i=r.propEntityType,a=r.propMetadata.dataField||n;if("NgField"===o){if(n===C.getPrimaryKey(g))return"continue";if(l.type!==I.ModifyType.ValueChange)throw Error("简单类型的属性上不支持ValueChange类型之外的变更");t[a]=l.value,f=null}else if("NgObject"===o)if(d[e+1].split(":")[1],d[e+1].split(":")[0]){var s=t[a],p=d.slice(0,e+1);s=(y=v.entityCollection.getEntityByPath(p))?y.toJSON(!0):{},t[a]=s,g=f=null}else c=(c=t[a])||{ChangeType:S.Modify,ChangeInfo:{}},t[a]=c,f=c,g=i;else if("NgList"===o){f.ChangeInfo[a]||(f.ChangeInfo[a]=[]);var u=f.ChangeInfo[a];if(e!==d.length-1){var c,h=d[e+1].split(":")[1];return(c=u.find(function(e){return e.ChangeInfo.DataId===h}))||(c=v.createEmptyChangeDetail(S.Modify,h),u.push(c)),f=c,g=i,"continue"}l.type===I.ModifyType.Add||l.type===I.ModifyType.Insert||(l.type,I.ModifyType.Remove),g=f=null}else if("NgDynamic"===o){p=d.slice(0,e+1);var y=v.entityCollection.getEntityByPath(p);t[a]={ChangeType:S.Modify,ChangeInfo:y?y.toJSON(!0):{}},g=f=null}},v=this,t=1;t<d.length&&f;t+=2)e(t)},u.prototype.getChangeInfo=function(e){return e.hasOwnProperty("ChangeInfo")?e.ChangeInfo:e},u.prototype.createEmptyChangeDetail=function(e,t){return{ChangeType:e,ChangeInfo:{DataId:t}}},u);function u(e,t){this.entityType=e,this.entityCollection=t}var c=(l.prototype.handle=function(e,t,n){this.handleChangeDetails(e,t,n)},l.prototype.handleChangeDetails=function(r,o,e){var i=this;e&&e.forEach(function(e){var t=e.ChangeInfo.dataId||e.ChangeInfo.DataId,n=i.getEntityById(o,t);n&&i.handleChangeDetail(r,n,e)})},l.prototype.handleChangeDetail=function(u,c,e){var h=this;if(e&&c&&e.ChangeType===S.Modify){var y=e.ChangeInfo;Object.keys(y).forEach(function(e){var t=C.getPropInfo(u,e),n=t.propType,r=t.propEntityType;if("NgField"===n)c[e]=y[e];else if("NgObject"===n){var o=c[e];if(o.primaryKey){var i=y[e];o.load(i)}else{var a=y[e];h.handleChangeDetail(r,o,a)}}else if("NgList"===n){var s=c[e],p=y[e];h.handleChangeDetails(r,s,p)}})}},l.prototype.getEntityById=function(e,t){return(e instanceof I.EntityCollection?e.getEntityById(t):e.get(t))||null},l);function l(){}var f=(g.prototype.getUserSessionId=function(){return this.sessionService.getUserSessionId()},g.prototype.getCurrentSessionId=function(e){var t;if(this.sessionService)if(e&&e.hasOwnProperty("tabId")){var n=e.tabId;t=this.sessionService.getCurrentSeesionId(n)}else t=this.sessionService.getCurrentSeesionId();return t=t||this.getUserSessionId()},g.decorators=[{type:i.Injectable}],g.ctorParameters=function(){return[{type:t.SessionService,decorators:[{type:i.Optional}]}]},g);function g(e){this.sessionService=e}var v=(m.prototype.getItem=function(e){return this.getAllBeSessions()[e]},m.prototype.setItem=function(e,t){var n=this.getAllBeSessions();n[e]=t,this.setAllBeSessions(n)},m.prototype.removeItem=function(e){var t=this.getAllBeSessions();t[e]&&delete t[e],this.setAllBeSessions(t)},m.prototype.clear=function(e,t){!0===this.isInFramework()?this.removeItemsByFrmSessionId(e):this.removeItem(t)},m.prototype.removeItemsByFrmSessionId=function(t){var n=this.getAllBeSessions();Object.keys(n).forEach(function(e){!0===e.startsWith(t)&&delete n[e]}),this.setAllBeSessions(n)},m.prototype.getAllBeSessions=function(){var e=window.sessionStorage.getItem(this.sessionStorageKey);return e?JSON.parse(e):{}},m.prototype.setAllBeSessions=function(e){var t=JSON.stringify(e);window.sessionStorage.setItem(this.sessionStorageKey,t)},m.prototype.isInFramework=function(){var e=window.location.hash;return!!e&&-1!==e.indexOf("tabId=")},m);function m(){this.sessionStorageKey="BE_SESSION_ID"}var E=function(e,t){return(E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function x(e,t){function n(){this.constructor=e}E(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var B=function(){return(B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function P(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function R(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i["return"])&&n.call(i)}finally{if(o)throw o.error}}return a}function D(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(R(arguments[t]));return e}var w=(q.convertToHeaders=function(t){if(1==(t=t||new h.HttpHeaders)instanceof h.HttpHeaders)return t;if(0<Object.keys(t).length){var n=new h.HttpHeaders;Object.keys(t).forEach(function(e){n=n.append(e,t[e])}),t=n}else t=new h.HttpHeaders;return t},q.appendSessionId=function(e,t){return e.append("SessionId",t)},q.appendCafRuntimeCommonVariable=function(e,t){return e.append("X-CAF-Runtime-CommonVariable",t)},q.appendCafRuntimeContext=function(e,t){return e.append("X-CAF-Runtime-Context",t)},q.appendContextType=function(e,t){return t=t||"application/json",e.append("Content-Type",t)},q.appendRequireMessage=function(e,t){return void 0===t&&(t=!0),e.append("Bff-Require-Message",t.toString())},q.appendFuncInstId=function(e,t){return e.append("Func-Inst-Id",t)},q.toJson=function(n){if(!(n instanceof h.HttpHeaders))return null;var r={};return n.keys().forEach(function(e){var t=n.getAll(e);1<t.length?r[e]=t:r[e]=t[0]||""}),r},q);function q(){}var O=(M.buildParams=function(e){var t=new h.HttpParams;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n].toString();t=t.append(n,r)}return t},M);function M(){}var T=(j.hasRequestInfo=function(e){if(!e||!e.body)return!1;var t=e.body;return!(!t.requestInfo||!t.requestInfo.dataChange)||!!t.dataChange},j.hasRequestInfoWithR=function(e){if(!e||!e.body)return!1;var t=e.body;return!(!t.RequestInfo||!t.RequestInfo.dataChange)||!!t.dataChange},j.buildRequestInfo=function(e){return{dataChange:e.entityManager.buildAllEntityChangeDetails(),variableChange:e.variableManager.buildChangeDetail()}},j.buildBodyWithRequestInfo=function(e,t){if(e.RequestInfo||e.requestInfo)return e;var n=this.buildRequestInfo(t);return Object.assign({},e,{requestInfo:n})},j);function j(){}var A=(U.unWrapResponseInfo=function(e){if(!e)return e;if(!1===e.hasOwnProperty("returnValue"))return e.hasOwnProperty("result")&&e.hasOwnProperty("pagination")?e.result:e;var t=e.returnValue;return t&&t.hasOwnProperty("result")&&t.hasOwnProperty("pagination")?t.result:e.returnValue},U.isReported401Error=function(e){return 401===e.status},U.parseBackEndMessage=function(e){return e&&e.message&&Array.isArray(e.message)&&0<e.message.length?e.message:null},U.parseBackEndError=function(e){var t=e&&e.error;return t&&t.hasOwnProperty("extensionMessage")&&t.extensionMessage&&t.extensionMessage.hasOwnProperty("UIMsg")&&t.extensionMessage.UIMsg&&0<t.extensionMessage.UIMsg.length?JSON.parse(t.extensionMessage.UIMsg):null},U);function U(){}var V=(H.prototype.getService=function(){for(var e=window;!e.gspframeworkService&&e!==window.top&&this.isSameOrigin(e);)e=window.parent;return e.gspframeworkService&&e.gspframeworkService.rtf||{}},H.prototype.isSameOrigin=function(e){var t=window.location.host;try{if(e&&e.location&&"undefined"!=typeof e.location.host)return e.location.host===t}catch(n){return!1}return!1},Object.defineProperty(H.prototype,"params",{get:function(){return this.rtf&&this.rtf.hasOwnProperty("session")&&"function"==typeof this.rtf.session.getCommonVariable?this.rtf.session.getCommonVariable():null},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"httpService",{get:function(){return this.rtf&&this.rtf.hasOwnProperty("http")&&"function"==typeof this.rtf.http.request?this.rtf.http:null},enumerable:!0,configurable:!0}),H.prototype.request=function(e,t,n){return void 0===n&&(n={}),this.defaultHttpClient.request(e,t,n)},H.decorators=[{type:i.Injectable}],H.ctorParameters=function(){return[{type:h.HttpClient}]},H);function H(e){this.defaultHttpClient=e,this.httpClient=e,this.rtf=this.getService()}var k=(F.prototype.getFrmSessionId=function(e){return this.frmSessionService.getCurrentSessionId(e)},Object.defineProperty(F.prototype,"frmSessionId",{get:function(){return this.frmSessionService.getCurrentSessionId()},enumerable:!0,configurable:!0}),F.prototype.getFrameworkSessionId=function(e){return this.getFrmSessionId(e)},F.prototype.getSessionIdFromStorage=function(e){var t=this.getSessionStorageKey(e);return this.storageStrategy.getItem(t)},F);function F(e,t){this.storageStrategy=e,this.frmSessionService=t}var N,_=(x(L,N=k),L.prototype.getSessionId=function(){var e=this.getSessionIdFromStorage();return e?b.of(e):this.createSession()},L.prototype.setSessionId=function(e){var t=this.getSessionStorageKey();this.storageStrategy.setItem(t,e)},L.prototype.clearSessionId=function(){var e=this.getSessionStorageKey();this.storageStrategy.clear(this.frmSessionId,e)},L.prototype.extendRequestHeaders=function(e,t){var n=this.getFrameworkSessionId(t),r=this.getSessionIdFromStorage(t);return e=w.appendCafRuntimeCommonVariable(e,n),r&&(e=w.appendCafRuntimeContext(e,r),e=w.appendSessionId(e,r)),e=w.appendFuncInstId(e,this.beSessionUri)},L.prototype.handleReponseHeaders=function(e){console.log(e)},L.prototype.createSession=function(){var t=this,e={responseType:"text"};return this.frmSessionId&&(this.injector.get(I.AppContext,null),e.headers=new h.HttpHeaders({SessionId:this.frmSessionId}),e.headers=e.headers.append("X-CAF-Runtime-CommonVariable",this.frmSessionId),e.headers=e.headers.append("Func-Inst-Id",this.beSessionUri),e.headers=w.toJson(e.headers)),this.httpService.request("POST",this.beSessionUri,e).pipe(d.tap(function(e){t.setSessionId(e)}))},L.prototype.extendHttpHeader=function(){},L.prototype.getSessionStorageKey=function(e){return(e?this.getFrameworkSessionId(e):this.frmSessionId)+"_"+this.beSessionUri},L);function L(e,t,n,r,o){var i=N.call(this,e,t)||this;return i.beSessionUri=r,i.httpClient=n,i.httpService=new V(i.httpClient),i.injector=o,i}var K,G=(x(J,K=k),J.prototype.getSessionId=function(){var e=this.getSessionStorageKey(),t=this.storageStrategy.getItem(e);return b.of(t)},J.prototype.setSessionId=function(e){var t=this.getSessionStorageKey();this.storageStrategy.setItem(t,e)},J.prototype.clearSessionId=function(){var e=this.getSessionStorageKey();this.storageStrategy.removeItem(e)},J.prototype.extendRequestHeaders=function(e,t){var n=this.getFrameworkSessionId(t),r=this.getSessionIdFromStorage(t),o=this.injector.get(I.AppContext,null);if(o){var i=o.Token;e=w.appendFuncInstId(e,i)}return e=w.appendCafRuntimeCommonVariable(e,n),r&&(e=w.appendCafRuntimeContext(e,r)),e},J.prototype.handleReponseHeaders=function(e){console.log(e)},J.prototype.getSessionStorageKey=function(e){return(e?this.getFrameworkSessionId(e):this.frmSessionId)+"_"+this.beSessionUri},J);function J(e,t,n,r){var o=K.call(this,e,t)||this;return o.beSessionUri=n,o.injector=r,o}var z=(W.prototype.create=function(e,t,n,r,o){var i=this.createStorageStrategy(),a=this.createBeSessionUri(n);return"UnifiedSession"===e?new G(i,t,a,o):new _(i,t,r,a,o)},W.prototype.createStorageStrategy=function(){return new v},W.prototype.createBeSessionUri=function(e){return e+"/service/createsession"},W.decorators=[{type:i.Injectable}],W);function W(){}var Q=(Object.defineProperty(Y.prototype,"token",{get:function(){return this.handlingStrategy.getFrameworkSessionId()},enumerable:!0,configurable:!0}),Y.prototype.getBeSessionId=function(){return this.handlingStrategy.getSessionId()},Y.prototype.setBeSessionId=function(e){this.handlingStrategy.setSessionId(e),this.setSessionId(e)},Y.prototype.clearBeSessionId=function(){this.handlingStrategy.clearSessionId()},Y.prototype.extendRequestHeaders=function(e,t){return this.handlingStrategy.extendRequestHeaders(e,t)},Y.prototype.handleResponseHeaders=function(e){return this.handlingStrategy.handleReponseHeaders(e)},Y.prototype.createBeSession=function(){return this.handlingStrategy.createSession()},Y.prototype.setSessionId=function(e){var t=this.injector.get(I.AppContext,null,i.InjectFlags.Optional);t&&e&&t.params.set("sessionId",e)},Y.prototype.createHandlingStrategy=function(e,t,n,r){var o;return o=(o=e?e.get(a,null,i.InjectFlags.Optional):"SeparatedSession")||"SeparatedSession",(new z).create(o,n,r,t,e)},Y.decorators=[{type:i.Injectable}],Y.ctorParameters=function(){return[{type:h.HttpClient},{type:String},{type:f},{type:i.Injector}]},Y);function Y(e,t,n,r){this.beBaseUri=t,this.injector=r,this.handlingStrategy=this.createHandlingStrategy(r,e,n,t)}var X,Z="@farris/bef NG_VARIABLE",$=I.makePropDecorator(Z,function(e){return e}),ee=(x(te,X=I.Repository),Object.defineProperty(te.prototype,"restService",{get:function(){return this.dataService.restService},enumerable:!0,configurable:!0}),Object.defineProperty(te.prototype,"changeBuilder",{get:function(){return this.entityManager.changeBuilder},enumerable:!0,configurable:!0}),Object.defineProperty(te.prototype,"changeHandler",{get:function(){return this.entityManager.changeHandler},enumerable:!0,configurable:!0}),te.prototype.getList=function(){return this.dataService.getList(null,null,null,null)},te.prototype.getById=function(e){return this.dataService.getById(e)},te.prototype.updateById=function(e){return this.dataService.updateById(e)},te.prototype.create=function(e){return this.dataService.create(e)},te.prototype.append=function(e){return this.dataService.append(e)},te.prototype.appendByPath=function(e){return this.dataService.appendByPath(e)},te.prototype.removeById=function(e,t){return this.dataService.removeById(e,t)},te.prototype.removeByIds=function(e,t){return this.dataService.removeByIds(e,t)},te.prototype.removeByPath=function(e,t){return this.dataService.removeByPath(e,t)},te.prototype.updateChangesById=function(e){return this.dataService.updateChangesById(e)},te.prototype.updateChangesByPath=function(e,t){throw new Error("Not Implement")},te.prototype.updateAllChanges=function(){return this.dataService.updateAllChanges()},te.prototype.applyChanges=function(){return this.dataService.applyChanges()},te.prototype.updateDataAndVariableChanges=function(){var e={FilterConditions:[],SortConditions:[],IsUsePagination:!0,Pagination:{PageIndex:1,PageSize:1,PageCount:0,TotalCount:0}},t=JSON.stringify(e),n=this.restService.buildRequestInfo();if(this.isEmptyRequestInfo(n))return b.of(null);var r=this.restService.baseUri+"/extension/query?entityFilter="+t,o={body:n};return this.restService.invoke(r,"PUT",null,o,!1,!0,!0)},te.prototype.applyChangesById=function(e){return this.dataService.applyChangesById(e)},te.prototype.cancelChanges=function(e){return this.dataService.cancelChanges(e)},te.prototype.clearAllEntityChanges=function(){return this.entityManager.clearAllEntityChanges()},te.prototype.getDataChangeDetails=function(){return this.entityManager.buildAllEntityChangeDetails()},te.prototype.handleDataChangeDetails=function(e){return this.entityManager.handleDataChangeDetails(e)},te.prototype.getVariableChangeDetail=function(){return this.variableManager.buildChangeDetail()},te.prototype.handleVariableChangeDetail=function(e){this.variableManager.handleChangeDetail(e)},te.prototype.isEmptyRequestInfo=function(e){return!e||(!e.dataChange||e.dataChange.length<1)&&(!e.variableChange||Object.keys(e.variableChange).length<1)},te.decorators=[{type:i.Injectable}],te.ctorParameters=function(){return[]},te);function te(){return X.call(this)||this}var ne,re=(x(oe,ne=I.EntityManager),oe.prototype.buildAllEntityChangeDetails=function(){var n=this,r=[];return this.entityCollection.getAllEntities().forEach(function(e){if(0!==e.changes.length){var t=n.changeBuilder.build(e.changes);t&&t.ChangeInfo&&t.ChangeInfo.DataId&&r.push(t)}}),r},oe.prototype.buildEntityChangeDetailById=function(e){var t=this.entityCollection.getEntityById(e);return 0===t.changes.length?null:this.changeBuilder.build(t.changes)},oe.prototype.handleDataChangeDetails=function(e){this.changeHandler.handle(this.entityType,this.entityCollection,e)},oe.prototype.reset=function(){this.entityCollection.clear()},oe);function oe(e){var t=ne.call(this,e)||this;return t.changeBuilder=new p(t.entityCollection.entityType,t.entityCollection),t.changeHandler=new c,t}var ie=(ae.createEmpty=function(e,t){var n={ChangeType:e,ChangeInfo:{}};return t&&(n.ChangeInfo.DataId=t),n},ae.getChangeInfo=function(e){return!0===this.isChangeDetail(e)?e.ChangeInfo:e},ae.isChangeDetail=function(e){var t=Object.keys(e);return 2===t.length&&-1<t.indexOf("ChangeType")&&-1<t.indexOf("ChangeInfo")},ae);function ae(){}var se=(pe.prototype.handleChangeDetail=function(e){var o=this,i=e.ChangeInfo;Object.keys(i).forEach(function(e){var t=o.ngVariableMap.get(e);if(t){var n=t.mapping,r=i[e];o.innerValueMap.get(e)!==r&&(o.setValueToUIState(n,r),o.innerValueMap.set(e,r))}})},pe.prototype.buildChangeDetail=function(){var i=this,a=ie.createEmpty(S.Modify);return this.ngVariableMap.forEach(function(e,t){var n=e.mapping,r=i.getValueFromUIState(n),o=i.innerValueMap.get(t);!1===i.isValueEqual(r,o)&&(i.innerValueMap.set(t,r),i.appendToChangeInfo(a,t,r))}),0===Object.keys(a.ChangeInfo).length?null:a},pe.prototype.reset=function(){this.innerValueMap.clear()},pe.prototype.clearChanges=function(){var i=this;this.ngVariableMap.forEach(function(e,t){var n=e.mapping,r=i.getValueFromUIState(n),o=i.innerValueMap.get(t);!1===i.isValueEqual(r,o)&&i.innerValueMap.set(t,r)})},pe.prototype.appendToChangeInfo=function(e,t,n){if(!0===this.isUdtVariable(n)){var r=ie.createEmpty(S.Modify);r.ChangeInfo=n,e.ChangeInfo[t]=r}else e.ChangeInfo[t]=n},pe.prototype.getValueFromUIState=function(e){var t=this.getRootUIState(),n=e.split(".").reduce(function(e,t){return e?e[t]:null},t);return n instanceof Date?r.format(n,"yyyy-MM-dd HH:mm:ss"):n},pe.prototype.getRootUIState=function(){var e=this.appContext.frameContextManager.getRootFrameContext();if(this.injector){var t=this.injector.get(I.FrameContext,null);t&&(e=t.getVirtualRootFrameContext()||e)}if(e)return e.uiState},pe.prototype.isValueEqual=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},pe.prototype.isUdtVariable=function(e){return e&&e.constructor&&"[object Object]"===e.toString()&&e.constructor.prototype.hasOwnProperty("isPrototypeOf")},pe.prototype.setValueToUIState=function(e,t){this.getRootUIState()[e]=t},pe.ctorParameters=function(){return[{type:I.AppContext},{type:undefined},{type:i.Injector,decorators:[{type:i.Optional}]}]},pe);function pe(e,t,n){var r=this;this.appContext=e,this.ngVariables=t,this.injector=n,this.ngVariableMap=new Map,this.innerValueMap=new Map,Object.keys(t).forEach(function(e){r.ngVariableMap.set(e,t[e])})}var ue=(ce.buildRequestInfo=function(e){return{dataChange:e.entityManager.buildAllEntityChangeDetails(),variableChange:e.variableManager.buildChangeDetail()}},ce);function ce(){}var he=(ye.convertToPathArray=function(e,t){var r=this,n=I.BindingPathConverter.toBindingPathArray(e),o=[],i=t.list.currentItem;return o.push(i.primaryKeyValue),n.forEach(function(e){var t=I.PropertyUtil.getPropertyByName(i.properties,e);if(t.type!==I.BindingPropertyType.List)throw new Error(t.name+"不是子表对应的属性");var n=i[e];i=n.currentItem,o.push(r.trimTrailingS(e)),o.push(i.primaryKeyValue)}),o},ye.convertToPathUrl=function(e,t){var n=this.convertToPathArray(e,t);return n.pop(),"/"+n.join("/")},ye.convertToObjectCodes=function(e,t){for(var n=this.convertToPathArray(e,t),r=n.length,o=[],i=1;i<r;i+=2)o.push(n[i]);return o},ye.convertToDataIdsForUpdate=function(e,t){for(var n=this.convertToPathArray(e,t),r=n.length,o=[],i=0;i<r;i+=2)o.push(n[i]);return o},ye.convertToDataIdsForAdd=function(e,t){var n=this.convertToDataIdsForUpdate(e,t);return n.pop(),n},ye.convertPathToUrl=function(e){for(var t=e.split("/"),n=t.length-1;0<n;n--)t[n]&&t[n].endsWith("s")&&(t[n]=t[n].substr(0,t[n].length-1).toLowerCase());return t.join("/")},ye.trimTrailingS=function(e){return e.substr(0,e.length-1)},ye.convertPathsToNodeCodes=function(e){var t=[];return!e||e.length<1||e.filter(function(e){return!!e&&-1===e.indexOf(":")}).forEach(function(e){t.push(e)}),t},ye.convertPathsToIds=function(e){var t=[];return!e||e.length<1||e.filter(function(e){return!!e&&-1!==e.indexOf(":")}).forEach(function(e){t.push(e.split(":")[1])}),t},ye);function ye(){}var le=(Object.defineProperty(de.prototype,"restProxy",{get:function(){return this.repository.restService.proxy},enumerable:!0,configurable:!0}),de.prototype.getList=function(e,t,n,r){var p=this;0!==n&&(n=n||this.repository.entityCollection.pageSize,r=r||this.repository.entityCollection.pageIndex);var o=this.buildEntityFilter(e,t,n,r),i=this.restService.buildRequestInfo();return this.restProxy.extendQuery(o,i).pipe(d.map(function(e){var t=e.returnValue,n=t.result,r=[];n.forEach(function(e){var t=p.repository.buildEntity(e);C.appendInitialData(t,e),r.push(t)});var o=t.pagination;if(o&&0<Object.keys(o).length){var i=o.pageSize,a=o.pageIndex,s=o.totalCount;p.repository.entityCollection.updatePaginationInfoByPath("/",{pageIndex:a,pageSize:i,totalCount:s})}else p.repository.entityCollection.updatePaginationInfoByPath("/",{pageIndex:1,pageSize:0,totalCount:r.length});return p.repository.entityCollection.loadEntities(r),r}))},de.prototype.filter=function(e,t,n,r){var p=this;0!==n&&(n=n||this.repository.entityCollection.pageSize,r=r||this.repository.entityCollection.pageIndex);var o=this.buildEntityFilter(e,t,n,r),i=this.restService.buildRequestInfo();return this.restProxy.filter(o,i).pipe(d.map(function(e){var t=e.returnValue,n=t.result,r=[];n.forEach(function(e){var t=p.repository.buildEntity(e);C.appendInitialData(t,e),r.push(t)});var o=t.pagination;if(o&&0<Object.keys(o).length){var i=o.pageSize,a=o.pageIndex,s=o.totalCount;p.repository.entityCollection.updatePaginationInfoByPath("/",{pageIndex:a,pageSize:i,totalCount:s})}else p.repository.entityCollection.updatePaginationInfoByPath("/",{pageIndex:1,pageSize:0,totalCount:r.length});return p.repository.entityCollection.loadEntities(r),r}))},de.prototype.buildEntityFilter=function(e,t,n,r){return e||t||n||r?(e&&0<e.length&&(e[e.length-1].Relation=0),{FilterConditions:e,SortConditions:t,IsUsePagination:0!==n,Pagination:{PageIndex:r,PageSize:n,PageCount:0,TotalCount:0}}):null},de.prototype.getById=function(e){var r=this,t=this.restService.buildRequestInfo();return this.restService.extendRetrieve(e,t).pipe(d.map(function(e){var t=e.returnValue,n=r.repository.buildEntity(t);return r.repository.entityCollection.loadEntities([n]),n}))},de.prototype.getPagedById=function(o){var i=this,e=this.restService.buildRequestInfo(),t=this.repository.entityCollection.getPaginationConfigByPath("/"),n=this.buildChildPagination(t),r=this.buildRetrieveParam(n);return this.restService.serviceRetrieve(o,r,e).pipe(d.map(function(e){var t=e.dataResult,n=e.paginations;i.updatePagination(n);var r=i.repository.entityCollection.getEntityById(o);return i.reloadEntityData(r,t),r}))},de.prototype.queryChild=function(s,e,t,n,r){var p=this,o=this.restService.buildRequestInfo(),u=he.convertPathsToNodeCodes(s),i=u.map(function(e){return e.substring(0,e.length-1)}),a=he.convertPathsToIds(s),c=B({nodeCodes:i,ids:a,pagination:{pageIndex:e,pageSize:t}},o),h=u[u.length-1];return h=h.substring(0,h.length-1),this.restService.queryChild(c).pipe(d.map(function(e){console.log(e);var t=e.returnValue;if(!t)return null;var n=t.result,r=void 0===n?[]:n,o=t.pagination,i=void 0===o?{}:o,a=[];r.forEach(function(e){var t=new(I.FieldMetadataUtil.getNgList(p.repository.entityType)[u[u.length-1]].type)(e);C.appendInitialData(t,e),a.push(t)}),u=u.map(function(e){return e.charAt(0).toLocaleLowerCase()+e.substr(1)}),p.repository.entityCollection.resetEntities(s,a),p.repository.entityCollection.setPaginationConfigByPath("/"+h,i)}))},de.prototype.buildChildPagination=function(n){var r={};return Object.keys(n).forEach(function(e){var t=n[e];"object"==typeof t&&(r[e]=t)}),r},de.prototype.updatePagination=function(t){var n=this;t&&Object.keys(t).forEach(function(e){n.repository.entityCollection.setPaginationConfigByPath("/"+e,t[e])})},de.prototype.buildRetrieveParam=function(r){var e={};if(r&&0<Object.keys(r).length){var o=[];Object.keys(r).forEach(function(e){var t=r[e],n={};n[e]={pagination:{pageSize:t.pageSize||0,pageIndex:1}},o.push(n)}),e.filters=o}return e},de.prototype.editById=function(r){var o=this;if(!this.repository.entityCollection.getEntityById(r))return b.of(null);var e=ue.buildRequestInfo(this.repository);return this.restProxy.edit(r,e).pipe(d.map(function(e){var t=e.returnValue.data,n=o.repository.entityCollection.getEntityById(r);return n&&t&&o.reloadEntityData(n,t),n}))},de.prototype.updateById=function(r){var o=this;if(!this.repository.entityCollection.getEntityById(r))return b.of(null);var e=this.restService.buildRequestInfo();return this.restService.extendRetrieve(r,e).pipe(d.map(function(e){var t=e.returnValue,n=o.repository.entityCollection.getEntityById(r);return o.reloadEntityData(n,t),n}))},de.prototype.reloadEntityData=function(e,t){e&&(this.appContext.changeDetectionController.detach(),this.repository.entityCollection.updateEntity(e,t),e.changes.splice(0,e.changes.length),this.appContext.changeDetectionController.reattach())},de.prototype.create=function(e){var r=this,t=this.restService.buildRequestInfo();return this.restService.create(e,t).pipe(d.map(function(e){var t=e.returnValue,n=r.repository.buildEntity(t);return C.appendInitialData(n,t),r.repository.entityCollection.loadEntities([n]),n}))},de.prototype.append=function(e){var r=this,t=this.restService.buildRequestInfo();return this.restService.create(e,t).pipe(d.map(function(e){var t=e.returnValue,n=r.repository.buildEntity(t);return r.repository.entityCollection.addEntity(n),n}))},de.prototype.insert=function(r,e){var o=this,t=this.buildRequestInfo();return this.restProxy.create(e,t).pipe(d.map(function(e){var t=e.returnValue,n=o.repository.buildEntity(t);return o.repository.entityCollection.insertEntity(n,r),n}))},de.prototype.appendByPath=function(n){var r=this,e=this.restService.buildRequestInfo();return this.restService.createByPath(n,e).pipe(d.map(function(e){var t=e.returnValue;return r.repository.entityManager.appendEntityByPath(n,t,t)}))},de.prototype.insertByPath=function(n,r){var o=this,e=this.buildRequestInfo();return this.restProxy.createByPath(n,e).pipe(d.map(function(e){var t=e.returnValue;return o.repository.entityManager.insertEntityByPath(n,t,t,r)}))},de.prototype.removeById=function(e,t){var n=this;t=t===undefined||t;var r=ue.buildRequestInfo(this.repository);return t?this.restProxy.deleteAndSave(e,r).pipe(d.switchMap(function(){return n.repository.entityCollection.removeEntityById(e),b.of(!0)})):this.restService.extendDelete(e,r).pipe(d.switchMap(function(){return n.repository.entityCollection.removeEntityById(e),n.repository.dataChangeHistory.addChange({dataId:e,changeType:I.DataChangeType.Delete}),b.of(!0)}))},de.prototype.removeAndSaveById=function(e){var t=this,n=ue.buildRequestInfo(this.repository);return this.restProxy.deleteAndSave(e,n).pipe(d.switchMap(function(){return t.repository.entityCollection.removeEntityById(e),b.of(!0)}))},de.prototype.removeByIds=function(n,e){var r=this;e=e===undefined||e;var t=this.restService.buildRequestInfo();return this.restService.extendBatchDelete(n,t).pipe(d.switchMap(function(){if(e)return r.applyChangesByIdArray(n).pipe(d.tap(function(e){e&&r.repository.entityCollection.removeEntities(function(e){return r.checkEntityValueExists(e,n)})}));if(r.repository.entityCollection.removeEntities(function(e){return r.checkEntityValueExists(e,n)}),n&&0<n.length){var t=[];n.forEach(function(e){t.push({dataId:e,changeType:I.DataChangeType.Delete})}),r.repository.dataChangeHistory.addChanges(t)}return b.of(!0)}))},de.prototype.checkEntityValueExists=function(e,t){for(var n=!1,r=0;r<t.length;r++)if(e.primaryValue===t[r]){n=!0;break}return n},de.prototype.removeByPath=function(e,t){var n=this,r=this.restService.buildRequestInfo();return this.restService.extendDeletByPath(e,t,r).pipe(d.map(function(){return n.repository.entityManager.removeEntityByPath(e,t),n.repository.dataChangeHistory.addChange({fpath:e,dataId:t,changeType:I.DataChangeType.Delete}),!0}))},de.prototype.batchRemoveByPath=function(t,n){var r=this,e=this.restService.buildRequestInfo();return this.restService.batchDeleteByPath(t,n,e).pipe(d.map(function(){var e=n.split(",");return 0<e.length&&e.forEach(function(e){r.repository.entityManager.removeEntityByPath(t,e),r.repository.dataChangeHistory.addChange({fPath:t,dataId:e,changeType:I.DataChangeType.Delete})}),!0}))},de.prototype.updateChangesById=function(e){var t=this,n=this.repository.entityCollection.getEntityById(e);if(!n.changes)return b.of(!0);if(0===n.changes.length)return b.of(!0);var r=this.repository.entityManager.buildEntityChangeDetailById(e),o=this.restService.buildRequestInfo();return this.restService.update(r,o).pipe(d.tap(function(){t.repository.entityManager.clearEntityChangesById(e)}),d.map(function(){return!0}))},de.prototype.updateChangesByPath=function(e,t){throw new Error("Not Implement")},de.prototype.updateAllChanges=function(){var n=this,r=[],e=this.repository.entityCollection.toArray();return 0===e.length?b.of(!0):(e.forEach(function(e){var t=n.updateChangesById(e.primaryValue);r.push(t)}),b.zip.apply(void 0,D(r)).pipe(d.map(function(){return!0})))},de.prototype.applyChanges=function(){var e=this,t=this.restService.buildRequestInfo();return this.restService.save(t).pipe(d.tap(function(){e.repository.entityManager.clearAllEntityChanges(),e.repository.dataChangeHistory.clear()}),d.map(function(){return!0}))},de.prototype.applyChangesByIdArray=function(e){var t=this,n=this.restService.buildRequestInfo();return this.restService.save(n).pipe(d.tap(function(){t.repository.entityManager.clearEntityChangesByArray(e),t.repository.dataChangeHistory.clearByIds(e)}),d.map(function(){return!0}))},de.prototype.applyChangesById=function(e){var t=this,n=this.restService.buildRequestInfo();return this.restService.save(n).pipe(d.tap(function(){t.repository.entityManager.clearEntityChangesById(e),t.repository.dataChangeHistory.clearByIds([e])}),d.map(function(){return!0}))},de.prototype.cancelChanges=function(e){var t=this;return this.restService.cancel(e).pipe(d.tap(function(){t.repository.entityManager.clearAllEntityChanges(),t.repository.dataChangeHistory.clear()}),d.map(function(){return!0}))},de.prototype.batchAppendByPath=function(o,e){var i=this,t=this.buildRequestInfo();return this.restProxy.batchAppendByPath(o,e,t).pipe(d.map(function(e){var t=e.returnValue,n=i.repository.entityManager.createEntitiesByPath(o,t),r=o.split("/").filter(function(e){return e});return i.repository.entityManager.appendEntitiesByPath(r,n),n}))},de.prototype.batchAppend=function(e){var r=this,t=this.buildRequestInfo();return this.restProxy.batchAppend(e,t).pipe(d.map(function(e){var t=e.returnValue,n=r.repository.buildEntities(t);return r.repository.entityCollection.addEntities(n),n}))},de.prototype.buildRequestInfo=function(){return{dataChange:this.repository.entityManager.buildAllEntityChangeDetails(),variableChange:this.repository.variableManager.buildChangeDetail()}},de);function de(e,t){this.injector=e,this.repository=t;var n=e.get(f),r=e.get(h.HttpClient),o=e.get(y)+"/"+this.repository.apiUri,i=e.get(I.EventBus);this.restService=new Oe(r,o,n,this.repository,i),this.appContext=e.get(I.AppContext)}var fe=(ge.handleMessage=function(e,t,n){var r={ns:t.get(I.NAMESPACE,null),appContext:t.get(I.AppContext,null)},o=this.buildBackEndMessages(e),i=new I.BackEndMessage.Message(o,r),a=t.get(I.BACK_END_MESSAGE_HANDLER_TOKEN,null);a&&a.handle(i,n)},ge.isBackEndMessageHandlerExist=function(e){return!!e.get(I.BACK_END_MESSAGE_HANDLER_TOKEN,null)},ge.getFormlessMessages=function(e){return(this.buildBackEndMessages(e)||[]).filter(function(e){return!e.location||!e.location.columns||e.location.columns.length<1||!e.location.nodeCode})},ge.buildBackEndMessages=function(e){if(!e||e.length<1||!Array.isArray(e))return null;var n=[];return e.forEach(function(e){var t={level:e.level,message:e.message};e.hasOwnProperty("location")&&e.location&&(t.location={nodeCode:e.location.nodeCode,rows:e.location.dataIds,columns:e.location.columnNames}),n.push(t)}),n},ge);function ge(){}var ve=(Ie.getSessionId=function(e,t){var n=e.ApplicationId+"_"+t.beBaseUri;return this.createSessionHistory.includes(n)?b.of(null):(this.createSessionHistory.push(n),t.getBeSessionId())},Ie.createSessionHistory=[],Ie.decorators=[{type:i.Injectable}],Ie);function Ie(){}var Se=(be.prototype.onResponse=function(e,t){e&&e.innerDataChange&&!0!==t&&this.context.handleDataChangeDetails(e.innerDataChange),e&&e.innerVariableChange&&this.context.handleVariableChangeDetail(e.innerVariableChange);var n=A.parseBackEndMessage(e);return fe.handleMessage(n,this.context.getInjector()),this.context.clearAllEntityChanges(),e&&e.hasOwnProperty("returnValue")?e.returnValue:e},be.prototype.onError=function(e,t,n){var r,o,i=this.context.appContext.getFormAppContext(),a=i.ApplicationId,s=window.DEVKIT_LOADING_SERVICE,p=A.parseBackEndError(e);if(fe.handleMessage(p,this.context.getInjector()),s&&s instanceof Array&&0<s.length)try{for(var u=P(s),c=u.next();!c.done;c=u.next()){var h=c.value;"function"==typeof h.clearAll&&h.clearAll()}}catch(S){r={error:S}}finally{try{c&&!c.done&&(o=u["return"])&&o.call(u)}finally{if(r)throw r.error}}if(t)return b.throwError(e);var y=this.context.restService.eventBus,l=!!(window[a]||{}).isExceptionHandlerExist,d=A.parseBackEndError(e),f=fe.getFormlessMessages(d),g=f&&0<f.length||!1,v=!(e&&e.error&&e.error.extensionMessage&&fe.isBackEndMessageHandlerExist(this.context.getInjector())&&!g),I=!!y&&l&&v;return fe.handleMessage(d,this.context.getInjector(),{hasThrowError:I,isException:!0,eventBus:y,error:e,formAppContext:i}),y&&l&&!A.isReported401Error(e)?(v&&y.post("Exception","","onException",e,i),n?b.of(null):b.EMPTY):b.throwError(e)},be.prototype.extendHeaders=function(t,n){var r=this,e=this.context.appContext.getFormAppContext();return ve.getSessionId(e,this.context.restService.sessionService).pipe(d.switchMap(function(e){return t=r.context.restService.sessionService.extendRequestHeaders(t,n),b.of(t)}))},be.prototype.extendUrl=function(e,t){if(!t)return e;for(var n in t)if(t.hasOwnProperty(n)){var r=JSON.stringify(t[n]);e=-1===e.indexOf("?")?e+"?"+n+"="+r:e+"&"+n+"="+r}return e},be.prototype.extendBody=function(t){var n=this;return!t||"object"!=typeof t||Object.keys(t).length<1||(Object.keys(t).forEach(function(e){"requestInfo"===e&&(t.requestInfo=n.context.restService.buildRequestInfo())}),1===Object.keys(t).length&&(t=Object.values(t)[0])),t},be.prototype.parseHeaders=function(e){var t="BEFSessionID";e.headers&&e.headers.has(t)&&this.context.restService.sessionService.setBeSessionId(e.headers.get(t))},be);function be(e){this.context=e}var Ce,me=(x(Ee,Ce=ee),Object.defineProperty(Ee.prototype,"proxy",{get:function(){return this.befProxy},set:function(e){this.befProxy=e,this.befProxy.setProxyExtend(new Se(this))},enumerable:!0,configurable:!0}),Ee.prototype.getEntities=function(e,t,n,r){return this.dataService.getList(e,t,n,r)},Ee.prototype.filter=function(e,t,n,r){return void 0===e&&(e=[]),void 0===t&&(t=[]),this.dataService.filter(e,t,n,r)},Ee.prototype.getPagedById=function(e){return this.dataService.getPagedById(e)},Ee.prototype.queryChild=function(e,t,n,r,o){return this.dataService.queryChild(e,t,n,r,o)},Ee.prototype.getEntityById=function(e){return this.dataService.getById(e)},Ee.prototype.updateEntityById=function(e){return this.dataService.updateById(e)},Ee.prototype.editEntityById=function(e){return this.dataService.editById(e)},Ee.prototype.createEntity=function(e){return this.dataService.create(e)},Ee.prototype.appendEntity=function(e){return this.dataService.append(e)},Ee.prototype.insert=function(e,t){return this.dataService.insert(e,t)},Ee.prototype.insertByPath=function(e,t){return this.dataService.insertByPath(e,t)},Ee.prototype.appendEntityByPath=function(e){return this.dataService.appendByPath(e)},Ee.prototype.removeEntityById=function(e,t){return this.dataService.removeById(e,t)},Ee.prototype.removeEntityAndSaveById=function(e){return this.dataService.removeAndSaveById(e)},Ee.prototype.removeEntityByPath=function(e,t){return this.dataService.removeByPath(e,t)},Ee.prototype.batchRemoveByPath=function(e,t){return this.dataService.batchRemoveByPath(e,t)},Ee.prototype.saveEntityById=function(e){return this.dataService.applyChangesById(e)},Ee.prototype.saveEntities=function(){return this.dataService.applyChanges()},Ee.prototype.cancelEntityChanges=function(){return this.dataService.cancelChanges()},Ee.prototype.batchAppendByPath=function(e,t){return this.dataService.batchAppendByPath(e,t)},Ee.prototype.batchAppend=function(e){return this.dataService.batchAppend(e)},Ee.prototype.reset=function(){this.entityManager.reset(),this.variableManager.reset(),this.restService.sessionService.clearBeSessionId()},Ee.prototype.getInjector=function(){return this.injector},Ee.prototype.clearAllVariableChanges=function(){},Ee.decorators=[{type:i.Injectable}],Ee.ctorParameters=function(){return[{type:i.Injector}]},Ee);function Ee(e){var t=Ce.call(this)||this;t.injector=e,t.entityCollection&&(t.entityManager=new re(t.entityCollection)),t.appContext=t.injector.get(I.AppContext);var n=I.MetadataUtil.getPropsMetadatasByName(t.constructor,Z);return t.variableManager=new se(t.appContext,n,t.injector),t.dataService=new le(t.injector,t),t.serverUri=e.get(y),t}var xe=(Be.prototype.extendUri=function(e){return this.serverUri+"/"+e},Be.decorators=[{type:i.Injectable}],Be.ctorParameters=function(){return[{type:String,decorators:[{type:i.Inject,args:[y]}]}]},Be);function Be(e){this.serverUri=e}var Pe="DELETE",Re="PUT",De="POST",we=(qe.prototype.setBaseUri=function(e){this.baseUri=e},qe.prototype.setProxyExtend=function(e){this.proxyExtend=e},qe.prototype.query=function(e){var t=this.baseUri;return e&&(t=t+"?entityFilter="+JSON.stringify(e)),this.request(t,"GET")},qe.prototype.extendQuery=function(e,t){var n=this.baseUri+"/extension/query";if(e){var r=JSON.stringify(e);n=n+"?entityFilter="+(r=I.encodeUrl(r))}var o=t,i=this.addBodyToOptions({},o);return this.request(n,Re,null,i,!1)},qe.prototype.filter=function(e,t){var n=this.baseUri+"/extension/filter",r={requestInfo:t};e&&(r={entityFilter:e,requestInfo:t});var o=this.addBodyToOptions({},r);return this.request(n,De,null,o,!1)},qe.prototype.retrieve=function(e){var t=this.baseUri+"/"+e;return this.request(t,"GET")},qe.prototype.serviceRetrieve=function(e,t,n){var r=this.baseUri+"/service/retrieve/"+e,o={body:{retrieveParam:t,requestInfo:n}};return this.request(r,Re,null,o)},qe.prototype.queryChild=function(e){var t=this.baseUri+"/service/querychild",n={body:e};return this.request(t,Re,null,n)},qe.prototype.extendRetrieve=function(e,t){var n=this.baseUri+"/extension/retrieve/"+e,r=t,o=this.addBodyToOptions({},r);return this.request(n,Re,null,o)},qe.prototype.edit=function(e,t){var n=this.baseUri+"/service/edit/"+e,r=t,o=this.addBodyToOptions({},r);return this.request(n,Re,null,o)},qe.prototype.create=function(e,t){var n={defaultValue:e,requestInfo:t},r=this.addBodyToOptions({},n);return this.request(this.baseUri,De,null,r)},qe.prototype.createByPath=function(e,t){var n=he.convertPathToUrl(e),r=""+this.baseUri+n,o=t,i=this.addBodyToOptions({},o);return this.request(r,De,null,i)},qe.prototype.update=function(e,t){var n={changeDetail:e,requestInfo:t},r=this.addBodyToOptions({},n);return this.request(this.baseUri,"PATCH",null,r)},qe.prototype.save=function(e){var t=e,n=this.addBodyToOptions({},t);return this.request(this.baseUri,Re,null,n)},qe.prototype["delete"]=function(e){var t=this.baseUri+"/"+e;return this.request(t,Pe)},qe.prototype.deleteAndSave=function(e,t){var n=this.baseUri+"/service/delete/"+e,r=t,o=this.addBodyToOptions({},r);return this.request(n,Re,null,o)},qe.prototype.extendDelete=function(e,t){var n=this.baseUri+"/extension/delete/"+e,r=t,o=this.addBodyToOptions({},r);return this.request(n,Re,null,o)},qe.prototype.deletByPath=function(e,t){var n=he.convertPathToUrl(e),r=""+this.baseUri+n+"/"+t;return this.request(r,Pe)},qe.prototype.extendDeletByPath=function(e,t,n){var r=he.convertPathToUrl(e),o=this.baseUri+"/extension"+r+"/"+t,i=n,a=this.addBodyToOptions({},i);return this.request(o,Re,null,a)},qe.prototype.batchDeleteByPath=function(e,t,n){var r=he.convertPathToUrl(e);if(r.split("/").length<3)throw Error("根据path删除实体数据出错了。传入的path["+e+"]格式不对");var o=this.baseUri+"/extension"+r+"/batch",i={ids:t.split(","),requestInfo:n},a=this.addBodyToOptions({},i);return this.request(o,Re,null,a)},qe.prototype.batchDelete=function(e){var t={ids:e.join(",")};return this.request(this.baseUri,Pe,t)},qe.prototype.extendBatchDelete=function(e,t){var n=this.baseUri+"/extension/batchdelete",r={ids:e.join(",")},o=t,i=this.addBodyToOptions({},o);return this.request(n,Re,r,i)},qe.prototype.cancel=function(e){var t=this.baseUri+"/service/cancel";return this.request(t,De,null,null,!1,!1,!1,e)},qe.prototype.batchAppendByPath=function(e,t,n){var r=he.convertPathToUrl(e),o=""+this.baseUri+r+"/batch",i={requestInfo:n,retrieveDefaultParam:{defaultValues:t}},a=this.addBodyToOptions({},i);return this.request(o,De,null,a)},qe.prototype.batchAppend=function(e,t){var n=this.baseUri+"/batch",r={requestInfo:t,retrieveDefaultParam:{defaultValues:e}},o=this.addBodyToOptions({},r);return this.request(n,De,null,o)},qe.prototype.request=function(t,n,e,r,o,i,a,s){var p=this;r=r||{},void 0!==o&&"boolean"==typeof o||(o=!1),void 0!==i&&"boolean"==typeof i||(i=!1),e&&(r.params=e),r.headers=w.convertToHeaders(r.headers);var u=this.hasRequestInfo(r);return r&&r.body&&r.body.hasOwnProperty("RequestInfo")&&(r.body.requestInfo=r.body.RequestInfo,delete r.body.RequestInfo),this.proxyExtend.extendHeaders(r.headers,s).pipe(d.switchMap(function(e){return r.headers=w.toJson(e),r.observe="response",p.httpService.request(n,t,r)}),d.tap(function(e){return p.proxyExtend.parseHeaders(e)}),d.map(function(e){return e.body}),d.map(function(e){return u?(p.proxyExtend.onResponse(e,a),e):p.unWrapResponseInfo(e)}),d.catchError(function(e){return p.proxyExtend.onError(e,o,i)}))},qe.prototype.invoke=function(t,n,r){var o=this;return r.params&&(t=this.proxyExtend.extendUrl(t,r.params),r.params=null),r.body&&(r.body=this.proxyExtend.extendBody(r.body)),r.headers=w.convertToHeaders(r.headers),this.proxyExtend.extendHeaders(r.headers).pipe(d.switchMap(function(e){return r.headers=w.toJson(e),r.observe="response",o.httpService.request(n,t,r).pipe(d.tap(function(e){return o.proxyExtend.parseHeaders(e)}),d.map(function(e){return e.body}),d.map(function(e){return o.proxyExtend.onResponse(e)}),d.catchError(function(e){return o.proxyExtend.onError(e,!1,!1)}))}))},qe.prototype.addBodyToOptions=function(e,t){return e=e||{},Object.assign(e,{body:t})},qe.prototype.buildParams=function(e){return O.buildParams(e)},qe.prototype.hasRequestInfo=function(e){return T.hasRequestInfo(e)||T.hasRequestInfoWithR(e)},qe.prototype.unWrapResponseInfo=function(e){return A.unWrapResponseInfo(e)},qe.decorators=[{type:i.Injectable}],qe.ctorParameters=function(){return[{type:h.HttpClient},{type:xe}]},qe);function qe(e,t){this.httpClient=e,this.uriService=t,this.httpService=new V(this.httpClient)}var Oe=(Object.defineProperty(Me.prototype,"proxy",{get:function(){return this.repository.proxy?this.repository.proxy:this.createBefProxy()},enumerable:!0,configurable:!0}),Me.prototype.createBefProxy=function(){var e=this.repository.serverUri,t=new xe(e),n=new we(this.httpClient,t);n.setBaseUri(this.baseUri);var r=new Se(this.repository);return n.setProxyExtend(r),n},Me.prototype.query=function(e){return this.proxy.query(e)},Me.prototype.extendQuery=function(e,t){return this.proxy.extendQuery(e,t)},Me.prototype.serviceRetrieve=function(e,t,n){return this.proxy.serviceRetrieve(e,t,n)},Me.prototype.queryChild=function(e){return this.proxy.queryChild(e)},Me.prototype.retrieve=function(e){return this.proxy.retrieve(e)},Me.prototype.extendRetrieve=function(e,t){return this.proxy.extendRetrieve(e,t)},Me.prototype.create=function(e,t){return this.proxy.create(e,t)},Me.prototype.createByPath=function(e,t){return this.proxy.createByPath(e,t)},Me.prototype.update=function(e,t){return this.proxy.update(e,t)},Me.prototype.save=function(e){return this.proxy.save(e)},Me.prototype["delete"]=function(e){return this.proxy["delete"](e)},Me.prototype.extendDelete=function(e,t){return this.proxy.extendDelete(e,t)},Me.prototype.deletByPath=function(e,t){return this.proxy.deletByPath(e,t)},Me.prototype.extendDeletByPath=function(e,t,n){return this.proxy.extendDeletByPath(e,t,n)},Me.prototype.batchDeleteByPath=function(e,t,n){return this.proxy.batchDeleteByPath(e,t,n)},Me.prototype.batchDelete=function(e){return this.proxy.batchDelete(e)},Me.prototype.extendBatchDelete=function(e,t){return this.proxy.extendBatchDelete(e,t)},Me.prototype.cancel=function(e){return this.proxy.cancel(e)},Me.prototype.request=function(e,t,n,r,o,i,a){return this.innerRequest(e,t,n,r,o,i,a,!1)},Me.prototype.invoke=function(e,t,n,r,o,i,a){if(r&&r.body&&r.body.RequestInfo)throw new Error("请使用requestInfo提交变更");return this.innerRequest(e,t,n,r,o,i,a,!0)},Me.prototype.innerRequest=function(t,n,e,r,o,i,a,s){var p=this;r=r||{};var u="BEFSessionID";void 0!==o&&"boolean"==typeof o||(o=!1),void 0!==i&&"boolean"==typeof i||(i=!1),void 0!==s&&"boolean"==typeof s||(s=!1);var c=s?this.existRequestInfo:this.hasRequestInfo;e&&(r.params=e);var h=c(r),y=w.convertToHeaders(r.headers),l=this.repository.appContext.getFormAppContext();return ve.getSessionId(l,this.sessionService).pipe(d.switchMap(function(e){return y=p.sessionService.extendRequestHeaders(y),r.headers=w.toJson(y),r.observe="response",p.httpService.request(n,t,r)}),d.tap(function(e){e.headers&&e.headers.has(u)&&p.sessionService.setBeSessionId(e.headers.get(u))}),d.map(function(e){return e.body}),d.map(function(e){var t=A.parseBackEndMessage(e);return fe.handleMessage(t,p.repository.getInjector()),p.handleReponseInfo(e,h,a)}),d.catchError(function(e){return p.handleErrors(e,o,i)}))},Me.prototype.handleReponseInfo=function(e,t,n){return t?(e&&e.innerDataChange&&!0!==n&&this.repository.handleDataChangeDetails(e.innerDataChange),e&&e.innerVariableChange&&this.repository.handleVariableChangeDetail(e.innerVariableChange),this.repository.clearAllEntityChanges(),e):this.unWrapResponseInfo(e)},Me.prototype.handleErrors=function(e,t,n){if(this.clearLoading(),t)return b.throwError(e);var r=this.repository.appContext.getFormAppContext(),o=r.ApplicationId,i=window[o]||{},a=A.parseBackEndError(e),s=fe.getFormlessMessages(a),p=!!i.isExceptionHandlerExist,u=s&&0<s.length||!1,c=!(e&&e.error&&e.error.extensionMessage&&fe.isBackEndMessageHandlerExist(this.repository.getInjector())&&!u),h=!!this.eventBus&&p&&c;return fe.handleMessage(a,this.repository.getInjector(),{hasThrowError:h,isException:!0,eventBus:this.eventBus,error:e,formAppContext:r}),this.eventBus&&p&&!A.isReported401Error(e)?(c&&this.eventBus.post("Exception","","onException",e,r),n?b.of(null):b.EMPTY):b.throwError(e)},Me.prototype.clearLoading=function(){var e,t;if(!1!==(window.DEVKIT_LOADING_SERVICE&&window.DEVKIT_LOADING_SERVICE instanceof Array&&0<window.DEVKIT_LOADING_SERVICE.length||!1)){var n=window.DEVKIT_LOADING_SERVICE;try{for(var r=P(n),o=r.next();!o.done;o=r.next()){var i=o.value;"function"==typeof i.clearAll&&i.clearAll()}}catch(a){e={error:a}}finally{try{o&&!o.done&&(t=r["return"])&&t.call(r)}finally{if(e)throw e.error}}}},Me.prototype.unWrapResponseInfo=function(e){return A.unWrapResponseInfo(e)},Me.prototype.hasRequestInfo=function(e){return T.hasRequestInfoWithR(e)},Me.prototype.existRequestInfo=function(e){return T.hasRequestInfo(e)},Me.prototype.buildParams=function(e){return O.buildParams(e)},Me.prototype.buildBodyWithRequestInfo=function(e){return T.buildBodyWithRequestInfo(e,this.repository)},Me.prototype.buildRequestInfo=function(){return T.buildRequestInfo(this.repository)},Me.decorators=[{type:i.Injectable}],Me.ctorParameters=function(){return[{type:h.HttpClient},{type:String},{type:f},{type:me},{type:I.EventBus}]},Me);function Me(e,t,n,r,o){this.httpClient=e,this.httpService=new V(this.httpClient),this.baseUri=t;var i=r.getInjector();this.sessionService=new Q(e,t,n,i),this.repository=r,this.eventBus=o}var Te=(je.prototype.getData=function(e,t){var n=e.split(".")[0],r=e.split(".")[1];return t=t||{},!0===this.ifEnableExtendLoadMethod(e)?this.extendGetHelpData(r,n,t):this.getHelpData(r,n,t)},je.prototype.saveUserSettings=function(e){return this.befRepository.restService.invoke("/api/runtime/bcc/v1.0/datagrid/settings","POST",null,{body:e},!1)},je.prototype.getUserSettings=function(e){var t="/api/runtime/bcc/v1.0/datagrid/settings/"+e;return this.befRepository.restService.invoke(t,"GET",null,null,!1)},je.prototype.ifEnableExtendLoadMethod=function(e){if(this.context&&this.context.hasOwnProperty("enableExtendLoadMethod"))return this.context.enableExtendLoadMethod;var t=!1;if(this.frameContext){var n=e+"@"+this.frameContext.repository.apiUri;t=this.frameContext.getParam(n)}return t},je.prototype.getHelpData=function(e,t,n){var r=this,o=this.befRepository.restService.baseUri+"/elementhelps/"+e;return this.befRepository.updateDataAndVariableChanges().pipe(d.switchMap(function(){return r.befRepository.restService.invoke(o,"GET",{nodeCode:t,queryParam:JSON.stringify(n)},null,!1)}))},je.prototype.extendGetHelpData=function(e,t,n){var r=this.befRepository.restService.baseUri+"/extension/elementhelps",o={body:{labelId:e,nodeCode:t,queryParam:n,requestInfo:this.befRepository.restService.buildRequestInfo()}};return this.befRepository.restService.invoke(r,"PUT",null,o,!1,!0,!0).pipe(d.map(function(e){return e&&e.returnValue||null}))},je.prototype.convert2TreeDataWithPathCode=function(r,t,n){var o=this;void 0===t&&(t=1),void 0===n&&(n="01");var e=r.filter(function(e){return e.layer===t&&e.pathcode===n});if(1<t&&(e=r.filter(function(e){return e.layer===t&&e.pathcode.substr(0,2*(t-1))===n})),e.length){var i=e.map(function(e){return{data:e,children:[]}});return i.forEach(function(e){var t,n=o.convert2TreeDataWithPathCode(r,e.data.layer+1,e.data.pathcode);(t=e.children).push.apply(t,D(n))}),i}},je.decorators=[{type:i.Injectable}],je.ctorParameters=function(){return[{type:I.Repository},{type:I.FrameContext,decorators:[{type:i.Optional}]}]},je);function je(e,t){this.frameContext=t,this.befRepository=e}var Ae=(Ue.prototype.createSession=function(e){var t=this.sessionService.getUserSessionId();return t?this.befRepository.restService.invoke(e,"POST",null,{headers:new h.HttpHeaders({SessionId:t}),responseType:"text"},!1).pipe(d.switchMap(function(e){return b.of({status:!0,payload:e})})):b.of({status:!1,payload:"用户登录信息已过期,请重新登录"})},Ue.prototype.getData=function(e,t){var n=this,r={};t.condition&&(r=t.condition),"/"===e[e.length-1]&&(e=e.substr(0,e.length-1));var o=e+"/extension/query",i=e+"/service/createsession";if(r){var a=JSON.stringify(r);o=o+"?entityFilter="+a}return this.createSession(i).pipe(d.switchMap(function(e){if(e.status)return e.payload,n.befRepository.restService.invoke(o,"PUT",null,{},!1);throw new Error(e.payload)}),s.map(function(e){var t=e.returnValue,n={items:t.result};return t.pagination?Object.assign({},n,{total:t.pagination.totalCount,pageInfo:{pageSize:t.pagination.pageSize,pageIndex:t.pagination.pageIndex,enablePager:!0}}):n}))},Ue.decorators=[{type:i.Injectable}],Ue.ctorParameters=function(){return[{type:I.Repository},{type:f}]},Ue);function Ue(e,t){this.sessionService=t,this.befRepository=e}var Ve=(He.isExistUnsaveData=function(e){var t=!1;if(!e||!e.entityCollection)throw"Current Object is null or it's entityCollection is null.";var n=e.entityCollection.toArray();if(e.dataChangeHistory.isChanged())return!0;for(var r=0;r<n.length;r++)if(0<n[r].changes.length){t=!0;break}return t},He);function He(){}var ke=(Fe.prototype.toString=function(){return this.url},Fe);function Fe(e,t){void 0===t&&(t=null);var n=this;this.url=e,this.paths=t,this.paths&&Object.keys(t).forEach(function(e){-1!==n.url.indexOf("{"+e+"}")&&(n.url=n.url.replace("{"+e+"}",""+t[e]))})}var Ne=(_e.prototype.getData=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n="GET");var r=new h.HttpHeaders({"content-type":"application/json"});return"get"!==n.toLowerCase()?this.befRest.restService.invoke(e,n,null,{headers:r,body:t}):this.befRest.restService.invoke(e,n,t,{headers:r})},_e.decorators=[{type:i.Injectable}],_e.ctorParameters=function(){return[{type:I.Repository}]},_e);function _e(e){this.befRest=e}var Le=(Ke.prototype.getData=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n="GET");var r=new h.HttpHeaders({"content-type":"application/json"});return this.befRest.restService.invoke(e,n,t,{headers:r})},Ke.decorators=[{type:i.Injectable}],Ke.ctorParameters=function(){return[{type:I.Repository}]},Ke);function Ke(e){this.befRest=e}var Ge,Je=(x(ze,Ge=me),ze.prototype.batchAppend=function(e){throw new Error("Method not implemented.")},ze);function ze(e,t,n,r,o){var i=Ge.call(this,e)||this;i.name=t,i.entityType=n,i.serverUri=r,i.apiUri=o,i.apiUri=o;var a={};a[n.typeName]={pageSize:20},i.paginationInfo=a,i.entityTypeInfo=new I.DataTypeInfo(i.entityType),i.entityCollection=new I.EntityCollection(i.entityType),i.entityManager=new re(i.entityCollection);var s=e.get(h.HttpClient),p=new xe(r),u=new we(s,p),c=p.extendUri(o);return u.setBaseUri(c),i.dataService=new le(e,i),i.serverUri=e.get(y),i}var We,Qe=(x(Ye,We=me),Ye.prototype.batchAppend=function(e){throw new Error("Method not implemented.")},Ye);function Ye(e,t){var n=We.call(this,e)||this;n.schema=t;var r=new I.EntityTypeFactory;return n.entityType=r.create(t),n.entityTypeInfo=new I.DataTypeInfo(n.entityType),n.entityCollection=new I.EntityCollection(n.entityType),n.entityManager=new re(n.entityCollection),n}e.VERSION="ver.",e.ChangeDetailType=S,e.BE_SERVER_URI_TOKEN=y,e.BE_SESSION_HANDLING_STRATEGY_TOKEN=a,e.BefChangeBuilder=p,e.BefChangeHandler=c,e.BefSessionService=Q,e.BefRestService=Oe,e.BefProxy=we,e.BefLookupRestService=Te,e.BefLookupDefaultService=Ae,e.BefRepository=me,e.FrameworkSessionService=f,e.NG_VARIABLE=Z,e.NgVariable=$,e.BefRepositoryUtil=Ve,e.BefDataPathUtil=he,e.UriService=xe,e.Uri=ke,e.DefaultComboHttpService=Ne,e.DefaultDynamiControlGroupHttpService=Le,e.BefEntityManager=re,e.DynamicBefRepository=Je,e.PresetBefRepository=Qe,e.ɵa=ee,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@ecp-caf/caf-common"),require("date-fns"),require("rxjs"),require("rxjs/operators"),require("rxjs/operators/map"),require("@angular/core"),require("@angular/common/http"),require("@farris/devkit")):"function"==typeof define&&define.amd?define("@farris/bef",["exports","@ecp-caf/caf-common","date-fns","rxjs","rxjs/operators","rxjs/operators/map","@angular/core","@angular/common/http","@farris/devkit"],t):t((e.farris=e.farris||{},e.farris.bef={}),e.cafCommon,e.dateFns,e.rxjs,e.rxjs.operators,e.rxjs["operators/map"],e.ng.core,e.ng.common.http,e.devkit)}(this,function(e,t,r,b,d,s,i,h,I){"use strict";var S=(n.Added="Added",n.Modify="Modify",n.Deleted="Deleted",n);function n(){}var y=new i.InjectionToken("@farris/be BE_SERVER_URL"),a=new i.InjectionToken("@farris/be BE_SESSION_HANDLING_STRATEGY_TOKEN"),C=(o.getPropInfo=function(e,t){var n,r,o,i=I.FieldMetadataUtil.getNgFields(e);Object.keys(i).forEach(function(e){e===t&&(n="NgField",r=null,o=i[e])});var a=I.FieldMetadataUtil.getNgObjects(e);Object.keys(a).forEach(function(e){e===t&&(n="NgObject",r=a[e].type,o=a[e])});var s=I.FieldMetadataUtil.getNgList(e);Object.keys(s).forEach(function(e){e===t&&(n="NgList",r=s[e].type,o=s[e])});var p=I.FieldMetadataUtil.getNgDynamic(e);return Object.keys(p).forEach(function(e){e===t&&(n="NgDynamic",r=p[e].type,o=p[e])}),{propType:n,propEntityType:r,propMetadata:o}},o.getPrimaryKey=function(e){var t=I.FieldMetadataUtil.getPrimaryFieldMetadata(e);return t?t.dataField:""},o.isObjectProp=function(e,t){var n=!1,r=I.FieldMetadataUtil.getNgObjects(e);return Object.keys(r).forEach(function(e){e===t&&(n=!0)}),n},o.isDynamicProp=function(e,t){var n=!1,r=I.FieldMetadataUtil.getNgDynamic(e);return Object.keys(r).forEach(function(e){e===t&&(n=!0)}),n},o.appendInitialData=function(e,t){var n=Object.assign({},t);delete n.id,delete n.parentID,e.initialData=n},o);function o(){}var p=(u.prototype.build=function(e){var t=this;return this.changeDetail={ChangeType:S.Modify,ChangeInfo:{DataId:""}},e.forEach(function(e){t.buildChangeDetail(e)}),this.changeDetail},u.prototype.buildChangeDetail=function(l){var d=l.path.concat();this.changeDetail.ChangeInfo.DataId||(this.changeDetail.ChangeInfo.DataId=d[0].split(":")[1]);for(var f=this.changeDetail,g=this.entityType,e=function(e){var t=v.getChangeInfo(f),n=d[e],r=C.getPropInfo(g,n),o=r.propType,i=r.propEntityType,a=r.propMetadata.dataField||n;if("NgField"===o){if(n===C.getPrimaryKey(g))return"continue";if(l.type!==I.ModifyType.ValueChange)throw Error("简单类型的属性上不支持ValueChange类型之外的变更");t[a]=l.value,f=null}else if("NgObject"===o)if(d[e+1].split(":")[1],d[e+1].split(":")[0]){var s=t[a],p=d.slice(0,e+1);s=(y=v.entityCollection.getEntityByPath(p))?y.toJSON(!0):{},t[a]=s,g=f=null}else c=(c=t[a])||{ChangeType:S.Modify,ChangeInfo:{}},t[a]=c,f=c,g=i;else if("NgList"===o){f.ChangeInfo[a]||(f.ChangeInfo[a]=[]);var u=f.ChangeInfo[a];if(e!==d.length-1){var c,h=d[e+1].split(":")[1];return(c=u.find(function(e){return e.ChangeInfo.DataId===h}))||(c=v.createEmptyChangeDetail(S.Modify,h),u.push(c)),f=c,g=i,"continue"}l.type===I.ModifyType.Add||l.type===I.ModifyType.Insert||(l.type,I.ModifyType.Remove),g=f=null}else if("NgDynamic"===o){p=d.slice(0,e+1);var y=v.entityCollection.getEntityByPath(p);t[a]={ChangeType:S.Modify,ChangeInfo:y?y.toJSON(!0):{}},g=f=null}},v=this,t=1;t<d.length&&f;t+=2)e(t)},u.prototype.getChangeInfo=function(e){return e.hasOwnProperty("ChangeInfo")?e.ChangeInfo:e},u.prototype.createEmptyChangeDetail=function(e,t){return{ChangeType:e,ChangeInfo:{DataId:t}}},u);function u(e,t){this.entityType=e,this.entityCollection=t}var c=(l.prototype.handle=function(e,t,n){this.handleChangeDetails(e,t,n)},l.prototype.handleChangeDetails=function(r,o,e){var i=this;e&&e.forEach(function(e){var t=e.ChangeInfo.dataId||e.ChangeInfo.DataId,n=i.getEntityById(o,t);n&&i.handleChangeDetail(r,n,e)})},l.prototype.handleChangeDetail=function(u,c,e){var h=this;if(e&&c&&e.ChangeType===S.Modify){var y=e.ChangeInfo;Object.keys(y).forEach(function(e){var t=C.getPropInfo(u,e),n=t.propType,r=t.propEntityType;if("NgField"===n)c[e]=y[e];else if("NgObject"===n){var o=c[e];if(o.primaryKey){var i=y[e];o.load(i)}else{var a=y[e];h.handleChangeDetail(r,o,a)}}else if("NgList"===n){var s=c[e],p=y[e];h.handleChangeDetails(r,s,p)}})}},l.prototype.getEntityById=function(e,t){return(e instanceof I.EntityCollection?e.getEntityById(t):e.get(t))||null},l);function l(){}var f=(g.prototype.getUserSessionId=function(){return this.sessionService.getUserSessionId()},g.prototype.getCurrentSessionId=function(e){var t;if(this.sessionService)if(e&&e.hasOwnProperty("tabId")){var n=e.tabId;t=this.sessionService.getCurrentSeesionId(n)}else t=this.sessionService.getCurrentSeesionId();return t=t||this.getUserSessionId()},g.decorators=[{type:i.Injectable}],g.ctorParameters=function(){return[{type:t.SessionService,decorators:[{type:i.Optional}]}]},g);function g(e){this.sessionService=e}var v=(E.prototype.getItem=function(e){return this.getAllBeSessions()[e]},E.prototype.setItem=function(e,t){var n=this.getAllBeSessions();n[e]=t,this.setAllBeSessions(n)},E.prototype.removeItem=function(e){var t=this.getAllBeSessions();t[e]&&delete t[e],this.setAllBeSessions(t)},E.prototype.clear=function(e,t){!0===this.isInFramework()?this.removeItemsByFrmSessionId(e):this.removeItem(t)},E.prototype.removeItemsByFrmSessionId=function(t){var n=this.getAllBeSessions();Object.keys(n).forEach(function(e){!0===e.startsWith(t)&&delete n[e]}),this.setAllBeSessions(n)},E.prototype.getAllBeSessions=function(){var e=window.sessionStorage.getItem(this.sessionStorageKey);return e?JSON.parse(e):{}},E.prototype.setAllBeSessions=function(e){var t=JSON.stringify(e);window.sessionStorage.setItem(this.sessionStorageKey,t)},E.prototype.isInFramework=function(){var e=window.location.hash;return!!e&&-1!==e.indexOf("tabId=")},E);function E(){this.sessionStorageKey="BE_SESSION_ID"}var m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function x(e,t){function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var B=function(){return(B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function P(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function R(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i["return"])&&n.call(i)}finally{if(o)throw o.error}}return a}function D(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(R(arguments[t]));return e}var w=(q.convertToHeaders=function(t){if(1==(t=t||new h.HttpHeaders)instanceof h.HttpHeaders)return t;if(0<Object.keys(t).length){var n=new h.HttpHeaders;Object.keys(t).forEach(function(e){n=n.append(e,t[e])}),t=n}else t=new h.HttpHeaders;return t},q.appendSessionId=function(e,t){return e.append("SessionId",t)},q.appendCafRuntimeCommonVariable=function(e,t){return e.append("X-CAF-Runtime-CommonVariable",t)},q.appendCafRuntimeContext=function(e,t){return e.append("X-CAF-Runtime-Context",t)},q.appendContextType=function(e,t){return t=t||"application/json",e.append("Content-Type",t)},q.appendRequireMessage=function(e,t){return void 0===t&&(t=!0),e.append("Bff-Require-Message",t.toString())},q.appendFuncInstId=function(e,t){return e.append("Func-Inst-Id",t)},q.toJson=function(n){if(!(n instanceof h.HttpHeaders))return null;var r={};return n.keys().forEach(function(e){var t=n.getAll(e);1<t.length?r[e]=t:r[e]=t[0]||""}),r},q);function q(){}var M=(O.buildParams=function(e){var t=new h.HttpParams;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n].toString();t=t.append(n,r)}return t},O);function O(){}var T=(j.hasRequestInfo=function(e){if(!e||!e.body)return!1;var t=e.body;return!(!t.requestInfo||!t.requestInfo.dataChange)||!!t.dataChange},j.hasRequestInfoWithR=function(e){if(!e||!e.body)return!1;var t=e.body;return!(!t.RequestInfo||!t.RequestInfo.dataChange)||!!t.dataChange},j.buildRequestInfo=function(e){return{dataChange:e.entityManager.buildAllEntityChangeDetails(),variableChange:e.variableManager.buildChangeDetail()}},j.buildBodyWithRequestInfo=function(e,t){if(e.RequestInfo||e.requestInfo)return e;var n=this.buildRequestInfo(t);return Object.assign({},e,{requestInfo:n})},j);function j(){}var A=(U.unWrapResponseInfo=function(e){if(!e)return e;if(!1===e.hasOwnProperty("returnValue"))return e.hasOwnProperty("result")&&e.hasOwnProperty("pagination")?e.result:e;var t=e.returnValue;return t&&t.hasOwnProperty("result")&&t.hasOwnProperty("pagination")?t.result:e.returnValue},U.isReported401Error=function(e){return 401===e.status},U.parseBackEndMessage=function(e){return e&&e.message&&Array.isArray(e.message)&&0<e.message.length?e.message:null},U.parseBackEndError=function(e){var t=e&&e.error;return t&&t.hasOwnProperty("extensionMessage")&&t.extensionMessage&&t.extensionMessage.hasOwnProperty("UIMsg")&&t.extensionMessage.UIMsg&&0<t.extensionMessage.UIMsg.length?JSON.parse(t.extensionMessage.UIMsg):null},U);function U(){}var V=(H.prototype.getService=function(){for(var e=window;!e.gspframeworkService&&e!==window.top&&this.isSameOrigin(e);)e=window.parent;return e.gspframeworkService&&e.gspframeworkService.rtf||{}},H.prototype.isSameOrigin=function(e){var t=window.location.host;try{if(e&&e.location&&"undefined"!=typeof e.location.host)return e.location.host===t}catch(n){return!1}return!1},Object.defineProperty(H.prototype,"params",{get:function(){return this.rtf&&this.rtf.hasOwnProperty("session")&&"function"==typeof this.rtf.session.getCommonVariable?this.rtf.session.getCommonVariable():null},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"httpService",{get:function(){return this.rtf&&this.rtf.hasOwnProperty("http")&&"function"==typeof this.rtf.http.request?this.rtf.http:null},enumerable:!0,configurable:!0}),H.prototype.request=function(e,t,n){return void 0===n&&(n={}),this.defaultHttpClient.request(e,t,n)},H.decorators=[{type:i.Injectable}],H.ctorParameters=function(){return[{type:h.HttpClient}]},H);function H(e){this.defaultHttpClient=e,this.httpClient=e,this.rtf=this.getService()}var k=(F.prototype.getFrmSessionId=function(e){return this.frmSessionService.getCurrentSessionId(e)},Object.defineProperty(F.prototype,"frmSessionId",{get:function(){return this.frmSessionService.getCurrentSessionId()},enumerable:!0,configurable:!0}),F.prototype.getFrameworkSessionId=function(e){return this.getFrmSessionId(e)},F.prototype.getSessionIdFromStorage=function(e){var t=this.getSessionStorageKey(e);return this.storageStrategy.getItem(t)},F);function F(e,t){this.storageStrategy=e,this.frmSessionService=t}var N,_=(x(L,N=k),L.prototype.getSessionId=function(){var e=this.getSessionIdFromStorage();return e?b.of(e):this.createSession()},L.prototype.setSessionId=function(e){var t=this.getSessionStorageKey();this.storageStrategy.setItem(t,e)},L.prototype.clearSessionId=function(){var e=this.getSessionStorageKey();this.storageStrategy.clear(this.frmSessionId,e)},L.prototype.extendRequestHeaders=function(e,t){var n=this.getFrameworkSessionId(t),r=this.getSessionIdFromStorage(t);return e=w.appendCafRuntimeCommonVariable(e,n),r&&(e=w.appendCafRuntimeContext(e,r),e=w.appendSessionId(e,r)),e=w.appendFuncInstId(e,this.beSessionUri)},L.prototype.handleReponseHeaders=function(e){console.log(e)},L.prototype.createSession=function(){var t=this,e={responseType:"text"};return this.frmSessionId&&(this.injector.get(I.AppContext,null),e.headers=new h.HttpHeaders({SessionId:this.frmSessionId}),e.headers=e.headers.append("X-CAF-Runtime-CommonVariable",this.frmSessionId),e.headers=e.headers.append("Func-Inst-Id",this.beSessionUri),e.headers=w.toJson(e.headers)),this.httpService.request("POST",this.beSessionUri,e).pipe(d.tap(function(e){t.setSessionId(e)}))},L.prototype.extendHttpHeader=function(){},L.prototype.getSessionStorageKey=function(e){return(e?this.getFrameworkSessionId(e):this.frmSessionId)+"_"+this.beSessionUri},L);function L(e,t,n,r,o){var i=N.call(this,e,t)||this;return i.beSessionUri=r,i.httpClient=n,i.httpService=new V(i.httpClient),i.injector=o,i}var K,G=(x(J,K=k),J.prototype.getSessionId=function(){var e=this.getSessionStorageKey(),t=this.storageStrategy.getItem(e);return b.of(t)},J.prototype.setSessionId=function(e){var t=this.getSessionStorageKey();this.storageStrategy.setItem(t,e)},J.prototype.clearSessionId=function(){var e=this.getSessionStorageKey();this.storageStrategy.removeItem(e)},J.prototype.extendRequestHeaders=function(e,t){var n=this.getFrameworkSessionId(t),r=this.getSessionIdFromStorage(t),o=this.injector.get(I.AppContext,null);if(o){var i=o.Token;e=w.appendFuncInstId(e,i)}return e=w.appendCafRuntimeCommonVariable(e,n),r&&(e=w.appendCafRuntimeContext(e,r)),e},J.prototype.handleReponseHeaders=function(e){console.log(e)},J.prototype.getSessionStorageKey=function(e){return(e?this.getFrameworkSessionId(e):this.frmSessionId)+"_"+this.beSessionUri},J);function J(e,t,n,r){var o=K.call(this,e,t)||this;return o.beSessionUri=n,o.injector=r,o}var z=(W.prototype.create=function(e,t,n,r,o){var i=this.createStorageStrategy(),a=this.createBeSessionUri(n);return"UnifiedSession"===e?new G(i,t,a,o):new _(i,t,r,a,o)},W.prototype.createStorageStrategy=function(){return new v},W.prototype.createBeSessionUri=function(e){return e+"/service/createsession"},W.decorators=[{type:i.Injectable}],W);function W(){}var Y=(Object.defineProperty(Q.prototype,"token",{get:function(){return this.handlingStrategy.getFrameworkSessionId()},enumerable:!0,configurable:!0}),Q.prototype.getBeSessionId=function(){return this.handlingStrategy.getSessionId()},Q.prototype.setBeSessionId=function(e){this.handlingStrategy.setSessionId(e),this.setSessionId(e)},Q.prototype.clearBeSessionId=function(){this.handlingStrategy.clearSessionId()},Q.prototype.extendRequestHeaders=function(e,t){return this.handlingStrategy.extendRequestHeaders(e,t)},Q.prototype.handleResponseHeaders=function(e){return this.handlingStrategy.handleReponseHeaders(e)},Q.prototype.createBeSession=function(){return this.handlingStrategy.createSession()},Q.prototype.setSessionId=function(e){var t=this.injector.get(I.AppContext,null,i.InjectFlags.Optional);t&&e&&t.params.set("sessionId",e)},Q.prototype.createHandlingStrategy=function(e,t,n,r){var o;return o=(o=e?e.get(a,null,i.InjectFlags.Optional):"SeparatedSession")||"SeparatedSession",(new z).create(o,n,r,t,e)},Q.decorators=[{type:i.Injectable}],Q.ctorParameters=function(){return[{type:h.HttpClient},{type:String},{type:f},{type:i.Injector}]},Q);function Q(e,t,n,r){this.beBaseUri=t,this.injector=r,this.handlingStrategy=this.createHandlingStrategy(r,e,n,t)}var X,Z="@farris/bef NG_VARIABLE",$=I.makePropDecorator(Z,function(e){return e}),ee=(x(te,X=I.Repository),Object.defineProperty(te.prototype,"restService",{get:function(){return this.dataService.restService},enumerable:!0,configurable:!0}),Object.defineProperty(te.prototype,"changeBuilder",{get:function(){return this.entityManager.changeBuilder},enumerable:!0,configurable:!0}),Object.defineProperty(te.prototype,"changeHandler",{get:function(){return this.entityManager.changeHandler},enumerable:!0,configurable:!0}),te.prototype.getList=function(){return this.dataService.getList(null,null,null,null)},te.prototype.getById=function(e){return this.dataService.getById(e)},te.prototype.updateById=function(e){return this.dataService.updateById(e)},te.prototype.create=function(e){return this.dataService.create(e)},te.prototype.append=function(e){return this.dataService.append(e)},te.prototype.appendByPath=function(e){return this.dataService.appendByPath(e)},te.prototype.removeById=function(e,t){return this.dataService.removeById(e,t)},te.prototype.removeByIds=function(e,t){return this.dataService.removeByIds(e,t)},te.prototype.removeByPath=function(e,t){return this.dataService.removeByPath(e,t)},te.prototype.updateChangesById=function(e){return this.dataService.updateChangesById(e)},te.prototype.updateChangesByPath=function(e,t){throw new Error("Not Implement")},te.prototype.updateAllChanges=function(){return this.dataService.updateAllChanges()},te.prototype.applyChanges=function(){return this.dataService.applyChanges()},te.prototype.updateDataAndVariableChanges=function(){var e={FilterConditions:[],SortConditions:[],IsUsePagination:!0,Pagination:{PageIndex:1,PageSize:1,PageCount:0,TotalCount:0}},t=JSON.stringify(e),n=this.restService.buildRequestInfo();if(this.isEmptyRequestInfo(n))return b.of(null);var r=this.restService.baseUri+"/extension/query?entityFilter="+t,o={body:n};return this.restService.invoke(r,"PUT",null,o,!1,!0,!0)},te.prototype.applyChangesById=function(e){return this.dataService.applyChangesById(e)},te.prototype.cancelChanges=function(e){return this.dataService.cancelChanges(e)},te.prototype.clearAllEntityChanges=function(){return this.entityManager.clearAllEntityChanges()},te.prototype.getDataChangeDetails=function(){return this.entityManager.buildAllEntityChangeDetails()},te.prototype.handleDataChangeDetails=function(e){return this.entityManager.handleDataChangeDetails(e)},te.prototype.getVariableChangeDetail=function(){return this.variableManager.buildChangeDetail()},te.prototype.handleVariableChangeDetail=function(e){this.variableManager.handleChangeDetail(e)},te.prototype.isEmptyRequestInfo=function(e){return!e||(!e.dataChange||e.dataChange.length<1)&&(!e.variableChange||Object.keys(e.variableChange).length<1)},te.decorators=[{type:i.Injectable}],te.ctorParameters=function(){return[]},te);function te(){return X.call(this)||this}var ne,re=(x(oe,ne=I.EntityManager),oe.prototype.buildAllEntityChangeDetails=function(){var n=this,r=[];return this.entityCollection.getAllEntities().forEach(function(e){if(0!==e.changes.length){var t=n.changeBuilder.build(e.changes);t&&t.ChangeInfo&&t.ChangeInfo.DataId&&r.push(t)}}),r},oe.prototype.buildEntityChangeDetailById=function(e){var t=this.entityCollection.getEntityById(e);return 0===t.changes.length?null:this.changeBuilder.build(t.changes)},oe.prototype.handleDataChangeDetails=function(e){this.changeHandler.handle(this.entityType,this.entityCollection,e)},oe.prototype.reset=function(){this.entityCollection.clear()},oe);function oe(e){var t=ne.call(this,e)||this;return t.changeBuilder=new p(t.entityCollection.entityType,t.entityCollection),t.changeHandler=new c,t}var ie=(ae.createEmpty=function(e,t){var n={ChangeType:e,ChangeInfo:{}};return t&&(n.ChangeInfo.DataId=t),n},ae.getChangeInfo=function(e){return!0===this.isChangeDetail(e)?e.ChangeInfo:e},ae.isChangeDetail=function(e){var t=Object.keys(e);return 2===t.length&&-1<t.indexOf("ChangeType")&&-1<t.indexOf("ChangeInfo")},ae);function ae(){}var se=(pe.prototype.handleChangeDetail=function(e){var o=this,i=e.ChangeInfo;Object.keys(i).forEach(function(e){var t=o.ngVariableMap.get(e);if(t){var n=t.mapping,r=i[e];o.innerValueMap.get(e)!==r&&(o.setValueToUIState(n,r),o.innerValueMap.set(e,r))}})},pe.prototype.buildChangeDetail=function(){var i=this,a=ie.createEmpty(S.Modify);return this.ngVariableMap.forEach(function(e,t){var n=e.mapping,r=i.getValueFromUIState(n),o=i.innerValueMap.get(t);!1===i.isValueEqual(r,o)&&(i.innerValueMap.set(t,r),i.appendToChangeInfo(a,t,r))}),0===Object.keys(a.ChangeInfo).length?null:a},pe.prototype.reset=function(){this.innerValueMap.clear()},pe.prototype.clearChanges=function(){var i=this;this.ngVariableMap.forEach(function(e,t){var n=e.mapping,r=i.getValueFromUIState(n),o=i.innerValueMap.get(t);!1===i.isValueEqual(r,o)&&i.innerValueMap.set(t,r)})},pe.prototype.appendToChangeInfo=function(e,t,n){if(!0===this.isUdtVariable(n)){var r=ie.createEmpty(S.Modify);r.ChangeInfo=n,e.ChangeInfo[t]=r}else e.ChangeInfo[t]=n},pe.prototype.getValueFromUIState=function(e){var t=this.getRootUIState(),n=e.split(".").reduce(function(e,t){return e?e[t]:null},t);return n instanceof Date?r.format(n,"yyyy-MM-dd HH:mm:ss"):n},pe.prototype.getRootUIState=function(){var e=this.appContext.frameContextManager.getRootFrameContext();if(this.injector){var t=this.injector.get(I.FrameContext,null);t&&(e=t.getVirtualRootFrameContext()||e)}if(e)return e.uiState},pe.prototype.isValueEqual=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},pe.prototype.isUdtVariable=function(e){return e&&e.constructor&&"[object Object]"===e.toString()&&e.constructor.prototype.hasOwnProperty("isPrototypeOf")},pe.prototype.setValueToUIState=function(e,t){this.getRootUIState()[e]=t},pe.ctorParameters=function(){return[{type:I.AppContext},{type:undefined},{type:i.Injector,decorators:[{type:i.Optional}]}]},pe);function pe(e,t,n){var r=this;this.appContext=e,this.ngVariables=t,this.injector=n,this.ngVariableMap=new Map,this.innerValueMap=new Map,Object.keys(t).forEach(function(e){r.ngVariableMap.set(e,t[e])})}var ue=(ce.buildRequestInfo=function(e){return{dataChange:e.entityManager.buildAllEntityChangeDetails(),variableChange:e.variableManager.buildChangeDetail()}},ce);function ce(){}var he=(ye.convertToPathArray=function(e,t){var r=this,n=I.BindingPathConverter.toBindingPathArray(e),o=[],i=t.list.currentItem;return o.push(i.primaryKeyValue),n.forEach(function(e){var t=I.PropertyUtil.getPropertyByName(i.properties,e);if(t.type!==I.BindingPropertyType.List)throw new Error(t.name+"不是子表对应的属性");var n=i[e];i=n.currentItem,o.push(r.trimTrailingS(e)),o.push(i.primaryKeyValue)}),o},ye.convertToPathUrl=function(e,t){var n=this.convertToPathArray(e,t);return n.pop(),"/"+n.join("/")},ye.convertToObjectCodes=function(e,t){for(var n=this.convertToPathArray(e,t),r=n.length,o=[],i=1;i<r;i+=2)o.push(n[i]);return o},ye.convertToDataIdsForUpdate=function(e,t){for(var n=this.convertToPathArray(e,t),r=n.length,o=[],i=0;i<r;i+=2)o.push(n[i]);return o},ye.convertToDataIdsForAdd=function(e,t){var n=this.convertToDataIdsForUpdate(e,t);return n.pop(),n},ye.convertPathToUrl=function(e){for(var t=e.split("/"),n=t.length-1;0<n;n--)t[n]&&t[n].endsWith("s")&&(t[n]=t[n].substr(0,t[n].length-1).toLowerCase());return t.join("/")},ye.trimTrailingS=function(e){return e.substr(0,e.length-1)},ye.convertPathsToNodeCodes=function(e){var t=[];return!e||e.length<1||e.filter(function(e){return!!e&&-1===e.indexOf(":")}).forEach(function(e){t.push(e)}),t},ye.convertPathsToIds=function(e){var t=[];return!e||e.length<1||e.filter(function(e){return!!e&&-1!==e.indexOf(":")}).forEach(function(e){t.push(e.split(":")[1])}),t},ye);function ye(){}var le=(Object.defineProperty(de.prototype,"restProxy",{get:function(){return this.repository.restService.proxy},enumerable:!0,configurable:!0}),de.prototype.getList=function(e,t,n,r){var p=this;0!==n&&(n=n||this.repository.entityCollection.pageSize,r=r||this.repository.entityCollection.pageIndex);var o=this.buildEntityFilter(e,t,n,r),i=this.restService.buildRequestInfo();return this.restProxy.extendQuery(o,i).pipe(d.map(function(e){var t=e.returnValue,n=t.result,r=[];n.forEach(function(e){var t=p.repository.buildEntity(e);C.appendInitialData(t,e),r.push(t)});var o=t.pagination;if(o&&0<Object.keys(o).length){var i=o.pageSize,a=o.pageIndex,s=o.totalCount;p.repository.entityCollection.updatePaginationInfoByPath("/",{pageIndex:a,pageSize:i,totalCount:s})}else p.repository.entityCollection.updatePaginationInfoByPath("/",{pageIndex:1,pageSize:0,totalCount:r.length});return p.repository.entityCollection.loadEntities(r),r}))},de.prototype.filter=function(e,t,n,r){var p=this;0!==n&&(n=n||this.repository.entityCollection.pageSize,r=r||this.repository.entityCollection.pageIndex);var o=this.buildEntityFilter(e,t,n,r),i=this.restService.buildRequestInfo();return this.restProxy.filter(o,i).pipe(d.map(function(e){var t=e.returnValue,n=t.result,r=[];n.forEach(function(e){var t=p.repository.buildEntity(e);C.appendInitialData(t,e),r.push(t)});var o=t.pagination;if(o&&0<Object.keys(o).length){var i=o.pageSize,a=o.pageIndex,s=o.totalCount;p.repository.entityCollection.updatePaginationInfoByPath("/",{pageIndex:a,pageSize:i,totalCount:s})}else p.repository.entityCollection.updatePaginationInfoByPath("/",{pageIndex:1,pageSize:0,totalCount:r.length});return p.repository.entityCollection.loadEntities(r),r}))},de.prototype.buildEntityFilter=function(e,t,n,r){return e||t||n||r?(e&&0<e.length&&(e[e.length-1].Relation=0),{FilterConditions:e,SortConditions:t,IsUsePagination:0!==n,Pagination:{PageIndex:r,PageSize:n,PageCount:0,TotalCount:0}}):null},de.prototype.getById=function(e){var r=this,t=this.restService.buildRequestInfo();return this.restService.extendRetrieve(e,t).pipe(d.map(function(e){var t=e.returnValue,n=r.repository.buildEntity(t);return r.repository.entityCollection.loadEntities([n]),n}))},de.prototype.getPagedById=function(o){var i=this,e=this.restService.buildRequestInfo(),t=this.repository.entityCollection.getPaginationConfigByPath("/"),n=this.buildChildPagination(t),r=this.buildRetrieveParam(n);return this.restService.serviceRetrieve(o,r,e).pipe(d.map(function(e){var t=e.dataResult,n=e.paginations;i.updatePagination(n);var r=i.repository.entityCollection.getEntityById(o);return i.reloadEntityData(r,t),r}))},de.prototype.queryChild=function(s,e,t,n,r){var p=this,o=this.restService.buildRequestInfo(),u=he.convertPathsToNodeCodes(s),i=u.map(function(e){return e.substring(0,e.length-1)}),a=he.convertPathsToIds(s),c=B({nodeCodes:i,ids:a,pagination:{pageIndex:e,pageSize:t}},o),h=u[u.length-1];return h=h.substring(0,h.length-1),this.restService.queryChild(c).pipe(d.map(function(e){console.log(e);var t=e.returnValue;if(!t)return null;var n=t.result,r=void 0===n?[]:n,o=t.pagination,i=void 0===o?{}:o,a=[];r.forEach(function(e){var t=new(I.FieldMetadataUtil.getNgList(p.repository.entityType)[u[u.length-1]].type)(e);C.appendInitialData(t,e),a.push(t)}),u=u.map(function(e){return e.charAt(0).toLocaleLowerCase()+e.substr(1)}),p.repository.entityCollection.resetEntities(s,a),p.repository.entityCollection.setPaginationConfigByPath("/"+h,i)}))},de.prototype.buildChildPagination=function(n){var r={};return Object.keys(n).forEach(function(e){var t=n[e];"object"==typeof t&&(r[e]=t)}),r},de.prototype.updatePagination=function(t){var n=this;t&&Object.keys(t).forEach(function(e){n.repository.entityCollection.setPaginationConfigByPath("/"+e,t[e])})},de.prototype.buildRetrieveParam=function(r){var e={};if(r&&0<Object.keys(r).length){var o=[];Object.keys(r).forEach(function(e){var t=r[e],n={};n[e]={pagination:{pageSize:t.pageSize||0,pageIndex:1}},o.push(n)}),e.filters=o}return e},de.prototype.editById=function(r){var o=this;if(!this.repository.entityCollection.getEntityById(r))return b.of(null);var e=ue.buildRequestInfo(this.repository);return this.restProxy.edit(r,e).pipe(d.map(function(e){var t=e.returnValue.data,n=o.repository.entityCollection.getEntityById(r);return n&&t&&o.reloadEntityData(n,t),n}))},de.prototype.updateById=function(r){var o=this;if(!this.repository.entityCollection.getEntityById(r))return b.of(null);var e=this.restService.buildRequestInfo();return this.restService.extendRetrieve(r,e).pipe(d.map(function(e){var t=e.returnValue,n=o.repository.entityCollection.getEntityById(r);return o.reloadEntityData(n,t),n}))},de.prototype.reloadEntityData=function(e,t){e&&(this.appContext.changeDetectionController.detach(),this.repository.entityCollection.updateEntity(e,t),e.changes.splice(0,e.changes.length),this.appContext.changeDetectionController.reattach())},de.prototype.create=function(e){var r=this,t=this.restService.buildRequestInfo();return this.restService.create(e,t).pipe(d.map(function(e){var t=e.returnValue,n=r.repository.buildEntity(t);return C.appendInitialData(n,t),r.repository.entityCollection.loadEntities([n],!0),n}))},de.prototype.append=function(e){var r=this,t=this.restService.buildRequestInfo();return this.restService.create(e,t).pipe(d.map(function(e){var t=e.returnValue,n=r.repository.buildEntity(t);return r.repository.entityCollection.addEntity(n),n}))},de.prototype.insert=function(r,e){var o=this,t=this.buildRequestInfo();return this.restProxy.create(e,t).pipe(d.map(function(e){var t=e.returnValue,n=o.repository.buildEntity(t);return o.repository.entityCollection.insertEntity(n,r),n}))},de.prototype.appendByPath=function(n){var r=this,e=this.restService.buildRequestInfo();return this.restService.createByPath(n,e).pipe(d.map(function(e){var t=e.returnValue;return r.repository.entityManager.appendEntityByPath(n,t,t)}))},de.prototype.insertByPath=function(n,r){var o=this,e=this.buildRequestInfo();return this.restProxy.createByPath(n,e).pipe(d.map(function(e){var t=e.returnValue;return o.repository.entityManager.insertEntityByPath(n,t,t,r)}))},de.prototype.removeById=function(e,t){var n=this;t=t===undefined||t;var r=ue.buildRequestInfo(this.repository);return t?this.restProxy.deleteAndSave(e,r).pipe(d.switchMap(function(){return n.repository.entityCollection.removeEntityById(e),b.of(!0)})):this.restService.extendDelete(e,r).pipe(d.switchMap(function(){return n.repository.entityCollection.removeEntityById(e),n.repository.dataChangeHistory.addChange({dataId:e,changeType:I.DataChangeType.Delete}),b.of(!0)}))},de.prototype.removeAndSaveById=function(e){var t=this,n=ue.buildRequestInfo(this.repository);return this.restProxy.deleteAndSave(e,n).pipe(d.switchMap(function(){return t.repository.entityCollection.removeEntityById(e),b.of(!0)}))},de.prototype.removeByIds=function(n,e){var r=this;e=e===undefined||e;var t=this.restService.buildRequestInfo();return this.restService.extendBatchDelete(n,t).pipe(d.switchMap(function(){if(e)return r.applyChangesByIdArray(n).pipe(d.tap(function(e){e&&r.repository.entityCollection.removeEntities(function(e){return r.checkEntityValueExists(e,n)})}));if(r.repository.entityCollection.removeEntities(function(e){return r.checkEntityValueExists(e,n)}),n&&0<n.length){var t=[];n.forEach(function(e){t.push({dataId:e,changeType:I.DataChangeType.Delete})}),r.repository.dataChangeHistory.addChanges(t)}return b.of(!0)}))},de.prototype.checkEntityValueExists=function(e,t){for(var n=!1,r=0;r<t.length;r++)if(e.primaryValue===t[r]){n=!0;break}return n},de.prototype.removeByPath=function(e,t){var n=this,r=this.restService.buildRequestInfo();return this.restService.extendDeletByPath(e,t,r).pipe(d.map(function(){return n.repository.entityManager.removeEntityByPath(e,t),n.repository.dataChangeHistory.addChange({fpath:e,dataId:t,changeType:I.DataChangeType.Delete}),!0}))},de.prototype.batchRemoveByPath=function(t,n){var r=this,e=this.restService.buildRequestInfo();return this.restService.batchDeleteByPath(t,n,e).pipe(d.map(function(){var e=n.split(",");return 0<e.length&&e.forEach(function(e){r.repository.entityManager.removeEntityByPath(t,e),r.repository.dataChangeHistory.addChange({fPath:t,dataId:e,changeType:I.DataChangeType.Delete})}),!0}))},de.prototype.updateChangesById=function(e){var t=this,n=this.repository.entityCollection.getEntityById(e);if(!n.changes)return b.of(!0);if(0===n.changes.length)return b.of(!0);var r=this.repository.entityManager.buildEntityChangeDetailById(e),o=this.restService.buildRequestInfo();return this.restService.update(r,o).pipe(d.tap(function(){t.repository.entityManager.clearEntityChangesById(e)}),d.map(function(){return!0}))},de.prototype.updateChangesByPath=function(e,t){throw new Error("Not Implement")},de.prototype.updateAllChanges=function(){var n=this,r=[],e=this.repository.entityCollection.toArray();return 0===e.length?b.of(!0):(e.forEach(function(e){var t=n.updateChangesById(e.primaryValue);r.push(t)}),b.zip.apply(void 0,D(r)).pipe(d.map(function(){return!0})))},de.prototype.applyChanges=function(){var e=this,t=this.restService.buildRequestInfo();return this.restService.save(t).pipe(d.tap(function(){e.repository.entityManager.clearAllEntityChanges(),e.repository.dataChangeHistory.clear()}),d.map(function(){return!0}))},de.prototype.applyChangesByIdArray=function(e){var t=this,n=this.restService.buildRequestInfo();return this.restService.save(n).pipe(d.tap(function(){t.repository.entityManager.clearEntityChangesByArray(e),t.repository.dataChangeHistory.clearByIds(e)}),d.map(function(){return!0}))},de.prototype.applyChangesById=function(e){var t=this,n=this.restService.buildRequestInfo();return this.restService.save(n).pipe(d.tap(function(){t.repository.entityManager.clearEntityChangesById(e),t.repository.dataChangeHistory.clearByIds([e])}),d.map(function(){return!0}))},de.prototype.cancelChanges=function(e){var t=this;return this.restService.cancel(e).pipe(d.tap(function(){t.repository.entityManager.clearAllEntityChanges(),t.repository.dataChangeHistory.clear()}),d.map(function(){return!0}))},de.prototype.batchAppendByPath=function(o,e){var i=this,t=this.buildRequestInfo();return this.restProxy.batchAppendByPath(o,e,t).pipe(d.map(function(e){var t=e.returnValue,n=i.repository.entityManager.createEntitiesByPath(o,t),r=o.split("/").filter(function(e){return e});return i.repository.entityManager.appendEntitiesByPath(r,n),n}))},de.prototype.batchAppend=function(e){var r=this,t=this.buildRequestInfo();return this.restProxy.batchAppend(e,t).pipe(d.map(function(e){var t=e.returnValue,n=r.repository.buildEntities(t);return r.repository.entityCollection.addEntities(n),n}))},de.prototype.buildRequestInfo=function(){return{dataChange:this.repository.entityManager.buildAllEntityChangeDetails(),variableChange:this.repository.variableManager.buildChangeDetail()}},de);function de(e,t){this.injector=e,this.repository=t;var n=e.get(f),r=e.get(h.HttpClient),o=e.get(y)+"/"+this.repository.apiUri,i=e.get(I.EventBus);this.restService=new Me(r,o,n,this.repository,i),this.appContext=e.get(I.AppContext)}var fe=(ge.handleMessage=function(e,t,n){var r={ns:t.get(I.NAMESPACE,null),appContext:t.get(I.AppContext,null)},o=this.buildBackEndMessages(e),i=new I.BackEndMessage.Message(o,r),a=t.get(I.BACK_END_MESSAGE_HANDLER_TOKEN,null);a&&a.handle(i,n)},ge.isBackEndMessageHandlerExist=function(e){return!!e.get(I.BACK_END_MESSAGE_HANDLER_TOKEN,null)},ge.getFormlessMessages=function(e){return(this.buildBackEndMessages(e)||[]).filter(function(e){return!e.location||!e.location.columns||e.location.columns.length<1||!e.location.nodeCode})},ge.buildBackEndMessages=function(e){if(!e||e.length<1||!Array.isArray(e))return null;var n=[];return e.forEach(function(e){var t={level:e.level,message:e.message};e.hasOwnProperty("location")&&e.location&&(t.location={nodeCode:e.location.nodeCode,rows:e.location.dataIds,columns:e.location.columnNames}),n.push(t)}),n},ge);function ge(){}var ve=(Ie.getSessionId=function(e,t){var n=e.ApplicationId+"_"+t.beBaseUri;return this.createSessionHistory.includes(n)?b.of(null):(this.createSessionHistory.push(n),t.getBeSessionId())},Ie.createSessionHistory=[],Ie.decorators=[{type:i.Injectable}],Ie);function Ie(){}var Se=(be.prototype.onResponse=function(e,t){e&&e.innerDataChange&&!0!==t&&this.context.handleDataChangeDetails(e.innerDataChange),e&&e.innerVariableChange&&this.context.handleVariableChangeDetail(e.innerVariableChange);var n=A.parseBackEndMessage(e);return fe.handleMessage(n,this.context.getInjector()),this.context.clearAllEntityChanges(),e&&e.hasOwnProperty("returnValue")?e.returnValue:e},be.prototype.onError=function(e,t,n){var r,o,i=this.context.appContext.getFormAppContext(),a=i.ApplicationId,s=window.DEVKIT_LOADING_SERVICE,p=A.parseBackEndError(e);if(fe.handleMessage(p,this.context.getInjector()),s&&s instanceof Array&&0<s.length)try{for(var u=P(s),c=u.next();!c.done;c=u.next()){var h=c.value;"function"==typeof h.clearAll&&h.clearAll()}}catch(S){r={error:S}}finally{try{c&&!c.done&&(o=u["return"])&&o.call(u)}finally{if(r)throw r.error}}if(t)return b.throwError(e);var y=this.context.restService.eventBus,l=!!(window[a]||{}).isExceptionHandlerExist,d=A.parseBackEndError(e),f=fe.getFormlessMessages(d),g=f&&0<f.length||!1,v=!(e&&e.error&&e.error.extensionMessage&&fe.isBackEndMessageHandlerExist(this.context.getInjector())&&!g),I=!!y&&l&&v;return fe.handleMessage(d,this.context.getInjector(),{hasThrowError:I,isException:!0,eventBus:y,error:e,formAppContext:i}),y&&l&&!A.isReported401Error(e)?(v&&y.post("Exception","","onException",e,i),n?b.of(null):b.EMPTY):b.throwError(e)},be.prototype.extendHeaders=function(t,n){var r=this,e=this.context.appContext.getFormAppContext();return ve.getSessionId(e,this.context.restService.sessionService).pipe(d.switchMap(function(e){return t=r.context.restService.sessionService.extendRequestHeaders(t,n),b.of(t)}))},be.prototype.extendUrl=function(e,t){if(!t)return e;for(var n in t)if(t.hasOwnProperty(n)){var r=JSON.stringify(t[n]);e=-1===e.indexOf("?")?e+"?"+n+"="+r:e+"&"+n+"="+r}return e},be.prototype.extendBody=function(t){var n=this;return!t||"object"!=typeof t||Object.keys(t).length<1||(Object.keys(t).forEach(function(e){"requestInfo"===e&&(t.requestInfo=n.context.restService.buildRequestInfo())}),1===Object.keys(t).length&&(t=Object.values(t)[0])),t},be.prototype.parseHeaders=function(e){var t="BEFSessionID";e.headers&&e.headers.has(t)&&this.context.restService.sessionService.setBeSessionId(e.headers.get(t))},be);function be(e){this.context=e}var Ce,Ee=(x(me,Ce=ee),Object.defineProperty(me.prototype,"proxy",{get:function(){return this.befProxy},set:function(e){this.befProxy=e,this.befProxy.setProxyExtend(new Se(this))},enumerable:!0,configurable:!0}),me.prototype.getEntities=function(e,t,n,r){return this.dataService.getList(e,t,n,r)},me.prototype.filter=function(e,t,n,r){return void 0===e&&(e=[]),void 0===t&&(t=[]),this.dataService.filter(e,t,n,r)},me.prototype.getPagedById=function(e){return this.dataService.getPagedById(e)},me.prototype.queryChild=function(e,t,n,r,o){return this.dataService.queryChild(e,t,n,r,o)},me.prototype.getEntityById=function(e){return this.dataService.getById(e)},me.prototype.updateEntityById=function(e){return this.dataService.updateById(e)},me.prototype.editEntityById=function(e){return this.dataService.editById(e)},me.prototype.createEntity=function(e){return this.dataService.create(e)},me.prototype.appendEntity=function(e){return this.dataService.append(e)},me.prototype.insert=function(e,t){return this.dataService.insert(e,t)},me.prototype.insertByPath=function(e,t){return this.dataService.insertByPath(e,t)},me.prototype.appendEntityByPath=function(e){return this.dataService.appendByPath(e)},me.prototype.removeEntityById=function(e,t){return this.dataService.removeById(e,t)},me.prototype.removeEntityAndSaveById=function(e){return this.dataService.removeAndSaveById(e)},me.prototype.removeEntityByPath=function(e,t){return this.dataService.removeByPath(e,t)},me.prototype.batchRemoveByPath=function(e,t){return this.dataService.batchRemoveByPath(e,t)},me.prototype.saveEntityById=function(e){return this.dataService.applyChangesById(e)},me.prototype.saveEntities=function(){return this.dataService.applyChanges()},me.prototype.cancelEntityChanges=function(){return this.dataService.cancelChanges()},me.prototype.batchAppendByPath=function(e,t){return this.dataService.batchAppendByPath(e,t)},me.prototype.batchAppend=function(e){return this.dataService.batchAppend(e)},me.prototype.reset=function(){this.entityManager.reset(),this.variableManager.reset(),this.restService.sessionService.clearBeSessionId()},me.prototype.getInjector=function(){return this.injector},me.prototype.clearAllVariableChanges=function(){},me.decorators=[{type:i.Injectable}],me.ctorParameters=function(){return[{type:i.Injector}]},me);function me(e){var t=Ce.call(this)||this;t.injector=e,t.entityCollection&&(t.entityManager=new re(t.entityCollection)),t.appContext=t.injector.get(I.AppContext);var n=I.MetadataUtil.getPropsMetadatasByName(t.constructor,Z);return t.variableManager=new se(t.appContext,n,t.injector),t.dataService=new le(t.injector,t),t.serverUri=e.get(y),t}var xe=(Be.prototype.extendUri=function(e){return this.serverUri+"/"+e},Be.decorators=[{type:i.Injectable}],Be.ctorParameters=function(){return[{type:String,decorators:[{type:i.Inject,args:[y]}]}]},Be);function Be(e){this.serverUri=e}var Pe="DELETE",Re="PUT",De="POST",we=(qe.prototype.setBaseUri=function(e){this.baseUri=e},qe.prototype.setProxyExtend=function(e){this.proxyExtend=e},qe.prototype.query=function(e){var t=this.baseUri;return e&&(t=t+"?entityFilter="+JSON.stringify(e)),this.request(t,"GET")},qe.prototype.extendQuery=function(e,t){var n=this.baseUri+"/extension/query";if(e){var r=JSON.stringify(e);n=n+"?entityFilter="+(r=I.encodeUrl(r))}var o=t,i=this.addBodyToOptions({},o);return this.request(n,Re,null,i,!1)},qe.prototype.filter=function(e,t){var n=this.baseUri+"/extension/filter",r={requestInfo:t};e&&(r={entityFilter:e,requestInfo:t});var o=this.addBodyToOptions({},r);return this.request(n,De,null,o,!1)},qe.prototype.retrieve=function(e){var t=this.baseUri+"/"+e;return this.request(t,"GET")},qe.prototype.serviceRetrieve=function(e,t,n){var r=this.baseUri+"/service/retrieve/"+e,o={body:{retrieveParam:t,requestInfo:n}};return this.request(r,Re,null,o)},qe.prototype.queryChild=function(e){var t=this.baseUri+"/service/querychild",n={body:e};return this.request(t,Re,null,n)},qe.prototype.extendRetrieve=function(e,t){var n=this.baseUri+"/extension/retrieve/"+e,r=t,o=this.addBodyToOptions({},r);return this.request(n,Re,null,o)},qe.prototype.edit=function(e,t){var n=this.baseUri+"/service/edit/"+e,r=t,o=this.addBodyToOptions({},r);return this.request(n,Re,null,o)},qe.prototype.create=function(e,t){var n={defaultValue:e,requestInfo:t},r=this.addBodyToOptions({},n);return this.request(this.baseUri,De,null,r)},qe.prototype.createByPath=function(e,t){var n=he.convertPathToUrl(e),r=""+this.baseUri+n,o=t,i=this.addBodyToOptions({},o);return this.request(r,De,null,i)},qe.prototype.update=function(e,t){var n={changeDetail:e,requestInfo:t},r=this.addBodyToOptions({},n);return this.request(this.baseUri,"PATCH",null,r)},qe.prototype.save=function(e){var t=e,n=this.addBodyToOptions({},t);return this.request(this.baseUri,Re,null,n)},qe.prototype["delete"]=function(e){var t=this.baseUri+"/"+e;return this.request(t,Pe)},qe.prototype.deleteAndSave=function(e,t){var n=this.baseUri+"/service/delete/"+e,r=t,o=this.addBodyToOptions({},r);return this.request(n,Re,null,o)},qe.prototype.extendDelete=function(e,t){var n=this.baseUri+"/extension/delete/"+e,r=t,o=this.addBodyToOptions({},r);return this.request(n,Re,null,o)},qe.prototype.deletByPath=function(e,t){var n=he.convertPathToUrl(e),r=""+this.baseUri+n+"/"+t;return this.request(r,Pe)},qe.prototype.extendDeletByPath=function(e,t,n){var r=he.convertPathToUrl(e),o=this.baseUri+"/extension"+r+"/"+t,i=n,a=this.addBodyToOptions({},i);return this.request(o,Re,null,a)},qe.prototype.batchDeleteByPath=function(e,t,n){var r=he.convertPathToUrl(e);if(r.split("/").length<3)throw Error("根据path删除实体数据出错了。传入的path["+e+"]格式不对");var o=this.baseUri+"/extension"+r+"/batch",i={ids:t.split(","),requestInfo:n},a=this.addBodyToOptions({},i);return this.request(o,Re,null,a)},qe.prototype.batchDelete=function(e){var t={ids:e.join(",")};return this.request(this.baseUri,Pe,t)},qe.prototype.extendBatchDelete=function(e,t){var n=this.baseUri+"/extension/batchdelete",r={ids:e.join(",")},o=t,i=this.addBodyToOptions({},o);return this.request(n,Re,r,i)},qe.prototype.cancel=function(e){var t=this.baseUri+"/service/cancel";return this.request(t,De,null,null,!1,!1,!1,e)},qe.prototype.batchAppendByPath=function(e,t,n){var r=he.convertPathToUrl(e),o=""+this.baseUri+r+"/batch",i={requestInfo:n,retrieveDefaultParam:{defaultValues:t}},a=this.addBodyToOptions({},i);return this.request(o,De,null,a)},qe.prototype.batchAppend=function(e,t){var n=this.baseUri+"/batch",r={requestInfo:t,retrieveDefaultParam:{defaultValues:e}},o=this.addBodyToOptions({},r);return this.request(n,De,null,o)},qe.prototype.request=function(t,n,e,r,o,i,a,s){var p=this;r=r||{},void 0!==o&&"boolean"==typeof o||(o=!1),void 0!==i&&"boolean"==typeof i||(i=!1),e&&(r.params=e),r.headers=w.convertToHeaders(r.headers);var u=this.hasRequestInfo(r);return r&&r.body&&r.body.hasOwnProperty("RequestInfo")&&(r.body.requestInfo=r.body.RequestInfo,delete r.body.RequestInfo),this.proxyExtend.extendHeaders(r.headers,s).pipe(d.switchMap(function(e){return r.headers=w.toJson(e),r.observe="response",p.httpService.request(n,t,r)}),d.tap(function(e){return p.proxyExtend.parseHeaders(e)}),d.map(function(e){return e.body}),d.map(function(e){return u?(p.proxyExtend.onResponse(e,a),e):p.unWrapResponseInfo(e)}),d.catchError(function(e){return p.proxyExtend.onError(e,o,i)}))},qe.prototype.invoke=function(t,n,r){var o=this;return r.params&&(t=this.proxyExtend.extendUrl(t,r.params),r.params=null),r.body&&(r.body=this.proxyExtend.extendBody(r.body)),r.headers=w.convertToHeaders(r.headers),this.proxyExtend.extendHeaders(r.headers).pipe(d.switchMap(function(e){return r.headers=w.toJson(e),r.observe="response",o.httpService.request(n,t,r).pipe(d.tap(function(e){return o.proxyExtend.parseHeaders(e)}),d.map(function(e){return e.body}),d.map(function(e){return o.proxyExtend.onResponse(e)}),d.catchError(function(e){return o.proxyExtend.onError(e,!1,!1)}))}))},qe.prototype.addBodyToOptions=function(e,t){return e=e||{},Object.assign(e,{body:t})},qe.prototype.buildParams=function(e){return M.buildParams(e)},qe.prototype.hasRequestInfo=function(e){return T.hasRequestInfo(e)||T.hasRequestInfoWithR(e)},qe.prototype.unWrapResponseInfo=function(e){return A.unWrapResponseInfo(e)},qe.decorators=[{type:i.Injectable}],qe.ctorParameters=function(){return[{type:h.HttpClient},{type:xe}]},qe);function qe(e,t){this.httpClient=e,this.uriService=t,this.httpService=new V(this.httpClient)}var Me=(Object.defineProperty(Oe.prototype,"proxy",{get:function(){return this.repository.proxy?this.repository.proxy:this.createBefProxy()},enumerable:!0,configurable:!0}),Oe.prototype.createBefProxy=function(){var e=this.repository.serverUri,t=new xe(e),n=new we(this.httpClient,t);n.setBaseUri(this.baseUri);var r=new Se(this.repository);return n.setProxyExtend(r),n},Oe.prototype.query=function(e){return this.proxy.query(e)},Oe.prototype.extendQuery=function(e,t){return this.proxy.extendQuery(e,t)},Oe.prototype.serviceRetrieve=function(e,t,n){return this.proxy.serviceRetrieve(e,t,n)},Oe.prototype.queryChild=function(e){return this.proxy.queryChild(e)},Oe.prototype.retrieve=function(e){return this.proxy.retrieve(e)},Oe.prototype.extendRetrieve=function(e,t){return this.proxy.extendRetrieve(e,t)},Oe.prototype.create=function(e,t){return this.proxy.create(e,t)},Oe.prototype.createByPath=function(e,t){return this.proxy.createByPath(e,t)},Oe.prototype.update=function(e,t){return this.proxy.update(e,t)},Oe.prototype.save=function(e){return this.proxy.save(e)},Oe.prototype["delete"]=function(e){return this.proxy["delete"](e)},Oe.prototype.extendDelete=function(e,t){return this.proxy.extendDelete(e,t)},Oe.prototype.deletByPath=function(e,t){return this.proxy.deletByPath(e,t)},Oe.prototype.extendDeletByPath=function(e,t,n){return this.proxy.extendDeletByPath(e,t,n)},Oe.prototype.batchDeleteByPath=function(e,t,n){return this.proxy.batchDeleteByPath(e,t,n)},Oe.prototype.batchDelete=function(e){return this.proxy.batchDelete(e)},Oe.prototype.extendBatchDelete=function(e,t){return this.proxy.extendBatchDelete(e,t)},Oe.prototype.cancel=function(e){return this.proxy.cancel(e)},Oe.prototype.request=function(e,t,n,r,o,i,a){return this.innerRequest(e,t,n,r,o,i,a,!1)},Oe.prototype.invoke=function(e,t,n,r,o,i,a){if(r&&r.body&&r.body.RequestInfo)throw new Error("请使用requestInfo提交变更");return this.innerRequest(e,t,n,r,o,i,a,!0)},Oe.prototype.innerRequest=function(t,n,e,r,o,i,a,s){var p=this;r=r||{};var u="BEFSessionID";void 0!==o&&"boolean"==typeof o||(o=!1),void 0!==i&&"boolean"==typeof i||(i=!1),void 0!==s&&"boolean"==typeof s||(s=!1);var c=s?this.existRequestInfo:this.hasRequestInfo;e&&(r.params=e);var h=c(r),y=w.convertToHeaders(r.headers),l=this.repository.appContext.getFormAppContext();return ve.getSessionId(l,this.sessionService).pipe(d.switchMap(function(e){return y=p.sessionService.extendRequestHeaders(y),r.headers=w.toJson(y),r.observe="response",p.httpService.request(n,t,r)}),d.tap(function(e){e.headers&&e.headers.has(u)&&p.sessionService.setBeSessionId(e.headers.get(u))}),d.map(function(e){return e.body}),d.map(function(e){var t=A.parseBackEndMessage(e);return fe.handleMessage(t,p.repository.getInjector()),p.handleReponseInfo(e,h,a)}),d.catchError(function(e){return p.handleErrors(e,o,i)}))},Oe.prototype.handleReponseInfo=function(e,t,n){return t?(e&&e.innerDataChange&&!0!==n&&this.repository.handleDataChangeDetails(e.innerDataChange),e&&e.innerVariableChange&&this.repository.handleVariableChangeDetail(e.innerVariableChange),this.repository.clearAllEntityChanges(),e):this.unWrapResponseInfo(e)},Oe.prototype.handleErrors=function(e,t,n){if(this.clearLoading(),t)return b.throwError(e);var r=this.repository.appContext.getFormAppContext(),o=r.ApplicationId,i=window[o]||{},a=A.parseBackEndError(e),s=fe.getFormlessMessages(a),p=!!i.isExceptionHandlerExist,u=s&&0<s.length||!1,c=!(e&&e.error&&e.error.extensionMessage&&fe.isBackEndMessageHandlerExist(this.repository.getInjector())&&!u),h=!!this.eventBus&&p&&c;return fe.handleMessage(a,this.repository.getInjector(),{hasThrowError:h,isException:!0,eventBus:this.eventBus,error:e,formAppContext:r}),this.eventBus&&p&&!A.isReported401Error(e)?(c&&this.eventBus.post("Exception","","onException",e,r),n?b.of(null):b.EMPTY):b.throwError(e)},Oe.prototype.clearLoading=function(){var e,t;if(!1!==(window.DEVKIT_LOADING_SERVICE&&window.DEVKIT_LOADING_SERVICE instanceof Array&&0<window.DEVKIT_LOADING_SERVICE.length||!1)){var n=window.DEVKIT_LOADING_SERVICE;try{for(var r=P(n),o=r.next();!o.done;o=r.next()){var i=o.value;"function"==typeof i.clearAll&&i.clearAll()}}catch(a){e={error:a}}finally{try{o&&!o.done&&(t=r["return"])&&t.call(r)}finally{if(e)throw e.error}}}},Oe.prototype.unWrapResponseInfo=function(e){return A.unWrapResponseInfo(e)},Oe.prototype.hasRequestInfo=function(e){return T.hasRequestInfoWithR(e)},Oe.prototype.existRequestInfo=function(e){return T.hasRequestInfo(e)},Oe.prototype.buildParams=function(e){return M.buildParams(e)},Oe.prototype.buildBodyWithRequestInfo=function(e){return T.buildBodyWithRequestInfo(e,this.repository)},Oe.prototype.buildRequestInfo=function(){return T.buildRequestInfo(this.repository)},Oe.decorators=[{type:i.Injectable}],Oe.ctorParameters=function(){return[{type:h.HttpClient},{type:String},{type:f},{type:Ee},{type:I.EventBus}]},Oe);function Oe(e,t,n,r,o){this.httpClient=e,this.httpService=new V(this.httpClient),this.baseUri=t;var i=r.getInjector();this.sessionService=new Y(e,t,n,i),this.repository=r,this.eventBus=o}var Te=(je.prototype.getData=function(e,t){var n=e.split(".")[0],r=e.split(".")[1];return t=t||{},!0===this.ifEnableExtendLoadMethod(e)?this.extendGetHelpData(r,n,t):this.getHelpData(r,n,t)},je.prototype.saveUserSettings=function(e){var n=this;return this.befRepository.restService.invoke("/api/runtime/bcc/v1.0/datagrid/settings","POST",null,{body:e},!1).pipe(d.catchError(function(e){var t=n.befRepository.appContext.getFormAppContext();return n.befRepository.restService.eventBus.post("Exception","","onException",e,t),b.EMPTY}))},je.prototype.getUserSettings=function(e){var n=this,t="/api/runtime/bcc/v1.0/datagrid/settings/"+e;return this.befRepository.restService.invoke(t,"GET",null,null,!1).pipe(d.catchError(function(e){var t=n.befRepository.appContext.getFormAppContext();return n.befRepository.restService.eventBus.post("Exception","","onException",e,t),b.EMPTY}))},je.prototype.ifEnableExtendLoadMethod=function(e){if(this.context&&this.context.hasOwnProperty("enableExtendLoadMethod"))return this.context.enableExtendLoadMethod;var t=!1;if(this.frameContext){var n=e+"@"+this.frameContext.repository.apiUri;t=this.frameContext.getParam(n)}return t},je.prototype.getHelpData=function(e,t,n){var r=this,o=this.befRepository.restService.baseUri+"/elementhelps/"+e;return this.befRepository.updateDataAndVariableChanges().pipe(d.switchMap(function(){return r.befRepository.restService.invoke(o,"GET",{nodeCode:t,queryParam:JSON.stringify(n)},null,!1).pipe(d.catchError(function(e){var t=r.befRepository.appContext.getFormAppContext();return r.befRepository.restService.eventBus.post("Exception","","onException",e,t),b.EMPTY}))}))},je.prototype.extendGetHelpData=function(e,t,n){var r=this,o=this.befRepository.restService.baseUri+"/extension/elementhelps",i={body:{labelId:e,nodeCode:t,queryParam:n,requestInfo:this.befRepository.restService.buildRequestInfo()}};return this.befRepository.restService.invoke(o,"PUT",null,i,!1,!0,!0).pipe(d.map(function(e){return e&&e.returnValue||null}),d.catchError(function(e){var t=r.befRepository.appContext.getFormAppContext();return r.befRepository.restService.eventBus.post("Exception","","onException",e,t),b.EMPTY}))},je.prototype.convert2TreeDataWithPathCode=function(r,t,n){var o=this;void 0===t&&(t=1),void 0===n&&(n="01");var e=r.filter(function(e){return e.layer===t&&e.pathcode===n});if(1<t&&(e=r.filter(function(e){return e.layer===t&&e.pathcode.substr(0,2*(t-1))===n})),e.length){var i=e.map(function(e){return{data:e,children:[]}});return i.forEach(function(e){var t,n=o.convert2TreeDataWithPathCode(r,e.data.layer+1,e.data.pathcode);(t=e.children).push.apply(t,D(n))}),i}},je.decorators=[{type:i.Injectable}],je.ctorParameters=function(){return[{type:I.Repository},{type:I.FrameContext,decorators:[{type:i.Optional}]}]},je);function je(e,t){this.frameContext=t,this.befRepository=e}var Ae=(Ue.prototype.createSession=function(e){var t=this.sessionService.getUserSessionId();return t?this.befRepository.restService.invoke(e,"POST",null,{headers:new h.HttpHeaders({SessionId:t}),responseType:"text"},!1).pipe(d.switchMap(function(e){return b.of({status:!0,payload:e})})):b.of({status:!1,payload:"用户登录信息已过期,请重新登录"})},Ue.prototype.getData=function(e,t){var n=this,r={};t.condition&&(r=t.condition),"/"===e[e.length-1]&&(e=e.substr(0,e.length-1));var o=e+"/extension/query",i=e+"/service/createsession";if(r){var a=JSON.stringify(r);o=o+"?entityFilter="+a}return this.createSession(i).pipe(d.switchMap(function(e){if(e.status)return e.payload,n.befRepository.restService.invoke(o,"PUT",null,{},!1);throw new Error(e.payload)}),s.map(function(e){var t=e.returnValue,n={items:t.result};return t.pagination?Object.assign({},n,{total:t.pagination.totalCount,pageInfo:{pageSize:t.pagination.pageSize,pageIndex:t.pagination.pageIndex,enablePager:!0}}):n}))},Ue.decorators=[{type:i.Injectable}],Ue.ctorParameters=function(){return[{type:I.Repository},{type:f}]},Ue);function Ue(e,t){this.sessionService=t,this.befRepository=e}var Ve=(He.isExistUnsaveData=function(e){var t=!1;if(!e||!e.entityCollection)throw"Current Object is null or it's entityCollection is null.";var n=e.entityCollection.toArray();if(e.dataChangeHistory.isChanged())return!0;for(var r=0;r<n.length;r++)if(0<n[r].changes.length){t=!0;break}return t},He);function He(){}var ke=(Fe.prototype.toString=function(){return this.url},Fe);function Fe(e,t){void 0===t&&(t=null);var n=this;this.url=e,this.paths=t,this.paths&&Object.keys(t).forEach(function(e){-1!==n.url.indexOf("{"+e+"}")&&(n.url=n.url.replace("{"+e+"}",""+t[e]))})}var Ne=(_e.prototype.getData=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n="GET");var r=new h.HttpHeaders({"content-type":"application/json"});return"get"!==n.toLowerCase()?this.befRest.restService.invoke(e,n,null,{headers:r,body:t}):this.befRest.restService.invoke(e,n,t,{headers:r})},_e.decorators=[{type:i.Injectable}],_e.ctorParameters=function(){return[{type:I.Repository}]},_e);function _e(e){this.befRest=e}var Le=(Ke.prototype.getData=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n="GET");var r=new h.HttpHeaders({"content-type":"application/json"});return this.befRest.restService.invoke(e,n,t,{headers:r})},Ke.decorators=[{type:i.Injectable}],Ke.ctorParameters=function(){return[{type:I.Repository}]},Ke);function Ke(e){this.befRest=e}var Ge,Je=(x(ze,Ge=Ee),ze.prototype.batchAppend=function(e){throw new Error("Method not implemented.")},ze);function ze(e,t,n,r,o){var i=Ge.call(this,e)||this;i.name=t,i.entityType=n,i.serverUri=r,i.apiUri=o,i.apiUri=o;var a={};a[n.typeName]={pageSize:20},i.paginationInfo=a,i.entityTypeInfo=new I.DataTypeInfo(i.entityType),i.entityCollection=new I.EntityCollection(i.entityType),i.entityManager=new re(i.entityCollection);var s=e.get(h.HttpClient),p=new xe(r),u=new we(s,p),c=p.extendUri(o);return u.setBaseUri(c),i.dataService=new le(e,i),i.serverUri=e.get(y),i}var We,Ye=(x(Qe,We=Ee),Qe.prototype.batchAppend=function(e){throw new Error("Method not implemented.")},Qe);function Qe(e,t){var n=We.call(this,e)||this;n.schema=t;var r=new I.EntityTypeFactory;return n.entityType=r.create(t),n.entityTypeInfo=new I.DataTypeInfo(n.entityType),n.entityCollection=new I.EntityCollection(n.entityType),n.entityManager=new re(n.entityCollection),n}e.VERSION="ver.",e.ChangeDetailType=S,e.BE_SERVER_URI_TOKEN=y,e.BE_SESSION_HANDLING_STRATEGY_TOKEN=a,e.BefChangeBuilder=p,e.BefChangeHandler=c,e.BefSessionService=Y,e.BefRestService=Me,e.BefProxy=we,e.BefLookupRestService=Te,e.BefLookupDefaultService=Ae,e.BefRepository=Ee,e.FrameworkSessionService=f,e.NG_VARIABLE=Z,e.NgVariable=$,e.BefRepositoryUtil=Ve,e.BefDataPathUtil=he,e.UriService=xe,e.Uri=ke,e.DefaultComboHttpService=Ne,e.DefaultDynamiControlGroupHttpService=Le,e.BefEntityManager=re,e.DynamicBefRepository=Je,e.PresetBefRepository=Ye,e.ɵa=ee,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=farris-bef.umd.min.js.map |
@@ -7,3 +7,4 @@ /** | ||
import { Injectable, Optional } from '@angular/core'; | ||
import { switchMap, map } from 'rxjs/operators'; | ||
import { EMPTY } from 'rxjs'; | ||
import { switchMap, map, catchError } from 'rxjs/operators'; | ||
import { Repository, FrameContext } from '@farris/devkit'; | ||
@@ -48,3 +49,12 @@ /** | ||
const url = '/api/runtime/bcc/v1.0/datagrid/settings'; | ||
return this.befRepository.restService.invoke(url, 'POST', null, { body: data }, false); | ||
return this.befRepository.restService.invoke(url, 'POST', null, { body: data }, false).pipe(catchError((/** | ||
* @param {?} error | ||
* @return {?} | ||
*/ | ||
error => { | ||
/** @type {?} */ | ||
const formAppContext = this.befRepository.appContext.getFormAppContext(); | ||
this.befRepository.restService.eventBus.post('Exception', '', 'onException', error, formAppContext); | ||
return EMPTY; | ||
}))); | ||
} | ||
@@ -58,3 +68,12 @@ /** | ||
const url = '/api/runtime/bcc/v1.0/datagrid/settings/' + key; | ||
return this.befRepository.restService.invoke(url, 'GET', null, null, false); | ||
return this.befRepository.restService.invoke(url, 'GET', null, null, false).pipe(catchError((/** | ||
* @param {?} error | ||
* @return {?} | ||
*/ | ||
error => { | ||
/** @type {?} */ | ||
const formAppContext = this.befRepository.appContext.getFormAppContext(); | ||
this.befRepository.restService.eventBus.post('Exception', '', 'onException', error, formAppContext); | ||
return EMPTY; | ||
}))); | ||
} | ||
@@ -103,3 +122,12 @@ /** | ||
// tslint:disable-next-line: max-line-length | ||
return this.befRepository.restService.invoke(url, 'GET', { nodeCode: tableName, queryParam: JSON.stringify(data) }, null, false); | ||
return this.befRepository.restService.invoke(url, 'GET', { nodeCode: tableName, queryParam: JSON.stringify(data) }, null, false).pipe(catchError((/** | ||
* @param {?} error | ||
* @return {?} | ||
*/ | ||
error => { | ||
/** @type {?} */ | ||
const formAppContext = this.befRepository.appContext.getFormAppContext(); | ||
this.befRepository.restService.eventBus.post('Exception', '', 'onException', error, formAppContext); | ||
return EMPTY; | ||
}))); | ||
}))); | ||
@@ -138,2 +166,11 @@ return result$; | ||
return responseInfo && responseInfo.returnValue || null; | ||
})), catchError((/** | ||
* @param {?} error | ||
* @return {?} | ||
*/ | ||
error => { | ||
/** @type {?} */ | ||
const formAppContext = this.befRepository.appContext.getFormAppContext(); | ||
this.befRepository.restService.eventBus.post('Exception', '', 'onException', error, formAppContext); | ||
return EMPTY; | ||
}))); | ||
@@ -212,2 +249,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLC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BsYXllciAmJiBkLnBhdGhjb2RlLnN1YnN0cigwLCAobGF5ZXIgLSAxKSAqIDIpID09PSBwYXJlbnRQYXRoQ29kZSk7XHJcbiAgICB9XHJcbiAgICBpZiAobm9kZXMubGVuZ3RoKSB7XHJcbiAgICAgIGNvbnN0IHRyZWVOb2RlcyA9IG5vZGVzLm1hcChuID0+IHtcclxuICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgZGF0YTogbixcclxuICAgICAgICAgIGNoaWxkcmVuOiBbXVxyXG4gICAgICAgIH07XHJcbiAgICAgIH0pO1xyXG5cclxuICAgICAgdHJlZU5vZGVzLmZvckVhY2godG4gPT4ge1xyXG4gICAgICAgIGNvbnN0IF90bnMgPSB0aGlzLmNvbnZlcnQyVHJlZURhdGFXaXRoUGF0aENvZGUoZGF0YSwgdG4uZGF0YS5sYXllciArIDEsIHRuLmRhdGEucGF0aGNvZGUpO1xyXG4gICAgICAgIHRuLmNoaWxkcmVuLnB1c2goLi4uX3Rucyk7XHJcbiAgICAgIH0pO1xyXG5cclxuICAgICAgcmV0dXJuIHRyZWVOb2RlcztcclxuICAgIH1cclxuICB9XHJcbn0iXX0= |
@@ -8,3 +8,4 @@ /** | ||
import { Injectable, Optional } from '@angular/core'; | ||
import { switchMap, map } from 'rxjs/operators'; | ||
import { EMPTY } from 'rxjs'; | ||
import { switchMap, map, catchError } from 'rxjs/operators'; | ||
import { Repository, FrameContext } from '@farris/devkit'; | ||
@@ -54,5 +55,15 @@ /** | ||
function (data) { | ||
var _this = this; | ||
/** @type {?} */ | ||
var url = '/api/runtime/bcc/v1.0/datagrid/settings'; | ||
return this.befRepository.restService.invoke(url, 'POST', null, { body: data }, false); | ||
return this.befRepository.restService.invoke(url, 'POST', null, { body: data }, false).pipe(catchError((/** | ||
* @param {?} error | ||
* @return {?} | ||
*/ | ||
function (error) { | ||
/** @type {?} */ | ||
var formAppContext = _this.befRepository.appContext.getFormAppContext(); | ||
_this.befRepository.restService.eventBus.post('Exception', '', 'onException', error, formAppContext); | ||
return EMPTY; | ||
}))); | ||
}; | ||
@@ -68,5 +79,15 @@ /** | ||
function (key) { | ||
var _this = this; | ||
/** @type {?} */ | ||
var url = '/api/runtime/bcc/v1.0/datagrid/settings/' + key; | ||
return this.befRepository.restService.invoke(url, 'GET', null, null, false); | ||
return this.befRepository.restService.invoke(url, 'GET', null, null, false).pipe(catchError((/** | ||
* @param {?} error | ||
* @return {?} | ||
*/ | ||
function (error) { | ||
/** @type {?} */ | ||
var formAppContext = _this.befRepository.appContext.getFormAppContext(); | ||
_this.befRepository.restService.eventBus.post('Exception', '', 'onException', error, formAppContext); | ||
return EMPTY; | ||
}))); | ||
}; | ||
@@ -136,3 +157,12 @@ /** | ||
// tslint:disable-next-line: max-line-length | ||
return _this.befRepository.restService.invoke(url, 'GET', { nodeCode: tableName, queryParam: JSON.stringify(data) }, null, false); | ||
return _this.befRepository.restService.invoke(url, 'GET', { nodeCode: tableName, queryParam: JSON.stringify(data) }, null, false).pipe(catchError((/** | ||
* @param {?} error | ||
* @return {?} | ||
*/ | ||
function (error) { | ||
/** @type {?} */ | ||
var formAppContext = _this.befRepository.appContext.getFormAppContext(); | ||
_this.befRepository.restService.eventBus.post('Exception', '', 'onException', error, formAppContext); | ||
return EMPTY; | ||
}))); | ||
}))); | ||
@@ -161,2 +191,3 @@ return result$; | ||
function (labelId, tableName, data) { | ||
var _this = this; | ||
/** @type {?} */ | ||
@@ -183,2 +214,11 @@ var url = this.befRepository.restService.baseUri + "/extension/elementhelps"; | ||
return responseInfo && responseInfo.returnValue || null; | ||
})), catchError((/** | ||
* @param {?} error | ||
* @return {?} | ||
*/ | ||
function (error) { | ||
/** @type {?} */ | ||
var formAppContext = _this.befRepository.appContext.getFormAppContext(); | ||
_this.befRepository.restService.eventBus.post('Exception', '', 'onException', error, formAppContext); | ||
return EMPTY; | ||
}))); | ||
@@ -270,2 +310,2 @@ }; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIj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7XHJcbiAgICB9XHJcbiAgfVxyXG59Il19 |
{ | ||
"name": "@farris/bef", | ||
"version": "0.0.12-20211026084402-dev", | ||
"version": "0.0.12-20211125133355-dev", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "@angular/common": "^7.2.0", |
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 too big to display
Sorry, the diff of this file is too big to display
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
3527181
43255