@kre-form/ant
Version:
1 lines • 371 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/router"),require("rxjs/operators"),require("@angular/common"),require("@angular/http"),require("@angular/cdk/drag-drop"),require("@angular/common/http"),require("@ngx-translate/core"),require("ng-zorro-antd"),require("ngx-color-picker"),require("@ant-design/icons-angular/icons"),require("@angular/common/locales/zh"),require("rxjs"),require("ng-zorro-antd/modal"),require("@angular/platform-browser"),require("@kre-form/core"),require("ng-zorro-antd/message"),require("@angular/cdk/overlay"),require("lodash"),require("@angular/forms"),require("date-fns/difference_in_calendar_days"),require("moment"),require("@kre-form/abc"),require("@angular/core")):"function"==typeof define&&define.amd?define("@kre-form/ant",["exports","@angular/router","rxjs/operators","@angular/common","@angular/http","@angular/cdk/drag-drop","@angular/common/http","@ngx-translate/core","ng-zorro-antd","ngx-color-picker","@ant-design/icons-angular/icons","@angular/common/locales/zh","rxjs","ng-zorro-antd/modal","@angular/platform-browser","@kre-form/core","ng-zorro-antd/message","@angular/cdk/overlay","lodash","@angular/forms","date-fns/difference_in_calendar_days","moment","@kre-form/abc","@angular/core"],t):t((e["kre-form"]=e["kre-form"]||{},e["kre-form"].ant={}),e.ng.router,e.rxjs.operators,e.ng.common,e.ng.http,e.ng.cdk["drag-drop"],e.ng.common.http,e.core,e.ngZorroAntd,e.ngxColorPicker,e.icons,e.ng.common.locales.zh,e.rxjs,e.i1$1,e.ng.platformBrowser,e.core$1,e.message,e.ng.cdk.overlay,e._,e.ng.forms,e.differenceInCalendarDays_,e.moment_,e.abc,e.ng.core)}(this,function(e,t,o,n,i,l,r,a,d,s,p,f,c,h,u,m,g,k,b,y,v,x,C,O){"use strict";f=f&&f.hasOwnProperty("default")?f["default"]:f;var z=function(e,t){return(z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function w(e,t){function n(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var F=function(){return(F=Object.assign||function F(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function D(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,l=n.call(e),r=[];try{for(;(void 0===t||0<t--)&&!(i=l.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=l["return"])&&n.call(l)}finally{if(o)throw o.error}}return r}function T(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(D(arguments[t]));return e}var I,S=(w(L,I=m.FieldType),L.decorators=[{type:O.Component,args:[{selector:"krefield-anchor",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <nz-divider\n class="control-design"\n [id]="field.key"\n [nzText]="to.description"\n ></nz-divider>\n \x3c!-- <div id="components-anchor-demo-basic" style="height: 400px;">1</div> --\x3e\n </ng-container>\n\n <ng-template #other>\n <nz-divider\n class="control-design"\n [id]="field.key"\n [nzText]="to.description"\n ></nz-divider>\n \x3c!-- <div id="components-anchor-demo-basic" style="height: 400px;">1</div> --\x3e\n </ng-template>\n '}]}],L);function L(){return null!==I&&I.apply(this,arguments)||this}var E,P=(w(B,E=m.FieldType),B.decorators=[{type:O.Component,args:[{selector:"krefield-text",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <div class="control-design">\n <input nz-input disabled />\n </div>\n </ng-container>\n <ng-template #other>\n <ng-container *ngIf="editor === true">\n <input\n nz-input\n autocomplete="off"\n [formControl]="formControl"\n [kreFormAttributes]="field"\n [placeholder]="placeHolder"\n [class.is-invalid]="showError"\n [maxLength]="to.maxLength || 200"\n [minLength]="to.minLength || 0"\n />\n \x3c!-- <div class="tips">\n <i\n class="icon-bangzhu"\n [nzTooltipTitle]="tips"\n nzTooltipPlacement="top"\n nz-tooltip\n *ngIf="tips != \'\'"\n ></i>\n </div> --\x3e\n </ng-container>\n\n <div class="fieldtext" *ngIf="editor === false">{{ text }}</div>\n </ng-template>\n '}]}],B);function B(){return null!==E&&E.apply(this,arguments)||this}var V,M=(w(A,V=m.FieldType),A.prototype.resize=function(e){this.visibleChange(e)},A.prototype.ngOnInit=function(){this.route.snapshot.queryParams.lang&&"en"===this.route.snapshot.queryParams.lang.toLocaleLowerCase()&&(this.languageList=[{languageType:"zh-cn",label:"中",resValue:null},{languageType:"en",label:"EN",resValue:null}])},Object.defineProperty(A.prototype,"language",{get:function(){return this.model!=undefined&&null!=this.model&&this.key!=undefined&&null!=this.key&&this.model.hasOwnProperty(this.key)&&this.formControl.value!=undefined&&null!=this.formControl.value&&this.formControl.value!=[]&&0<this.formControl.value.length&&this.formControl.value!=this.languageList&&(this.languageList=this.formControl.value),this.languageList},enumerable:!0,configurable:!0}),A.prototype.onChange=function(e){this.to.required&&this.languageList.some(function(e){return(null===e.resValue||""===e.resValue||" "===e.resValue)&&"zh-cn"===e.languageType})?this.formControl.setValue([]):this.formControl.setValue(this.languageList),this.formControl.markAsTouched()},A.prototype.visibleChange=function(e){e&&this.cdkOverlayOrigin!==undefined&&(this.triggerWidth=+this.cdkOverlayOrigin.elementRef.nativeElement.getBoundingClientRect().width+"px")},Object.defineProperty(A.prototype,"langText",{get:function(){if(this.model==undefined||null==this.model||this.key==undefined||null==this.key||this.model[this.key]==undefined)return"";var e=this.model[this.key];return e!=undefined&&null!=e&&""!=e&&e instanceof Array&&0<e.length?e[0].resValue:""},enumerable:!0,configurable:!0}),A.decorators=[{type:O.Component,args:[{selector:"kreform-field-inputi18n",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <div class="control-design">\n <input nz-input disabled />\n </div>\n </ng-container>\n\n <ng-template #other>\n <ng-container *ngIf="editor === true">\n <div class="inputi18n">\n <div class="inputi18n-text" cdkOverlayOrigin>\n <input\n nz-input\n autocomplete="off"\n [(ngModel)]="language[0].resValue"\n [kreFormAttributes]="field"\n (ngModelChange)="onChange(language[0].resValue)"\n nz-popover\n nzPopoverTrigger="click"\n [nzPopoverContent]="contentTemplate"\n nzOverlayClassName="inputi18n-template"\n nzPopoverPlacement="bottom"\n [nzOverlayStyle]="{ width: triggerWidth }"\n (nzVisibleChange)="visibleChange($event)"\n [maxLength]="to.maxLength || 200"\n [minLength]="to.minLength || 0"\n />\n <i nz-icon class="inputi18n-i" nzType="global"></i>\n </div>\n \x3c!-- <div class="tips">\n <i\n class="icon-bangzhu"\n [nzTooltipTitle]="tips"\n nzTooltipPlacement="top"\n nz-tooltip\n *ngIf="tips != \'\'"\n ></i>\n </div> --\x3e\n </div>\n\n <ng-template #contentTemplate>\n <ul>\n <ng-container *ngFor="let item of language; let i = index">\n <li *ngIf="i > 0">\n <label>{{ item.label }}</label>\n <input\n nz-input\n autocomplete="off"\n [(ngModel)]="item.resValue"\n [kreFormAttributes]="field"\n (ngModelChange)="onChange(item.resValue)"\n [maxLength]="to.maxLength || 200"\n [minLength]="to.minLength || 0"\n />\n </li>\n </ng-container>\n </ul>\n </ng-template>\n </ng-container>\n <div class="fieldtext" *ngIf="editor === false">{{ langText }}</div>\n </ng-template>\n '}]}],A.ctorParameters=function(){return[{type:t.ActivatedRoute}]},A.propDecorators={cdkOverlayOrigin:[{type:O.ViewChild,args:[k.CdkOverlayOrigin,{"static":!1}]}],resize:[{type:O.HostListener,args:["window:resize",["$event"]]}]},A);function A(e){var t=V.call(this)||this;return t.route=e,t.triggerWidth="260px",t.languageList=[{languageType:"zh-cn",label:"中",resValue:null},{languageType:"en",label:"英",resValue:null}],t}var _,N=(w(G,_=m.FieldType),G.prototype.ngOnInit=function(){},G.decorators=[{type:O.Component,args:[{selector:"krefield-textarea",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <div class="control-design">\n <textarea\n nz-input\n disabled\n [rows]="to.rows ? to.rows : 4"\n style="resize:none"\n >\n </textarea>\n </div>\n </ng-container>\n\n <ng-template #other>\n <ng-container *ngIf="editor === true">\n <textarea\n wrap="hard"\n nz-input\n autocomplete="off"\n [formControl]="formControl"\n class="form-control"\n [class.is-invalid]="showError"\n [kreFormAttributes]="field"\n [rows]="to.rows ? to.rows : 4"\n style="resize:none"\n [maxLength]="to.maxLength || 500"\n [minLength]="to.minLength || 0"\n >\n </textarea>\n \x3c!-- <div class="tips">\n <i\n class="icon-bangzhu"\n [nzTooltipTitle]="tips"\n nzTooltipPlacement="top"\n nz-tooltip\n *ngIf="tips != \'\'"\n ></i>\n </div> --\x3e\n </ng-container>\n <div\n class="fieldtext krefield-textarea-{{ to.rows || 4 }} "\n *ngIf="editor === false"\n [innerHTML]="text | replaceLine"\n ></div>\n </ng-template>\n '}]}],G);function G(){return null!==_&&_.apply(this,arguments)||this}var q,H=(w(R,q=m.FieldType),Object.defineProperty(R.prototype,"precision",{get:function(){var e=0;return e=this.to!=undefined&&null!=this.to&&this.to.precision!=undefined&&null!=this.to.precision?this.to.precision:e},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"number",{get:function(){var e=this.text;return this.to!=undefined&&null!=this.to&&this.to.precision!=undefined&&null!=this.to.precision&&(!e&&0!==e||(e=b.round(e,this.to.precision),!b.isEmpty(this.model)&&this.model.hasOwnProperty(this.key)&&(this.model[this.key]=e))),e},enumerable:!0,configurable:!0}),R.decorators=[{type:O.Component,args:[{selector:"krefield-number",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <div class="control-design">\n <input nz-input disabled />\n </div>\n </ng-container>\n\n <ng-template #other>\n <ng-container *ngIf="editor === true">\n <nz-input-number\n autocomplete="off"\n [formControl]="formControl"\n [nzPlaceHolder]="placeHolder"\n [kreFormAttributes]="field"\n [class.is-invalid]="showError"\n [nzPrecision]="\n to.precision == undefined || to.precision == null\n ? null\n : to.precision\n "\n [nzMax]="to.max || 999999"\n [nzMin]="to.min || -999999"\n ></nz-input-number>\n </ng-container>\n <div class="fieldtext" *ngIf="editor === false">{{ number }}</div>\n </ng-template>\n '}]}],R);function R(){return null!==q&&q.apply(this,arguments)||this}var j,W=(w(K,j=m.FieldType),K.prototype.ngOnInit=function(){},K.decorators=[{type:O.Component,args:[{selector:"krefield-password",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <div class="control-design">\n <input nz-input disabled />\n </div>\n </ng-container>\n\n <ng-template #other>\n <ng-container *ngIf="editor === true">\n \x3c!-- <input\n nz-input\n autocomplete="off"\n [formControl]="formControl"\n [kreFormAttributes]="field"\n [class.is-invalid]="showError"\n [type]="\'password\'"\n />--\x3e\n\n <nz-input-group [nzSuffix]="suffixTemplate">\n <input\n [type]="passwordVisible ? \'text\' : \'password\'"\n nz-input\n autocomplete="off"\n [formControl]="formControl"\n [kreFormAttributes]="field"\n [class.is-invalid]="showError"\n />\n </nz-input-group>\n <ng-template #suffixTemplate>\n <i\n nz-icon\n [nzType]="passwordVisible ? \'eye-invisible\' : \'eye\'"\n (click)="passwordVisible = !passwordVisible"\n ></i>\n </ng-template>\n </ng-container>\n\n <div class="fieldtext" *ngIf="editor === false">\n {{ text }}\n </div>\n </ng-template>\n '}]}],K);function K(){var e=null!==j&&j.apply(this,arguments)||this;return e.passwordVisible=!1,e}var J,$=(w(Y,J=m.FieldType),Y.decorators=[{type:O.Component,args:[{selector:"krefield-radio",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <div class="control-design">\n <label nz-radio nzDisabled="true"></label>\n </div>\n </ng-container>\n\n <ng-template #other>\n <ng-container *ngIf="editor === true">\n <label\n nz-radio\n [formControl]="formControl"\n [kreFormAttributes]="field"\n [class.is-invalid]="showError"\n ></label>\n \x3c!-- <div class="tips">\n <i\n class="icon-bangzhu"\n [nzTooltipTitle]="tips"\n nzTooltipPlacement="top"\n nz-tooltip\n *ngIf="tips != \'\'"\n ></i>\n </div> --\x3e\n </ng-container>\n\n <div class="fieldtext" *ngIf="editor === false">{{ text }}</div>\n </ng-template>\n '}]}],Y);function Y(){return null!==J&&J.apply(this,arguments)||this}var U,Q=(w(X,U=m.FieldType),X.decorators=[{type:O.Component,args:[{selector:"krefield-radiogroup",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <div class="control-design">\n <nz-radio-group\n [nzName]="\'radiogroup-\' + guid"\n [formControl]="formControl"\n [kreFormAttributes]="field"\n [class.is-invalid]="showError"\n >\n <ng-container *ngFor="let item of to.options">\n <label nz-radio [nzValue]="item.value" nzDisabled="true">{{\n item.label\n }}</label>\n </ng-container>\n </nz-radio-group>\n </div>\n </ng-container>\n\n <ng-template #other>\n <ng-container *ngIf="editor === true">\n <nz-radio-group\n [nzName]="\'radiogroup-\' + guid"\n [formControl]="formControl"\n [kreFormAttributes]="field"\n [class.is-invalid]="showError"\n >\n <ng-container *ngFor="let item of to.options">\n <ng-container *ngIf="to.type == \'button\'">\n <label nz-radio-button [nzValue]="item.value">{{\n item.label\n }}</label>\n </ng-container>\n <ng-container\n *ngIf="\n to.type == null || to.type == undefined || to.type == \'default\'\n "\n >\n <label nz-radio [nzValue]="item.value">{{ item.label }}</label>\n </ng-container>\n </ng-container>\n </nz-radio-group>\n \x3c!-- <div class="tips">\n <i\n class="icon-bangzhu"\n [nzTooltipTitle]="tips"\n nzTooltipPlacement="top"\n nz-tooltip\n *ngIf="tips != \'\'"\n ></i>\n </div> --\x3e\n </ng-container>\n\n <div class="fieldtext" *ngIf="editor === false">{{ textRadio }}</div>\n </ng-template>\n '}]}],X);function X(){var e=null!==U&&U.apply(this,arguments)||this;return e.guid=m.Guid.create().value,e}var Z,ee=(w(te,Z=m.FieldType),te.decorators=[{type:O.Component,args:[{selector:"krefield-checkbox",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <div class="control-design">\n <label nz-checkbox nzDisabled="true"></label>\n </div>\n </ng-container>\n\n <ng-template #other>\n <ng-container *ngIf="editor === true">\n <label\n nz-checkbox\n [formControl]="formControl"\n [kreFormAttributes]="field"\n [class.is-invalid]="showError"\n ></label>\n \x3c!-- <div class="tips">\n <i\n class="icon-bangzhu"\n [nzTooltipTitle]="tips"\n nzTooltipPlacement="top"\n nz-tooltip\n *ngIf="tips != \'\'"\n ></i>\n </div> --\x3e\n </ng-container>\n\n <div class="fieldtext" *ngIf="editor === false">{{ text }}</div>\n </ng-template>\n '}]}],te);function te(){return null!==Z&&Z.apply(this,arguments)||this}var ne,ie=(w(oe,ne=m.FieldType),oe.prototype.onChange=function(e){var t=this;e!=undefined&&null!=e&&0<e.length&&e.forEach(function(e){t.to.options!==undefined&&null!==t.to.options&&t.to.options.forEach(function(e){e.value})}),this.formControl.patchValue(e),this.formControl.markAsTouched()},oe.prototype.getCheckStatus=function(e){this.formControl.value},oe.prototype.getControlChecked=function(e,t){var n=!1;return n=t&&e?e.some(function(e){return e==t.value}):n},oe.decorators=[{type:O.Component,args:[{selector:"krefield-checkboxgroup",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <div class="control-design">\n <nz-checkbox-wrapper\n style="width: 100%;"\n (nzOnChange)="onChange($event)"\n [class.is-invalid]="showError"\n >\n <ng-container *ngFor="let option of to.options; let i = index">\n <label\n nz-checkbox\n [nzValue]="option.value"\n [ngModel]="getControlChecked(formControl.value, option)"\n [kreFormAttributes]="field"\n disabled\n >{{ option.label }}</label\n >\n </ng-container>\n </nz-checkbox-wrapper>\n </div>\n </ng-container>\n\n <ng-template #other>\n <ng-container *ngIf="editor === true">\n <nz-checkbox-wrapper\n style="width: 100%;"\n (nzOnChange)="onChange($event)"\n [class.is-invalid]="showError"\n >\n <ng-container *ngFor="let option of to.options; let i = index">\n <label\n nz-checkbox\n [nzValue]="option.value"\n [ngModel]="getControlChecked(formControl.value, option)"\n [kreFormAttributes]="field"\n >{{ option.label }}</label\n >\n </ng-container>\n </nz-checkbox-wrapper>\n \x3c!-- <div class="tips">\n <i\n class="icon-bangzhu"\n [nzTooltipTitle]="tips"\n nzTooltipPlacement="top"\n nz-tooltip\n *ngIf="tips != \'\'"\n ></i>\n </div> --\x3e\n </ng-container>\n <div class="fieldtext" *ngIf="editor === false">{{ textMultiple }}</div>\n </ng-template>\n '}]}],oe);function oe(){var e=null!==ne&&ne.apply(this,arguments)||this;return e.guid=m.Guid.create().value,e}var le,re=(w(ae,le=m.FieldType),Object.defineProperty(ae.prototype,"getModelValue",{get:function(){return"multiple"===this.to.selectType?this.defaultValues:this.defaultValue},set:function(e){},enumerable:!0,configurable:!0}),Object.defineProperty(ae.prototype,"defaultValue",{get:function(){return this.model&&this.model[this.key]&&Array.isArray(this.model[this.key])&&0<this.model[this.key].length?(this._defaultValue=this.model[this.key][0].value,this._defaultValue):null},enumerable:!0,configurable:!0}),Object.defineProperty(ae.prototype,"defaultValues",{get:function(){var t=this;return this.model&&this.model[this.key]&&Array.isArray(this.model[this.key])?(this._defaultValues.length=0,this.model[this.key].forEach(function(e){t._defaultValues.push(e.value)}),this._defaultValues):null},enumerable:!0,configurable:!0}),ae.prototype.getSelectText=function(){return this.to&&this.to.selectType&&"multiple"===this.to.selectType?this.textMultiple:this.textSingle},ae.prototype.selectedChange=function(t){var e=this,n=[];this.to.selectType&&"multiple"==this.to.selectType?t&&Array.isArray(t)&&t.forEach(function(t){e.to.options&&Array.isArray(e.to.options)&&e.to.options.forEach(function(e){e.value==t&&n.push(e)})}):this.to.options&&Array.isArray(this.to.options)&&this.to.options.forEach(function(e){e.value==t&&(n=[e])}),this.formControl.patchValue(n),this.formControl.markAsTouched()},Object.defineProperty(ae.prototype,"clear",{get:function(){return"undefined"==typeof this.to.clear||!!this.to.clear},enumerable:!0,configurable:!0}),ae.decorators=[{type:O.Component,args:[{selector:"krefield-select",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <div class="control-design">\n <input nz-input disabled />\n </div>\n </ng-container>\n\n <ng-template #other>\n <ng-container *ngIf="editor === true">\n <nz-select\n [nzAllowClear]="!to.required && clear"\n [nzMode]="to.selectType === \'multiple\' ? \'multiple\' : \'default\'"\n [kreFormAttributes]="field"\n [class.is-invalid]="showError"\n [nzPlaceHolder]="placeHolder"\n [(ngModel)]="getModelValue"\n nzShowSearch="true"\n (ngModelChange)="selectedChange($event)"\n >\n <ng-container *ngFor="let item of to.options">\n <nz-option\n [nzLabel]="item.label"\n [nzValue]="item.value"\n ></nz-option>\n </ng-container>\n </nz-select>\n \x3c!-- <div class="tips">\n <i\n class="icon-bangzhu"\n [nzTooltipTitle]="tips"\n nzTooltipPlacement="top"\n nz-tooltip\n *ngIf="tips != \'\'"\n ></i>\n </div> --\x3e\n </ng-container>\n <div class="fieldtext" *ngIf="editor === false">\n {{ getSelectText() }}\n </div>\n </ng-template>\n '}]}],ae);function ae(){var e=null!==le&&le.apply(this,arguments)||this;return e._defaultValue="",e._defaultValues=[],e.selectType="default",e}var de,se=x,pe=v,fe=(w(ce,de=m.FieldType),ce.prototype.nzOnOpenChange=function(e,t){1==t&&this.field&&this.field.templateOptions&&this.field.templateOptions.enableInterface&&this.globalService.notifyDataChanged("DateTimeClick",{rdm:Math.random(),config:this.field,state:e}),0==e&&this.to!=undefined&&null!=this.to&&this.to.blur!=undefined&&null!=this.to.blur&&this.to.blur(this.field,null)},Object.defineProperty(ce.prototype,"format",{get:function(){var e="yyyy/MM/dd HH:mm";return e=this.to.format!=undefined&&null!=this.to.format&&""!=this.to.format?this.to.format:e},enumerable:!0,configurable:!0}),Object.defineProperty(ce.prototype,"showType",{get:function(){var e="datetime";return e=this.to.type!=undefined&&null!=this.to.type&&""!=this.to.type?this.to.type.toLowerCase():e},enumerable:!0,configurable:!0}),ce.prototype.getText=function(){var e="";if(this.to.type!==undefined&&null!==this.to.type&&""!==this.to.type||(this.to.type="datetime"),this.model!=undefined&&null!=this.model&&this.field!=undefined&&null!=this.field&&this.field.key!=undefined&&null!=this.field.key&&this.model[this.field.key]!=undefined&&null!=this.model[this.field.key]&&""!=this.model[this.field.key]&&se(this.model[this.field.key]).isValid()){var t=this.model[this.field.key];switch(this.to.type){case"datetime":e=se(t).format("YYYY/MM/DD HH:mm");break;case"date":e=se(t).format("YYYY/MM/DD");break;case"year":e=se(t).format("YYYY");break;case"month":e=se(t).format("YYYY/MM");break;case"time":e=se(t).format("HH:mm")}}return e},ce.prototype.range=function(e,t){for(var n=[],i=e;i<t;i++)n.push(i);return n},Object.defineProperty(ce.prototype,"showToday",{get:function(){return"undefined"==typeof this.to.today||!!this.to.today},enumerable:!0,configurable:!0}),ce.decorators=[{type:O.Component,args:[{selector:"krefield-datetime",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <div class="control-design">\n <input nz-input disabled />\n </div>\n </ng-container>\n\n <ng-template #other>\n <ng-container *ngIf="editor === true">\n <ng-container [ngSwitch]="showType">\n <ng-container *ngSwitchCase="\'datetime\'">\n <nz-date-picker\n nzShowTime\n [nzShowTime]="{ nzFormat: \'HH:mm\' }"\n nzFormat="yyyy/MM/dd HH:mm"\n [formControl]="formControl"\n [kreFormAttributes]="field"\n [class.is-invalid]="showError"\n [nzDisabledDate]="disabledDate"\n [nzDisabledTime]="disabledDateTime"\n [nzPlaceHolder]="to.placeholder || undefined"\n (nzOnOpenChange)="nzOnOpenChange($event, true)"\n ></nz-date-picker>\n </ng-container>\n <ng-container *ngSwitchCase="\'date\'">\n <nz-date-picker\n nzFormat="yyyy/MM/dd"\n [formControl]="formControl"\n [kreFormAttributes]="field"\n [nzDisabledDate]="disabledDate"\n [class.is-invalid]="showError"\n [nzShowToday]="showToday"\n [nzPlaceHolder]="to.placeholder || undefined"\n (nzOnOpenChange)="nzOnOpenChange($event, false)"\n ></nz-date-picker>\n </ng-container>\n <ng-container *ngSwitchCase="\'year\'">\n <nz-year-picker\n nzFormat="yyyy"\n [formControl]="formControl"\n [kreFormAttributes]="field"\n [class.is-invalid]="showError"\n [nzPlaceHolder]="to.placeholder || undefined"\n (nzOnOpenChange)="nzOnOpenChange($event, false)"\n ></nz-year-picker>\n </ng-container>\n <ng-container *ngSwitchCase="\'month\'">\n <nz-month-picker\n nzFormat="yyyy/MM"\n [formControl]="formControl"\n [kreFormAttributes]="field"\n [class.is-invalid]="showError"\n [nzPlaceHolder]="to.placeholder || undefined"\n (nzOnOpenChange)="nzOnOpenChange($event, false)"\n ></nz-month-picker>\n </ng-container>\n <ng-container *ngSwitchCase="\'time\'">\n <nz-time-picker\n nzFormat="HH:mm"\n [formControl]="formControl"\n [kreFormAttributes]="field"\n [class.is-invalid]="showError"\n [nzDisabledHours]="disabledHours"\n [nzDisabledMinutes]="disabledMinutes"\n (nzOpenChange)="nzOnOpenChange($event, true)"\n [nzPlaceHolder]="to.placeholder || undefined"\n nzClearText=""\n [nzPopupClassName]="field.className"\n ></nz-time-picker>\n </ng-container>\n <ng-container *ngSwitchDefault></ng-container>\n </ng-container>\n </ng-container>\n\n <div class="fieldtext" *ngIf="editor === false">\n {{ getText() }}\n </div>\n </ng-template>\n '}]}],ce.ctorParameters=function(){return[{type:m.FormGlobalService},{type:m.KreFormCommonService}]},ce);function ce(e,t){var i=de.call(this)||this;return i.globalService=e,i.commonService=t,i.disabledDate=function(e){return i.to.maxDate&&i.to.minDate?0<pe(e,new Date(i.to.maxDate))||pe(e,new Date(i.to.minDate))<0:i.to.maxDate&&!i.to.minDate?0<pe(e,new Date(i.to.maxDate)):!(i.to.maxDate||!i.to.minDate)&&pe(e,new Date(i.to.minDate))<0},i.disabledDateTime=function(e){var t=[],n=[];return i.to.maxDate&&i.to.minDate?(0===pe(e,new Date(i.to.minDate))&&(t=i.range(-1,new Date(i.to.minDate).getHours()),e&&new Date(i.to.minDate).getHours()-e.getHours()==0&&(n=i.range(-1,new Date(i.to.minDate).getMinutes()))),0===pe(e,new Date(i.to.maxDate))&&(t=T(t,i.range(new Date(i.to.maxDate).getHours()+1,24)),e&&new Date(i.to.maxDate).getHours()-e.getHours()==0&&(n=T(n,i.range(new Date(i.to.maxDate).getMinutes(),60))))):i.to.maxDate&&!i.to.minDate?e&&0===pe(e,new Date(i.to.maxDate))&&(t=i.range(new Date(i.to.maxDate).getHours()+1,24),e&&new Date(i.to.maxDate).getHours()-e.getHours()==0&&(n=i.range(new Date(i.to.maxDate).getMinutes(),60))):!i.to.maxDate&&i.to.minDate&&e&&0===pe(e,new Date(i.to.minDate))&&(t=i.range(0,new Date(i.to.minDate).getHours()),e&&new Date(i.to.minDate).getHours()-e.getHours()==0&&(n=i.range(-1,new Date(i.to.minDate).getMinutes()))),{nzDisabledHours:function(){return t},nzDisabledMinutes:function(){return n},nzDisabledSeconds:function(){return[]}}},i.disabledHours=function(){var e=[];return i.to.maxDate&&i.to.minDate?e=(e=i.range(-1,new Date(i.to.minDate).getHours())).concat(i.range(new Date(i.to.maxDate).getHours()+1,24)):i.to.maxDate&&!i.to.minDate?e=i.range(new Date(i.to.maxDate).getHours()+1,24):!i.to.maxDate&&i.to.minDate&&(e=i.range(0,new Date(i.to.minDate).getHours())),e},i.disabledMinutes=function(e){var t=[];return i.to.maxDate&&i.to.minDate?(0===pe(e,new Date(i.to.minDate))&&e&&new Date(i.to.minDate).getHours()-e.getHours()==0&&(t=i.range(-1,new Date(i.to.minDate).getMinutes())),0===pe(e,new Date(i.to.maxDate))&&e&&new Date(i.to.maxDate).getHours()-e.getHours()==0&&(t=i.range(new Date(i.to.maxDate).getMinutes(),60))):i.to.maxDate&&!i.to.minDate?e&&0===pe(e,new Date(i.to.maxDate))&&e&&new Date(i.to.maxDate).getHours()-e.getHours()==0&&(t=i.range(new Date(i.to.maxDate).getMinutes(),60)):!i.to.maxDate&&i.to.minDate&&e&&0===pe(e,new Date(i.to.minDate))&&e&&new Date(i.to.minDate).getHours()-e.getHours()==0&&(t=i.range(-1,new Date(i.to.minDate).getMinutes())),t},i}var he,ue=(w(me,he=m.FieldType),me.decorators=[{type:O.Component,args:[{selector:"krefield-image",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <div class="control-design">\n <input nz-input disabled />\n </div>\n </ng-container>\n <ng-template #other>\n <nz-avatar\n nzIcon="user"\n nzSrc="//zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnKreCYX.png"\n ></nz-avatar>\n \x3c!-- <div class="tips">\n <i\n class="icon-bangzhu"\n [nzTooltipTitle]="tips"\n nzTooltipPlacement="top"\n nz-tooltip\n *ngIf="tips != \'\'"\n ></i>\n </div> --\x3e\n </ng-template>\n '}]}],me);function me(){return null!==he&&he.apply(this,arguments)||this}var ge,ke=(w(be,ge=m.FieldType),be.prototype.handleChange=function(e){var t,i=e.file,n=e.fileList,e=i.status;"done"===e?(t=n.map(function(e){return{uid:e.uid,name:e.name,url:e.url}}),this.formControl.patchValue(t),this.formControl.markAsTouched(),this.msg.success("文件"+i.name+" 上传成功!")):"error"===e&&this.msg.error("文件"+i.name+" 上传失败!"),"removed"===e&&((t=this.formControl.value).forEach(function(e,t,n){e.uid===i.uid&&n.splice(t,1)}),this.msg.success("文件"+i.name+" 删除成功!"))},be.prototype.checkFileType=function(t){var e,n=!0;return this.field&&this.field.templateOptions&&this.field.templateOptions.attachment&&this.field.templateOptions.attachment.type&&((e=this.field.templateOptions.attachment.type)!=undefined&&null!=e&&""!=e&&(n=e.split(",").some(function(e){return t.type===e}))),n},be.prototype.checkFileSize=function(e){var t,n=!0;return this.field&&this.field.templateOptions&&this.field.templateOptions.attachment&&this.field.templateOptions.attachment.size&&((t=this.field.templateOptions.attachment.size)!=undefined&&null!=t&&(n=e.size/1024/1024<=t)),n},be.decorators=[{type:O.Component,args:[{selector:"krefield-upload",template:'\n <ng-container *ngIf="formStatus !== 0; else other">\n <div class="control-design">\n <nz-upload nzType="drag" [nzDisabled]="true">\n <p class="ant-upload-drag-icon"></p>\n <p class="ant-upload-text">单击或拖动文件到此区域上传</p>\n <p class="ant-upload-hint">\n 支持单个或批量上传。严禁上传不法文件,谢谢!\n </p>\n </nz-upload>\n </div>\n </ng-container>\n\n <ng-template #other>\n <nz-upload\n nzType="drag"\n nzAction="https://jsonplaceholder.typicode.com/posts/"\n [nzFileList]="defaultFileList"\n [nzMultiple]="true"\n (nzChange)="handleChange($event)"\n [class.is-invalid]="showError"\n >\n <p class="ant-upload-drag-icon"></p>\n <p class="ant-upload-text">单击或拖动文件到此区域上传</p>\n <p class="ant-upload-hint">\n 支持单个或批量上传。严禁上传不法文件,谢谢!\n </p>\n </nz-upload>\n <div class="tips"></div>\n </ng-template>\n '}]}],be.ctorParameters=function(){return[{type:g.NzMessageService}]},be);function be(e){var n=ge.call(this)||this;return n.msg=e,n.defaultFileList=[],n.handleRemove=function(e){return new c.Observable(function(e){e.next(!0),e.complete()})},n.beforeUpload=function(t){return new c.Observable(function(e){t.type;return n.checkFileType(t)?n.checkFileSize(t)?e.next(!0):n.msg.error("您上传的文件大小已经超出最大设置"):n.msg.error("您上传的文件类型不符合要求!"),void e.complete()})},n}var ye=(ve.prototype.fieldOperational=function(e,t){this.fieldEvent.emit({sign:e,field:t})},ve.prototype.groupOperational=function(e,t){this.btnEvent.emit({type:e,field:t})},ve.decorators=[{type:O.Injectable}],ve.ctorParameters=function(){return[]},ve);function ve(){this.btnEvent=new O.EventEmitter,this.fieldEvent=new O.EventEmitter,this.workList=[]}var xe=(Ce.prototype.switchSize=function(e){var t={width:700,height:500};switch(e){case"small":t.width=530,t.height=400;break;case"medium":t.width=700,t.height=500;break;case"large":t.width=950,t.height=600;break;default:t.width=700,t.height=500}return t},Ce.prototype.CreateModelDialog=function(e,t,n){var i=this.switchSize(e.size).width,o=this.switchSize(e.size).height,l=this.modalService.create({nzTitle:e.nzTitle||"提示",nzWidth:i+"px",nzClosable:!0,nzMaskClosable:!1,nzWrapClassName:e.vertical?"vertical-center-modal":"",nzBodyStyle:{padding:"0",height:e.hideBtn?o-54+"px":o-107+"px"},nzContent:e.nzContent,nzFooter:e.hideBtn?null:[{show:!0,label:"取消",type:"default",onClick:function(e){l.destroy()}},{show:e.showResetBtn,label:"重置",type:"default",onClick:function(e){return n(e,l)}},{show:!0,label:e.primaryLabel||"确定",type:"primary",onClick:function(e){return n(e,l)}}],nzOnOk:function(e){},nzOnCancel:function(e){},nzComponentParams:t});l.afterClose.subscribe(function(e){e&&n(e)})},Ce.prototype.CreateModelDialogField=function(e,t,n){var i=this.switchSize(e.size).width,o=this.switchSize(e.size).height,l=this.modalService.create({nzTitle:e.nzTitle||"提示",nzWidth:i+"px",nzClosable:!0,nzMaskClosable:!1,nzWrapClassName:e.vertical?"vertical-center-modal":"",nzBodyStyle:{padding:"0",height:e.hideBtn?o-54+"px":o-107+"px"},nzContent:e.nzContent,nzFooter:e.hideBtn?null:[{show:!0,label:"取消",type:"default",onClick:function(e){l.destroy()}},{show:!0,label:e.primaryLabel||"确定",type:"primary",onClick:function(e){return n("save",e,l)}}],nzOnOk:function(e){},nzOnCancel:function(e){},nzComponentParams:t});l.afterClose.subscribe(function(e){e&&n(e)})},Ce.decorators=[{type:O.Injectable,args:[{providedIn:"root"}]}],Ce.ctorParameters=function(){return[{type:d.NzModalService}]},Ce.ngInjectableDef=O.ɵɵdefineInjectable({factory:function(){return new Ce(O.ɵɵinject(h.NzModalService))},token:Ce,providedIn:"root"}),Ce);function Ce(e){this.modalService=e}var Oe=(Object.defineProperty(ze.prototype,"loading",{get:function(){return this._loading},enumerable:!0,configurable:!0}),ze.prototype.parseParams=function(e){return e!==undefined&&null!==e||(e={}),new r.HttpParams({fromObject:e})},ze.prototype.formEncode=function(e){var t,n="";for(t in e)0!==n.length&&(n+="&"),n+=t+"="+encodeURIComponent(e[t]);return n},ze.prototype.appliedUrl=function(e,t){if(!t)return e;e+=~e.indexOf("?")?"":"?";var n,i=[];for(n in t)i.push(n+"="+t[n]);return e+i.join("&")},ze.prototype.begin=function(){var e=this;setTimeout(function(){return e._loading=!0})},ze.prototype.end=function(){var e=this;setTimeout(function(){return e._loading=!1})},ze.prototype.get=function(e,t,n){return this.request("GET",e,Object.assign({params:t},n))},ze.prototype.post=function(e,t,n,i){return this.request("POST",e,Object.assign({body:t,params:n},i))},ze.prototype["delete"]=function(e,t,n){return this.request("DELETE",e,Object.assign({params:t},n))},ze.prototype.jsonp=function(e,t,n){var i=this;return void 0===n&&(n="JSONP_CALLBACK"),this.http.jsonp(this.appliedUrl(e,t),n).pipe(o.tap(function(){i.end()}),o.catchError(function(e){return i.end(),c.throwError(e)}))},ze.prototype.patch=function(e,t,n,i){return this.request("PATCH",e,Object.assign({body:t,params:n},i))},ze.prototype.put=function(e,t,n,i){return this.request("PUT",e,Object.assign({body:t,params:n},i))},ze.prototype.request=function(e,t,n){var i=this;return this.begin(),n&&(n.params&&(n.params=this.parseParams(n.params)),n.body),this.http.request(e,t,n).pipe(o.tap(function(){i.end()}),o.catchError(function(e){return i.end(),c.throwError(e)}))},ze.decorators=[{type:O.Injectable,args:[{providedIn:"root"}]}],ze.ctorParameters=function(){return[{type:r.HttpClient}]},ze.ngInjectableDef=O.ɵɵdefineInjectable({factory:function(){return new ze(O.ɵɵinject(r.HttpClient))},token:ze,providedIn:"root"}),ze);function ze(e){this.http=e,this._loading=!1}var we=(Fe.prototype.getBusinessTables=function(e,t){return this._http.get(e,t=void 0===t?{}:t)},Fe.prototype.getFormInfo=function(e,t){return this._http.get(e,t=void 0===t?{}:t)},Fe.prototype.getSysCtrEmployee=function(e){void 0===e&&(e={});var t=this.getWebAPIName("employee");return this._http.get(t,e)},Fe.prototype.getSysCtrOrgTree=function(e){void 0===e&&(e={});var t=this.getWebAPIName("organization");return this._http.get(t,e)},Fe.prototype.getSysCtrPostionTable=function(e){void 0===e&&(e={});var t=this.getWebAPIName("postion");return this._http.get(t,e)},Fe.prototype.getSysCtrArea=function(e){return this._http.get("tables.json",e=void 0===e?{}:e)},Fe.prototype.getTreeData=function(e){void 0===e&&(e={});var t=this.getWebAPIName("tree");return this._http.get(t,e)},Fe.prototype.getWebAPIName=function(e){var t="",n=localStorage.getItem("KreFORM:WEBAPI");return t=(t=n!=undefined&&null!=n&&""!=n?JSON.parse(n)[e]:t)==undefined||null==t?"":t},Fe.decorators=[{type:O.Injectable,args:[{providedIn:"root"}]}],Fe.ctorParameters=function(){return[{type:Oe}]},Fe.ngInjectableDef=O.ɵɵdefineInjectable({factory:function(){return new Fe(O.ɵɵinject(Oe))},token:Fe,providedIn:"root"}),Fe);function Fe(e){this._http=e}var De=(Object.defineProperty(Te.prototype,"selectedNode",{get:function(){return b.cloneDeep(this.selectData)},enumerable:!0,configurable:!0}),Object.defineProperty(Te.prototype,"selectType",{get:function(){var e="";return e=this.fieldConfig!=undefined&&null!=this.fieldConfig&&this.fieldConfig.templateOptions!=undefined&&null!=this.fieldConfig.templateOptions&&this.fieldConfig.templateOptions.selectType!=undefined?this.fieldConfig.templateOptions.selectType:e},enumerable:!0,configurable:!0}),Te.prototype.ngOnInit=function(){var e=b.get(this.fieldConfig,"templateOptions.treeid");e!=undefined&&null!=e&&""!=e&&(this.controlid=b.get(this.fieldConfig,"templateOptions.treeid")),this.getTreeData()},Te.prototype.ngOnChanges=function(e){e.defaultNode},Te.prototype.getTreeData=function(){var t=this;this.dataService.getTreeData({id:this.controlid}).subscribe(function(e){t.treeData=e,t.getSelectData()})},Te.prototype.getSelectData=function(){null!=this.fieldConfig&&this.fieldConfig.model!=undefined&&null!=this.fieldConfig.model&&this.fieldConfig.key!=undefined&&null!=this.fieldConfig.key&&this.fieldConfig.model[this.fieldConfig.key]!=undefined&&null!=this.fieldConfig.model[this.fieldConfig.key]&&(this.selectData=b.cloneDeep(this.fieldConfig.model[this.fieldConfig.key]))},Te.decorators=[{type:O.Component,args:[{selector:"kreform-tree",template:'<kreform-private-tree [data]="treeData" [selectType]="selectType" [selectData]="selectData" [tag]="tag"></kreform-private-tree>',providers:[we],styles:[":host ::ng-deep .builder-content{width:100%;padding:0 0 0 12px}:host ::ng-deep .builder-content .content{width:50%;float:left;margin:0 0 15px;min-height:45px}:host ::ng-deep .builder-content .content .label{width:100%}:host ::ng-deep .builder-content .content .control{width:100%;padding:0 15px 0 0}:host ::ng-deep .builder-content .content .control .ant-input-number{width:100%!important}:host ::ng-deep .builder-content .textarea{width:100%}"]}]}],Te.ctorParameters=function(){return[{type:we}]},Te.propDecorators={fieldConfig:[{type:O.Input}],tag:[{type:O.Input}],treeChangeEvent:[{type:O.Output}]},Te);function Te(e){this.dataService=e,this.fieldConfig={},this.tag=!1,this.treeChangeEvent=new O.EventEmitter,this.treeData=[],this.controlid="",this.selectData=[]}var Ie=(Object.defineProperty(Se.prototype,"selectedNode",{get:function(){return b.cloneDeep(this.selectData)},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"selectType",{get:function(){var e="";return e=this.fieldConfig!=undefined&&null!=this.fieldConfig&&this.fieldConfig.templateOptions!=undefined&&null!=this.fieldConfig.templateOptions&&this.fieldConfig.templateOptions.selectType!=undefined?this.fieldConfig.templateOptions.selectType:e},enumerable:!0,configurable:!0}),Se.prototype.getSelectData=function(){null!=this.fieldConfig&&this.fieldConfig.model!=undefined&&null!=this.fieldConfig.model&&this.fieldConfig.key!=undefined&&null!=this.fieldConfig.key&&this.fieldConfig.model[this.fieldConfig.key]!=undefined&&null!=this.fieldConfig.model[this.fieldConfig.key]&&(this.selectData=b.cloneDeep(this.fieldConfig.model[this.fieldConfig.key])),null!=this.selectData&&0<this.selectData.length?this.checkid=this.selectData.map(function(e){return{id:e.value,name:e.label}}):this.checkid=[]},Se.prototype.ngOnInit=function(){"multiple"==this.selectType&&(this.check=!0,this.action=0),"single"==this.selectType&&(this.check=!1,this.action=2,this.header.push({key:"action",name:"操作",hiden:!0,action:!0})),this.getEmployeeData()},Se.prototype.ngOnChanges=function(e){},Se.prototype.getEmployeeData=function(){var t=this;this.dataService.getSysCtrEmployee({keyWord:this.query.keyWord,pageIndex:this.query.pageIndex,pageSize:this.query.pageSize}).subscribe(function(e){t.query.pageIndex=e.index,t.query.total=e.total,t.body=e.data}),this.getSelectData()},Se.prototype.pageIndexChange=function(t){var n=this;this.dataService.getSysCtrEmployee({keyWord:this.query.keyWord,pageIndex:this.query.pageIndex,pageSize:this.query.pageSize}).subscribe(function(e){n.query.pageIndex=t.pageIndex,n.query.total=e.total,n.body=e.data})},Se.prototype.checkChange=function(e){null!=e&&0<e.length?this.selectData=e.map(function(e){return{label:e.name,value:e.id}}):this.selectData=[]},Se.decorators=[{type:O.Component,args:[{selector:"kreform-employee",template:'<kreform-private-table\n [tableIndex]="query.pageIndex"\n [tableSize]="query.pageSize"\n [tableTotal]="query.total"\n [header]="header"\n [body]="body"\n [check]="check"\n [action]="action"\n [checkid]="checkid" \n (checkChangeEvent)="checkChange($event)"\n (pageIndexEvent)="pageIndexChange($event)" >\n</kreform-private-table>',providers:[we],styles:[":host ::ng-deep{display:flex;width:100%;height:100%}:host ::ng-deep .content-left{display:flex;flex-direction:column;width:300px;padding:0 10px}:host ::ng-deep .content-left nz-select{width:100%}:host ::ng-deep .content-left .tree{flex:1;overflow-y:auto;display:in}:host ::ng-deep .content-right{flex:1}"]}]}],Se.ctorParameters=function(){return[{type:we}]},Se.propDecorators={fieldConfig:[{type:O.Input}]},Se);function Se(e){this.dataService=e,this.fieldConfig={},this.selectData=[],this.tag=!0,this.check=!1,this.action=0,this.header=[{key:"id",name:"id",hiden:!0},{key:"code",name:"工号",width:150},{key:"name",name:"姓名",width:150},{key:"organization",name:"部门"}],this.body=[],this.buttonlist=[],this.checkid=[],this.query={total:0,pageIndex:1,pageSize:15,sortName:"",sortValue:"",keyWord:""}}var Le=(Object.defineProperty(Ee.prototype,"selectedNode",{get:function(){return b.cloneDeep(this.selectData)},enumerable:!0,configurable:!0}),Object.defineProperty(Ee.prototype,"selectType",{get:function(){var e="";return e=this.fieldConfig!=undefined&&null!=this.fieldConfig&&this.fieldConfig.templateOptions!=undefined&&null!=this.fieldConfig.templateOptions&&this.fieldConfig.templateOptions.selectType!=undefined?this.fieldConfig.templateOptions.selectType:e},enumerable:!0,configurable:!0}),Ee.prototype.ngOnInit=function(){var e=b.get(this.fieldConfig,"templateOptions.controlid");e!=undefined&&null!=e&&""!=e&&(this.controlid=b.get(this.fieldConfig,"templateOptions.controlid")),this.getOrgData()},Ee.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},Ee.prototype.ngOnChanges=function(e){},Ee.prototype.getOrgData=function(){var t=this;this.dataService.getSysCtrOrgTree().subscribe(function(e){t.data=e,null!=t.data&&0<t.data.length&&t.data[0].children!=undefined&&(t.curOrgId=t.data[0].key,t.treeData=t.data[0].children),t.getTreeSelectData()})},Ee.prototype.getTreeSelectData=function(){null!=this.fieldConfig&&this.fieldConfig.model!=undefined&&null!=this.fieldConfig.model&&this.fieldConfig.key!=undefined&&null!=this.fieldConfig.key&&this.fieldConfig.model[this.fieldConfig.key]!=undefined&&null!=this.fieldConfig.model[this.fieldConfig.key]&&(this.selectData=b.cloneDeep(this.fieldConfig.model[this.fieldConfig.key]))},Ee.prototype.orgChange=function(t){var n=this;this.data.forEach(function(e){e.key===t&&(n.treeData=e.children)}),this.selectData.forEach(function(e){n.setTreeChecked(n.data,e.value)})},Ee.prototype.treeChange=function(t){var n=this;this.dimension&&this.data.forEach(function(e){n.setTreeUnChecked(e.children,t["delete"])}),this.treeChangeEvent.emit(this.selectData)},Ee.prototype.setTreeUnChecked=function(e,t){var n=this;e&&0<e.length&&e.forEach(function(e){e.key===t?e.checked=!1:e.children&&0<e.children.length&&n.setTreeUnChecked(e.children,t)})},Ee.prototype.setTreeChecked=function(e,t){var n=this;e&&0<e.length&&e.forEach(function(e){e.key===t?e.checked=!0:e.children&&0<e.children.length&&n.setTreeChecked(e.children,t)})},Ee.decorators=[{type:O.Component,args:[{selector:"kreform-org",template:'<div class="org-select" *ngIf="dimension==true">\n <span>维度:</span>\n <nz-select [(ngModel)]="curOrgId" (ngModelChange)="orgChange($event)">\n <ng-container *ngFor="let item of data;">\n <nz-option [nzValue]="item.key" [nzLabel]="item.title"></nz-option>\n </ng-container>\n </nz-select>\n</div>\n<div class="org-tree"> \n <kreform-private-tree [data]="treeData" [selectType]="selectType" [selectData]="selectData" [tag]="tag" (treeChangeEvent)="treeChange($event)"></kreform-private-tree>\n</div>',providers:[we],styles:[":host ::ng-deep .org-select{min-width:500px;padding:15px 0 0 15px;font-size:12px}:host ::ng-deep .org-select nz-select{min-width:250px}:host ::ng-deep .org-select .ant-select{font-size:12px}:host ::ng-deep .org-select .ant-select-dropdown{font-size:12px}:host ::ng-deep .org-tree{height:calc(100% - 47px);padding:0 0 0 10px}:host ::ng-deep .org-tree .tree-item{padding-left:0!important}:host ::ng-deep .org-tree .tree-tag{margin-top:-47px}"]}]}],Ee.ctorParameters=function(){return[{type:we},{type:O.ChangeDetectorRef}]},Ee.propDecorators={fieldConfig:[{type:O.Input}],tag:[{type:O.Input}],treeChangeEvent:[{type:O.Output}],nzTreeComponent:[{type:O.ViewChild,args:["nzTreeComponent",{"static":!1}]}]},Ee);function Ee(e,t){this.dataService=e,this.cd=t,this.fieldConfig={},this.tag=!0,this.treeChangeEvent=new O.EventEmitter,this.data=[],this.dimension=!0,this.selectData=[],this.curOrgId="",this.orgData=[],this.treeData=[],this.controlid="",this.treeid="",this.selectedKey=[],this.skeletonStatus=0}var Pe=(Object.defineProperty(Be.prototype,"selectedNode",{get:function(){return b.cloneDeep(this.selectData)},enumerable:!0,configurable:!0}),Be.prototype.ngOnInit=function(){this.getOrgData(),this.action=2,"multiple"==this.selectType&&(this.check=!0,this.action=0),"single"==this.selectType&&(this.check=!1,this.action=2,this.header.push({key:"action",name:"操作",hiden:!0,action:!0}))},Be.prototype.ngOnChanges=function(e){e.defaultNode},Be.prototype.getOrgData=function(){var t=this;this.dataService.getTreeData({id:this.controlid}).subscribe(function(e){t.treeData=e,t.getSelectData()})},Object.defineProperty(Be.prototype,"selectType",{get:function(){var e="";return e=this.fieldConfig!=undefined&&null!=this.fieldConfig&&this.fieldConfig.templateOptions!=undefined&&null!=this.fieldConfig.templateOptions&&this.fieldConfig.templateOptions.selectType!=undefined?this.fieldConfig.templateOptions.selectType:e},enumerable:!0,configurable:!0}),Be.prototype.getSelectData=function(){null!=this.fieldConfig&&this.fieldConfig.model!=undefined&&null!=this.fieldConfig.model&&this.fieldConfig.key!=undefined&&null!=this.fieldConfig.key&&this.fieldConfig.model[this.fieldConfig.key]!=undefined&&null!=this.fieldConfig.model[this.fieldConfig.key]&&(this.selectData=b.cloneDeep(this.fieldConfig.model[this.fieldConfig.key])),null!=this.selectData&&0<this.selectData.length?this.checkid=this.selectData.map(function(e){return{id:e.value,name:e.label}}):this.checkid=[]},Be.prototype.getPostionData=function(){var t=this;this.dataService.getSysCtrPostionTable({keyWord:this.query.keyWord,pageIndex:this.query.pageIndex,pageSize:this.query.pageSize}).subscribe(function(e){t.query.pageIndex=e.index,t.query.total=e.total,t.body=e.data}),this.getSelectData()},Be.p