fastlion-amis
Version:
一种MIS页面生成工具
84 lines (83 loc) • 6.73 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PrimaryTr = 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");
require("./index.scss");
var PrimaryTrAreaContainer = function (props) {
var colSpan = props.colSpan, list_columns = props.list_columns, surfaceItemWidth = props.surfaceItemWidth, source = props.source;
return (react_1.default.createElement("td", { className: "tbody-td--column thead-th--column tbody-td--column--surface--mainarea", colSpan: colSpan - 2 },
react_1.default.createElement("div", { style: { display: 'flex', justifyContent: 'space-between' } }, list_columns.map(function (item, index) {
var _a, _b, _c, _d, _e;
if (item === null || item === void 0 ? void 0 : item.buttons)
return null;
return (react_1.default.createElement("div", { key: index, className: "lion-table-primary-group", style: {
width: (item === null || item === void 0 ? void 0 : item.width) ? item === null || item === void 0 ? void 0 : item.width : surfaceItemWidth,
paddingLeft: index === 0 ? '5px' : ''
} },
react_1.default.createElement("div", { className: "surface-group-container", style: {
flexDirection: ((_a = item === null || item === void 0 ? void 0 : item.group) === null || _a === void 0 ? void 0 : _a.length) > 1 ? 'column' : 'row',
justifyContent: ((_b = item === null || item === void 0 ? void 0 : item.group) === null || _b === void 0 ? void 0 : _b.length) > 1 ? 'center' : 'normal',
alignItems: ((_c = item === null || item === void 0 ? void 0 : item.group) === null || _c === void 0 ? void 0 : _c.length) > 1 ? 'normal' : 'center'
} }, ((_d = item === null || item === void 0 ? void 0 : item.group) === null || _d === void 0 ? void 0 : _d.length) > 0 ? (_e = item === null || item === void 0 ? void 0 : item.group) === null || _e === void 0 ? void 0 : _e.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: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, group === null || group === void 0 ? void 0 : group.body), { label: null })
}, {
data: source,
value: source[group.name],
style: {
overflow: 'hidden'
}
});
}
return (react_1.default.createElement("span", { key: groupIndex, className: "surface-group-item" }, (group === null || group === void 0 ? void 0 : group.hideLabel) ? (group.type ? temp_element : source[group === null || group === void 0 ? void 0 : group.name]) : react_1.default.createElement(react_1.default.Fragment, null,
react_1.default.createElement("span", { className: "surface-group-item--label" },
group.label,
"\uFF1A"),
group.type ? temp_element : source[group === null || group === void 0 ? void 0 : group.name])));
}) : [''].map(function (_) {
var temp_element;
var hide = (item === null || item === void 0 ? void 0 : item.hiddenOn) ? (0, tpl_1.evalExpression)(item === null || item === void 0 ? void 0 : item.hiddenOn, (0, tslib_1.__assign)({}, source)) : false;
if (hide)
return null;
if (item.type) {
temp_element = (0, index_1.render)({
type: item.type,
name: item.name,
body: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, item === null || item === void 0 ? void 0 : item.body), { label: null })
}, {
data: source,
value: source[item.name],
style: {
overflow: 'hidden'
}
});
}
return react_1.default.createElement("span", { key: _, className: "surface-group-item" }, (item === null || item === void 0 ? void 0 : item.hideLabel) ? (item.type ? temp_element : source[item === null || item === void 0 ? void 0 : item.name]) : react_1.default.createElement(react_1.default.Fragment, null,
react_1.default.createElement("span", { className: "surface-group-item--label" },
item.label,
"\uFF1A"),
item.type ? temp_element : source[item === null || item === void 0 ? void 0 : item.name]));
}))));
}))));
};
var PrimaryTr = function (props) {
var primaryElevae = props.primaryElevae, trClick = props.trClick, list_columns = props.list_columns, colSpan = props.colSpan, source = props.source, surfaceItemWidth = props.surfaceItemWidth;
return (react_1.default.createElement("tr", { onClick: trClick, className: "tbody-tr--column--common tbody-tr--column--gray", style: {
height: primaryElevae
} },
react_1.default.createElement("td", { className: "tbody-td--column tbody-td--column--hide tbody-td--column--hide--checkbox" }),
react_1.default.createElement(PrimaryTrAreaContainer, { source: source, colSpan: colSpan, list_columns: list_columns, surfaceItemWidth: surfaceItemWidth }),
react_1.default.createElement("td", { className: "tbody-td--column thead-th--column tbody-td--opreation" })));
};
exports.PrimaryTr = PrimaryTr;
//# sourceMappingURL=./renderers/Lion/Table/LionTable/assembly/table/intermediateArea/primaryTr.js.map