UNPKG

@bos-alpha/data

Version:

数据管理

84 lines (83 loc) 4.49 kB
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import styled from '@emotion/styled'; import { ResizableTable } from '@bos-alpha/common/lib/components/table/resizable-table'; import list from '../img-base64/list'; var attrTypes = { system: '系统自带', extend: '集成', userdefined: '自定义' }; export var AttributeList = function (_a) { var dataSource = _a.dataSource; var columns = [ { title: '名称', dataIndex: 'code', width: 210, minWidth: 70 }, { title: '类型', dataIndex: 'dataType', width: 100, minWidth: 70 }, { title: '描述', dataIndex: 'description', width: 210, minWidth: 70 }, { title: '属性组', dataIndex: 'group', width: 210, minWidth: 70, render: function (group) { return (group ? group.join('') : ''); } }, { title: '是否必填', dataIndex: 'require', width: 100, minWidth: 70, render: function (require) { return (require ? 'Y' : 'N'); } }, { title: '属性来源', dataIndex: 'attributeType', width: 100, minWidth: 70, render: function (attributeType) { return (_jsx(AttrType, __assign({ className: "attr-type ".concat(attributeType) }, { children: attrTypes[attributeType] || '自定义' }), void 0)); } } ]; return (_jsxs("div", { children: [_jsxs(Title, { children: [_jsx("img", { className: "icon", src: list, alt: "" }, void 0), _jsx("span", { children: "\u5C5E\u6027\u5217\u8868" }, void 0)] }, void 0), _jsx(ResizableTable, { rowKey: "code", style: { width: '100%' }, scroll: { x: 1000, y: 400 }, columns: columns, dataSource: dataSource, pagination: { size: 'small', showSizeChanger: true, showQuickJumper: true, showTotal: function (total, range) { var page = Math.floor(range[0] / 10) + 1; return "\u5171".concat(total, "\u6761\uFF0C\u5F53\u524D\u7B2C").concat(page, "\u9875"); } } }, void 0)] }, void 0)); }; var Title = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n font-weight: 600;\n color: #444;\n padding: 16px 0;\n & > .icon {\n width: 20px;\n height: 20px;\n margin-right: 10px;\n }\n"], ["\n display: flex;\n align-items: center;\n font-weight: 600;\n color: #444;\n padding: 16px 0;\n & > .icon {\n width: 20px;\n height: 20px;\n margin-right: 10px;\n }\n"]))); var AttrType = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: inline-block;\n height: auto;\n margin: 0 8px 0 0;\n padding: 0 7px;\n font-size: 12px;\n line-height: 20px;\n white-space: nowrap;\n background: rgb(251, 237, 206);\n border: 1px solid #d9d9d9;\n border-radius: 4px;\n &.system {\n background-color: rgb(205, 231, 226);\n }\n &.extend {\n background-color: #83c5f3;\n }\n"], ["\n display: inline-block;\n height: auto;\n margin: 0 8px 0 0;\n padding: 0 7px;\n font-size: 12px;\n line-height: 20px;\n white-space: nowrap;\n background: rgb(251, 237, 206);\n border: 1px solid #d9d9d9;\n border-radius: 4px;\n &.system {\n background-color: rgb(205, 231, 226);\n }\n &.extend {\n background-color: #83c5f3;\n }\n"]))); var templateObject_1, templateObject_2;