geminis-ng
Version:
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.14.
16 lines (14 loc) • 72 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("ng-zorro-antd/message"),require("ng-zorro-antd/notification"),require("@angular/router"),require("@angular/common/http"),require("@auth0/angular-jwt"),require("ng-zorro-antd/icon"),require("@angular/common/locales/zh"),require("@angular/common"),require("@angular/forms"),require("ng-zorro-antd/input-number"),require("ng-zorro-antd/switch"),require("ng-zorro-antd/date-picker"),require("ng-zorro-antd/slider"),require("ng-zorro-antd/checkbox"),require("ng-zorro-antd/form"),require("@angular/platform-browser"),require("geminis-ng-core"),require("ng-zorro-antd/modal"),require("ng-zorro-antd/input"),require("crypto-js/sha256"),require("crypto-js/enc-hex"),require("ng-zorro-antd/radio"),require("ng-zorro-antd/select"),require("ng-zorro-antd/spin"),require("ng-zorro-antd/table"),require("ng-zorro-antd/button"),require("ng-zorro-antd/breadcrumb"),require("ng-zorro-antd/layout"),require("ng-zorro-antd/menu"),require("ng-zorro-antd/tree"),require("rxjs")):"function"==typeof define&&define.amd?define("geminis-ng",["exports","@angular/core","ng-zorro-antd/message","ng-zorro-antd/notification","@angular/router","@angular/common/http","@auth0/angular-jwt","ng-zorro-antd/icon","@angular/common/locales/zh","@angular/common","@angular/forms","ng-zorro-antd/input-number","ng-zorro-antd/switch","ng-zorro-antd/date-picker","ng-zorro-antd/slider","ng-zorro-antd/checkbox","ng-zorro-antd/form","@angular/platform-browser","geminis-ng-core","ng-zorro-antd/modal","ng-zorro-antd/input","crypto-js/sha256","crypto-js/enc-hex","ng-zorro-antd/radio","ng-zorro-antd/select","ng-zorro-antd/spin","ng-zorro-antd/table","ng-zorro-antd/button","ng-zorro-antd/breadcrumb","ng-zorro-antd/layout","ng-zorro-antd/menu","ng-zorro-antd/tree","rxjs"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["geminis-ng"]={},e.ng.core,e.message,e.notification,e.ng.router,e.ng.common.http,e.angularJwt,e.icon,e.ng.common.locales.zh,e.ng.common,e.ng.forms,e.inputNumber,e._switch,e.datePicker,e.slider,e.checkbox,e.form,e.ng.platformBrowser,e.geminisNgCore,e.modal,e.input,e.SHA256,e.HEX,e.radio,e.select,e.spin,e.table,e.button,e.breadcrumb,e.layout,e.menu,e.tree,e.rxjs)}(this,(function(exports,core,message,notification,router,http,angularJwt,icon,zh,common,forms,inputNumber,_switch,datePicker,slider,checkbox,form,platformBrowser,geminisNgCore,modal,input,SHA256,HEX,radio,select,spin,table,button,breadcrumb,layout,menu,tree,rxjs){"use strict";function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var zh__default=_interopDefaultLegacy(zh),SHA256__default=_interopDefaultLegacy(SHA256),HEX__default=_interopDefaultLegacy(HEX),GnMessageService=function(){function e(e,t){this.messageService=e,this.notificationService=t}return e.prototype.success=function(e){this.messageService.success(e)},e.prototype.error=function(e){this.notificationService.error("错误",e)},e.prototype.warn=function(e){this.notificationService.warning("提示",e)},e.prototype.clean=function(){this.messageService.remove(),this.notificationService.remove()},e}();GnMessageService.decorators=[{type:core.Injectable}],GnMessageService.ctorParameters=function(){return[{type:message.NzMessageService},{type:notification.NzNotificationService}]};var GnMessageServiceModule=function(){};GnMessageServiceModule.decorators=[{type:core.NgModule,args:[{imports:[message.NzMessageModule,notification.NzNotificationModule],providers:[GnMessageService]}]}];var GnLoginUser=function(){};GnLoginUser.decorators=[{type:core.Injectable}];var GnSiteInfo=function(){function e(e){this.loginUser=e,this.showBreadcrumb=!1,this.siderMenuTheme="dark",this.authSiderMenu=[],this.siteAuthorities=[],this.siderMenu=[]}return e.prototype.filterMenu=function(){this.authSiderMenu=this.getAuthorityMenu(this.siderMenu,"")},e.prototype.getAuthorityMenu=function(e,t){var n=this;return this.loginUser.authorities&&e?e.map((function(e){var o,r=t+(e.router||"");e.authority&&((null===(o=n.siteAuthorities)||void 0===o?void 0:o.find((function(e){return e.url===r})))||n.siteAuthorities.push({url:r,authority:e.authority}));return{title:e.title,router:e.router,icon:e.icon,authority:e.authority,subMenu:n.getAuthorityMenu(e.subMenu,r)}})).filter((function(e){return n.loginUser.authorities.includes(e.authority)||(!e.subMenu||0===e.subMenu.length)&&!e.authority||e.subMenu&&e.subMenu.length>0})):e},e}();GnSiteInfo.decorators=[{type:core.Injectable}],GnSiteInfo.ctorParameters=function(){return[{type:GnLoginUser}]};var GnRouteGuard=function(){function e(e,t,n,o){this.user=e,this.siteInfo=t,this.router=n,this.messageService=o}return e.prototype.canActivate=function(e,t){var n;if(this.user.isLogin){var o=null===(n=this.siteInfo.siteAuthorities)||void 0===n?void 0:n.find((function(e){return e.url===t.url}));return!(o&&!this.user.authorities.includes(o.authority))||(sessionStorage.setItem("blockUrl",t.url),this.messageService.warn("您的权限不足"),this.router.navigateByUrl(this.siteInfo.loginUrl),!1)}return sessionStorage.setItem("blockUrl",t.url),this.messageService.warn("请登录"),this.router.navigateByUrl(this.siteInfo.loginUrl),!1},e}();GnRouteGuard.decorators=[{type:core.Injectable}],GnRouteGuard.ctorParameters=function(){return[{type:GnLoginUser},{type:GnSiteInfo},{type:router.Router},{type:GnMessageService}]};var GnHttpInterceptorConfig=function(){this.ignoreUrls=[]};GnHttpInterceptorConfig.decorators=[{type:core.Injectable}];var GnOAuthUtils=function(){function e(){this.helper=new angularJwt.JwtHelperService}return e.prototype.setToken=function(e){return sessionStorage.setItem("Authorization",e)},e.prototype.getToken=function(){return sessionStorage.getItem("Authorization")},e.prototype.parseToken=function(e){return this.helper.decodeToken(e)},e.prototype.tokenExpired=function(e){return this.helper.isTokenExpired(e)},e}(),GnOAuthHttpInterceptor=function(){function e(e,t,n){this.config=e,this.siteInfo=t,this.route=n,this.oAuthUtils=new GnOAuthUtils}return e.prototype.intercept=function(e,t){var n=e.headers;if(this.config.startWithUrl&&e.url.startsWith(this.config.startWithUrl)&&!this.config.ignoreUrls.includes(e.url)){var o=this.oAuthUtils.getToken();this.oAuthUtils.tokenExpired(o)?this.siteInfo&&this.siteInfo.loginUrl&&this.route.navigateByUrl(this.siteInfo.loginUrl):n=e.headers.set("Authorization","Bearer "+o)}return t.handle(e.clone({headers:n}))},e}();GnOAuthHttpInterceptor.decorators=[{type:core.Injectable}],GnOAuthHttpInterceptor.ctorParameters=function(){return[{type:GnHttpInterceptorConfig},{type:GnSiteInfo},{type:router.Router}]},common.registerLocaleData(zh__default.default);var GnAppConfigModule=function(e,t,n,o){e.get("assets/config/siteInfo.json").subscribe((function(e){t.title=e.title,t.siderMenu=e.siderMenu,t.siderMenuTheme=e.siderMenuTheme||"dark",t.showBreadcrumb=e.showBreadcrumb,t.siteAuthorities=e.siteAuthorities,t.iconFontUrl=e.iconFontUrl,t.authSiderMenu=t.getAuthorityMenu(t.siderMenu,""),n.fetchFromIconfont({scriptUrl:t.iconFontUrl})}),(function(e){throw o.error("获取系统信息错误"),e}))};GnAppConfigModule.decorators=[{type:core.NgModule,args:[{declarations:[],exports:[],imports:[http.HttpClientModule,GnMessageServiceModule],providers:[GnSiteInfo,GnLoginUser,GnRouteGuard,GnHttpInterceptorConfig,{provide:http.HTTP_INTERCEPTORS,useClass:GnOAuthHttpInterceptor,multi:!0}]}]}],GnAppConfigModule.ctorParameters=function(){return[{type:http.HttpClient},{type:GnSiteInfo},{type:icon.NzIconService},{type:GnMessageService}]};var GnAppRootComponent=function(){};GnAppRootComponent.decorators=[{type:core.Component,args:[{selector:"gn-app-root",template:'\n <router-outlet></router-outlet>\n <div id="gn-app-root"></div>\n '}]}];var GnAppRootModule=function(){};GnAppRootModule.decorators=[{type:core.NgModule,args:[{declarations:[GnAppRootComponent],exports:[GnAppRootComponent],imports:[router.RouterModule]}]}];
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function __rest(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function __decorate(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function __param(e,t){return function(n,o){t(n,o,e)}}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))}function __generator(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var __createBinding=Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]};function __exportStar(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||__createBinding(t,e,n)}function __values(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e}function __spreadArrays(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o}function __spreadArray(e,t){for(var n=0,o=t.length,r=e.length;n<o;n++,r++)e[r]=t[n];return e}function __await(e){return this instanceof __await?(this.v=e,this):new __await(e)}function __asyncGenerator(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(e,t||[]),i=[];return o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o;function a(e){r[e]&&(o[e]=function(t){return new Promise((function(n,o){i.push([e,t,n,o])>1||s(e,t)}))})}function s(e,t){try{(n=r[e](t)).value instanceof __await?Promise.resolve(n.value.v).then(l,u):c(i[0][2],n)}catch(e){c(i[0][3],e)}var n}function l(e){s("next",e)}function u(e){s("throw",e)}function c(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function __asyncDelegator(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:__await(e[o](t)),done:"return"===o}:r?r(t):t}:r}}function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){(function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)})(o,r,(t=e[n](t)).done,t.value)}))}}}function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var __setModuleDefault=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function __importStar(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&__createBinding(t,e,n);return __setModuleDefault(t,e),t}function __importDefault(e){return e&&e.__esModule?e:{default:e}}function __classPrivateFieldGet(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function __classPrivateFieldSet(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}var formItemTypes={"input-number":inputNumber.NzInputNumberComponent,date:datePicker.NzDatePickerComponent,slider:slider.NzSliderComponent,switch:_switch.NzSwitchComponent},GnCheckboxGroupComponent_1;function GnFormItem(e){return function(t){formItemTypes[e]=t}}exports.GnCheckboxGroupComponent=GnCheckboxGroupComponent_1=function(){function e(){this.valueChanged=new core.EventEmitter,this.valueChange=function(e){}}return Object.defineProperty(e.prototype,"value",{get:function(){return this.innerValue=this.items.filter((function(e){return e.checked})).map((function(e){return e.value})),this.innerValue},set:function(e){var t=this;this.innerValue!==e&&(this.innerValue=e,this.items.forEach((function(e){e.checked=t.innerValue.includes(e.value)})),this.valueChange(this.innerValue))},enumerable:!1,configurable:!0}),e.prototype.registerOnChange=function(e){this.valueChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.writeValue=function(e){this.value=e},e}(),exports.GnCheckboxGroupComponent.decorators=[{type:core.Component,args:[{selector:"gn-checkbox-group",template:'\n <nz-checkbox-group [(ngModel)]="items" (ngModelChange)="valueChange(value);valueChanged.emit()"></nz-checkbox-group>\n ',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:core.forwardRef((function(){return GnCheckboxGroupComponent_1})),multi:!0}]}]}],exports.GnCheckboxGroupComponent.propDecorators={value:[{type:core.Input}],valueChanged:[{type:core.Output}]},exports.GnCheckboxGroupComponent=GnCheckboxGroupComponent_1=__decorate([GnFormItem("checkbox-group")],exports.GnCheckboxGroupComponent);var GnCheckboxGroupModule=function(){};function controlContainerFactory(){var e=new forms.FormGroupDirective([],[]);return e.form=new forms.FormGroup({}),e}GnCheckboxGroupModule.decorators=[{type:core.NgModule,args:[{declarations:[exports.GnCheckboxGroupComponent],imports:[common.CommonModule,forms.FormsModule,checkbox.NzCheckboxModule],exports:[exports.GnCheckboxGroupComponent],entryComponents:[]}]}];var GnFormDirective=function(){function e(e,t,n,o,r,i){var a=this;this.controlContainer=e,this.elementRef=t,this.renderer=n,this.http=o,this.changeDetectorRef=r,this.binded=!1,this.labelWidth=6,this.controlWidth=18,this.autoLoadData=!0,this.submitMethod="put",this.loadMethod="post",this.format="json",this.formGroup=e.control,this.formGroup.valueChanges.subscribe((function(e){i&&i.updateConfig({nzOkDisabled:a.formGroup.invalid}),a.innerBindValue&&a.binded&&Object.assign(a.innerBindValue,e)}))}return Object.defineProperty(e.prototype,"cols",{get:function(){return this.colsValue},set:function(e){this.colsValue=e,!this.colsValue||this.colsValue<1||(this.renderer.setStyle(this.elementRef.nativeElement,"display","grid"),this.renderer.setStyle(this.elementRef.nativeElement,"grid-template-columns","repeat("+this.colsValue+", 1fr)"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bindValue",{set:function(e){this.binded=!1,this.innerBindValue=e,this.formGroup.patchValue(e),this.binded=!0},enumerable:!1,configurable:!0}),e.prototype.setValue=function(e){this.defaultValue=e,this.formGroup.patchValue(e)},Object.defineProperty(e.prototype,"submitValue",{get:function(){var e;return e=this.defaultValue?Object.assign(geminisNgCore.GnObjectUtils.deepCopy(this.defaultValue),this.formGroup.value):this.formGroup.value,"form"===this.format&&(e=geminisNgCore.GnJsonUtils.obj2FormData(e)),e},enumerable:!1,configurable:!0}),e.prototype.submit=function(){if(this.url){var e=Object.assign({body:this.submitValue},this.submitOptions);return this.http.request(this.submitMethod,this.url,e).toPromise()}return Promise.resolve(this.submitValue)},e.prototype.loadData=function(){var e=this;if(!this.url||!this.dataId)return this.defaultValue&&this.formGroup.patchValue(this.defaultValue),Promise.resolve(null);var t={pageSize:1,pageIndex:0,includes:this.dataIncludes,filterGroup:{type:"and",filters:[{field:this.dataKey,compareType:"=",value:this.dataId}]}},n=Object.assign({body:t},this.loadOptions);return this.http.request(this.loadMethod,this.url,n).toPromise().then((function(t){if(0===t.content.length)throw new Error("未找到数据["+e.dataId+"]");return e.defaultValue=e.defaultValue||{},Object.assign(e.defaultValue,t.content[0]),e.formGroup.patchValue(e.defaultValue),e.defaultValue}))},e.prototype.ngOnInit=function(){this.autoLoadData&&this.loadData()},e.prototype.ngAfterViewInit=function(){this.changeDetectorRef.detectChanges()},e}();GnFormDirective.decorators=[{type:core.Directive,args:[{selector:"[gn-form]",providers:[{provide:forms.ControlContainer,useFactory:controlContainerFactory}]}]}],GnFormDirective.ctorParameters=function(){return[{type:forms.ControlContainer},{type:core.ElementRef},{type:core.Renderer2},{type:http.HttpClient},{type:core.ChangeDetectorRef},{type:modal.NzModalRef,decorators:[{type:core.Optional}]}]},GnFormDirective.propDecorators={url:[{type:core.Input}],labelWidth:[{type:core.Input}],controlWidth:[{type:core.Input}],dataId:[{type:core.Input}],dataKey:[{type:core.Input}],dataIncludes:[{type:core.Input}],autoLoadData:[{type:core.Input}],submitMethod:[{type:core.Input}],loadMethod:[{type:core.Input}],format:[{type:core.Input}],submitOptions:[{type:core.Input}],loadOptions:[{type:core.Input}],defaultValue:[{type:core.Input}],cols:[{type:core.Input}],bindValue:[{type:core.Input}]};var GnFormItemComponent=function(){function GnFormItemComponent(e,t,n,o){this.gnForm=e,this.nzForm=t,this.cdr=n,this.domSanitizer=o,this.controlVisible=!0,this.validators=[]}return Object.defineProperty(GnFormItemComponent.prototype,"visible",{get:function(){return this.controlVisible},set:function(e){this.controlVisible=e,this.ensureFormControl()},enumerable:!1,configurable:!0}),Object.defineProperty(GnFormItemComponent.prototype,"colspan",{get:function(){return this.colspanValue},set:function(e){this.colspanValue=e,this.colspanValue>1&&this.label?(this.labelWidth=Math.ceil(this.gnForm.labelWidth/this.colspanValue),this.controlWidth=Math.floor((this.gnForm.controlWidth+24*(this.colspanValue-1))/this.colspanValue)):this.label||(this.controlWidth=24)},enumerable:!1,configurable:!0}),Object.defineProperty(GnFormItemComponent.prototype,"hasRequired",{get:function(){return this.validators&&this.validators.some((function(e){return"required"===e.validator}))},enumerable:!1,configurable:!0}),Object.defineProperty(GnFormItemComponent.prototype,"colSpan",{get:function(){return this.colspan?this.domSanitizer.bypassSecurityTrustStyle("auto / span "+this.colspan):null},enumerable:!1,configurable:!0}),Object.defineProperty(GnFormItemComponent.prototype,"rowSpan",{get:function(){return this.colspan?this.domSanitizer.bypassSecurityTrustStyle("auto / span "+this.rowspan):null},enumerable:!1,configurable:!0}),Object.defineProperty(GnFormItemComponent.prototype,"styleDisplay",{get:function(){return!1===this.display?"none":""},enumerable:!1,configurable:!0}),GnFormItemComponent.prototype.ngOnInit=function(){this.ensureFormControl()},GnFormItemComponent.prototype.ngAfterViewInit=function(){if(this.nzFormControl&&(this.nzFormControl.nzValidateStatus=this.formControl),this.defaultValue||!1===this.defaultValue){if("string"==typeof this.defaultValue&&this.defaultValue.startsWith("{")&&this.defaultValue.endsWith("}")){var calcValue=eval(this.defaultValue.substr(1,this.defaultValue.length-2));this.formControl.patchValue(calcValue)}else this.formControl.patchValue(this.defaultValue);this.cdr.detectChanges()}},GnFormItemComponent.prototype.ensureFormControl=function(){this.field&&(this.controlVisible?this.formControl=geminisNgCore.GnFormUtils.ensureFormControl(this.gnForm.formGroup,this.field,this.validators):geminisNgCore.GnFormUtils.removeFormControl(this.gnForm.formGroup,this.field))},GnFormItemComponent}();GnFormItemComponent.decorators=[{type:core.Component,args:[{selector:"gn-form-item,[gn-form-item]",template:'<nz-form-item *ngIf="controlVisible">\n <nz-form-label *ngIf="label" [nzRequired]="hasRequired"\n [nzSpan]="nzForm.nzLayout === \'horizontal\' ? (labelWidth || gnForm.labelWidth) : null">{{label}}\n </nz-form-label>\n <nz-form-control [nzErrorTip]="errorTpl"\n [nzSpan]="nzForm.nzLayout === \'horizontal\' ? (controlWidth || gnForm.controlWidth) : null">\n <ng-content></ng-content>\n <ng-template #errorTpl let-control>\n <ng-container *ngFor="let validator of validators">\n <ng-container *ngIf="control.hasError(validator.validator)">\n {{validator.message}}\n </ng-container>\n </ng-container>\n </ng-template>\n </nz-form-control>\n</nz-form-item>\n',styles:[":host{padding:0 5px}"]}]}],GnFormItemComponent.ctorParameters=function(){return[{type:GnFormDirective},{type:form.NzFormDirective},{type:core.ChangeDetectorRef},{type:platformBrowser.DomSanitizer}]},GnFormItemComponent.propDecorators={nzFormControl:[{type:core.ViewChild,args:[form.NzFormControlComponent]}],visible:[{type:core.Input}],label:[{type:core.Input}],field:[{type:core.Input}],colspan:[{type:core.Input}],rowspan:[{type:core.Input}],validators:[{type:core.Input}],defaultValue:[{type:core.Input}],display:[{type:core.Input}],colSpan:[{type:core.HostBinding,args:["style.grid-column"]}],rowSpan:[{type:core.HostBinding,args:["style.grid-row"]}],styleDisplay:[{type:core.HostBinding,args:["style.display"]}]};var GnFormModule=function(){},GnHiddenComponent_1;GnFormModule.decorators=[{type:core.NgModule,args:[{declarations:[GnFormDirective,GnFormItemComponent],exports:[GnFormDirective,GnFormItemComponent],imports:[common.CommonModule,forms.FormsModule,forms.ReactiveFormsModule,form.NzFormModule]}]}],exports.GnHiddenComponent=GnHiddenComponent_1=function(){function e(e){this.formItem=e,this.valueChange=function(e){}}return Object.defineProperty(e.prototype,"value",{get:function(){return this.innerValue},set:function(e){this.innerValue!==e&&(this.innerValue=e,this.valueChange(this.innerValue))},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.formItem&&(this.formItem.display=!1)},e.prototype.registerOnChange=function(e){this.valueChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.writeValue=function(e){this.value=e},e}(),exports.GnHiddenComponent.decorators=[{type:core.Component,args:[{selector:"gn-hidden",template:"",providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:core.forwardRef((function(){return GnHiddenComponent_1})),multi:!0}]}]}],exports.GnHiddenComponent.ctorParameters=function(){return[{type:GnFormItemComponent,decorators:[{type:core.Optional}]}]},exports.GnHiddenComponent.propDecorators={value:[{type:core.Input}]},exports.GnHiddenComponent=GnHiddenComponent_1=__decorate([GnFormItem("hidden")],exports.GnHiddenComponent);var GnHiddenModule=function(){},GnInputComponent_1;GnHiddenModule.decorators=[{type:core.NgModule,args:[{declarations:[exports.GnHiddenComponent],exports:[exports.GnHiddenComponent],imports:[common.CommonModule,forms.FormsModule],entryComponents:[]}]}],exports.GnInputComponent=GnInputComponent_1=function(){function e(){this.placeholder="",this.valueChange=function(e){}}return Object.defineProperty(e.prototype,"value",{get:function(){return this.innerValue},set:function(e){this.innerValue!==e&&(this.innerValue=e,this.valueChange(this.innerValue))},enumerable:!1,configurable:!0}),e.prototype.registerOnChange=function(e){this.valueChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.writeValue=function(e){this.value=e},e}(),exports.GnInputComponent.decorators=[{type:core.Component,args:[{selector:"gn-input",template:'<input [(ngModel)]="value" nz-input [placeholder]="placeholder"/>\n',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:core.forwardRef((function(){return GnInputComponent_1})),multi:!0}],styles:[""]}]}],exports.GnInputComponent.propDecorators={placeholder:[{type:core.Input}],value:[{type:core.Input}]},exports.GnInputComponent=GnInputComponent_1=__decorate([GnFormItem("input")],exports.GnInputComponent);var GnInputModule=function(){};GnInputModule.decorators=[{type:core.NgModule,args:[{declarations:[exports.GnInputComponent],exports:[exports.GnInputComponent],imports:[common.CommonModule,input.NzInputModule,forms.FormsModule],entryComponents:[]}]}];var modalContentTypes={},GnJsonFormComponent_1;function GnModalContent(e){var t="string"==typeof e?{key:e}:e;return function(e){modalContentTypes[t.key]=Object.assign({type:e},t),delete modalContentTypes[t.key].key}}exports.GnJsonFormComponent=GnJsonFormComponent_1=function(){function e(e,t,n){this.http=e,this.messageService=t,this.changeDetectorRef=n,this.config={fields:[]},this.configLoaded=new core.EventEmitter}return Object.defineProperty(e.prototype,"url",{get:function(){return this.urlValue},set:function(e){var t=this;this.urlValue=e,this.urlValue&&this.http.get(this.urlValue).subscribe((function(e){t.config=Object.assign(e,t.defaultConfig),t.config.fields.sort(GnJsonFormComponent_1.sortField),t.changeDetectorRef.detectChanges(),t.configLoaded.emit(t.config),t.form.loadData()}),(function(e){t.messageService.error("获取表单配置错误"),console.error(e)}))},enumerable:!1,configurable:!0}),e.sortField=function(e,t){return(e.showOrder||0)>(t.showOrder||0)?1:(e.showOrder||0)<(t.showOrder||0)?-1:0},e.prototype.sortFields=function(){this.config.fields.sort(GnJsonFormComponent_1.sortField),this.changeDetectorRef.detectChanges()},e}(),exports.GnJsonFormComponent.decorators=[{type:core.Component,args:[{selector:"gn-json-form",template:'<form nz-form\n [nzLayout]="config?.layout||\'horizontal\'"\n gn-form\n [url]="config?.url"\n [dataKey]="config?.dataKey"\n [dataIncludes]="config?.includes"\n [defaultValue]="defaultValue || config?.defaultValue"\n [autoLoadData]="false"\n [dataId]="dataId"\n [format]="config?.format || \'json\'"\n [loadMethod]="config?.loadMethod || \'post\'"\n [loadOptions]="config?.loadOptions"\n [submitMethod]="config?.submitMethod || \'put\'"\n [submitOptions]="config?.submitOptions"\n [cols]="config?.cols"\n [labelWidth]="config?.labelWidth||6"\n [controlWidth]="config?.controlWidth||18">\n <gn-json-form-item *ngFor="let itemConfig of config?.fields" [config]="itemConfig"></gn-json-form-item>\n</form>\n',styles:[""]}]}],exports.GnJsonFormComponent.ctorParameters=function(){return[{type:http.HttpClient},{type:GnMessageService},{type:core.ChangeDetectorRef}]},exports.GnJsonFormComponent.propDecorators={url:[{type:core.Input}],config:[{type:core.Input}],dataId:[{type:core.Input}],defaultValue:[{type:core.Input}],defaultConfig:[{type:core.Input}],configLoaded:[{type:core.Output}],form:[{type:core.ViewChild,args:[GnFormDirective,{static:!0}]}],nzForm:[{type:core.ViewChild,args:[form.NzFormDirective,{static:!0}]}]},exports.GnJsonFormComponent=GnJsonFormComponent_1=__decorate([GnModalContent("json-form")],exports.GnJsonFormComponent);var GnJsonFormItemComponent=function(){function GnJsonFormItemComponent(e,t,n,o){this.resolver=e,this.changeDetectorRef=t,this.domSanitizer=n,this.controlContainer=o,this.form=this.controlContainer.control}return Object.defineProperty(GnJsonFormItemComponent.prototype,"colSpan",{get:function(){return this.config.colspan?this.domSanitizer.bypassSecurityTrustStyle("auto / span "+this.config.colspan):null},enumerable:!1,configurable:!0}),Object.defineProperty(GnJsonFormItemComponent.prototype,"rowSpan",{get:function(){return this.config.colspan?this.domSanitizer.bypassSecurityTrustStyle("auto / span "+this.config.rowspan):null},enumerable:!1,configurable:!0}),Object.defineProperty(GnJsonFormItemComponent.prototype,"visible",{get:function(){if(void 0===this.config.visible)return!0;if("string"==typeof this.config.visible){var form=this.form;return eval(this.config.visible)}return this.config.visible},enumerable:!1,configurable:!0}),GnJsonFormItemComponent.prototype.ngOnInit=function(){var e,t,n=formItemTypes[this.config.type];if(!n)throw new Error("输入组件["+this.config.type+"]未注册");var o=this.resolver.resolveComponentFactory(n),r=this.container.createComponent(o);if(this.config.options)try{for(var i=__values(Object.keys(this.config.options)),a=i.next();!a.done;a=i.next()){var s=a.value;r.instance[s]=this.config.options[s]}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}if(this.config.field){var l=geminisNgCore.GnFormUtils.ensureFormControl(this.form,this.config.field,this.config.validators),u=r.injector.get(forms.NG_VALUE_ACCESSOR,null)[0];u.registerOnChange((function(e){l.markAsDirty(),l.setValue(e)})),l.registerOnChange((function(e){u.writeValue(e)}))}},GnJsonFormItemComponent}(),GnPasswordComponent_1;GnJsonFormItemComponent.decorators=[{type:core.Component,args:[{selector:"gn-json-form-item",template:'<gn-form-item [label]="config.label"\n [field]="config.field"\n [validators]="config.validators"\n [defaultValue]="config.defaultValue"\n [visible]="visible"\n [display]="config.display"\n [rowspan]="config.rowspan"\n [colspan]="config.colspan">\n <ng-template></ng-template>\n</gn-form-item>\n',styles:[":host{display:contents}"]}]}],GnJsonFormItemComponent.ctorParameters=function(){return[{type:core.ComponentFactoryResolver},{type:core.ChangeDetectorRef},{type:platformBrowser.DomSanitizer},{type:forms.ControlContainer}]},GnJsonFormItemComponent.propDecorators={container:[{type:core.ViewChild,args:[core.TemplateRef,{static:!0,read:core.ViewContainerRef}]}],formItemComponent:[{type:core.ViewChild,args:[GnFormItemComponent,{static:!0}]}],config:[{type:core.Input}],colSpan:[{type:core.HostBinding,args:["style.grid-column"]}],rowSpan:[{type:core.HostBinding,args:["style.grid-row"]}]},exports.GnPasswordComponent=GnPasswordComponent_1=function(){function e(){this.passwordVisible=!1,this.placeholder="",this.valueChange=function(e){}}return Object.defineProperty(e.prototype,"value",{get:function(){return this.password},set:function(e){this.password!==e&&this.hash!==e&&(this.password=e,this.hash=this.password&&""!==this.password?HEX__default.default.stringify(SHA256__default.default(this.password)):null,this.valueChange(this.hash))},enumerable:!1,configurable:!0}),e.prototype.registerOnChange=function(e){this.valueChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.setDisabledState=function(e){},e.prototype.writeValue=function(e){this.value=e},e}(),exports.GnPasswordComponent.decorators=[{type:core.Component,args:[{selector:"gn-password",template:'<nz-input-group [nzSuffix]="suffixTemplate">\n <input [type]="passwordVisible ? \'text\' : \'password\'" nz-input [placeholder]="placeholder" [(ngModel)]="value"/>\n</nz-input-group>\n<ng-template #suffixTemplate>\n <i nz-icon [nzIconfont]="passwordVisible ? \'visible\' : \'invisible\'" (click)="passwordVisible = !passwordVisible"></i>\n</ng-template>\n',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:core.forwardRef((function(){return GnPasswordComponent_1})),multi:!0}],styles:[""]}]}],exports.GnPasswordComponent.ctorParameters=function(){return[]},exports.GnPasswordComponent.propDecorators={placeholder:[{type:core.Input}],value:[{type:core.Input}]},exports.GnPasswordComponent=GnPasswordComponent_1=__decorate([GnFormItem("password")],exports.GnPasswordComponent);var GnPasswordModule=function(){},GnRadioComponent_1;GnPasswordModule.decorators=[{type:core.NgModule,args:[{declarations:[exports.GnPasswordComponent],exports:[exports.GnPasswordComponent],imports:[common.CommonModule,input.NzInputModule,forms.FormsModule,icon.NzIconModule],entryComponents:[]}]}],exports.GnRadioComponent=GnRadioComponent_1=function(){function e(){this.items=[],this.valueChanged=new core.EventEmitter,this.valueChange=function(e){}}return Object.defineProperty(e.prototype,"value",{get:function(){return this.innerValue},set:function(e){this.innerValue!==e&&(this.innerValue=e,this.valueChange(this.innerValue))},enumerable:!1,configurable:!0}),e.prototype.registerOnChange=function(e){this.valueChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.writeValue=function(e){this.value=e},e}(),exports.GnRadioComponent.decorators=[{type:core.Component,args:[{selector:"gn-radio",template:'\n <nz-radio-group [(ngModel)]="value" (ngModelChange)="valueChanged.emit()">\n <label nz-radio *ngFor="let item of items" [nzValue]="item.value">{{item.label}}</label>\n </nz-radio-group>\n ',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:core.forwardRef((function(){return GnRadioComponent_1})),multi:!0}]}]}],exports.GnRadioComponent.propDecorators={value:[{type:core.Input}],items:[{type:core.Input}],valueChanged:[{type:core.Output}]},exports.GnRadioComponent=GnRadioComponent_1=__decorate([GnFormItem("radio")],exports.GnRadioComponent);var GnRadioModule=function(){},GnSelectComponent_1;GnRadioModule.decorators=[{type:core.NgModule,args:[{declarations:[exports.GnRadioComponent],imports:[common.CommonModule,forms.FormsModule,radio.NzRadioModule],exports:[exports.GnRadioComponent],entryComponents:[]}]}],exports.GnSelectComponent=GnSelectComponent_1=function(){function e(e,t){this.http=e,this.messageService=t,this.items=[],this.pageSize=10,this.valueChanged=new core.EventEmitter,this.valueChange=function(e){}}return Object.defineProperty(e.prototype,"value",{get:function(){return this.innerValue},set:function(e){this.innerValue!==e&&(this.innerValue=e,this.valueChange(this.innerValue))},enumerable:!1,configurable:!0}),e.prototype.searchData=function(e){this.showSearch&&(this.searchValue=e,this.pageIndex=0,this.noMore=!1,this.items=[],this.fetchData())},e.prototype.appendData=function(){this.showSearch&&!this.noMore&&(this.pageIndex++,this.fetchData())},e.prototype.fetchData=function(){var e=this;this.loading=!0;var t={pageSize:this.pageSize,pageIndex:this.pageIndex,includes:this.includes||[],filterGroup:{type:"and",filters:[{field:this.searchField,compareType:"like",value:"%"+this.searchValue+"%"}]}};this.http.post(this.url,t).subscribe((function(t){0===t.content.length&&(e.noMore=!0),t.content.forEach((function(t){e.items.push({value:geminisNgCore.GnObjectUtils.getValue(t,e.valueField),label:geminisNgCore.GnObjectUtils.getValue(t,e.labelField)})})),e.loading=!1}),(function(t){throw e.loading=!1,e.messageService.error("获取数据错误"),t}))},e.prototype.registerOnChange=function(e){this.valueChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.writeValue=function(e){this.value=e},e}(),exports.GnSelectComponent.decorators=[{type:core.Component,args:[{selector:"gn-select",template:'\n <nz-select [(ngModel)]="value" [nzAllowClear]="allowClear" [nzPlaceHolder]="placeHolder"\n (ngModelChange)="valueChanged.emit()" [nzShowSearch]="showSearch" [nzLoading]="loading"\n (nzOnSearch)="searchData($event)" (nzScrollToBottom)="appendData()" [nzDropdownRender]="renderTemplate">\n <nz-option *ngFor="let item of items" [nzValue]="item.value" [nzLabel]="item.label"></nz-option>\n </nz-select>\n <ng-template #renderTemplate>\n <nz-spin *ngIf="loading"></nz-spin>\n </ng-template>\n ',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:core.forwardRef((function(){return GnSelectComponent_1})),multi:!0}]}]}],exports.GnSelectComponent.ctorParameters=function(){return[{type:http.HttpClient},{type:GnMessageService}]},exports.GnSelectComponent.propDecorators={value:[{type:core.Input}],items:[{type:core.Input}],placeHolder:[{type:core.Input}],allowClear:[{type:core.Input}],showSearch:[{type:core.Input}],url:[{type:core.Input}],pageSize:[{type:core.Input}],includes:[{type:core.Input}],searchField:[{type:core.Input}],valueField:[{type:core.Input}],labelField:[{type:core.Input}],valueChanged:[{type:core.Output}]},exports.GnSelectComponent=GnSelectComponent_1=__decorate([GnFormItem("select")],exports.GnSelectComponent);var GnSelectModule=function(){};GnSelectModule.decorators=[{type:core.NgModule,args:[{declarations:[exports.GnSelectComponent],imports:[common.CommonModule,forms.FormsModule,select.NzSelectModule,spin.NzSpinModule],exports:[exports.GnSelectComponent],entryComponents:[]}]}];var GnJsonFormModule=function(){};GnJsonFormModule.decorators=[{type:core.NgModule,args:[{declarations:[exports.GnJsonFormComponent,GnJsonFormItemComponent],exports:[exports.GnJsonFormComponent,GnJsonFormItemComponent],imports:[common.CommonModule,form.NzFormModule,inputNumber.NzInputNumberModule,_switch.NzSwitchModule,GnFormModule,GnInputModule,GnRadioModule,GnSelectModule,GnPasswordModule,GnMessageServiceModule]}]}];var GnTableColumnDirective=function(){function e(e){this.templateRef=e}return Object.defineProperty(e.prototype,"setId",{set:function(e){this.id=e},enumerable:!1,configurable:!0}),e}();GnTableColumnDirective.decorators=[{type:core.Directive,args:[{selector:"[gnTableColumn]"}]}],GnTableColumnDirective.ctorParameters=function(){return[{type:core.TemplateRef,decorators:[{type:core.Optional}]}]},GnTableColumnDirective.propDecorators={setId:[{type:core.Input,args:["gnTableColumn"]}],id:[{type:core.Input}],title:[{type:core.Input}],pipe:[{type:core.Input}],pipeArgs:[{type:core.Input}]};var RemoteDataStrategy=function(){function e(e){this.table=e}return e.prototype.load=function(){if(!this.table.url)return Promise.resolve(null);var e={pageSize:this.table.pageSize,pageIndex:this.table.pageIndex-1,includes:this.table.includes||[],sorts:this.table.sorts,filterGroup:this.table.filterGroup};return this.table.http.post(this.table.url,e).toPromise()},e.prototype.delete=function(e,t){return this.table.isLoading=!0,this.table.http.request("delete",e,{body:t}).toPromise()},e.prototype.save=function(e,t){return this.table.http.put(this.table.url,t).toPromise()},e}(),LocalDataStrategy=function(){function e(e){this.table=e}return e.prototype.delete=function(e,t){var n=this,o=[];return t.forEach((function(e){var t=n.table.data.find((function(t){return t[n.table.dataKey]===e}));o.push(t);var r=n.table.data.findIndex((function(e){return e===t}));n.table.data.splice(r,1)})),Promise.resolve(o)},e.prototype.load=function(){return Promise.resolve({content:this.table.data,totalElements:this.table.dataTotal})},e.prototype.save=function(e,t){return Promise.resolve(t)},e}(),GnTableComponent=function(){function e(e,t,n){this.http=e,this.modalService=t,this.messageService=n,this.dataStrategies={},this.includes=[],this.sorts=[],this.data=[],this.dataTotal=0,this.pageIndex=1,this.pageSize=10,this.showPagination=!0,this.showSizeChanger=!0,this.autoLoadData=!0,this.selectionMode="multi",this.dataStrategy="remote",this.dataSaved=new core.EventEmitter,this.dataDeleted=new core.EventEmitter,this.dataLoaded=new core.EventEmitter,this.selectionStatus={},this.selected=[],this.selectedKeys=[],this.isSelected=!1,this.isAllSelected=!1,this.isSomeSelected=!1,this.isSingleSelected=!1,this.editData=null,this.isLoading=!1,this.dataStrategies.remote=new RemoteDataStrategy(this),this.dataStrategies.local=new LocalDataStrategy(this)}return e.prototype.getValue=function(e,t){return geminisNgCore.GnObjectUtils.getValue(e,t)},e.prototype.getValueWithPipe=function(e,t,n,o){if(!n)return this.getValue(e,t);var r=geminisNgCore.pipeTypes[n];if(!r)throw new Error("管道["+n+"]未注册");var i=this.getValue(e,t);return r.transform(i,o)},e.prototype.loadData=function(){var e=this;return this.isLoading=!0,this.dataStrategies[this.dataStrategy].load().then((function(t){return e.data=null==t?void 0:t.content,e.dataTotal=null==t?void 0:t.totalElements,e.dataLoaded.emit(e.data),e.data})).catch((function(t){throw e.messageService.error("获取数据错误"),t})).finally((function(){e.isLoading=!1}))},e.prototype.loadDataAndCleanSelection=function(){this.changeAllSelectStatus(!1),this.loadData()},e.prototype.deleteData=function(e,t){var n=this;this.modalService.confirm({nzContent:"确定删除所选数据?",nzOnOk:function(){return n.isLoading=!0,n.dataStrategies[n.dataStrategy].delete(e,t).then((function(){n.messageService.success("删除数据成功"),n.dataDeleted.emit()})).catch((function(e){n.messageService.error("删除数据错误"),console.error(e)})).finally((function(){n.isLoading=!1,n.loadDataAndCleanSelection()}))}},"confirm")},e.prototype.deleteSelectedData=function(){this.deleteData(this.url,this.selectedKeys)},e.prototype.refreshSelectionStatus=function(){var e=this;this.selected=this.data.filter((function(t){return e.selectionStatus[e.getValue(t,e.dataKey)]})),this.selectedKeys=this.selected.map((function(t){return e.getValue(t,e.dataKey)})),this.isSelected=this.selectedKeys.length>0,this.isAllSelected=this.isSelected&&this.selectedKeys.length===this.data.length,this.isSomeSelected=this.isSelected&&this.selectedKeys.length<this.data.length,this.isSingleSelected=1===this.selectedKeys.length,this.selectedKey=this.isSelected?this.selectedKeys[0]:null,this.selectedOne=this.isSelected?this.selected[0]:null},e.prototype.changeSelectStatus=function(e){"none"!==this.selectionMode&&("single"===this.selectionMode&&(this.selectionStatus={}),this.selectionStatus[e]=!this.selectionStatus[e],this.refreshSelectionStatus())},e.prototype.changeAllSelectStatus=function(e){var t=this;this.data.forEach((function(n){return t.selectionStatus[t.getValue(n,t.dataKey)]=e})),this.refreshSelectionStatus()},e.prototype.selectOne=function(e){this.select([e])},e.prototype.select=function(e){var t=this;this.changeAllSelectStatus(!1),e.forEach((function(e){return t.selectionStatus[e]=!0})),this.refreshSelectionStatus()},e.prototype.ngOnInit=function(){this.autoLoadData&&this.loadData()},e.prototype.refreshData=function(e){this.data=e,this.dataTotal=e.length},e.prototype.startEdit=function(e){this.editData=e},e.prototype.endEdit=function(){var e=this;this.isLoading=!0,this.dataStrategies[this.dataStrategy].save(this.url,this.editData).then((function(t){e.dataSaved.emit(e.editData),e.editData=null})).catch((function(t){throw e.messageService.error("更新数据错误"),t})).finally((function(){e.isLoading=!1}))},e}();GnTableComponent.decorators=[{type:core.Component,args:[{selector:"gn-table",template:'<nz-table\n [nzData]="data"\n [nzLoading]="isLoading"\n [nzFrontPagination]="false"\n [nzShowPagination]="showPagination"\n [nzTotal]="dataTotal"\n [nzShowTotal]="totalTemplate"\n [(nzPageIndex)]="pageIndex"\n [(nzPageSize)]="pageSize"\n (nzPageIndexChange)="loadData()"\n [nzShowSizeChanger]="showSizeChanger"\n (nzPageSizeChange)="loadData()">\n <thead>\n <tr>\n <th class="selection"\n *ngIf="selectionMode === \'multi\'"\n nzShowCheckbox\n [nzChecked]="isAllSelected"\n [nzIndeterminate]="isSomeSelected"\n (nzCheckedChange)="changeAllSelectStatus($event)"></th>\n <th class="selection"\n *ngIf="selectionMode === \'single\'"></th>\n <th *ngFor="let header of columns" [innerHTML]="header.title"></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let row of data" (click)="changeSelectStatus(getValue(row,dataKey))">\n <td nzShowCheckbox *ngIf="selectionMode !== \'none\'"\n [(nzChecked)]="selectionStatus[getValue(row,dataKey)]"\n (nzCheckedChange)="selectionMode === \'single\'?selectOne(getValue(row,dataKey)):refreshSelectionStatus()"></td>\n <td *ngFor="let body of columns">\n <ng-container\n *ngIf="!body.templateRef; else template">{{getValueWithPipe(row, body.id, body.pipe, body.pipeArgs)}}</ng-container>\n <ng-template #template [ngTemplateOutlet]="body.templateRef"\n [ngTemplateOutletContext]="{ $implicit: row }"></ng-template>\n </td>\n </tr>\n </tbody>\n <ng-template #totalTemplate let-total>共 {{ total }} 条记录</ng-template>\n</nz-table>\n',styles:[".selection{max-width:5rem}"]}]}],GnTableComponent.ctorParameters=function(){return[{type:http.HttpClient},{type:modal.NzModalService},{type:GnMessageService}]},GnTableComponent.propDecorators={nzTable:[{type:core.ViewChild,args:[table.NzTableComponent,{static:!0}]}],url:[{type:core.Input}],includes:[{type:core.Input}],filterGroup:[{type:core.Input}],sorts:[{type:core.Input}],data:[{type:core.Input}],dataKey:[{type:core.Input}],dataTotal:[{type:core.Input}],pageIndex:[{type:core.Input}],pageSize:[{type:core.Input}],showPagination:[{type:core.Input}],showSizeChanger:[{type:core.Input}],autoLoadData:[{type:core.Input}],selectionMode:[{type:core.Input}],dataStrategy:[{type:core.Input}],dataSaved:[{type:core.Output}],dataDeleted:[{type:core.Output}],dataLoaded:[{type:core.Output}],columns:[{type:core.ContentChildren,args:[GnTableColumnDirective]}]};var tableButtonTypes={};function GnTableButton(e){return function(t){tableButtonTypes[e]=t}}var GnModalButtonDirective=function(){function e(e,t){this.modalService=e,this.messageService=t,this.afterOpen=new core.EventEmitter,this.ok=new core.EventEmitter}return e.prototype.onClick=function(){var e=this,t=modalContentTypes[this.content||"json-form"],n=this.modalService.create({nzTitle:this.title,nzContent:t.type,nzComponentParams:this.params,nzWidth:this.width||t.width||"520px",nzBodyStyle:{overflow:"auto",height:this.height||t.height||"auto"},nzStyle:{top:this.top||t.top||"100px"},nzOkDisabled:this.okDisabled,nzOnOk:function(){var t=n.getContentComponent(),o=geminisNgCore.GnObjectUtils.callFunc(t,e.okMethod||"form.submit");return o&&"boolean"!=typeof o?o.then((function(t){return e.ok.emit(t),t})).catch((function(t){return e.messageService.error("处理错误"),console.error(t),!1})):(e.ok.emit(o),o)}});return n.afterOpen.subscribe((function(){e.afterOpen.emit(n)})),!1},e}();GnModalButtonDirective.decorators=[{type:core.Directive,args:[{selector:"[gn-modal-button]"}]}],GnModalButtonDirective.ctorParameters=function(){return[{type:modal.NzModalService},{type:GnMessageService}]},GnModalButtonDirective.propDecorators={title:[{type:core.Input}],content:[{type:core.Input}],params:[{type:core.Input}],okMethod:[{type:core.Input}],okDisabled:[{type:core.Input}],width:[{type:core.Input}],height:[{type:core.Input}],top:[{type:core.Input}],afterOpen:[{type:core.Output}],ok:[{type:core.Output}],onClick:[{type:core.HostListener,args:["click"]}]};var GnTableButtonComponent=function(){function e(e){this.resolver=e}return Object.defineProperty(e.prototype,"config",{get:function(){return this.configValue},set:function(e){if(this.configValue=e,this.config&&this.config.other){var t=tableButtonTypes[this.config.other];if(!t)throw new Error("表格按钮组件["+this.config.other+"]未注册");var n=this.resolver.resolveComponentFactory(t);this.container.createComponent(n).instance.table=this.table}},enumerable:!1,configurable:!0}),e.prototype.assignObject=function(e,t){return e?Object.assign(e,t):t},e}(),GnJsonTableComponent_1;GnTableButtonComponent.decorators=[{type:core.Component,args:[{selector:"gn-table-button",template:'<button nz-button class="button-new" *ngIf="co