@adins/ucviewgeneric 2.0.76 → 2.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/adins-ucviewgeneric.metadata.json +1 -1
- package/bundles/adins-ucviewgeneric.umd.js +49 -25
- package/bundles/adins-ucviewgeneric.umd.js.map +1 -1
- package/bundles/adins-ucviewgeneric.umd.min.js +1 -1
- package/bundles/adins-ucviewgeneric.umd.min.js.map +1 -1
- package/esm2015/lib/ucviewgeneric.component.js +32 -15
- package/esm5/lib/ucviewgeneric.component.js +50 -26
- package/fesm2015/adins-ucviewgeneric.js +31 -14
- package/fesm2015/adins-ucviewgeneric.js.map +1 -1
- package/fesm5/adins-ucviewgeneric.js +49 -25
- package/fesm5/adins-ucviewgeneric.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/common/http"),require("ngx-cookie"),require("crypto-js"),require("@angular/core"),require("@angular/common"),require("@angular/router"),require("@adins/uc-subsection"),require("@ngx-translate/core")):"function"==typeof define&&define.amd?define("@adins/ucviewgeneric",["exports","@angular/common/http","ngx-cookie","crypto-js","@angular/core","@angular/common","@angular/router","@adins/uc-subsection","@ngx-translate/core"],n):n((e.adins=e.adins||{},e.adins.ucviewgeneric={}),e.ng.common.http,e.ngxCookie,e.CryptoJS,e.ng.core,e.ng.common,e.ng.router,e.ucSubsection,e.core)}(this,function(e,n,i,s,r,t,o,a,l){"use strict";var c=(u.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],u.ctorParameters=function(){return[]},u.ngInjectableDef=r.defineInjectable({factory:function(){return new u},token:u,providedIn:"root"}),u);function u(){}var p=function b(){this.viewInput="",this.viewEnvironment="",this.ddlEnvironments=new Array,this.listEnvironments=new Array,this.whereValue=new Array},f=(m.prototype.ngOnInit=function(){console.log("viewgeneric"),this.initiateForm()},m.prototype.initiateForm=function(){var a=this;this.getJSON(this.viewGenericObj.viewInput).subscribe(function(e){a.viewList=e,a.viewInfoObjList=[];for(var n=0;n<a.viewList.subsection.length;n++)a.viewInfoObjList.push(n);for(var i,t=function(o){null!=a.viewList.subsection[o].querystring?(0==a.viewGenericObj.whereValue.length?a.viewList.subsection[o].querystring.whereQuery=Object.values(a.getList):a.viewList.subsection[o].querystring.whereQuery=a.viewGenericObj.whereValue,a.viewList.subsection[o].mainInfoPath!=undefined&&""!=a.viewList.subsection[o].mainInfoPath&&a.viewGenericObj.viewEnvironment!=undefined&&""!=a.viewGenericObj.viewEnvironment?a.viewList.subsection[o].fullpath=a.viewGenericObj.viewEnvironment+a.viewList.subsection[o].mainInfoPath:a.viewList.subsection[o].fullpath=a.viewList.subsection[o].mainInfoUrl,i={querystring:a.viewList.subsection[o].querystring},a.http.post(a.viewList.subsection[o].fullpath,i).subscribe(function(e){a.viewInfoObjList[o]=e.Data[0];for(var n=0;n<a.viewList.subsection[o].mainInfo.length;n++){if(a.viewList.subsection[o].mainInfo[n].propertyList!=undefined&&0!=a.viewList.subsection[o].mainInfo[n].propertyList.length){for(var i=a.viewList.subsection[o].mainInfo[n].propertyList,t="",s=0;s<i.length;s++)t=t+i[s].prefix+a.viewInfoObjList[o][i[s].property]+i[s].suffix;a.viewList.subsection[o].mainInfo[n].concat=t}if("link"==a.viewList.subsection[o].mainInfo[n].type&&(a.viewGenericObj.navigationConst!=undefined||null!=a.viewGenericObj.navigationConst)){var r=a.viewGenericObj.navigationConst[a.viewList.subsection[o].mainInfo[n].path];r!=undefined&&null!=r&&(a.viewList.subsection[o].mainInfo[n].path=r)}if("link"==a.viewList.subsection[o].mainInfo[n].type&&a.viewGenericObj.ddlEnvironments!=undefined&&0!=a.viewGenericObj.ddlEnvironments.length){for(s=0;s<a.viewGenericObj.ddlEnvironments.length;s++)if(a.viewList.subsection[o].mainInfo[n].name==a.viewGenericObj.ddlEnvironments[s].name){a.viewList.subsection[o].mainInfo[n].isFullpath=!0,a.viewList.subsection[o].mainInfo[n].fullpath=a.viewGenericObj.ddlEnvironments[s].environment+a.viewList.subsection[o].mainInfo[n].path;break}}else if("link"==a.viewList.subsection[o].mainInfo[n].type&&a.viewGenericObj.listEnvironments!=undefined&&0!=a.viewGenericObj.listEnvironments.length){for(s=0;s<a.viewGenericObj.listEnvironments.length;s++)if(a.viewList.subsection[o].mainInfo[n].environment==a.viewGenericObj.listEnvironments[s].environment){a.viewList.subsection[o].mainInfo[n].isFullpath=!0,a.viewList.subsection[o].mainInfo[n].fullpath=a.viewGenericObj.listEnvironments[s].url+a.viewList.subsection[o].mainInfo[n].path;break}}else"link"==a.viewList.subsection[o].mainInfo[n].type&&(a.viewList.subsection[o].mainInfo[n].isFullpath=!1,a.viewList.subsection[o].mainInfo[n].fullpath=a.viewList.subsection[o].mainInfo[n].path)}a.isReady=!0},function(e){console.log(e)})):(a.viewList.subsection[o].mainInfoPath!=undefined&&""!=a.viewList.subsection[o].mainInfoPath&&a.viewGenericObj.viewEnvironment!=undefined&&""!=a.viewGenericObj.viewEnvironment?a.viewList.subsection[o].fullpath=a.viewGenericObj.viewEnvironment+a.viewList.subsection[o].mainInfoPath:a.viewList.subsection[o].fullpath=a.viewList.subsection[o].mainInfoUrl,a.http.post(a.viewList.subsection[o].fullpath,a.getList).subscribe(function(e){a.viewInfoObjList[o]=e.Data},function(e){console.log(e)}))},s=0;s<a.viewList.subsection.length;s++)t(s)})},m.prototype.getJSON=function(e){return this.http.get(e)},m.prototype.GetCookie=function(e,n){var i=e.get(n);return i==undefined||""==i.trim()?null:this.DecryptString(i,"AdInsFOU12345678")},m.prototype.DecryptString=function(e,n){if(n==undefined||""==n.trim()||e==undefined||""==e.trim())return e;var i=s.enc.Utf8.parse(n),t=s.lib.WordArray.create([0,0,0,0]);return s.AES.decrypt(e,i,{iv:t}).toString(s.enc.Utf8)},m.prototype.genAction=function(e,n){for(var i={},t=0;t<n.length;t++)e[n[t].type]!=undefined||e[n[t].property]!=undefined?i[n[t].type]=e[n[t].property]:i[n[t].type]=n[t].property;return i},m.prototype.genRouterLink=function(e){var n=e;return this.viewGenericObj.navigationConst!=undefined&&null!=this.viewGenericObj.navigationConst[e]&&(n=this.viewGenericObj.navigationConst[e]),n},m.prototype.redirectFullPath=function(e,n,i){for(var t="",s=Object.keys(n),r=0;r<s.length;r++)t=""!=t?t+"&"+s[r]+"="+n[s[r]]:s[r]+"="+n[s[r]];window.open(e+"?"+t,i)},m.prototype.callbackFunction=function(e,n){void 0===n&&(n="");var i={ViewObj:e,Key:n};this.callback.emit(i)},m.prototype.switchCase=function(n,i){for(var t=this,e=!1,s=0;s<i.conditions.length;s++)if("EQ"==i.conditions[s].restriction)if(1!=i.conditions[s].isUser){if(n[i.conditions[s].property]!=i.conditions[s].value){e=!1;break}e=!0}else{if(n[i.conditions[s].property]!=this.UserAccess.UserName){e=!1;break}e=!0}else if("NEQ"==i.conditions[s].restriction)if(1!=i.conditions[s].isUser){if(n[i.conditions[s].property]==i.conditions[s].value){e=!1;break}e=!0}else{if(n[i.conditions[s].property]==this.UserAccess.UserName){e=!1;break}e=!0}else if("GT"==i.conditions[s].restriction)if(1!=i.conditions[s].isUser){if(!(n[i.conditions[s].property]>i.conditions[s].value)){e=!1;break}e=!0}else{if(!(n[i.conditions[s].property]>this.UserAccess.UserName)){e=!1;break}e=!0}else if("GTE"==i.conditions[s].restriction)if(1!=i.conditions[s].isUser){if(!(n[i.conditions[s].property]>=i.conditions[s].value)){e=!1;break}e=!0}else{if(!(n[i.conditions[s].property]>=this.UserAccess.UserName)){e=!1;break}e=!0}else if("LT"==i.conditions[s].restriction)if(1!=i.conditions[s].isUser){if(!(n[i.conditions[s].property]<i.conditions[s].value)){e=!1;break}e=!0}else{if(!(n[i.conditions[s].property]<this.UserAccess.UserName)){e=!1;break}e=!0}else if("LTE"==i.conditions[s].restriction)if(1!=i.conditions[s].isUser){if(!(n[i.conditions[s].property]<=i.conditions[s].value)){e=!1;break}e=!0}else{if(!(n[i.conditions[s].property]<=this.UserAccess.UserName)){e=!1;break}e=!0}else if("IN"==i.conditions[s].restriction)if(1!=i.conditions[s].isUser){if(!(0<=i.conditions[s].value.findIndex(function(e){return e==n[i.conditions[s].property]}))){e=!1;break}e=!0}else{if(!(0<=i.conditions[s].value.findIndex(function(e){return e==t.UserAccess.UserName}))){e=!1;break}e=!0}else if("NIN"==i.conditions[s].restriction)if(1!=i.conditions[s].isUser){if(-1!=i.conditions[s].value.findIndex(function(e){return e==n[i.conditions[s].property]})){e=!1;break}e=!0}else{if(-1!=i.conditions[s].value.findIndex(function(e){return e==t.UserAccess.UserName})){e=!1;break}e=!0}return e},m.decorators=[{type:r.Component,args:[{selector:"lib-ucviewgeneric",template:'<section id="horizontal-form-layouts">\r\n <div class="row text-left">\r\n <div class="col-md-12">\r\n <div class="card" *ngIf="isReady">\r\n <div class="pl-3 mb-2 mt-2" *ngIf="viewList?.title != \'\'">\r\n <h4 class="card-title ucSearch-title" id="horz-layout-colored-controls" translate>{{viewList.title}}</h4>\r\n </div>\r\n <div class="card-body" *ngFor="let ss of viewList?.subsection;let i = index;">\r\n <div class="px-3">\r\n <lib-ucSubsection *ngIf="ss.subsection != \'\'" [id]="ss.subSectionId + \'id\'" [title]="ss.subSectionTitle"\r\n [panel]="ss.subSectionId">\r\n </lib-ucSubsection>\r\n <div class="form-body" [id]=\'ss.subSectionId\'>\r\n <div class="form-group row">\r\n <div *ngFor="let mi of ss?.mainInfo"\r\n [ngClass]="{ \'col-md-6\': mi.isHide == undefined || !mi.isHide || (viewInfoObjList[i][mi.property] != \'\' && viewInfoObjList[i][mi.property] != null)}">\r\n <span\r\n *ngIf="mi.isHide == undefined || !mi.isHide || (viewInfoObjList[i][mi.property] != \'\' && viewInfoObjList[i][mi.property] != null)">\r\n <div class="row">\r\n <div class="col-md-6" *ngIf="mi.type != \'switch\'">\r\n <label class="label-control"\r\n [ngClass]="mi.customClassLabel != undefined ? mi.customClassLabel : \'\'" translate>{{mi.label}}</label>\r\n </div>\r\n <div class="col-md-6" *ngIf="mi.type == \'switch\'">\r\n <div *ngFor="let case of mi?.case">\r\n <div *ngIf="switchCase(viewInfoObjList[i],case)">\r\n <label class="label-control"\r\n [ngClass]="mi.customClassLabel != undefined ? mi.customClassLabel : \'\'" translate>{{case.result.label}}</label>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf="viewInfoObjList[i] != undefined" class="col-md-6" [ngClass]="{ \'text-left\': mi.position == \'left\',\r\n \'text-right\': mi.position == \'right\', \'text-center\': mi.position == \'center\' }">\r\n <span\r\n *ngIf="(mi.type == \'boolean\' && viewInfoObjList[i][mi.property] != null) || (viewInfoObjList[i][mi.property] != \'\' && viewInfoObjList[i][mi.property] != null) || mi.type == \'switch\' || mi.type ==\'concat\'; then nonEmptyLabel else emptyLabel"></span>\r\n <ng-template #emptyLabel>\r\n <label class="label-control"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate>-</label>\r\n </ng-template>\r\n <ng-template #nonEmptyLabel>\r\n <span *ngIf="mi.type == \'text\'">\r\n <label\r\n *ngIf="viewInfoObjList[i][mi.property] != \'\' && viewInfoObjList[i][mi.property] != null"\r\n class="label-control breakword"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n {{ viewInfoObjList[i][mi.property] }}\r\n </label>\r\n <label\r\n *ngIf="viewInfoObjList[i][mi.property] == \'\' || viewInfoObjList[i][mi.property] == null"\r\n class="label-control"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>-\r\n </label>\r\n </span>\r\n <label *ngIf="mi.type == \'currency\'" class="label-control"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n {{ viewInfoObjList[i][mi.property] | number: mi?.precision ? mi?.precision : \'0.2\' :\'en-US\'}} <span *ngIf="mi?.IsPrcnt"> %</span> </label>\r\n <label *ngIf="mi.type == \'date\'" class="label-control"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n {{ viewInfoObjList[i][mi.property] | date: \'dd-MMM-yyyy\'}} </label>\r\n <label *ngIf="mi.type == \'link\'" class="label-control"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n <a *ngIf="!mi?.isFullpath" [routerLink]="genRouterLink(mi.path)" [target]="mi.target"\r\n [queryParams]="genAction(viewInfoObjList[i], mi.param)">\r\n <span *ngIf="(mi.isCurrency != undefined && mi.isCurrency)">{{\r\n viewInfoObjList[i][mi.property] | number:\'.2\':\'en-US\' }}</span>\r\n <span *ngIf="(mi.isCurrency == undefined || !mi.isCurrency)">{{\r\n viewInfoObjList[i][mi.property] }}</span>\r\n </a>\r\n <a *ngIf="mi?.isFullpath" href="javascript:void(0);"\r\n (click)="redirectFullPath(mi.fullpath, genAction(viewInfoObjList[i], mi.param), mi.target)">\r\n <span *ngIf="(mi.isCurrency != undefined && mi.isCurrency)">{{\r\n viewInfoObjList[i][mi.property] | number:\'.2\':\'en-US\' }}</span>\r\n <span *ngIf="(mi.isCurrency == undefined || !mi.isCurrency)">{{\r\n viewInfoObjList[i][mi.property] }}</span>\r\n </a>\r\n </label>\r\n <label *ngIf="mi.type == \'callback\'" class="label-control"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n <a href="javascript:void(0);" (click)="callbackFunction(viewInfoObjList[i], mi.key)">\r\n {{ viewInfoObjList[i][mi.property] }}\r\n </a>\r\n </label>\r\n <textarea *ngIf="mi.type == \'textarea\'" class="form-control" readonly\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate> {{ viewInfoObjList[i][mi.property] }} </textarea>\r\n <span *ngIf="mi.type == \'boolean\'"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n <label *ngIf="viewInfoObjList[i][mi.property] == true">Yes</label>\r\n <label *ngIf="viewInfoObjList[i][mi.property] == false">No</label>\r\n \x3c!-- <label\r\n *ngIf="viewInfoObjList[i][mi.property] == \'\' || viewInfoObjList[i][mi.property] == null">-</label> --\x3e\r\n </span>\r\n <span *ngIf="mi.type == \'concat\'">\r\n <label class="label-control breakword"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n {{ mi.concat }}\r\n </label>\r\n </span>\r\n <span *ngIf="mi.type == \'switch\'">\r\n <span *ngFor="let cs of mi?.case">\r\n <span *ngIf="switchCase(viewInfoObjList[i],cs)">\r\n <span class="label-control breakword"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate *ngIf="cs.result.type == \'text\'">{{ viewInfoObjList[i][cs.result.property]\r\n }}\r\n </span>\r\n <span [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate *ngIf="cs.result.type == \'decimal\'">{{\r\n viewInfoObjList[i][cs.result.property] | number:\'.2\':\'en-US\' }}</span>\r\n <span [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate *ngIf="cs.result.type == \'date\'">{{ viewInfoObjList[i][cs.result.property] |\r\n date: \'dd-MMM-yyyy\' }}\r\n </span>\r\n <span *ngIf="cs.result.type == \'link\'"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate>\r\n <a [target]="cs.result.target" [routerLink]="genRouterLink(cs.result.path)"\r\n [queryParams]="genAction(viewInfoObjList[i],cs.result.param)">\r\n <span *ngIf="(mi.isCurrency != undefined && mi.isCurrency)">{{\r\n viewInfoObjList[i][cs.result.property] | number:\'.2\':\'en-US\' }}</span>\r\n <span *ngIf="(mi.isCurrency == undefined || !mi.isCurrency)">{{\r\n viewInfoObjList[i][cs.result.property] }}</span>\r\n </a>\r\n </span>\r\n <span *ngIf="cs.result.type == \'boolean\'"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate>\r\n <span *ngIf="viewInfoObjList[i][cs.result.property] == \'true\'">Yes</span>\r\n <span *ngIf="viewInfoObjList[i][cs.result.property] == \'false\'">No</span>\r\n </span>\r\n </span>\r\n </span>\r\n </span>\r\n </ng-template>\r\n </div>\r\n </div>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</section>'}]}],m.ctorParameters=function(){return[{type:o.ActivatedRoute},{type:n.HttpClient},{type:l.TranslateService},{type:i.CookieService}]},m.propDecorators={viewGenericObj:[{type:r.Input}],callback:[{type:r.Output}]},m);function m(e,n,i,t){var s=this;this.route=e,this.http=n,this.translateService=i,this.cookieService=t,this.viewGenericObj=new p,this.callback=new r.EventEmitter,this.UserAccess=JSON.parse(this.GetCookie(this.cookieService,"UserAccess")),this.viewList="",this.isReady=!1,this.route.queryParams.subscribe(function(e){s.getList=e}),this.translateService.setDefaultLang("en"),this.translateService.use(localStorage.getItem("lang")||"en")}var d=(v.decorators=[{type:r.NgModule,args:[{declarations:[f],imports:[t.CommonModule,o.RouterModule,a.UcSubsectionModule,l.TranslateModule.forChild()],exports:[f]}]}],v);function v(){}e.UcviewgenericService=c,e.UcviewgenericComponent=f,e.UcviewgenericModule=d,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/common/http"),require("ngx-cookie"),require("crypto-js"),require("@angular/core"),require("@angular/common"),require("@angular/router"),require("@adins/uc-subsection"),require("@ngx-translate/core")):"function"==typeof define&&define.amd?define("@adins/ucviewgeneric",["exports","@angular/common/http","ngx-cookie","crypto-js","@angular/core","@angular/common","@angular/router","@adins/uc-subsection","@ngx-translate/core"],n):n((e.adins=e.adins||{},e.adins.ucviewgeneric={}),e.ng.common.http,e.ngxCookie,e.CryptoJS,e.ng.core,e.ng.common,e.ng.router,e.ucSubsection,e.core)}(this,function(e,n,i,r,s,t,o,a,c){"use strict";var l=(u.decorators=[{type:s.Injectable,args:[{providedIn:"root"}]}],u.ctorParameters=function(){return[]},u.ngInjectableDef=s.defineInjectable({factory:function(){return new u},token:u,providedIn:"root"}),u);function u(){}var p=function b(){this.viewInput="",this.viewEnvironment="",this.ddlEnvironments=new Array,this.listEnvironments=new Array,this.whereValue=new Array},f=(m.prototype.ngOnInit=function(){console.log("viewgeneric"),this.initiateForm()},m.prototype.initiateForm=function(){var c=this;this.getJSON(this.viewGenericObj.viewInput).subscribe(function(e){c.viewList=e,c.viewInfoObjList=[];for(var n=0;n<c.viewList.subsection.length;n++)c.viewInfoObjList.push(n);for(var i=function(a){var e;null!=c.viewList.subsection[a].querystring?(0==c.viewGenericObj.whereValue.length?c.viewList.subsection[a].querystring.whereQuery=Object.values(c.getList):c.viewList.subsection[a].querystring.whereQuery=c.viewGenericObj.whereValue,c.viewList.subsection[a].mainInfoPath!=undefined&&""!=c.viewList.subsection[a].mainInfoPath&&c.viewGenericObj.viewEnvironment!=undefined&&""!=c.viewGenericObj.viewEnvironment?c.viewList.subsection[a].fullpath=c.viewGenericObj.viewEnvironment+c.viewList.subsection[a].mainInfoPath:c.viewList.subsection[a].fullpath=c.viewList.subsection[a].mainInfoUrl,e={querystring:c.viewList.subsection[a].querystring},c.http.post(c.viewList.subsection[a].fullpath,e).subscribe(function(e){c.viewInfoObjList[a]=e.Data[0];for(var n=0;n<c.viewList.subsection[a].mainInfo.length;n++){if(c.viewList.subsection[a].mainInfo[n].propertyList!=undefined&&0!=c.viewList.subsection[a].mainInfo[n].propertyList.length){for(var i=c.viewList.subsection[a].mainInfo[n].propertyList,t="",r=0;r<i.length;r++)t=t+i[r].prefix+c.viewInfoObjList[a][i[r].property]+i[r].suffix;c.viewList.subsection[a].mainInfo[n].concat=t}if("switch"==c.viewList.subsection[a].mainInfo[n].type)for(var s=0;s<c.viewList.subsection[a].mainInfo["case"].length;s++)if(c.viewList.subsection[a].mainInfo[s]["case"].result.propertyList!=undefined&&0!=c.viewList.subsection[a].mainInfo[s]["case"].result.propertyList.length){for(i=c.viewList.subsection[a].mainInfo[s]["case"].result.propertyList,t="",r=0;r<i.length;r++)t=t+i[r].prefix+c.viewInfoObjList[a][i[r].property]+i[r].suffix;c.viewList.subsection[a].mainInfo[s]["case"].result.concat=t}if("link"==c.viewList.subsection[a].mainInfo[n].type&&(c.viewGenericObj.navigationConst!=undefined||null!=c.viewGenericObj.navigationConst)){var o=c.viewGenericObj.navigationConst[c.viewList.subsection[a].mainInfo[n].path];o!=undefined&&null!=o&&(c.viewList.subsection[a].mainInfo[n].path=o)}if("link"==c.viewList.subsection[a].mainInfo[n].type&&c.viewGenericObj.ddlEnvironments!=undefined&&0!=c.viewGenericObj.ddlEnvironments.length){for(r=0;r<c.viewGenericObj.ddlEnvironments.length;r++)if(c.viewList.subsection[a].mainInfo[n].name==c.viewGenericObj.ddlEnvironments[r].name){c.viewList.subsection[a].mainInfo[n].isFullpath=!0,c.viewList.subsection[a].mainInfo[n].fullpath=c.viewGenericObj.ddlEnvironments[r].environment+c.viewList.subsection[a].mainInfo[n].path;break}}else if("link"==c.viewList.subsection[a].mainInfo[n].type&&c.viewGenericObj.listEnvironments!=undefined&&0!=c.viewGenericObj.listEnvironments.length){for(r=0;r<c.viewGenericObj.listEnvironments.length;r++)if(c.viewList.subsection[a].mainInfo[n].environment==c.viewGenericObj.listEnvironments[r].environment){c.viewList.subsection[a].mainInfo[n].isFullpath=!0,c.viewList.subsection[a].mainInfo[n].fullpath=c.viewGenericObj.listEnvironments[r].url+c.viewList.subsection[a].mainInfo[n].path;break}}else"link"==c.viewList.subsection[a].mainInfo[n].type&&(c.viewList.subsection[a].mainInfo[n].isFullpath=!1,c.viewList.subsection[a].mainInfo[n].fullpath=c.viewList.subsection[a].mainInfo[n].path)}c.isReady=!0},function(e){console.log(e)})):(c.viewList.subsection[a].mainInfoPath!=undefined&&""!=c.viewList.subsection[a].mainInfoPath&&c.viewGenericObj.viewEnvironment!=undefined&&""!=c.viewGenericObj.viewEnvironment?c.viewList.subsection[a].fullpath=c.viewGenericObj.viewEnvironment+c.viewList.subsection[a].mainInfoPath:c.viewList.subsection[a].fullpath=c.viewList.subsection[a].mainInfoUrl,c.http.post(c.viewList.subsection[a].fullpath,c.getList).subscribe(function(e){c.viewInfoObjList[a]=e.Data},function(e){console.log(e)}))},t=0;t<c.viewList.subsection.length;t++)i(t)})},m.prototype.getJSON=function(e){return this.http.get(e)},m.prototype.GetCookie=function(e,n){var i=e.get(n);return i==undefined||""==i.trim()?null:this.DecryptString(i,"AdInsFOU12345678")},m.prototype.DecryptString=function(e,n){if(n==undefined||""==n.trim()||e==undefined||""==e.trim())return e;var i=r.enc.Utf8.parse(n),t=r.lib.WordArray.create([0,0,0,0]);return r.AES.decrypt(e,i,{iv:t}).toString(r.enc.Utf8)},m.prototype.genAction=function(e,n){for(var i={},t=0;t<n.length;t++)e[n[t].type]!=undefined||e[n[t].property]!=undefined?i[n[t].type]=e[n[t].property]:i[n[t].type]=n[t].property;return i},m.prototype.genRouterLink=function(e){var n=e;return this.viewGenericObj.navigationConst!=undefined&&null!=this.viewGenericObj.navigationConst[e]&&(n=this.viewGenericObj.navigationConst[e]),n},m.prototype.redirectFullPath=function(e,n,i){for(var t="",r=Object.keys(n),s=0;s<r.length;s++)t=""!=t?t+"&"+r[s]+"="+n[r[s]]:r[s]+"="+n[r[s]];window.open(e+"?"+t,i)},m.prototype.callbackFunction=function(e,n){void 0===n&&(n="");var i={ViewObj:e,Key:n};this.callback.emit(i)},m.prototype.switchCase=function(i,t){var r=this,e=!1;if(!i)return!1;for(var n=function(n){if("EQ"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(i[t.conditions[n].property]!=t.conditions[n].value)return e=!1,"break";e=!0}else{if(i[t.conditions[n].property]!=s.UserAccess.UserName)return e=!1,"break";e=!0}else if("NEQ"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(i[t.conditions[n].property]==t.conditions[n].value)return e=!1,"break";e=!0}else{if(i[t.conditions[n].property]==s.UserAccess.UserName)return e=!1,"break";e=!0}else if("GT"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(!(i[t.conditions[n].property]>t.conditions[n].value))return e=!1,"break";e=!0}else{if(!(i[t.conditions[n].property]>s.UserAccess.UserName))return e=!1,"break";e=!0}else if("GTE"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(!(i[t.conditions[n].property]>=t.conditions[n].value))return e=!1,"break";e=!0}else{if(!(i[t.conditions[n].property]>=s.UserAccess.UserName))return e=!1,"break";e=!0}else if("LT"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(!(i[t.conditions[n].property]<t.conditions[n].value))return e=!1,"break";e=!0}else{if(!(i[t.conditions[n].property]<s.UserAccess.UserName))return e=!1,"break";e=!0}else if("LTE"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(!(i[t.conditions[n].property]<=t.conditions[n].value))return e=!1,"break";e=!0}else{if(!(i[t.conditions[n].property]<=s.UserAccess.UserName))return e=!1,"break";e=!0}else if("IN"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(!(0<=t.conditions[n].value.findIndex(function(e){return e==i[t.conditions[n].property]})))return e=!1,"break";e=!0}else{if(!(0<=t.conditions[n].value.findIndex(function(e){return e==r.UserAccess.UserName})))return e=!1,"break";e=!0}else if("NIN"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(-1!=t.conditions[n].value.findIndex(function(e){return e==i[t.conditions[n].property]}))return e=!1,"break";e=!0}else{if(-1!=t.conditions[n].value.findIndex(function(e){return e==r.UserAccess.UserName}))return e=!1,"break";e=!0}},s=this,o=0;o<t.conditions.length&&"break"!==n(o);o++);return e},m.decorators=[{type:s.Component,args:[{selector:"lib-ucviewgeneric",template:'<section id="horizontal-form-layouts">\r\n <div class="row text-left">\r\n <div class="col-md-12">\r\n <div class="card" *ngIf="isReady">\r\n <div class="pl-3 mb-2 mt-2" *ngIf="viewList?.title != \'\'">\r\n <h4 class="card-title ucSearch-title" id="horz-layout-colored-controls" translate>{{viewList.title}}</h4>\r\n </div>\r\n <div class="card-body" *ngFor="let ss of viewList?.subsection;let i = index;">\r\n <div class="px-3">\r\n <lib-ucSubsection *ngIf="ss.subsection != \'\'" [id]="ss.subSectionId + \'id\'" [title]="ss.subSectionTitle"\r\n [panel]="ss.subSectionId">\r\n </lib-ucSubsection>\r\n <div class="form-body" [id]=\'ss.subSectionId\'>\r\n <div class="form-group row">\r\n <div *ngFor="let mi of ss?.mainInfo"\r\n [ngClass]="{ \'col-md-6\': mi.isHide == undefined || !mi.isHide || (viewInfoObjList[i][mi.property] != \'\' && viewInfoObjList[i][mi.property] != null)}">\r\n <span\r\n *ngIf="mi.isHide == undefined || !mi.isHide || (viewInfoObjList[i][mi.property] != \'\' && viewInfoObjList[i][mi.property] != null)">\r\n <div class="row">\r\n <div class="col-md-6" *ngIf="mi.type != \'switch\'">\r\n <label class="label-control"\r\n [ngClass]="mi.customClassLabel != undefined ? mi.customClassLabel : \'\'" translate>{{mi.label}}</label>\r\n </div>\r\n <div class="col-md-6" *ngIf="mi.type == \'switch\'">\r\n <div *ngFor="let case of mi?.case">\r\n <div *ngIf="switchCase(viewInfoObjList[i],case)">\r\n <label class="label-control"\r\n [ngClass]="mi.customClassLabel != undefined ? mi.customClassLabel : \'\'" translate>{{case.result.label}}</label>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf="viewInfoObjList[i] != undefined" class="col-md-6" [ngClass]="{ \'text-left\': mi.position == \'left\',\r\n \'text-right\': mi.position == \'right\', \'text-center\': mi.position == \'center\' }">\r\n <span\r\n *ngIf="(mi.type == \'boolean\' && viewInfoObjList[i][mi.property] != null) || (viewInfoObjList[i][mi.property] != \'\' && viewInfoObjList[i][mi.property] != null) || mi.type == \'switch\' || mi.type ==\'concat\'; then nonEmptyLabel else emptyLabel"></span>\r\n <ng-template #emptyLabel>\r\n <label class="label-control"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate>-</label>\r\n </ng-template>\r\n <ng-template #nonEmptyLabel>\r\n <span *ngIf="mi.type == \'text\'">\r\n <label\r\n *ngIf="viewInfoObjList[i][mi.property] != \'\' && viewInfoObjList[i][mi.property] != null"\r\n class="label-control breakword"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n {{ viewInfoObjList[i][mi.property] }}\r\n </label>\r\n <label\r\n *ngIf="viewInfoObjList[i][mi.property] == \'\' || viewInfoObjList[i][mi.property] == null"\r\n class="label-control"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>-\r\n </label>\r\n </span>\r\n <label *ngIf="mi.type == \'currency\'" class="label-control"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n {{ viewInfoObjList[i][mi.property] | number: mi?.precision ? mi?.precision : \'0.2\' :\'en-US\'}} <span *ngIf="mi?.IsPrcnt"> %</span> </label>\r\n <label *ngIf="mi.type == \'date\'" class="label-control"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n {{ viewInfoObjList[i][mi.property] | date: \'dd-MMM-yyyy\'}} </label>\r\n <label *ngIf="mi.type == \'link\'" class="label-control"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n <a *ngIf="!mi?.isFullpath" [routerLink]="genRouterLink(mi.path)" [target]="mi.target"\r\n [queryParams]="genAction(viewInfoObjList[i], mi.param)">\r\n <span *ngIf="(mi.isCurrency != undefined && mi.isCurrency)">{{\r\n viewInfoObjList[i][mi.property] | number:\'.2\':\'en-US\' }}</span>\r\n <span *ngIf="(mi.isCurrency == undefined || !mi.isCurrency)">{{\r\n viewInfoObjList[i][mi.property] }}</span>\r\n </a>\r\n <a *ngIf="mi?.isFullpath" href="javascript:void(0);"\r\n (click)="redirectFullPath(mi.fullpath, genAction(viewInfoObjList[i], mi.param), mi.target)">\r\n <span *ngIf="(mi.isCurrency != undefined && mi.isCurrency)">{{\r\n viewInfoObjList[i][mi.property] | number:\'.2\':\'en-US\' }}</span>\r\n <span *ngIf="(mi.isCurrency == undefined || !mi.isCurrency)">{{\r\n viewInfoObjList[i][mi.property] }}</span>\r\n </a>\r\n </label>\r\n <label *ngIf="mi.type == \'callback\'" class="label-control"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n <a href="javascript:void(0);" (click)="callbackFunction(viewInfoObjList[i], mi.key)">\r\n {{ viewInfoObjList[i][mi.property] }}\r\n </a>\r\n </label>\r\n <textarea *ngIf="mi.type == \'textarea\'" class="form-control" readonly\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate> {{ viewInfoObjList[i][mi.property] }} </textarea>\r\n <span *ngIf="mi.type == \'boolean\'"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n <label *ngIf="viewInfoObjList[i][mi.property] == true">Yes</label>\r\n <label *ngIf="viewInfoObjList[i][mi.property] == false">No</label>\r\n \x3c!-- <label\r\n *ngIf="viewInfoObjList[i][mi.property] == \'\' || viewInfoObjList[i][mi.property] == null">-</label> --\x3e\r\n </span>\r\n <span *ngIf="mi.type == \'concat\'">\r\n <label class="label-control breakword"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n {{ mi.concat }}\r\n </label>\r\n </span>\r\n <span *ngIf="mi.type == \'switch\'">\r\n <span *ngFor="let cs of mi?.case">\r\n <span *ngIf="switchCase(viewInfoObjList[i],cs)">\r\n <span class="label-control breakword"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate *ngIf="cs.result.type == \'text\'">{{ viewInfoObjList[i][cs.result.property]\r\n }}\r\n </span>\r\n <span [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate *ngIf="cs.result.type == \'decimal\'">{{\r\n viewInfoObjList[i][cs.result.property] | number:\'.2\':\'en-US\' }}</span>\r\n <span [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate *ngIf="cs.result.type == \'date\'">{{ viewInfoObjList[i][cs.result.property] |\r\n date: \'dd-MMM-yyyy\' }}\r\n </span>\r\n <span *ngIf="cs.result.type == \'link\'"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate>\r\n <a [target]="cs.result.target" [routerLink]="genRouterLink(cs.result.path)"\r\n [queryParams]="genAction(viewInfoObjList[i],cs.result.param)">\r\n <span *ngIf="(mi.isCurrency != undefined && mi.isCurrency)">{{\r\n viewInfoObjList[i][cs.result.property] | number:\'.2\':\'en-US\' }}</span>\r\n <span *ngIf="(mi.isCurrency == undefined || !mi.isCurrency)">{{\r\n viewInfoObjList[i][cs.result.property] }}</span>\r\n </a>\r\n </span>\r\n <span *ngIf="cs.result.type == \'boolean\'"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'"\r\n translate>\r\n <span *ngIf="viewInfoObjList[i][cs.result.property] == \'true\'">Yes</span>\r\n <span *ngIf="viewInfoObjList[i][cs.result.property] == \'false\'">No</span>\r\n </span>\r\n <span *ngIf="cs.result.type == \'concat\'">\r\n <label class="label-control breakword"\r\n [ngClass]="mi.customClassProperty != undefined ? mi.customClassProperty : \'\'" translate>\r\n {{ viewInfoObjList[i][cs.result.concat] }}\r\n </label>\r\n </span>\r\n </span>\r\n </span>\r\n </span>\r\n </ng-template>\r\n </div>\r\n </div>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</section>'}]}],m.ctorParameters=function(){return[{type:o.ActivatedRoute},{type:n.HttpClient},{type:c.TranslateService},{type:i.CookieService}]},m.propDecorators={viewGenericObj:[{type:s.Input}],callback:[{type:s.Output}]},m);function m(e,n,i,t){var r=this;this.route=e,this.http=n,this.translateService=i,this.cookieService=t,this.viewGenericObj=new p,this.callback=new s.EventEmitter,this.UserAccess=JSON.parse(this.GetCookie(this.cookieService,"UserAccess")),this.viewList="",this.isReady=!1,this.route.queryParams.subscribe(function(e){r.getList=e}),this.translateService.setDefaultLang("en"),this.translateService.use(localStorage.getItem("lang")||"en")}var d=(v.decorators=[{type:s.NgModule,args:[{declarations:[f],imports:[t.CommonModule,o.RouterModule,a.UcSubsectionModule,c.TranslateModule.forChild()],exports:[f]}]}],v);function v(){}e.UcviewgenericService=l,e.UcviewgenericComponent=f,e.UcviewgenericModule=d,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=adins-ucviewgeneric.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ng://@adins/ucviewgeneric/lib/ucviewgeneric.service.ts","ng://@adins/ucviewgeneric/lib/model/UcViewGenericObj.model.ts","ng://@adins/ucviewgeneric/lib/ucviewgeneric.component.ts","ng://@adins/ucviewgeneric/lib/ucviewgeneric.module.ts"],"names":["UcviewgenericService","Injectable","args","providedIn","UcViewGenericObj","this","viewInput","viewEnvironment","ddlEnvironments","Array","listEnvironments","whereValue","UcviewgenericComponent","prototype","ngOnInit","console","log","initiateForm","_this","getJSON","viewGenericObj","subscribe","data","viewList","viewInfoObjList","j","subsection","length","push","queryObj","i","querystring","whereQuery","values","getList","mainInfoPath","undefined","fullpath","mainInfoUrl","http","post","response","y","mainInfo","propertyList","concat","z","prefix","property","suffix","type","navigationConst","tempLink","path","name","isFullpath","environment","url","isReady","error","get","GetCookie","cookieService","key","value","trim","DecryptString","chipperText","chipperKey","chipperKeyArr","CryptoJS.enc","Utf8","parse","iv","CryptoJS.lib","WordArray","create","CryptoJS.AES","decrypt","toString","genAction","viewObj","param","arrList","genRouterLink","urlLink","redirectFullPath","target","queryParam","ListObj","Object","keys","window","open","callbackFunction","item","CBObj","ViewObj","Key","callback","emit","switchCase","condList","condition","conditions","restriction","isUser","UserAccess","findIndex","x","Component","selector","template","ActivatedRoute","HttpClient","TranslateService","CookieService","Input","Output","route","translateService","EventEmitter","JSON","queryParams","params","setDefaultLang","use","localStorage","getItem","UcviewgenericModule","NgModule","declarations","imports","CommonModule","RouterModule","UcSubsectionModule","TranslateModule","forChild","exports"],"mappings":"6sBAAA,IAAAA,uBAECC,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,uJAIZ,SAAAH,KCNF,IAAAI,EAQI,SAAAA,IACIC,KAAKC,UAAY,GACjBD,KAAKE,gBAAkB,GACvBF,KAAKG,gBAAkB,IAAIC,MAC3BJ,KAAKK,iBAAmB,IAAID,MAC5BJ,KAAKM,WAAa,IAAIF,OCd9BG,GAkCEA,EAAAC,UAAAC,SAAA,WACEC,QAAQC,IAAI,eACZX,KAAKY,gBAGPL,EAAAC,UAAAI,aAAA,WAAA,IAAAC,EAAAb,KACEA,KAAKc,QAAQd,KAAKe,eAAed,WAAWe,UAAS,SAACC,GACpDJ,EAAKK,SAAWD,EAChBJ,EAAKM,gBAAkB,GAEvB,IAAK,IAAIC,EAAI,EAAGA,EAAIP,EAAKK,SAASG,WAAWC,OAAQF,IACnDP,EAAKM,gBAAgBI,KAAKH,GAG5B,QAEQI,aAFCC,GACwC,MAA3CZ,EAAKK,SAASG,WAAWI,GAAGC,aAEe,GAAzCb,EAAKE,eAAeT,WAAWgB,OACjCT,EAAKK,SAASG,WAAWI,GAAGC,YAAYC,WAAa,OAAcC,OAAOf,EAAKgB,SAE/EhB,EAAKK,SAASG,WAAWI,GAAGC,YAAYC,WAAad,EAAKE,eAAeT,WAGvEO,EAAKK,SAASG,WAAWI,GAAGK,cAAgBC,WAAyD,IAA5ClB,EAAKK,SAASG,WAAWI,GAAGK,cACnFjB,EAAKE,eAAeb,iBAAmB6B,WAAoD,IAAvClB,EAAKE,eAAeb,gBAC1EW,EAAKK,SAASG,WAAWI,GAAGO,SAAWnB,EAAKE,eAAeb,gBAAkBW,EAAKK,SAASG,WAAWI,GAAGK,aAK3GjB,EAAKK,SAASG,WAAWI,GAAGO,SAAWnB,EAAKK,S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S5G,KAAA,CAAC,CACT6G,SAAU,oBACVC,SAAA,+2VAXOC,EAAAA,sBACAC,EAAAA,kBAIAC,EAAAA,wBACAC,EAAAA,yDAUNC,EAAAA,wBACAC,EAAAA,UAmUH1G,GA5TE,SAAAA,EAAoB2G,EAA+BhF,EAA0BiF,EAA4C1D,GAAzH,IAAA5C,EAAAb,KAAoBA,KAAAkH,MAAAA,EAA+BlH,KAAAkC,KAAAA,EAA0BlC,KAAAmH,iBAAAA,EAA4CnH,KAAAyD,cAAAA,EARhHzD,KAAAe,eAAmC,IAAIhB,EACtCC,KAAA8F,SAA8B,IAAIsB,EAAAA,aAC5CpH,KAAAsG,WAAkBe,KAAKlD,MAAMnE,KAAKwD,UAAUxD,KAAKyD,cAAe,eAChEzD,KAAAkB,SAAgB,GAGhBlB,KAAAqD,SAAmB,EAGjBrD,KAAKkH,MAAMI,YAAYtG,UAAS,SAACuG,GAC/B1G,EAAKgB,QAAU0F,IAGjBvH,KAAKmH,iBAAiBK,eAAe,MACrCxH,KAAKmH,iBAAiBM,IAAIC,aAAaC,QAAQ,SAAW,MC/B9D,IAAAC,uBAOCC,EAAAA,SAAQhI,KAAA,CAAC,CACRiI,aAAc,CAACvH,GACfwH,QAAS,CACPC,EAAAA,aACAC,EAAAA,aACAC,EAAAA,mBACAC,EAAAA,gBAAgBC,YAElBC,QAAS,CAAC9H,OAEuBqH,GAVnC,SAAAA","sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class UcviewgenericService {\r\n\r\n constructor() { }\r\n}\r\n","\r\nexport class UcViewGenericObj {\r\n viewInput: string;\r\n viewEnvironment: string;\r\n navigationConst: any;\r\n ddlEnvironments: Array<EnviObj>;\r\n listEnvironments: Array<EnvisObj>;\r\n whereValue: Array<WhereValueObj>;\r\n\r\n constructor() {\r\n this.viewInput = \"\";\r\n this.viewEnvironment = \"\";\r\n this.ddlEnvironments = new Array<EnviObj>();\r\n this.listEnvironments = new Array<EnvisObj>();\r\n this.whereValue = new Array<WhereValueObj>();\r\n }\r\n}\r\n\r\nexport class EnviObj {\r\n name: string;\r\n environment: string;\r\n\r\n constructor() {\r\n this.name = \"\";\r\n this.environment = \"\";\r\n }\r\n}\r\n\r\nexport class WhereValueObj {\r\n property: string;\r\n value: any;\r\n\r\n constructor() {\r\n this.property = \"\";\r\n }\r\n}\r\n\r\nexport class EnvisObj {\r\n environment: string;\r\n url: string;\r\n\r\n constructor() {\r\n this.environment = \"\";\r\n this.url = \"\";\r\n }\r\n}","import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\r\nimport { ActivatedRoute } from '@angular/router';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { Observable } from 'rxjs';\r\nimport { EnviObj } from './model/EnviObj.model';\r\nimport { UcViewGenericObj } from './model/UcViewGenericObj.model';\r\nimport { TranslateService } from '@ngx-translate/core';\r\nimport { CookieService } from 'ngx-cookie';\r\nimport * as CryptoJS from 'crypto-js';\r\n\r\n@Component({\r\n selector: 'lib-ucviewgeneric',\r\n templateUrl: './ucviewgeneric.component.html',\r\n styles: []\r\n})\r\nexport class UcviewgenericComponent implements OnInit {\r\n\r\n @Input() viewGenericObj: UcViewGenericObj = new UcViewGenericObj();\r\n @Output() callback: EventEmitter<any> = new EventEmitter();\r\n UserAccess: any = JSON.parse(this.GetCookie(this.cookieService, \"UserAccess\"));\r\n viewList: any = \"\";\r\n getList: any;\r\n viewInfoObjList: any;\r\n isReady: boolean = false;\r\n\r\n constructor(private route: ActivatedRoute, private http: HttpClient, private translateService: TranslateService, private cookieService: CookieService) {\r\n this.route.queryParams.subscribe(params => {\r\n this.getList = params;\r\n });\r\n\r\n this.translateService.setDefaultLang('en');\r\n this.translateService.use(localStorage.getItem('lang') || 'en');\r\n }\r\n\r\n ngOnInit() {\r\n console.log(\"viewgeneric\");\r\n this.initiateForm();\r\n }\r\n\r\n initiateForm() {\r\n this.getJSON(this.viewGenericObj.viewInput).subscribe(data => {\r\n this.viewList = data;\r\n this.viewInfoObjList = [];\r\n\r\n for (var j = 0; j < this.viewList.subsection.length; j++) {\r\n this.viewInfoObjList.push(j);\r\n }\r\n\r\n for (let i = 0; i < this.viewList.subsection.length; i++) {\r\n if (this.viewList.subsection[i].querystring != null) {\r\n var queryObj: any;\r\n if (this.viewGenericObj.whereValue.length == 0) {\r\n this.viewList.subsection[i].querystring.whereQuery = (<any>Object).values(this.getList);\r\n } else {\r\n this.viewList.subsection[i].querystring.whereQuery = this.viewGenericObj.whereValue;\r\n }\r\n\r\n if (this.viewList.subsection[i].mainInfoPath != undefined && this.viewList.subsection[i].mainInfoPath != \"\") {\r\n if (this.viewGenericObj.viewEnvironment != undefined && this.viewGenericObj.viewEnvironment != \"\") {\r\n this.viewList.subsection[i].fullpath = this.viewGenericObj.viewEnvironment + this.viewList.subsection[i].mainInfoPath;\r\n } else {\r\n this.viewList.subsection[i].fullpath = this.viewList.subsection[i].mainInfoUrl;\r\n }\r\n } else {\r\n this.viewList.subsection[i].fullpath = this.viewList.subsection[i].mainInfoUrl;\r\n }\r\n\r\n queryObj = {\r\n querystring: this.viewList.subsection[i].querystring\r\n }\r\n this.http.post(this.viewList.subsection[i].fullpath, queryObj).subscribe(\r\n (response) => {\r\n this.viewInfoObjList[i] = response[\"Data\"][0];\r\n\r\n for (var y = 0; y < this.viewList.subsection[i].mainInfo.length; y++) {\r\n if (this.viewList.subsection[i].mainInfo[y].propertyList != undefined && this.viewList.subsection[i].mainInfo[y].propertyList.length != 0) {\r\n const propertyList = this.viewList.subsection[i].mainInfo[y].propertyList;\r\n let concat = \"\";\r\n for (let z = 0; z < propertyList.length; z++) {\r\n concat = concat + propertyList[z].prefix + this.viewInfoObjList[i][propertyList[z].property] + propertyList[z].suffix;\r\n }\r\n this.viewList.subsection[i].mainInfo[y].concat = concat;\r\n }\r\n\r\n if (this.viewList.subsection[i].mainInfo[y].type == \"link\" && (this.viewGenericObj.navigationConst != undefined || this.viewGenericObj.navigationConst != null)) {\r\n let tempLink = this.viewGenericObj.navigationConst[this.viewList.subsection[i].mainInfo[y].path];\r\n if (tempLink != undefined && tempLink != null) {\r\n this.viewList.subsection[i].mainInfo[y].path = tempLink;\r\n }\r\n }\r\n if (this.viewList.subsection[i].mainInfo[y].type == \"link\"\r\n && this.viewGenericObj.ddlEnvironments != undefined && this.viewGenericObj.ddlEnvironments.length != 0) {\r\n for (let z = 0; z < this.viewGenericObj.ddlEnvironments.length; z++) {\r\n if (this.viewList.subsection[i].mainInfo[y].name == this.viewGenericObj.ddlEnvironments[z].name) {\r\n this.viewList.subsection[i].mainInfo[y].isFullpath = true;\r\n this.viewList.subsection[i].mainInfo[y].fullpath = this.viewGenericObj.ddlEnvironments[z].environment + this.viewList.subsection[i].mainInfo[y].path;\r\n break;\r\n }\r\n }\r\n } else if (this.viewList.subsection[i].mainInfo[y].type == \"link\"\r\n && this.viewGenericObj.listEnvironments != undefined && this.viewGenericObj.listEnvironments.length != 0) {\r\n for (let z = 0; z < this.viewGenericObj.listEnvironments.length; z++) {\r\n if (this.viewList.subsection[i].mainInfo[y].environment == this.viewGenericObj.listEnvironments[z].environment) {\r\n this.viewList.subsection[i].mainInfo[y].isFullpath = true;\r\n this.viewList.subsection[i].mainInfo[y].fullpath = this.viewGenericObj.listEnvironments[z].url + this.viewList.subsection[i].mainInfo[y].path;\r\n break;\r\n }\r\n }\r\n } else if (this.viewList.subsection[i].mainInfo[y].type == \"link\") {\r\n this.viewList.subsection[i].mainInfo[y].isFullpath = false;\r\n this.viewList.subsection[i].mainInfo[y].fullpath = this.viewList.subsection[i].mainInfo[y].path;\r\n }\r\n }\r\n this.isReady = true;\r\n },\r\n (error) => {\r\n console.log(error);\r\n });\r\n } else {\r\n if (this.viewList.subsection[i].mainInfoPath != undefined && this.viewList.subsection[i].mainInfoPath != \"\") {\r\n if (this.viewGenericObj.viewEnvironment != undefined && this.viewGenericObj.viewEnvironment != \"\") {\r\n this.viewList.subsection[i].fullpath = this.viewGenericObj.viewEnvironment + this.viewList.subsection[i].mainInfoPath;\r\n } else {\r\n this.viewList.subsection[i].fullpath = this.viewList.subsection[i].mainInfoUrl;\r\n }\r\n } else {\r\n this.viewList.subsection[i].fullpath = this.viewList.subsection[i].mainInfoUrl;\r\n }\r\n\r\n this.http.post(this.viewList.subsection[i].fullpath, this.getList).subscribe(\r\n (response) => {\r\n this.viewInfoObjList[i] = response[\"Data\"];\r\n },\r\n (error) => {\r\n console.log(error);\r\n })\r\n }\r\n }\r\n })\r\n }\r\n\r\n public getJSON(url: string): Observable<any> {\r\n return this.http.get(url);\r\n }\r\n\r\n private GetCookie(cookieService: CookieService, key: string) {\r\n var value = cookieService.get(key);\r\n if (value == undefined || value.trim() == '') return null;\r\n return this.DecryptString(value, \"AdInsFOU12345678\");\r\n }\r\n\r\n private DecryptString(chipperText: string, chipperKey: string) {\r\n if (\r\n chipperKey == undefined || chipperKey.trim() == '' ||\r\n chipperText == undefined || chipperText.trim() == ''\r\n ) return chipperText;\r\n var chipperKeyArr = CryptoJS.enc.Utf8.parse(chipperKey);\r\n var iv = CryptoJS.lib.WordArray.create([0x00, 0x00, 0x00, 0x00]);\r\n var decrypted = CryptoJS.AES.decrypt(chipperText, chipperKeyArr, { iv: iv });\r\n var plainText = decrypted.toString(CryptoJS.enc.Utf8);\r\n return plainText;\r\n }\r\n\r\n genAction(viewObj, param) {\r\n var arrList = {};\r\n\r\n for (var i = 0; i < param.length; i++) {\r\n if (viewObj[param[i].type] != undefined || viewObj[param[i].property] != undefined) {\r\n arrList[param[i].type] = viewObj[param[i].property];\r\n } else {\r\n arrList[param[i].type] = param[i].property;\r\n }\r\n }\r\n return arrList;\r\n }\r\n\r\n genRouterLink(urlLink: string) {\r\n let tempLink = urlLink;\r\n if (this.viewGenericObj.navigationConst != undefined && this.viewGenericObj.navigationConst[urlLink] != null) {\r\n tempLink = this.viewGenericObj.navigationConst[urlLink];\r\n }\r\n return tempLink;\r\n }\r\n\r\n redirectFullPath(fullpath: string, param: Object, target: string) {\r\n let queryParam = \"\";\r\n const ListObj = Object.keys(param);\r\n for (let i = 0; i < ListObj.length; i++) {\r\n if (queryParam != \"\") {\r\n queryParam = queryParam + \"&\" + ListObj[i] + \"=\" + param[ListObj[i]];\r\n } else {\r\n queryParam = ListObj[i] + \"=\" + param[ListObj[i]];\r\n }\r\n }\r\n window.open(fullpath + \"?\" + queryParam, target);\r\n }\r\n\r\n callbackFunction(item, key: string = \"\") {\r\n var CBObj = {\r\n ViewObj: item,\r\n Key: key\r\n }\r\n this.callback.emit(CBObj);\r\n }\r\n\r\n switchCase(item, condList) {\r\n var condition = false;\r\n\r\n for (var i = 0; i < condList.conditions.length; i++) {\r\n if (condList.conditions[i].restriction == \"EQ\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (item[condList.conditions[i].property] == condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (item[condList.conditions[i].property] == this.UserAccess[\"UserName\"]) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"NEQ\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (item[condList.conditions[i].property] != condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (item[condList.conditions[i].property] != this.UserAccess[\"UserName\"]) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"GT\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (item[condList.conditions[i].property] > condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (item[condList.conditions[i].property] > this.UserAccess[\"UserName\"]) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"GTE\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (item[condList.conditions[i].property] >= condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (item[condList.conditions[i].property] >= this.UserAccess[\"UserName\"]) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"LT\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (item[condList.conditions[i].property] < condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (item[condList.conditions[i].property] < this.UserAccess[\"UserName\"]) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"LTE\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (item[condList.conditions[i].property] <= condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (item[condList.conditions[i].property] <= this.UserAccess[\"UserName\"]) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } \r\n } else if (condList.conditions[i].restriction == \"IN\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (condList.conditions[i].value.findIndex(x => x == item[condList.conditions[i].property]) >= 0) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (condList.conditions[i].value.findIndex(x => x == this.UserAccess[\"UserName\"]) >= 0) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"NIN\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (condList.conditions[i].value.findIndex(x => x == item[condList.conditions[i].property]) == -1) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (condList.conditions[i].value.findIndex(x => x == this.UserAccess[\"UserName\"]) == -1) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return condition;\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { UcviewgenericComponent } from './ucviewgeneric.component';\r\nimport { CommonModule } from '@angular/common';\r\nimport { RouterModule } from '@angular/router';\r\nimport { UcSubsectionModule } from '@adins/uc-subsection';\r\nimport { TranslateModule } from '@ngx-translate/core';\r\n\r\n@NgModule({\r\n declarations: [UcviewgenericComponent],\r\n imports: [\r\n CommonModule,\r\n RouterModule,\r\n UcSubsectionModule,\r\n TranslateModule.forChild()\r\n ],\r\n exports: [UcviewgenericComponent]\r\n})\r\nexport class UcviewgenericModule { }\r\n"]}
|
|
1
|
+
{"version":3,"sources":["ng://@adins/ucviewgeneric/lib/ucviewgeneric.service.ts","ng://@adins/ucviewgeneric/lib/model/UcViewGenericObj.model.ts","ng://@adins/ucviewgeneric/lib/ucviewgeneric.component.ts","ng://@adins/ucviewgeneric/lib/ucviewgeneric.module.ts"],"names":["UcviewgenericService","Injectable","args","providedIn","UcViewGenericObj","this","viewInput","viewEnvironment","ddlEnvironments","Array","listEnvironments","whereValue","UcviewgenericComponent","prototype","ngOnInit","console","log","initiateForm","_this","getJSON","viewGenericObj","subscribe","data","viewList","viewInfoObjList","j","subsection","length","push","i","queryObj","querystring","whereQuery","values","getList","mainInfoPath","undefined","fullpath","mainInfoUrl","http","post","response","y","mainInfo","propertyList","concat","z","prefix","property","suffix","type","y_1","case","result","navigationConst","tempLink","path","name","isFullpath","environment","url","isReady","error","get","GetCookie","cookieService","key","value","trim","DecryptString","chipperText","chipperKey","chipperKeyArr","CryptoJS.enc","Utf8","parse","iv","CryptoJS.lib","WordArray","create","CryptoJS.AES","decrypt","toString","genAction","viewObj","param","arrList","genRouterLink","urlLink","redirectFullPath","target","queryParam","ListObj","Object","keys","window","open","callbackFunction","item","CBObj","ViewObj","Key","callback","emit","switchCase","condList","condition","conditions","restriction","isUser","this_1","UserAccess","findIndex","x","Component","selector","template","ActivatedRoute","HttpClient","TranslateService","CookieService","Input","Output","route","translateService","EventEmitter","JSON","queryParams","params","setDefaultLang","use","localStorage","getItem","UcviewgenericModule","NgModule","declarations","imports","CommonModule","RouterModule","UcSubsectionModule","TranslateModule","forChild","exports"],"mappings":"6sBAAA,IAAAA,uBAECC,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,uJAIZ,SAAAH,KCNF,IAAAI,EAQI,SAAAA,IACIC,KAAKC,UAAY,GACjBD,KAAKE,gBAAkB,GACvBF,KAAKG,gBAAkB,IAAIC,MAC3BJ,KAAKK,iBAAmB,IAAID,MAC5BJ,KAAKM,WAAa,IAAIF,OCd9BG,GAkCEA,EAAAC,UAAAC,SAAA,WACEC,QAAQC,IAAI,eACZX,KAAKY,gBAGPL,EAAAC,UAAAI,aAAA,WAAA,IAAAC,EAAAb,KACEA,KAAKc,QAAQd,KAAKe,eAAed,WAAWe,UAAS,SAACC,GACpDJ,EAAKK,SAAWD,EAChBJ,EAAKM,gBAAkB,GAEvB,IAAK,IAAIC,EAAI,EAAGA,EAAIP,EAAKK,SAASG,WAAWC,OAAQF,IACnDP,EAAKM,gBAAgBI,KAAKH,GAG5B,mBAASI,OAEDC,EADyC,MAA3CZ,EAAKK,SAASG,WAAWG,GAAGE,aAEe,GAAzCb,EAAKE,eAAeT,WAAWgB,OACjCT,EAAKK,SAASG,WAAWG,GAAGE,YAAYC,WAAa,OAAcC,OAAOf,EAAKgB,SAE/EhB,EAAKK,SAASG,WAAWG,GAAGE,YAAYC,WAAad,EAAKE,eAAeT,WAGvEO,EAAKK,SAASG,WAAWG,GAAGM,cAAgBC,WAAyD,IAA5ClB,EAAKK,SAASG,WAAWG,GAAGM,cACnFjB,EAAKE,eAAeb,iBAAmB6B,WAAoD,IAAvClB,EAAKE,eAAeb,gBAC1EW,EAAKK,SAASG,WAAWG,GAAGQ,SAAWnB,EAAKE,eAAeb,gBAAkBW,EAAKK,SAASG,WAAWG,GAAGM,aAK3GjB,EAAKK,SAASG,WAAWG,GAAGQ,SAAWnB,EAAKK,SAASG,WAAWG,GAAGS,YAGr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GACf4H,QAAS,CACPC,EAAAA,aACAC,EAAAA,aACAC,EAAAA,mBACAC,EAAAA,gBAAgBC,YAElBC,QAAS,CAAClI,OAEuByH,GAVnC,SAAAA","sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class UcviewgenericService {\r\n\r\n constructor() { }\r\n}\r\n","\r\nexport class UcViewGenericObj {\r\n viewInput: string;\r\n viewEnvironment: string;\r\n navigationConst: any;\r\n ddlEnvironments: Array<EnviObj>;\r\n listEnvironments: Array<EnvisObj>;\r\n whereValue: Array<WhereValueObj>;\r\n\r\n constructor() {\r\n this.viewInput = \"\";\r\n this.viewEnvironment = \"\";\r\n this.ddlEnvironments = new Array<EnviObj>();\r\n this.listEnvironments = new Array<EnvisObj>();\r\n this.whereValue = new Array<WhereValueObj>();\r\n }\r\n}\r\n\r\nexport class EnviObj {\r\n name: string;\r\n environment: string;\r\n\r\n constructor() {\r\n this.name = \"\";\r\n this.environment = \"\";\r\n }\r\n}\r\n\r\nexport class WhereValueObj {\r\n property: string;\r\n value: any;\r\n\r\n constructor() {\r\n this.property = \"\";\r\n }\r\n}\r\n\r\nexport class EnvisObj {\r\n environment: string;\r\n url: string;\r\n\r\n constructor() {\r\n this.environment = \"\";\r\n this.url = \"\";\r\n }\r\n}","import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\r\nimport { ActivatedRoute } from '@angular/router';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { Observable } from 'rxjs';\r\nimport { EnviObj } from './model/EnviObj.model';\r\nimport { UcViewGenericObj } from './model/UcViewGenericObj.model';\r\nimport { TranslateService } from '@ngx-translate/core';\r\nimport { CookieService } from 'ngx-cookie';\r\nimport * as CryptoJS from 'crypto-js';\r\n\r\n@Component({\r\n selector: 'lib-ucviewgeneric',\r\n templateUrl: './ucviewgeneric.component.html',\r\n styles: []\r\n})\r\nexport class UcviewgenericComponent implements OnInit {\r\n\r\n @Input() viewGenericObj: UcViewGenericObj = new UcViewGenericObj();\r\n @Output() callback: EventEmitter<any> = new EventEmitter();\r\n UserAccess: any = JSON.parse(this.GetCookie(this.cookieService, \"UserAccess\"));\r\n viewList: any = \"\";\r\n getList: any;\r\n viewInfoObjList: any;\r\n isReady: boolean = false;\r\n\r\n constructor(private route: ActivatedRoute, private http: HttpClient, private translateService: TranslateService, private cookieService: CookieService) {\r\n this.route.queryParams.subscribe(params => {\r\n this.getList = params;\r\n });\r\n\r\n this.translateService.setDefaultLang('en');\r\n this.translateService.use(localStorage.getItem('lang') || 'en');\r\n }\r\n\r\n ngOnInit() {\r\n console.log(\"viewgeneric\");\r\n this.initiateForm();\r\n }\r\n\r\n initiateForm() {\r\n this.getJSON(this.viewGenericObj.viewInput).subscribe(data => {\r\n this.viewList = data;\r\n this.viewInfoObjList = [];\r\n\r\n for (let j = 0; j < this.viewList.subsection.length; j++) {\r\n this.viewInfoObjList.push(j);\r\n }\r\n\r\n for (let i = 0; i < this.viewList.subsection.length; i++) {\r\n if (this.viewList.subsection[i].querystring != null) {\r\n let queryObj: any;\r\n if (this.viewGenericObj.whereValue.length == 0) {\r\n this.viewList.subsection[i].querystring.whereQuery = (<any>Object).values(this.getList);\r\n } else {\r\n this.viewList.subsection[i].querystring.whereQuery = this.viewGenericObj.whereValue;\r\n }\r\n\r\n if (this.viewList.subsection[i].mainInfoPath != undefined && this.viewList.subsection[i].mainInfoPath != \"\") {\r\n if (this.viewGenericObj.viewEnvironment != undefined && this.viewGenericObj.viewEnvironment != \"\") {\r\n this.viewList.subsection[i].fullpath = this.viewGenericObj.viewEnvironment + this.viewList.subsection[i].mainInfoPath;\r\n } else {\r\n this.viewList.subsection[i].fullpath = this.viewList.subsection[i].mainInfoUrl;\r\n }\r\n } else {\r\n this.viewList.subsection[i].fullpath = this.viewList.subsection[i].mainInfoUrl;\r\n }\r\n\r\n queryObj = {\r\n querystring: this.viewList.subsection[i].querystring\r\n }\r\n this.http.post(this.viewList.subsection[i].fullpath, queryObj).subscribe(\r\n (response) => {\r\n this.viewInfoObjList[i] = response[\"Data\"][0];\r\n\r\n for (let y = 0; y < this.viewList.subsection[i].mainInfo.length; y++) {\r\n if (this.viewList.subsection[i].mainInfo[y].propertyList != undefined && this.viewList.subsection[i].mainInfo[y].propertyList.length != 0) {\r\n const propertyList = this.viewList.subsection[i].mainInfo[y].propertyList;\r\n let concat = \"\";\r\n for (let z = 0; z < propertyList.length; z++) {\r\n concat = concat + propertyList[z].prefix + this.viewInfoObjList[i][propertyList[z].property] + propertyList[z].suffix;\r\n }\r\n this.viewList.subsection[i].mainInfo[y].concat = concat;\r\n }\r\n\r\n //concat switch case\r\n if (this.viewList.subsection[i].mainInfo[y].type == \"switch\"){\r\n for (let y = 0; y < this.viewList.subsection[i].mainInfo.case.length; y++) {\r\n if (this.viewList.subsection[i].mainInfo[y].case.result.propertyList != undefined && this.viewList.subsection[i].mainInfo[y].case.result.propertyList.length != 0) {\r\n const propertyList = this.viewList.subsection[i].mainInfo[y].case.result.propertyList;\r\n let concat = \"\";\r\n for (let z = 0; z < propertyList.length; z++) {\r\n concat = concat + propertyList[z].prefix + this.viewInfoObjList[i][propertyList[z].property] + propertyList[z].suffix;\r\n }\r\n this.viewList.subsection[i].mainInfo[y].case.result.concat = concat;\r\n }\r\n }\r\n }\r\n\r\n if (this.viewList.subsection[i].mainInfo[y].type == \"link\" && (this.viewGenericObj.navigationConst != undefined || this.viewGenericObj.navigationConst != null)) {\r\n let tempLink = this.viewGenericObj.navigationConst[this.viewList.subsection[i].mainInfo[y].path];\r\n if (tempLink != undefined && tempLink != null) {\r\n this.viewList.subsection[i].mainInfo[y].path = tempLink;\r\n }\r\n }\r\n if (this.viewList.subsection[i].mainInfo[y].type == \"link\"\r\n && this.viewGenericObj.ddlEnvironments != undefined && this.viewGenericObj.ddlEnvironments.length != 0) {\r\n for (let z = 0; z < this.viewGenericObj.ddlEnvironments.length; z++) {\r\n if (this.viewList.subsection[i].mainInfo[y].name == this.viewGenericObj.ddlEnvironments[z].name) {\r\n this.viewList.subsection[i].mainInfo[y].isFullpath = true;\r\n this.viewList.subsection[i].mainInfo[y].fullpath = this.viewGenericObj.ddlEnvironments[z].environment + this.viewList.subsection[i].mainInfo[y].path;\r\n break;\r\n }\r\n }\r\n } else if (this.viewList.subsection[i].mainInfo[y].type == \"link\"\r\n && this.viewGenericObj.listEnvironments != undefined && this.viewGenericObj.listEnvironments.length != 0) {\r\n for (let z = 0; z < this.viewGenericObj.listEnvironments.length; z++) {\r\n if (this.viewList.subsection[i].mainInfo[y].environment == this.viewGenericObj.listEnvironments[z].environment) {\r\n this.viewList.subsection[i].mainInfo[y].isFullpath = true;\r\n this.viewList.subsection[i].mainInfo[y].fullpath = this.viewGenericObj.listEnvironments[z].url + this.viewList.subsection[i].mainInfo[y].path;\r\n break;\r\n }\r\n }\r\n } else if (this.viewList.subsection[i].mainInfo[y].type == \"link\") {\r\n this.viewList.subsection[i].mainInfo[y].isFullpath = false;\r\n this.viewList.subsection[i].mainInfo[y].fullpath = this.viewList.subsection[i].mainInfo[y].path;\r\n }\r\n }\r\n this.isReady = true;\r\n },\r\n (error) => {\r\n console.log(error);\r\n });\r\n } else {\r\n if (this.viewList.subsection[i].mainInfoPath != undefined && this.viewList.subsection[i].mainInfoPath != \"\") {\r\n if (this.viewGenericObj.viewEnvironment != undefined && this.viewGenericObj.viewEnvironment != \"\") {\r\n this.viewList.subsection[i].fullpath = this.viewGenericObj.viewEnvironment + this.viewList.subsection[i].mainInfoPath;\r\n } else {\r\n this.viewList.subsection[i].fullpath = this.viewList.subsection[i].mainInfoUrl;\r\n }\r\n } else {\r\n this.viewList.subsection[i].fullpath = this.viewList.subsection[i].mainInfoUrl;\r\n }\r\n\r\n this.http.post(this.viewList.subsection[i].fullpath, this.getList).subscribe(\r\n (response) => {\r\n this.viewInfoObjList[i] = response[\"Data\"];\r\n },\r\n (error) => {\r\n console.log(error);\r\n })\r\n }\r\n }\r\n })\r\n }\r\n\r\n public getJSON(url: string): Observable<any> {\r\n return this.http.get(url);\r\n }\r\n\r\n private GetCookie(cookieService: CookieService, key: string) {\r\n let value = cookieService.get(key);\r\n if (value == undefined || value.trim() == '') return null;\r\n return this.DecryptString(value, \"AdInsFOU12345678\");\r\n }\r\n\r\n private DecryptString(chipperText: string, chipperKey: string) {\r\n if (\r\n chipperKey == undefined || chipperKey.trim() == '' ||\r\n chipperText == undefined || chipperText.trim() == ''\r\n ) return chipperText;\r\n let chipperKeyArr = CryptoJS.enc.Utf8.parse(chipperKey);\r\n let iv = CryptoJS.lib.WordArray.create([0x00, 0x00, 0x00, 0x00]);\r\n let decrypted = CryptoJS.AES.decrypt(chipperText, chipperKeyArr, { iv: iv });\r\n let plainText = decrypted.toString(CryptoJS.enc.Utf8);\r\n return plainText;\r\n }\r\n\r\n genAction(viewObj, param) {\r\n let arrList = {};\r\n\r\n for (let i = 0; i < param.length; i++) {\r\n if (viewObj[param[i].type] != undefined || viewObj[param[i].property] != undefined) {\r\n arrList[param[i].type] = viewObj[param[i].property];\r\n } else {\r\n arrList[param[i].type] = param[i].property;\r\n }\r\n }\r\n return arrList;\r\n }\r\n\r\n genRouterLink(urlLink: string) {\r\n let tempLink = urlLink;\r\n if (this.viewGenericObj.navigationConst != undefined && this.viewGenericObj.navigationConst[urlLink] != null) {\r\n tempLink = this.viewGenericObj.navigationConst[urlLink];\r\n }\r\n return tempLink;\r\n }\r\n\r\n redirectFullPath(fullpath: string, param: Object, target: string) {\r\n let queryParam = \"\";\r\n const ListObj = Object.keys(param);\r\n for (let i = 0; i < ListObj.length; i++) {\r\n if (queryParam != \"\") {\r\n queryParam = queryParam + \"&\" + ListObj[i] + \"=\" + param[ListObj[i]];\r\n } else {\r\n queryParam = ListObj[i] + \"=\" + param[ListObj[i]];\r\n }\r\n }\r\n window.open(fullpath + \"?\" + queryParam, target);\r\n }\r\n\r\n callbackFunction(item, key: string = \"\") {\r\n let CBObj = {\r\n ViewObj: item,\r\n Key: key\r\n }\r\n this.callback.emit(CBObj);\r\n }\r\n\r\n switchCase(item, condList) {\r\n let condition = false;\r\n if (!item) return false;\r\n for (let i = 0; i < condList.conditions.length; i++) {\r\n if (condList.conditions[i].restriction == \"EQ\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (item[condList.conditions[i].property] == condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (item[condList.conditions[i].property] == this.UserAccess[\"UserName\"]) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"NEQ\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (item[condList.conditions[i].property] != condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (item[condList.conditions[i].property] != this.UserAccess[\"UserName\"]) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"GT\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (item[condList.conditions[i].property] > condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (item[condList.conditions[i].property] > this.UserAccess[\"UserName\"]) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"GTE\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (item[condList.conditions[i].property] >= condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (item[condList.conditions[i].property] >= this.UserAccess[\"UserName\"]) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"LT\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (item[condList.conditions[i].property] < condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (item[condList.conditions[i].property] < this.UserAccess[\"UserName\"]) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"LTE\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (item[condList.conditions[i].property] <= condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (item[condList.conditions[i].property] <= this.UserAccess[\"UserName\"]) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } \r\n } else if (condList.conditions[i].restriction == \"IN\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (condList.conditions[i].value.findIndex(x => x == item[condList.conditions[i].property]) >= 0) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (condList.conditions[i].value.findIndex(x => x == this.UserAccess[\"UserName\"]) >= 0) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"NIN\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (condList.conditions[i].value.findIndex(x => x == item[condList.conditions[i].property]) == -1) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n if (condList.conditions[i].value.findIndex(x => x == this.UserAccess[\"UserName\"]) == -1) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return condition;\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { UcviewgenericComponent } from './ucviewgeneric.component';\r\nimport { CommonModule } from '@angular/common';\r\nimport { RouterModule } from '@angular/router';\r\nimport { UcSubsectionModule } from '@adins/uc-subsection';\r\nimport { TranslateModule } from '@ngx-translate/core';\r\n\r\n@NgModule({\r\n declarations: [UcviewgenericComponent],\r\n imports: [\r\n CommonModule,\r\n RouterModule,\r\n UcSubsectionModule,\r\n TranslateModule.forChild()\r\n ],\r\n exports: [UcviewgenericComponent]\r\n})\r\nexport class UcviewgenericModule { }\r\n"]}
|