UNPKG

@bos-alpha/data

Version:

数据管理

35 lines (34 loc) 5.03 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, Fragment as _Fragment } from "react/jsx-runtime"; import { Breadcrumb } from 'antd'; import styled from '@emotion/styled'; import { InfoCard } from '../info-card'; import { BaseClassList } from '../base-class-list'; import { InfoTabs } from '../info-tabs'; import { DataImportLocal } from '../data-import-local'; import { DataExport } from '../data-export'; import { EdgeBatch } from '../edge-batch'; // import { DatabaseImport } from '../database-import'; import importIcon from '../img-base64/database-import'; var rootKeys = ['doc', 'edge']; export var RightContent = function (_a) { var curNodeInfo = _a.curNodeInfo, setCurNodeInfo = _a.setCurNodeInfo, onDataImport = _a.onDataImport; var isRootNodes = curNodeInfo && rootKeys.indexOf(curNodeInfo.key) >= 0; return (_jsxs(Container, { children: [_jsxs("div", __assign({ className: "info-header" }, { children: [_jsx("div", __assign({ className: "breadcrumb" }, { children: _jsxs(Breadcrumb, { children: [_jsx(Breadcrumb.Item, { children: "\u6570\u636E\u7BA1\u7406" }, void 0), _jsx(Breadcrumb.Item, { children: (curNodeInfo === null || curNodeInfo === void 0 ? void 0 : curNodeInfo.type) === 'edge' ? '关系类' : '对象类' }, void 0), _jsx(Breadcrumb.Item, { children: curNodeInfo === null || curNodeInfo === void 0 ? void 0 : curNodeInfo.className }, void 0)] }, void 0) }), void 0), _jsxs("div", __assign({ className: "import" }, { children: [_jsx(DataImportLocal, {}, void 0), _jsx(DataExport, {}, void 0), _jsx(EdgeBatch, {}, void 0), _jsxs("span", __assign({ className: "func-btn", onClick: function () { return onDataImport && onDataImport(); } }, { children: [_jsx("img", { className: "icon", src: importIcon, alt: "" }, void 0), "\u5BF9\u63A5\u7B2C\u4E09\u65B9\u6570\u636E"] }), void 0)] }), void 0)] }), void 0), isRootNodes ? (_jsx(BaseClassList, { dataSource: curNodeInfo.children }, void 0)) : (_jsxs(_Fragment, { children: [_jsx(InfoCard, { curClass: curNodeInfo, onSave: setCurNodeInfo }, void 0), _jsx(InfoTabs, { curClass: curNodeInfo }, void 0)] }, void 0))] }, void 0)); }; var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 1;\n padding: 14px 24px 24px;\n overflow: hidden;\n overflow-y: auto;\n &::-webkit-scrollbar {\n -webkit-appearance: none;\n }\n /* \u6EDA\u52A8\u6761\u5E38\u663E */\n &::-webkit-scrollbar:vertical {\n width: 6px;\n }\n &::-webkit-scrollbar:horizontal {\n height: 6px;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 8px;\n border: 6px solid rgba(255, 255, 255, 0.4);\n background-color: rgba(0, 0, 0, 0.5);\n }\n & > .info-header {\n display: flex;\n justify-content: space-between;\n & > .import {\n width: 50%;\n display: flex;\n justify-content: flex-end;\n & > .func-btn {\n margin: 0 16px;\n display: flex;\n color: #444;\n align-items: center;\n cursor: pointer;\n & > .icon {\n width: 18px;\n height: 18px;\n margin-right: 2px;\n }\n }\n }\n }\n"], ["\n flex: 1;\n padding: 14px 24px 24px;\n overflow: hidden;\n overflow-y: auto;\n &::-webkit-scrollbar {\n -webkit-appearance: none;\n }\n /* \u6EDA\u52A8\u6761\u5E38\u663E */\n &::-webkit-scrollbar:vertical {\n width: 6px;\n }\n &::-webkit-scrollbar:horizontal {\n height: 6px;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 8px;\n border: 6px solid rgba(255, 255, 255, 0.4);\n background-color: rgba(0, 0, 0, 0.5);\n }\n & > .info-header {\n display: flex;\n justify-content: space-between;\n & > .import {\n width: 50%;\n display: flex;\n justify-content: flex-end;\n & > .func-btn {\n margin: 0 16px;\n display: flex;\n color: #444;\n align-items: center;\n cursor: pointer;\n & > .icon {\n width: 18px;\n height: 18px;\n margin-right: 2px;\n }\n }\n }\n }\n"]))); var templateObject_1;