UNPKG

@bos-model-alpha/data

Version:

数据管理

61 lines (60 loc) 3.59 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 { CustomTable } from '../custom-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' }, { title: '类型', dataIndex: 'dataType' }, { title: '描述', dataIndex: 'description' }, { title: '属性组', dataIndex: 'group', render: function (group) { return (group ? group.join('') : ''); } }, { title: '是否必填', dataIndex: 'require', render: function (require) { return (require ? 'Y' : 'N'); } }, { title: '属性来源', dataIndex: 'definedClass', render: function (definedClass) { return (_jsx(AttrType, __assign({ className: "attr-type ".concat(definedClass) }, { children: attrTypes[definedClass] || '自定义' }))); } } ]; return (_jsxs("div", { children: [_jsxs(Title, { children: [_jsx("img", { className: "icon", src: list, alt: "" }), _jsx("span", { children: "\u5C5E\u6027\u5217\u8868" })] }), _jsx(CustomTable, { rowKey: "code", columns: columns, dataSource: dataSource, pagination: false })] })); }; 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;