@grc/business
Version:
更新sider选项 : forceSubMenuRender
45 lines (44 loc) • 2.89 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import React, { PureComponent } from 'react';
import { Icon } from "@grc/base/components/icon";
import { FailReasonDefaultComponent } from "./fail-reson.component";
var ImportFileFailComponent = /** @class */ (function (_super) {
__extends(ImportFileFailComponent, _super);
function ImportFileFailComponent() {
return _super !== null && _super.apply(this, arguments) || this;
}
ImportFileFailComponent.prototype.render = function () {
var _a = this.props, prefixCls = _a.prefixCls, title = _a.title, tip = _a.tip, file = _a.file, reasonChildren = _a.reasonChildren, reasonDefault = _a.reasonDefault;
var response = file.response, name = file.name, result = file.result;
var reasonDefaultData = null;
if (reasonDefault && ("dataSource" in reasonDefault)) {
reasonDefaultData = reasonDefault.dataSource.call(null, result);
}
return (React.createElement("div", { className: prefixCls + "-result " + prefixCls + "-fail" },
React.createElement("p", { className: prefixCls + "-result_header " + prefixCls + "-fail_header" },
React.createElement(Icon, { type: "close-circle", theme: "filled" })),
React.createElement("div", { className: prefixCls + "-result_body " + prefixCls + "-fail_body" },
title && (React.createElement("div", { className: prefixCls + "-result_title " + prefixCls + "-fail_title" }, typeof title === "function" ? title(response, status) : title)),
tip && (React.createElement("div", { className: prefixCls + "-result_tip " + prefixCls + "-fail_tip" }, typeof tip === "function" ? tip(response, status) : tip))),
React.createElement("div", { className: prefixCls + "-result_footer " + prefixCls + "-fail_footer" },
React.createElement(Icon, { type: 'file' }),
React.createElement("span", null, name)),
React.createElement("div", { className: prefixCls + "-fail_reason" }, (reasonChildren && reasonDefault) ?
reasonChildren
: (React.createElement(FailReasonDefaultComponent, { columns: reasonDefault.columns, dataSource: reasonDefaultData })))));
};
return ImportFileFailComponent;
}(PureComponent));
export default ImportFileFailComponent;