UNPKG

@wjya/ngx-webapp-icpc.group.pms

Version:

angular webapp : icpc.group.pms

39 lines 3.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var data_source_helper_1 = require("../service/data-source.helper"); var core_1 = require("@angular/core"); var ngx_webapp_fx_1 = require("@wjya/ngx-webapp-fx"); var SettingChildTemplateComponent = /** @class */ (function () { function SettingChildTemplateComponent(userStorageService, dataSourceHelper) { this.userStorageService = userStorageService; this.dataSourceHelper = dataSourceHelper; this.data = []; this.dataSource = dataSourceHelper.settings; } SettingChildTemplateComponent.prototype.ngOnInit = function () { this.communityGroupId = this.userStorageService.getCurrentOffice().id; }; SettingChildTemplateComponent.prototype.save = function (val) { this.dataSource.create([val], { communityGroupId: this.communityGroupId }).subscribe(); }; SettingChildTemplateComponent.decorators = [ { type: core_1.Component, args: [{ selector: 'zx-setting-child-template', template: "<nz-collapseset [nzBordered]=\"false\"><ng-container *ngFor=\"let item of data\"><nz-collapse *ngIf=\"item.visibility\" [nzTitle]=\"item.label\" [nzActive]=\"item.active\"><nz-input [(ngModel)]=\"item.value\" [nzSize]=\"'large'\" *ngIf=\"item.valueType === 'STRING'\" [nzDisabled]=\"!item.editable\" (ngModelChange)=\"save(item)\"></nz-input><label nz-checkbox [(ngModel)]=\"item.value\" *ngIf=\"item.valueType === 'BOOLEAN'\" [nzDisabled]=\"!item.editable\" (ngModelChange)=\"save(item)\"></label><nz-select [(ngModel)]=\"item.value\" [nzSize]=\"'large'\" *ngIf=\"item.valueOptions\" [nzDisabled]=\"!item.editable\" (ngModelChange)=\"save(item)\"><nz-option *ngFor=\"let option of item.parseValueOptions\" [nzLabel]=\"option.label\" [nzValue]=\"option.value\" (ngModelChange)=\"save(item)\"></nz-option></nz-select><p *ngIf=\"item.tip\" class=\"tip\">{{item.tip}}</p><zx-setting-child-template [data]=\"item?.children\"></zx-setting-child-template></nz-collapse></ng-container></nz-collapseset>", styles: [ "\n :host .tip{\n margin-top:10px;\n }\n :host ::ng-deep .ant-card-body{\n padding:16px 24px;\n }\n :host ::ng-deep .ant-collapse-content-box nz-input,\n :host ::ng-deep .ant-collapse-content-box nz-select {\n width:500px;\n }\n " ] },] }, ]; /** @nocollapse */ SettingChildTemplateComponent.ctorParameters = function () { return [ { type: ngx_webapp_fx_1.UserStorageService, }, { type: data_source_helper_1.DataSourceHelper, }, ]; }; SettingChildTemplateComponent.propDecorators = { "data": [{ type: core_1.Input },], }; return SettingChildTemplateComponent; }()); exports.SettingChildTemplateComponent = SettingChildTemplateComponent; //# sourceMappingURL=setting-child-template.component.js.map