UNPKG

yoyo-ng-modulewindy

Version:

服务于52ABP模板的前端开源的相关组件内容。整合了ng-alain和你NG ZORRO的内容

75 lines 3.28 kB
import { Component, Input, ContentChild, TemplateRef } from '@angular/core'; var ExceptionComponent = /** @class */ (function () { function ExceptionComponent() { this._img = ''; this._title = ''; this._desc = ''; } Object.defineProperty(ExceptionComponent.prototype, "type", { set: function (value) { var item = { 403: { img: 'https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg', title: '403', desc: '抱歉,你无权访问该页面', }, 404: { img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg', title: '404', desc: '抱歉,你访问的页面不存在', }, 500: { img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg', title: '500', desc: '抱歉,服务器出错了', }, }[value]; if (!item) return; this._img = item.img; this._title = item.title; this._desc = item.desc; }, enumerable: true, configurable: true }); Object.defineProperty(ExceptionComponent.prototype, "img", { set: function (value) { this._img = value; }, enumerable: true, configurable: true }); Object.defineProperty(ExceptionComponent.prototype, "title", { set: function (value) { this._title = value; }, enumerable: true, configurable: true }); Object.defineProperty(ExceptionComponent.prototype, "desc", { set: function (value) { this._desc = value; }, enumerable: true, configurable: true }); ExceptionComponent.decorators = [ { type: Component, args: [{ selector: 'exception', template: "\n <div class=\"img-block\">\n <div class=\"img\" [ngStyle]=\"{'background-image': 'url(' + _img + ')'}\"></div>\n </div>\n <div class=\"cont\">\n <h1 [innerHTML]=\"_title\"></h1>\n <div class=\"desc\" [innerHTML]=\"_desc\"></div>\n <ng-template #defaultActions>\n <button nz-button [routerLink]=\"['/']\" [nzType]=\"'primary'\">\u8FD4\u56DE\u9996\u9875</button>\n <ng-content></ng-content>\n </ng-template>\n <div class=\"actions\" *ngIf=\"actions; else defaultActions\">\n <ng-template [ngTemplateOutlet]=\"actions\"></ng-template>\n <ng-content></ng-content>\n </div>\n </div>\n ", host: { '[class.ad-exception]': 'true' }, preserveWhitespaces: false, },] }, ]; ExceptionComponent.propDecorators = { type: [{ type: Input }], img: [{ type: Input }], title: [{ type: Input }], desc: [{ type: Input }], actions: [{ type: ContentChild, args: ['actions',] }] }; return ExceptionComponent; }()); export { ExceptionComponent }; //# sourceMappingURL=exception.component.js.map