@bos-alpha/data
Version:
数据管理
93 lines (92 loc) • 7.37 kB
JavaScript
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 { Steps } from 'antd';
import { Modal, Icon, prefixCls } from '@bos-alpha/common';
import store from '../../store';
import styled from '@emotion/styled';
import { StepOne } from '../step-one';
import { StepTwo } from '../step-two';
import { StepThree } from '../step-three';
import { StepFour } from '../step-four';
import { StepFive } from '../step-five';
import { DbConfig } from '../database-import/db-config';
import { DbImport } from '../database-import/db-import';
var Step = Steps.Step;
/**
* <StepOne /> 导入任务基础配置信息
* <StepTwo /> 导入任务预认证信息
* <StepThree /> 导入任务数据源配置
* <StepFour /> 导入任务临时数据源配置
* <StepFive /> 导入任务配置数据映射
*/
var apiImpotSteps = [
_jsx(StepOne, {}, void 0),
_jsx(StepTwo, {}, void 0),
_jsx(StepThree, {}, void 0),
_jsx(StepFour, {}, void 0),
_jsx(StepFive, {}, void 0)
];
var modalWidth = {
api: [1084, 640, 835, 880, 920],
db: [1084, 600, 720]
};
var dbImpotSteps = [_jsx(StepOne, {}, void 0), _jsx(DbConfig, {}, void 0), _jsx(DbImport, {}, void 0)];
/**
* 添加“从第三方数据库导入数据”配置 或 添加“从第三方API导入数据”配置
* 导入步骤指引
*/
export var ImportSteps = function () {
var _a = store(), step = _a.step, type = _a.type, visible = _a.visible;
var stepContent = {
api: apiImpotSteps[step],
db: dbImpotSteps[step]
};
return (_jsx(Modal, __assign({ visible: visible, width: modalWidth[type][step] || 640, footer: null, closable: false }, { children: _jsx(ModalContainer, { children: stepContent[type] }, void 0) }), void 0));
};
export var ModalTitle = function (_a) {
var _b = _a.type, type = _b === void 0 ? 'api' : _b, _c = _a.current, current = _c === void 0 ? 0 : _c, onClose = _a.onClose, children = _a.children;
var steps = ['wait', 'wait', 'wait', 'wait', 'wait']
.map(function (item, index) { return (current >= index ? 'process' : 'wait'); })
.slice(0, type === 'api' ? 5 : 3);
return (_jsxs(Title, { children: [_jsx(Steps, __assign({ current: 4, size: "small" }, { children: steps.map(function (status, index) { return (_jsx(Step, { status: status }, index)); }) }), void 0), _jsx("div", __assign({ className: "title-text" }, { children: children }), void 0), _jsx(Icon, { className: "close-icon", type: "iconicon_close", onClick: function () { return onClose && onClose(); } }, void 0)] }, void 0));
};
export var exitConfirm = function (_a) {
var _b = _a.title, title = _b === void 0 ? '退出导入第三方API数据' : _b, _c = _a.content, content = _c === void 0 ? '放弃创建导入第三方API数据配置和任务,是否确定?' : _c, onOk = _a.onOk;
Modal.confirm({
centered: true,
title: title,
content: content,
cancelButtonProps: {
shape: 'round',
style: {
width: 106
}
},
okButtonProps: {
shape: 'round',
style: {
width: 106
}
},
onOk: function () { return onOk(); }
});
};
var Title = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0 50px 20px 0;\n position: relative;\n & > .title-text {\n padding-top: 10px;\n font-size: 18px;\n color: #444;\n font-weight: 700;\n }\n & > .close-icon {\n position: absolute;\n right: 0;\n top: 0;\n cursor: pointer;\n font-size: 22px;\n }\n"], ["\n padding: 0 50px 20px 0;\n position: relative;\n & > .title-text {\n padding-top: 10px;\n font-size: 18px;\n color: #444;\n font-weight: 700;\n }\n & > .close-icon {\n position: absolute;\n right: 0;\n top: 0;\n cursor: pointer;\n font-size: 22px;\n }\n"])));
export var ModalContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-bottom: 62px;\n color: #333;\n .", "-form, .", "-form-item-label > label {\n color: #333;\n font-size: 12px;\n }\n"], ["\n padding-bottom: 62px;\n color: #333;\n .", "-form, .", "-form-item-label > label {\n color: #333;\n font-size: 12px;\n }\n"])), prefixCls, prefixCls);
export var FormBox = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n max-height: calc(100vh - 220px);\n overflow-y: ", ";\n padding-right: ", ";\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"], ["\n max-height: calc(100vh - 220px);\n overflow-y: ", ";\n padding-right: ", ";\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"])), function (props) { return (props.offset === 'false' ? 'auto' : 'scroll'); }, function (props) { return (props.offset === 'false' ? '0' : '4px'); });
export var FooterButtons = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 62px;\n padding: 10px 18px 20px;\n position: absolute;\n width: 100%;\n bottom: 0;\n left: 0;\n display: flex;\n justify-content: flex-end;\n background-color: #fff;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n & > button {\n min-width: 106px;\n margin: 0 6px;\n }\n & > .pre-step {\n position: absolute;\n left: 24px;\n }\n"], ["\n height: 62px;\n padding: 10px 18px 20px;\n position: absolute;\n width: 100%;\n bottom: 0;\n left: 0;\n display: flex;\n justify-content: flex-end;\n background-color: #fff;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n & > button {\n min-width: 106px;\n margin: 0 6px;\n }\n & > .pre-step {\n position: absolute;\n left: 24px;\n }\n"])));
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;