atr-components 0.1.39 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/utils/ToolsUtil.d.ts +0 -1
- package/esm2020/core/utils/ToolsUtil.mjs +2 -3
- package/esm2020/lib/shared/view-form/view-form.component.mjs +85 -3
- package/fesm2015/atr-components.mjs +85 -4
- package/fesm2015/atr-components.mjs.map +1 -1
- package/fesm2020/atr-components.mjs +85 -4
- package/fesm2020/atr-components.mjs.map +1 -1
- package/lib/shared/view-form/view-form.component.d.ts +3 -0
- package/package.json +1 -1
|
@@ -305,7 +305,7 @@ class ToolsUtil {
|
|
|
305
305
|
if (url.startsWith("http")) {
|
|
306
306
|
return url;
|
|
307
307
|
}
|
|
308
|
-
return
|
|
308
|
+
return atr_static_datas.OSS_URL + url;
|
|
309
309
|
}
|
|
310
310
|
static mul(...numbers) {
|
|
311
311
|
if (numbers.length < 2) {
|
|
@@ -398,7 +398,6 @@ class ToolsUtil {
|
|
|
398
398
|
return { 'maxHeight': ToolsUtil.windowHeight() - 200 + 'px', 'overflow-y': 'auto' };
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
|
-
ToolsUtil.ossPrefix = atr_static_datas.OSS_URL;
|
|
402
401
|
ToolsUtil.getOrgCode = function () {
|
|
403
402
|
// var orgCode = '';
|
|
404
403
|
// var hrefs = window.location.href.split('?')
|
|
@@ -3355,6 +3354,88 @@ class ViewFormComponent {
|
|
|
3355
3354
|
console.log('atrForm.value formOpts', this.formOpts);
|
|
3356
3355
|
}, 1150);
|
|
3357
3356
|
}
|
|
3357
|
+
isShow(isHidden, operator) {
|
|
3358
|
+
if (isHidden) {
|
|
3359
|
+
return false;
|
|
3360
|
+
}
|
|
3361
|
+
let isShow = false;
|
|
3362
|
+
if (!operator || operator == null || operator == "") {
|
|
3363
|
+
return true;
|
|
3364
|
+
}
|
|
3365
|
+
else if (operator.indexOf('&&') > 0) {
|
|
3366
|
+
// a|eq|b &&c|eq|d
|
|
3367
|
+
const ops = operator.split('&&');
|
|
3368
|
+
if (ops.length > 1) {
|
|
3369
|
+
// tslint:disable-next-line:prefer-for-of
|
|
3370
|
+
for (let i = 0; i < ops.length; i++) {
|
|
3371
|
+
isShow = true;
|
|
3372
|
+
if (!this.checkIsShowBase(ops[i].split('|'))) {
|
|
3373
|
+
isShow = false;
|
|
3374
|
+
break;
|
|
3375
|
+
}
|
|
3376
|
+
}
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
else if (operator.indexOf('||') > 0) {
|
|
3380
|
+
// a|eq|b||c|eq|d
|
|
3381
|
+
const ops = operator.split('&&');
|
|
3382
|
+
if (ops.length > 1) {
|
|
3383
|
+
for (let i = 0; i < ops.length; i++) {
|
|
3384
|
+
isShow = false;
|
|
3385
|
+
if (this.checkIsShowBase(ops[i].split('|'))) {
|
|
3386
|
+
isShow = true;
|
|
3387
|
+
break;
|
|
3388
|
+
}
|
|
3389
|
+
}
|
|
3390
|
+
}
|
|
3391
|
+
}
|
|
3392
|
+
else {
|
|
3393
|
+
let op = operator.split("|");
|
|
3394
|
+
isShow = this.checkIsShowBase(op);
|
|
3395
|
+
}
|
|
3396
|
+
return isShow;
|
|
3397
|
+
}
|
|
3398
|
+
checkIsShowBase(op) {
|
|
3399
|
+
let isShow = false;
|
|
3400
|
+
if (op.length > 1) {
|
|
3401
|
+
let value = this.atrForm.get(op[0]).value;
|
|
3402
|
+
isShow = this.compare(value, op[1], op[2]);
|
|
3403
|
+
}
|
|
3404
|
+
else
|
|
3405
|
+
isShow = false;
|
|
3406
|
+
return isShow;
|
|
3407
|
+
}
|
|
3408
|
+
compare(value, operator, target) {
|
|
3409
|
+
let isRight = false;
|
|
3410
|
+
switch (operator) {
|
|
3411
|
+
case 'eq':
|
|
3412
|
+
if (value == target) {
|
|
3413
|
+
isRight = true;
|
|
3414
|
+
}
|
|
3415
|
+
break;
|
|
3416
|
+
case 'gh':
|
|
3417
|
+
if (value >= target) {
|
|
3418
|
+
isRight = true;
|
|
3419
|
+
}
|
|
3420
|
+
break;
|
|
3421
|
+
case 'notEmpty':
|
|
3422
|
+
isRight = false;
|
|
3423
|
+
if (value) {
|
|
3424
|
+
isRight = true;
|
|
3425
|
+
}
|
|
3426
|
+
break;
|
|
3427
|
+
case 'empty':
|
|
3428
|
+
isRight = false;
|
|
3429
|
+
if (!value) {
|
|
3430
|
+
isRight = true;
|
|
3431
|
+
}
|
|
3432
|
+
break;
|
|
3433
|
+
default:
|
|
3434
|
+
isRight = false;
|
|
3435
|
+
break;
|
|
3436
|
+
}
|
|
3437
|
+
return isRight;
|
|
3438
|
+
}
|
|
3358
3439
|
getCascaderLabel(value, item) {
|
|
3359
3440
|
let result = this.getCascaderDefultV(item.dictList, value, 0, []);
|
|
3360
3441
|
if (item.dictList[0].userObject?.showName) {
|
|
@@ -3389,10 +3470,10 @@ class ViewFormComponent {
|
|
|
3389
3470
|
}
|
|
3390
3471
|
}
|
|
3391
3472
|
ViewFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ViewFormComponent, deps: [{ token: ShareService }, { token: i3$1.FormBuilder }, { token: DictService }, { token: i0.Injector }, { token: LOCALE_ID }, { token: HttpService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3392
|
-
ViewFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ViewFormComponent, selector: "atr-view-form", inputs: { formOpts: "formOpts", atrForm: "atrForm", dicts: "dicts", items: "items" }, ngImport: i0, template: "<nz-descriptions [nzColumn]=\"column\" nzBordered [nzColon]=\"true\" [nzColumn]=\"24\">\r\n <ng-container *ngFor=\"let item of formOpts.items\">\r\n <ng-container *ngIf=\"!item.isHidden\">\r\n <nz-descriptions-item [nzTitle]=\"item.label\" [ngSwitch]=\"item.type\"\r\n\r\n [nzSpan]=\"item.span || 6\">\r\n <ng-container *ngSwitchCase=\"'radio'\">\r\n <ng-container *ngFor=\"let o of item.dictList\">\r\n <label *ngIf=\"o.value == atrForm.value[item.key]\">{{o.label}}</label>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'treeSelect'\">\r\n <nz-tree-select\r\n [nzNodes]=\"item.treeList\"\r\n nzShowSearch=\"true\"\r\n nzHideUnMatched=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"\r\n [nzDisabled]=\"true\"\r\n >\r\n </nz-tree-select>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"'select'\">\r\n {{getSelectLabel(atrForm.value[item.key],dicts[item.dictCode])}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'selectCus'\">\r\n {{getSelectLabel(atrForm.value[item.key],item.dictList)}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'selectc'\">\r\n <nz-select\r\n [nzDisabled]=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"\r\n >\r\n <nz-option *ngFor=\"let o of item.dictList\" [nzLabel]=\"o.label\"\r\n [nzValue]=\"o.value\"></nz-option>\r\n </nz-select>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'sceneUser'\">\r\n <nz-select\r\n [nzDisabled]=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"\r\n >\r\n <nz-option *ngFor=\"let o of item.dictList\" [nzLabel]=\"o.title\"\r\n [nzValue]=\"o.key\"></nz-option>\r\n </nz-select>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchDefault>\r\n {{atrForm.value[item.key]}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date'\">\r\n {{atrForm.value[item.key] | date:(item.dateFormat || 'yyyy-MM-dd')}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'dateTime'\">\r\n {{atrForm.value[item.key] | date:(item.dateFormat || 'yyyy-MM-dd 00:00:00')}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'cascader'\">\r\n {{getCascaderLabel(atrForm.value[item.key],item)}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'tags'\">\r\n {{getTagLabel(atrForm.value[item.key], 'name')}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'image'\">\r\n <ng-container *ngFor=\"let img of getImgs(atrForm.value[item.key])\">\r\n <img nz-image style=\"max-width: 200px;max-height: 200px\" [nzSrc]=\"img | ossImg\">\r\n </ng-container>\r\n\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'rate'\">\r\n <nz-rate [nzDisabled]=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"></nz-rate>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'editor'\">\r\n <div style=\"width: 800px\">\r\n <app-quill-editor [(ngModel)]=\"atrForm.value[item.key]\" style=\"width: 60%\" [readOnly]=\"true\"\r\n [styles]=\"{height:item.height > 0 ? item.height + 'px' : '250px'}\"></app-quill-editor>\r\n\r\n </div>\r\n </ng-container>\r\n\r\n </nz-descriptions-item>\r\n </ng-container>\r\n\r\n </ng-container>\r\n\r\n</nz-descriptions>\r\n", styles: [":host img{max-width:200px;max-height:200px}\n"], components: [{ type: i5$3.NzDescriptionsComponent, selector: "nz-descriptions", inputs: ["nzBordered", "nzLayout", "nzColumn", "nzSize", "nzTitle", "nzExtra", "nzColon"], exportAs: ["nzDescriptions"] }, { type: i5$3.NzDescriptionsItemComponent, selector: "nz-descriptions-item", inputs: ["nzSpan", "nzTitle"], exportAs: ["nzDescriptionsItem"] }, { type: i5.NzTreeSelectComponent, selector: "nz-tree-select", inputs: ["nzId", "nzAllowClear", "nzShowExpand", "nzShowLine", "nzDropdownMatchSelectWidth", "nzCheckable", "nzHideUnMatched", "nzShowIcon", "nzShowSearch", "nzDisabled", "nzAsyncData", "nzMultiple", "nzDefaultExpandAll", "nzCheckStrictly", "nzVirtualItemSize", "nzVirtualMaxBufferPx", "nzVirtualMinBufferPx", "nzVirtualHeight", "nzExpandedIcon", "nzNotFoundContent", "nzNodes", "nzOpen", "nzSize", "nzPlaceHolder", "nzDropdownStyle", "nzDropdownClassName", "nzBackdrop", "nzStatus", "nzExpandedKeys", "nzDisplayWith", "nzMaxTagCount", "nzMaxTagPlaceholder", "nzTreeTemplate"], outputs: ["nzOpenChange", "nzCleared", "nzRemoved", "nzExpandChange", "nzTreeClick", "nzTreeCheckBoxChange"], exportAs: ["nzTreeSelect"] }, { type: i3.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus"], exportAs: ["nzSelect"] }, { type: i3.NzOptionComponent, selector: "nz-option", inputs: ["nzLabel", "nzValue", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { type: i8$2.NzRateComponent, selector: "nz-rate", inputs: ["nzAllowClear", "nzAllowHalf", "nzDisabled", "nzAutoFocus", "nzCharacter", "nzCount", "nzTooltips"], outputs: ["nzOnBlur", "nzOnFocus", "nzOnHoverChange", "nzOnKeyDown"], exportAs: ["nzRate"] }, { type: QuillEditorComponent, selector: "app-quill-editor", inputs: ["placeholder", "styles", "value", "readOnly", "needImgSeq"] }], directives: [{ type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i10.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i10.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i6$2.NzImageDirective, selector: "img[nz-image]", inputs: ["nzSrc", "nzSrcset", "nzDisablePreview", "nzFallback", "nzPlaceholder"], exportAs: ["nzImage"] }], pipes: { "date": i10.DatePipe, "ossImg": OssImgPipe } });
|
|
3473
|
+
ViewFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ViewFormComponent, selector: "atr-view-form", inputs: { formOpts: "formOpts", atrForm: "atrForm", dicts: "dicts", items: "items" }, ngImport: i0, template: "<nz-descriptions [nzColumn]=\"column\" nzBordered [nzColon]=\"true\" [nzColumn]=\"24\">\r\n <ng-container *ngFor=\"let item of formOpts.items\">\r\n <ng-container *ngIf=\"!item.isHidden\">\r\n <nz-descriptions-item [nzTitle]=\"item.label\" [ngSwitch]=\"item.type\"\r\n *ngIf=\"isShow(item.isHidden,item.operator)\"\r\n [nzSpan]=\"item.span || 6\">\r\n <ng-container *ngSwitchCase=\"'radio'\">\r\n <ng-container *ngFor=\"let o of item.dictList\">\r\n <label *ngIf=\"o.value == atrForm.value[item.key]\">{{o.label}}</label>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'treeSelect'\">\r\n <nz-tree-select\r\n [nzNodes]=\"item.treeList\"\r\n nzShowSearch=\"true\"\r\n nzHideUnMatched=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"\r\n [nzDisabled]=\"true\"\r\n >\r\n </nz-tree-select>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"'select'\">\r\n {{getSelectLabel(atrForm.value[item.key],dicts[item.dictCode])}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'selectCus'\">\r\n {{getSelectLabel(atrForm.value[item.key],item.dictList)}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'selectc'\">\r\n <nz-select\r\n [nzDisabled]=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"\r\n >\r\n <nz-option *ngFor=\"let o of item.dictList\" [nzLabel]=\"o.label\"\r\n [nzValue]=\"o.value\"></nz-option>\r\n </nz-select>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'sceneUser'\">\r\n <nz-select\r\n [nzDisabled]=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"\r\n >\r\n <nz-option *ngFor=\"let o of item.dictList\" [nzLabel]=\"o.title\"\r\n [nzValue]=\"o.key\"></nz-option>\r\n </nz-select>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchDefault>\r\n {{atrForm.value[item.key]}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date'\">\r\n {{atrForm.value[item.key] | date:(item.dateFormat || 'yyyy-MM-dd')}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'dateTime'\">\r\n {{atrForm.value[item.key] | date:(item.dateFormat || 'yyyy-MM-dd 00:00:00')}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'cascader'\">\r\n {{getCascaderLabel(atrForm.value[item.key],item)}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'tags'\">\r\n {{getTagLabel(atrForm.value[item.key], 'name')}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'image'\">\r\n <ng-container *ngFor=\"let img of getImgs(atrForm.value[item.key])\">\r\n <img nz-image style=\"max-width: 200px;max-height: 200px\" [nzSrc]=\"img | ossImg\">\r\n </ng-container>\r\n\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'rate'\">\r\n <nz-rate [nzDisabled]=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"></nz-rate>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'editor'\">\r\n <div style=\"width: 800px\">\r\n <app-quill-editor [(ngModel)]=\"atrForm.value[item.key]\" style=\"width: 60%\" [readOnly]=\"true\"\r\n [styles]=\"{height:item.height > 0 ? item.height + 'px' : '250px'}\"></app-quill-editor>\r\n\r\n </div>\r\n </ng-container>\r\n\r\n </nz-descriptions-item>\r\n </ng-container>\r\n\r\n </ng-container>\r\n\r\n</nz-descriptions>\r\n", styles: [":host img{max-width:200px;max-height:200px}\n"], components: [{ type: i5$3.NzDescriptionsComponent, selector: "nz-descriptions", inputs: ["nzBordered", "nzLayout", "nzColumn", "nzSize", "nzTitle", "nzExtra", "nzColon"], exportAs: ["nzDescriptions"] }, { type: i5$3.NzDescriptionsItemComponent, selector: "nz-descriptions-item", inputs: ["nzSpan", "nzTitle"], exportAs: ["nzDescriptionsItem"] }, { type: i5.NzTreeSelectComponent, selector: "nz-tree-select", inputs: ["nzId", "nzAllowClear", "nzShowExpand", "nzShowLine", "nzDropdownMatchSelectWidth", "nzCheckable", "nzHideUnMatched", "nzShowIcon", "nzShowSearch", "nzDisabled", "nzAsyncData", "nzMultiple", "nzDefaultExpandAll", "nzCheckStrictly", "nzVirtualItemSize", "nzVirtualMaxBufferPx", "nzVirtualMinBufferPx", "nzVirtualHeight", "nzExpandedIcon", "nzNotFoundContent", "nzNodes", "nzOpen", "nzSize", "nzPlaceHolder", "nzDropdownStyle", "nzDropdownClassName", "nzBackdrop", "nzStatus", "nzExpandedKeys", "nzDisplayWith", "nzMaxTagCount", "nzMaxTagPlaceholder", "nzTreeTemplate"], outputs: ["nzOpenChange", "nzCleared", "nzRemoved", "nzExpandChange", "nzTreeClick", "nzTreeCheckBoxChange"], exportAs: ["nzTreeSelect"] }, { type: i3.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus"], exportAs: ["nzSelect"] }, { type: i3.NzOptionComponent, selector: "nz-option", inputs: ["nzLabel", "nzValue", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { type: i8$2.NzRateComponent, selector: "nz-rate", inputs: ["nzAllowClear", "nzAllowHalf", "nzDisabled", "nzAutoFocus", "nzCharacter", "nzCount", "nzTooltips"], outputs: ["nzOnBlur", "nzOnFocus", "nzOnHoverChange", "nzOnKeyDown"], exportAs: ["nzRate"] }, { type: QuillEditorComponent, selector: "app-quill-editor", inputs: ["placeholder", "styles", "value", "readOnly", "needImgSeq"] }], directives: [{ type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i10.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i10.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i6$2.NzImageDirective, selector: "img[nz-image]", inputs: ["nzSrc", "nzSrcset", "nzDisablePreview", "nzFallback", "nzPlaceholder"], exportAs: ["nzImage"] }], pipes: { "date": i10.DatePipe, "ossImg": OssImgPipe } });
|
|
3393
3474
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ViewFormComponent, decorators: [{
|
|
3394
3475
|
type: Component,
|
|
3395
|
-
args: [{ selector: 'atr-view-form', template: "<nz-descriptions [nzColumn]=\"column\" nzBordered [nzColon]=\"true\" [nzColumn]=\"24\">\r\n <ng-container *ngFor=\"let item of formOpts.items\">\r\n <ng-container *ngIf=\"!item.isHidden\">\r\n <nz-descriptions-item [nzTitle]=\"item.label\" [ngSwitch]=\"item.type\"\r\n\r\n [nzSpan]=\"item.span || 6\">\r\n <ng-container *ngSwitchCase=\"'radio'\">\r\n <ng-container *ngFor=\"let o of item.dictList\">\r\n <label *ngIf=\"o.value == atrForm.value[item.key]\">{{o.label}}</label>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'treeSelect'\">\r\n <nz-tree-select\r\n [nzNodes]=\"item.treeList\"\r\n nzShowSearch=\"true\"\r\n nzHideUnMatched=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"\r\n [nzDisabled]=\"true\"\r\n >\r\n </nz-tree-select>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"'select'\">\r\n {{getSelectLabel(atrForm.value[item.key],dicts[item.dictCode])}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'selectCus'\">\r\n {{getSelectLabel(atrForm.value[item.key],item.dictList)}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'selectc'\">\r\n <nz-select\r\n [nzDisabled]=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"\r\n >\r\n <nz-option *ngFor=\"let o of item.dictList\" [nzLabel]=\"o.label\"\r\n [nzValue]=\"o.value\"></nz-option>\r\n </nz-select>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'sceneUser'\">\r\n <nz-select\r\n [nzDisabled]=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"\r\n >\r\n <nz-option *ngFor=\"let o of item.dictList\" [nzLabel]=\"o.title\"\r\n [nzValue]=\"o.key\"></nz-option>\r\n </nz-select>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchDefault>\r\n {{atrForm.value[item.key]}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date'\">\r\n {{atrForm.value[item.key] | date:(item.dateFormat || 'yyyy-MM-dd')}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'dateTime'\">\r\n {{atrForm.value[item.key] | date:(item.dateFormat || 'yyyy-MM-dd 00:00:00')}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'cascader'\">\r\n {{getCascaderLabel(atrForm.value[item.key],item)}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'tags'\">\r\n {{getTagLabel(atrForm.value[item.key], 'name')}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'image'\">\r\n <ng-container *ngFor=\"let img of getImgs(atrForm.value[item.key])\">\r\n <img nz-image style=\"max-width: 200px;max-height: 200px\" [nzSrc]=\"img | ossImg\">\r\n </ng-container>\r\n\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'rate'\">\r\n <nz-rate [nzDisabled]=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"></nz-rate>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'editor'\">\r\n <div style=\"width: 800px\">\r\n <app-quill-editor [(ngModel)]=\"atrForm.value[item.key]\" style=\"width: 60%\" [readOnly]=\"true\"\r\n [styles]=\"{height:item.height > 0 ? item.height + 'px' : '250px'}\"></app-quill-editor>\r\n\r\n </div>\r\n </ng-container>\r\n\r\n </nz-descriptions-item>\r\n </ng-container>\r\n\r\n </ng-container>\r\n\r\n</nz-descriptions>\r\n", styles: [":host img{max-width:200px;max-height:200px}\n"] }]
|
|
3476
|
+
args: [{ selector: 'atr-view-form', template: "<nz-descriptions [nzColumn]=\"column\" nzBordered [nzColon]=\"true\" [nzColumn]=\"24\">\r\n <ng-container *ngFor=\"let item of formOpts.items\">\r\n <ng-container *ngIf=\"!item.isHidden\">\r\n <nz-descriptions-item [nzTitle]=\"item.label\" [ngSwitch]=\"item.type\"\r\n *ngIf=\"isShow(item.isHidden,item.operator)\"\r\n [nzSpan]=\"item.span || 6\">\r\n <ng-container *ngSwitchCase=\"'radio'\">\r\n <ng-container *ngFor=\"let o of item.dictList\">\r\n <label *ngIf=\"o.value == atrForm.value[item.key]\">{{o.label}}</label>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'treeSelect'\">\r\n <nz-tree-select\r\n [nzNodes]=\"item.treeList\"\r\n nzShowSearch=\"true\"\r\n nzHideUnMatched=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"\r\n [nzDisabled]=\"true\"\r\n >\r\n </nz-tree-select>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"'select'\">\r\n {{getSelectLabel(atrForm.value[item.key],dicts[item.dictCode])}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'selectCus'\">\r\n {{getSelectLabel(atrForm.value[item.key],item.dictList)}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'selectc'\">\r\n <nz-select\r\n [nzDisabled]=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"\r\n >\r\n <nz-option *ngFor=\"let o of item.dictList\" [nzLabel]=\"o.label\"\r\n [nzValue]=\"o.value\"></nz-option>\r\n </nz-select>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'sceneUser'\">\r\n <nz-select\r\n [nzDisabled]=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"\r\n >\r\n <nz-option *ngFor=\"let o of item.dictList\" [nzLabel]=\"o.title\"\r\n [nzValue]=\"o.key\"></nz-option>\r\n </nz-select>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchDefault>\r\n {{atrForm.value[item.key]}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date'\">\r\n {{atrForm.value[item.key] | date:(item.dateFormat || 'yyyy-MM-dd')}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'dateTime'\">\r\n {{atrForm.value[item.key] | date:(item.dateFormat || 'yyyy-MM-dd 00:00:00')}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'cascader'\">\r\n {{getCascaderLabel(atrForm.value[item.key],item)}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'tags'\">\r\n {{getTagLabel(atrForm.value[item.key], 'name')}}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'image'\">\r\n <ng-container *ngFor=\"let img of getImgs(atrForm.value[item.key])\">\r\n <img nz-image style=\"max-width: 200px;max-height: 200px\" [nzSrc]=\"img | ossImg\">\r\n </ng-container>\r\n\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'rate'\">\r\n <nz-rate [nzDisabled]=\"true\"\r\n [(ngModel)]=\"atrForm.value[item.key]\"></nz-rate>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'editor'\">\r\n <div style=\"width: 800px\">\r\n <app-quill-editor [(ngModel)]=\"atrForm.value[item.key]\" style=\"width: 60%\" [readOnly]=\"true\"\r\n [styles]=\"{height:item.height > 0 ? item.height + 'px' : '250px'}\"></app-quill-editor>\r\n\r\n </div>\r\n </ng-container>\r\n\r\n </nz-descriptions-item>\r\n </ng-container>\r\n\r\n </ng-container>\r\n\r\n</nz-descriptions>\r\n", styles: [":host img{max-width:200px;max-height:200px}\n"] }]
|
|
3396
3477
|
}], ctorParameters: function () { return [{ type: ShareService }, { type: i3$1.FormBuilder }, { type: DictService }, { type: i0.Injector }, { type: undefined, decorators: [{
|
|
3397
3478
|
type: Inject,
|
|
3398
3479
|
args: [LOCALE_ID]
|