UNPKG

fastlion-amis

Version:

一种MIS页面生成工具

60 lines (59 loc) 4.72 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GenericSubordinateArea = void 0; var tslib_1 = require("tslib"); var react_1 = (0, tslib_1.__importDefault)(require("react")); var tpl_1 = require("../../../../../../utils/tpl"); var index_1 = require("../../../../../../index"); var GenericSubordinateArea = function (_a) { var columns = _a.columns, seat = _a.seat, source = _a.source; var className = "tbody-td--column" + (seat ? " fix--hidden" : ""); return react_1.default.createElement(react_1.default.Fragment, null, columns === null || columns === void 0 ? void 0 : columns.map(function (column, index) { var _a, _b; if ((column === null || column === void 0 ? void 0 : column.name) === "checkbox" || (column === null || column === void 0 ? void 0 : column.buttons)) return null; return (react_1.default.createElement("td", { className: className }, react_1.default.createElement("div", { style: { width: (column === null || column === void 0 ? void 0 : column.width) ? column === null || column === void 0 ? void 0 : column.width : 50, fontSize: '12px' }, className: 'tbody-td--column--cell' }, react_1.default.createElement("span", { style: { width: (column === null || column === void 0 ? void 0 : column.width) ? column === null || column === void 0 ? void 0 : column.width : 50 } }, !seat && (((_a = column === null || column === void 0 ? void 0 : column.group) === null || _a === void 0 ? void 0 : _a.length) > 0 ? (_b = column === null || column === void 0 ? void 0 : column.group) === null || _b === void 0 ? void 0 : _b.map(function (group, groupIndex) { var hide = (group === null || group === void 0 ? void 0 : group.hiddenOn) ? (0, tpl_1.evalExpression)(group === null || group === void 0 ? void 0 : group.hiddenOn, (0, tslib_1.__assign)({}, source)) : false; if (hide) return null; var temp_element; if (group === null || group === void 0 ? void 0 : group.type) { temp_element = (0, index_1.render)({ type: group === null || group === void 0 ? void 0 : group.type, name: group === null || group === void 0 ? void 0 : group.name, body: group === null || group === void 0 ? void 0 : group.body }, { data: source }); } return (react_1.default.createElement("div", { key: groupIndex, style: { display: 'flex' } }, (group === null || group === void 0 ? void 0 : group.hideLabel) ? null : react_1.default.createElement("span", { style: { color: '#999' } }, group === null || group === void 0 ? void 0 : group.label, "\uFF1A"), react_1.default.createElement("span", null, group.type ? temp_element : source[group === null || group === void 0 ? void 0 : group.name]))); }) : [''].map(function (_) { var temp_element; var hide = (column === null || column === void 0 ? void 0 : column.hiddenOn) ? (0, tpl_1.evalExpression)(column === null || column === void 0 ? void 0 : column.hiddenOn, (0, tslib_1.__assign)({}, source)) : false; if (hide) return null; if (column.type) { temp_element = (0, index_1.render)({ type: column.type, name: column.name, body: column === null || column === void 0 ? void 0 : column.body }, { data: source }); } return react_1.default.createElement(react_1.default.Fragment, null, (column === null || column === void 0 ? void 0 : column.hideLabel) ? null : react_1.default.createElement("span", { style: { color: '#999' } }, column === null || column === void 0 ? void 0 : column.label, "\uFF1A"), react_1.default.createElement("span", null, column.type ? temp_element : source[column === null || column === void 0 ? void 0 : column.name])); })))))); })); }; exports.GenericSubordinateArea = GenericSubordinateArea; //# sourceMappingURL=./renderers/Lion/Table/LionTable/assembly/generic/GenericSubordinateArea.js.map