@bos-alpha/data
Version:
数据管理
546 lines (545 loc) • 39.9 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);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { Form, Select, Button, List, message, Tooltip, Checkbox, Radio } from 'antd';
import styled from '@emotion/styled';
import { useEffect, useRef, useState } from 'react';
import { Icon, Table, prefixCls, Modal } from '@bos-alpha/common';
import * as api from '@bos-alpha/common/lib/services';
import store from '../../store';
import { ModalTitle, FormBox, FooterButtons, exitConfirm } from '../import-steps';
import { mappingsParse, parseMappings2TableData } from './utils';
var Item = Form.Item;
var Option = Select.Option, OptGroup = Select.OptGroup;
// bos保留属性 这4个字段是后台自动处理的,且不能随意设置映射
var specialAttributes = ['leaf', 'level', 'longCode', 'longName'];
/**
* 导入任务创建数据映射
* @returns
*/
export var StepFive = function () {
// store暂存信息
var _a = store(), isEdit = _a.isEdit, taskId = _a.taskId, mappings = _a.mappings, setVisible = _a.setVisible, preStep = _a.preStep, insert = _a.insert, update = _a.update, rollback = _a.rollback;
// 左侧数据映射列表
var _b = useState([]), mapList = _b[0], setMapList = _b[1];
// 暂存左侧数据映射列表
var mapListRef = useRef([]);
// 当前选中bos className
var _c = useState(''), currClassName = _c[0], setCurrClassName = _c[1];
var curClassDefinition = useRef({});
// bos对象类
var _d = useState([]), docList = _d[0], setDocList = _d[1];
// bos关系类
var _e = useState([]), edgeList = _e[0], setEdgeList = _e[1];
// 表格数据 以bos侧的属性为准
var _f = useState([]), tableData = _f[0], setTableData = _f[1];
// 当前任务可用的api数据源 或 视图列表
var _g = useState([]), apiList = _g[0], setApiList = _g[1];
// 选择的api信息
var _h = useState({}), apiInfo = _h[0], setApiInfo = _h[1];
var form = Form.useForm()[0];
// 已添加映射的对象类或关系类
var existCode = mapList.map(function (item) { return item.code; });
useEffect(function () {
getClassListAndApiList();
}, []); // eslint-disable-line
// 获取所有bos类和所有api
var getClassListAndApiList = function () { return __awaiter(void 0, void 0, void 0, function () {
var _a, docRes, edgeRes, apiRes, docClassList, edgeClassList, taskApiList, oldMapList, defaultBosClass_1, defaultBosClass, iniMapList;
return __generator(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, Promise.all([
api.getDatamodelBaseTree('doc'),
api.getDatamodelBaseTree('edge'),
api.getDataImportDatasets({
params: {
taskId: taskId
}
})
])];
case 1:
_a = _b.sent(), docRes = _a[0], edgeRes = _a[1], apiRes = _a[2];
docClassList = docRes.map(function (item) { return (__assign(__assign({}, item.classDefinition), { label: "".concat(item.classDefinition.className, "\uFF08").concat(item.classDefinition.objectName, "\uFF09") })); });
edgeClassList = edgeRes.map(function (item) { return (__assign(__assign({}, item.classDefinition), { label: "".concat(item.classDefinition.className, "\uFF08").concat(item.classDefinition.relType, "\uFF09") })); });
taskApiList = apiRes.map(function (item) { return (__assign(__assign({}, item), { value: item.id, label: item.name })); });
setDocList(docClassList);
setEdgeList(edgeClassList);
setApiList(taskApiList);
// 编辑任务
if (isEdit) {
// 编辑时 导入选项回显
form.setFieldsValue({
insert: insert,
update: update,
rollback: rollback
});
oldMapList = mappingsParse(mappings, docClassList, edgeClassList);
// 当任务已有映射关系
if (oldMapList.length > 0) {
setMapList(oldMapList);
mapListRef.current = oldMapList;
defaultBosClass_1 = oldMapList[0];
form.setFieldsValue({
bosclass: defaultBosClass_1.code,
source: defaultBosClass_1.mappings.dataset
});
setApiInfo(taskApiList.find(function (item) {
return item.id === defaultBosClass_1.mappings.dataset;
}));
getBosClassDetail(defaultBosClass_1.code);
return [2 /*return*/];
}
}
defaultBosClass = docClassList[0];
form.setFieldsValue({
bosclass: defaultBosClass.className
});
iniMapList = [
{
label: defaultBosClass.label,
code: defaultBosClass.className,
mappings: {}
}
];
setMapList(iniMapList);
mapListRef.current = iniMapList;
getBosClassDetail(defaultBosClass.className);
return [2 /*return*/];
}
});
}); };
// 获取类详情
var getBosClassDetail = function (className) { return __awaiter(void 0, void 0, void 0, function () {
var res, newList;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
setCurrClassName(className);
return [4 /*yield*/, api.getDatamodelDetail(className)];
case 1:
res = _a.sent();
curClassDefinition.current = res.classDefinition;
newList = parseMappings2TableData(mapListRef.current, className,
// 1.属性排序:自定义属性靠后 2.bos保留属性不可配置映射
res.attributes
.filter(function (item) { return specialAttributes.indexOf(item.code) < 0; })
.sort(function (a, b) {
return a.attributeType < b.attributeType ? -1 : 1;
}), res.classDefinition);
setTableData(newList);
return [2 /*return*/];
}
});
}); };
// 右侧切换bos类 清空字段映射 清空数据源
var onSelectBosClass = function (val) {
var curClassInfo = __spreadArray(__spreadArray([], docList, true), edgeList, true).find(function (item) { return item.className === val; });
form.setFieldsValue({ source: null });
setApiInfo({});
// 左侧现有bos类替换
var newList = mapList.map(function (item) {
if (item.code === currClassName) {
item.code = val;
item.label = curClassInfo.label;
item.mappings = {
bosclass: val,
dataset: apiInfo === null || apiInfo === void 0 ? void 0 : apiInfo.id
};
}
return item;
});
setMapList(newList);
mapListRef.current = newList;
// 获取新的bos类详情 attributes
getBosClassDetail(val);
};
// 左侧映射切换 需保存
var onMapSwitch = function (item) { return __awaiter(void 0, void 0, void 0, function () {
var curMap;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (item.code === currClassName)
return [2 /*return*/];
// 切换映射 都要保存 不然改动会丢失
return [4 /*yield*/, onSave('save')];
case 1:
// 切换映射 都要保存 不然改动会丢失
_a.sent();
curMap = mapListRef.current.find(function (el) { return el.code === item.code; });
// 回填bos类 选择的数据源
form.setFieldsValue({
bosclass: item.code,
source: curMap.mappings.dataset
});
setApiInfo(apiList.find(function (item) { return item.id === curMap.mappings.dataset; }));
getBosClassDetail(item.code);
return [2 /*return*/];
}
});
}); };
// 切换数据源
var onApiSelectChange = function (val, option) {
setApiInfo(option);
setTableData(tableData.map(function (item) { return (__assign(__assign({}, item), { field: null, checked: false, isParent: false })); }));
};
var onExit = function (type) {
exitConfirm(__assign(__assign({}, (type === 'preStep'
? {
title: '返回上一步',
content: '未保存的配置将会丢失,确定返回上一步?'
}
: {})), { onOk: function () {
if (type === 'preStep') {
preStep();
}
else {
setVisible(false);
}
} }));
};
// 移除映射 注意移除的是当前选中时
var onRemove = function (item) {
if (mapList.length <= 1)
return message.warning('必须保留一项');
Modal.confirm({
title: '删除数据映射',
content: "\u5C06\u8981\u5220\u9664\u6570\u636E\u6620\u5C04\u201C".concat(item.label, "\u201D\uFF0C\u662F\u5426\u786E\u5B9A\uFF1F"),
onOk: function () {
var newList = mapList.filter(function (el) { return el.code !== item.code; });
setMapList(newList);
mapListRef.current = newList;
// 删除的是当前选中 回到第一个
if (item.code === currClassName) {
form.setFieldsValue({
bosclass: newList[0].code,
source: newList[0].mappings.dataset
});
setApiInfo(apiList.find(function (item) {
return item.id === newList[0].mappings.dataset;
}));
getBosClassDetail(newList[0].code);
}
}
});
};
// 创建新映射 只能创建未创建的
var addNewRow = function () { return __awaiter(void 0, void 0, void 0, function () {
var defaultBosClass, docRest, edgeRest, newList;
return __generator(this, function (_a) {
defaultBosClass = {};
docRest = docList.filter(function (item) { return existCode.indexOf(item.className) < 0; });
edgeRest = edgeList.filter(function (item) { return existCode.indexOf(item.className) < 0; });
if (docRest.length > 0) {
defaultBosClass = docRest[0];
}
else if (edgeRest.length > 0) {
defaultBosClass = edgeRest[0];
}
else {
return [2 /*return*/, message.error('当前应用已不能再创建映射')];
}
// 创建新映射 数据源恢复默认
form.setFieldsValue({
bosclass: defaultBosClass.className,
source: null
});
setApiInfo({});
newList = __spreadArray(__spreadArray([], mapList, true), [
{
code: defaultBosClass.className,
label: defaultBosClass.label,
mappings: {}
}
], false);
setMapList(newList);
mapListRef.current = newList;
getBosClassDetail(defaultBosClass.className);
return [2 /*return*/];
});
}); };
/**
创建映射 选择字段或勾选关键字
field.设置映射字段
keyword.是否关键词 注意:清除关键词时需要清除父节点关键词
isParent.是否父节点关键词
parent.设置父节点映射字段
*/
var setMappings = function (val, type, record) {
setTableData(tableData.map(function (item) {
if (item.code === record.code) {
// bos每个字段对应的第三方数据字段 以及 是否是关键字
switch (type) {
case 'field':
item.field = val;
break;
case 'keyword':
item.checked = val;
if (!val) {
item.isParent = false;
item.parent = null;
}
break;
case 'isParent':
item.isParent = val;
break;
case 'parent':
item.parent = val;
break;
}
}
return item;
}));
};
var columns = __spreadArray([
{
dataIndex: 'code',
title: "".concat(currClassName, "\u5B57\u6BB5"),
width: 168,
ellipsis: true,
render: function (code, record) { return (_jsxs(_Fragment, { children: [record.require ? (_jsx("span", __assign({ className: "required-mark" }, { children: "*" }), void 0)) : (''), code] }, void 0)); }
},
{
dataIndex: 'field',
title: "".concat((apiInfo === null || apiInfo === void 0 ? void 0 : apiInfo.name) || '', "\u5B57\u6BB5"),
width: 178,
ellipsis: true,
render: function (field, record) { return (_jsx(Select, { className: "field-select", showSearch: true, value: record.field, options: (apiInfo.fields || []).map(function (field) { return ({
label: field,
value: field
}); }), allowClear: true, placeholder: "\u9009\u62E9\u5B57\u6BB5", onChange: function (val) { return setMappings(val, 'field', record); } }, void 0)); }
},
{
dataIndex: 'checked',
width: 72,
title: (_jsxs("div", { children: [_jsx("div", __assign({ style: { paddingRight: '10px' } }, { children: "\u662F\u5426" }), void 0), _jsxs("div", { children: ["\u5173\u952E\u5B57", _jsx(Tooltip, __assign({ title: "\u5173\u952E\u5B57\u5B57\u6BB5\u7528\u4E8E\u5224\u65AD\u4E24\u4E2A\u6570\u636E\u662F\u5426\u4E3A\u540C\u4E00\u4E2A\u5BF9\u8C61\uFF0C\u5982\u679C\u4E0D\u662F\u540C\u4E00\u4E2A\u5BF9\u8C61\uFF0C\u5219\u6309\u7167\u65B0\u589EBOS\u6570\u636E\u5199\u5165\uFF1B\u5982\u679C\u662F\u540C\u4E00\u4E2A\u5BF9\u8C61\uFF0C\u5219\u6309\u7167\u66F4\u65B0BOS\u6570\u636E\u5199\u5165\u3002" }, { children: _jsx(TipsIcon, { className: "tips-icon", type: "iconicon_explain" }, void 0) }), void 0)] }, void 0)] }, void 0)),
align: 'center',
render: function (checked, record) { return (_jsx(Checkbox, { checked: checked, disabled: curClassDefinition.current.type === 'edge', onChange: function (e) {
return setMappings(e.target.checked, 'keyword', record);
} }, void 0)); }
}
], (curClassDefinition.current.type === 'doc'
? [
{
dataIndex: 'isParent',
width: 80,
title: (_jsxs("div", { children: [_jsx("div", { children: "\u662F\u5426\u7236\u8282\u70B9" }, void 0), _jsxs("div", { children: ["\u5173\u952E\u5B57", _jsx(Tooltip, __assign({ title: "\u7236\u8282\u70B9\u5173\u952E\u5B57\u5E94\u7528\u4E8E\u6811\u5F62\u8282\u70B9\u7684BOS\u5BF9\u8C61\u7C7B\u3002\u901A\u8FC7\u7236\u8282\u70B9\u5173\u952E\u5B57\u5B57\u6BB5\u627E\u5230\u5F53\u524D\u8282\u70B9\u7684\u7236\u8282\u70B9\uFF0C\u5E76\u81EA\u52A8\u5EFA\u7ACB\u7236-\u5B50\u8282\u70B9\u5173\u7CFB" }, { children: _jsx(TipsIcon, { className: "tips-icon", type: "iconicon_explain" }, void 0) }), void 0)] }, void 0)] }, void 0)),
align: 'center',
render: function (isParent, record) { return (_jsx(Checkbox, { checked: isParent, disabled: !record.checked, onChange: function (e) {
return setMappings(e.target.checked, 'isParent', record);
} }, void 0)); }
}
]
: []), true);
// 树节点映射
var treeColumns = [
{
dataIndex: 'code',
title: '子对象字段',
width: 150,
ellipsis: true,
render: function (code) { return (_jsxs("span", { children: [_jsx("span", __assign({ className: "required-mark" }, { children: "*" }), void 0), "parent.", code] }, void 0)); }
},
{
dataIndex: 'parent',
title: '父对象字段',
width: 200,
ellipsis: true,
render: function (parent, record) { return (_jsx(Select, { className: "field-select ".concat(!record.parent ? 'error' : ''), showSearch: true, value: record.parent, options: (apiInfo.fields || []).map(function (field) { return ({
label: field,
value: field
}); }), allowClear: true, placeholder: "\u9009\u62E9\u5B57\u6BB5", onChange: function (val) { return setMappings(val, 'parent', record); } }, void 0)); }
},
{
dataIndex: 'checked',
width: 122,
title: (_jsxs("span", { children: ["\u662F\u5426\u5173\u952E\u5B57", _jsx(Tooltip, __assign({ title: "\u5173\u952E\u5B57\u5B57\u6BB5\u7528\u4E8E\u5224\u65AD\u4E24\u4E2A\u6570\u636E\u662F\u5426\u4E3A\u540C\u4E00\u4E2A\u5BF9\u8C61\uFF0C\u5982\u679C\u4E0D\u662F\u540C\u4E00\u4E2A\u5BF9\u8C61\uFF0C\u5219\u6309\u7167\u65B0\u589EBOS\u6570\u636E\u5199\u5165\uFF1B\u5982\u679C\u662F\u540C\u4E00\u4E2A\u5BF9\u8C61\uFF0C\u5219\u6309\u7167\u66F4\u65B0BOS\u6570\u636E\u5199\u5165\u3002" }, { children: _jsx(TipsIcon, { className: "tips-icon", type: "iconicon_explain" }, void 0) }), void 0)] }, void 0)),
align: 'center',
render: function (checked, record) { return (_jsx(Checkbox, { checked: checked, disabled: true }, void 0)); }
}
];
// 树节点映射数据
var treeMapData = tableData.filter(function (item) { return item.isParent; });
// save.仅保存
// add.创建新行 须保存
// exit.保存并退出 关闭弹窗
// execute.保存并开始执行 关闭弹窗
var onSave = function (type) {
return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
var vals, mapAttrs, requireAttrsEmpty, isParentAttrsEmpty, mappingsItem_1, newMapList, taskUpdateData, res, err_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 3, , 4]);
return [4 /*yield*/, form.validateFields()];
case 1:
vals = _a.sent();
mapAttrs = tableData.filter(function (item) { return !!item.field; });
// 已配置映射的bos属性
if (mapAttrs.length <= 0) {
return [2 /*return*/, message.error('请配置字段映射')];
}
requireAttrsEmpty = tableData.filter(function (item) { return item.require && !item.field; });
if (requireAttrsEmpty.length > 0) {
return [2 /*return*/, message.error("bos\u7C7B".concat(currClassName, "\u4E2D\u7684\u5FC5\u586B\u5B57\u6BB5").concat(requireAttrsEmpty
.map(function (item) { return item.code; })
.join('、'), "\u987B\u914D\u7F6E\u5B57\u6BB5\u6620\u5C04"), 3)];
}
isParentAttrsEmpty = tableData.filter(function (item) { return item.isParent && !item.parent; });
if (isParentAttrsEmpty.length > 0) {
return [2 /*return*/, message.error("\u7236\u8282\u70B9\u5173\u952E\u5B57\u987B\u914D\u7F6E\u5B57\u6BB5\u6620\u5C04")];
}
mappingsItem_1 = {
bosclass: vals.bosclass,
dataset: apiInfo.id // api数据源的key
};
/* 映射关系
"description":"folderDescript", // 普通字段
"IdAttribute.code":"folderCode", // 实体类的主键字段
"LeftIdAttribute.code":"folderCode" // 关系类左对象的主键字段
"RightIdAttribute.code":"documentCode" // 关系类右对象的主键字段
*/
mapAttrs.forEach(function (item) {
// 对象类
if (curClassDefinition.current.type === 'doc') {
mappingsItem_1["".concat(item.checked ? 'IdAttribute.' : '').concat(item.code)] = item.field;
// 父节点关键字
if (item.isParent) {
mappingsItem_1["ParentAttribute.".concat(item.code)] =
item.parent;
}
}
// 关系类 edgeCode由setTableData时拼接
else {
mappingsItem_1[item.edgeCode || item.code] = item.field;
// 设置左右对象
if (item.leftObject) {
mappingsItem_1.LeftObjectClass = item.leftObject;
}
else if (item.rightObject) {
mappingsItem_1.RightObjectClass = item.rightObject;
}
}
});
console.log(mapAttrs);
newMapList = mapList.map(function (item) {
if (item.code === currClassName) {
// 更新映射配置到列表
item.mappings = mappingsItem_1;
}
return item;
});
setMapList(newMapList);
mapListRef.current = newMapList;
taskUpdateData = {
taskId: taskId,
mappings: newMapList.map(function (item) { return item.mappings; }),
enabled: true,
status: type === 'execute' ? '0.5' : '0',
insert: vals.insert,
update: vals.update,
rollback: vals.rollback
};
return [4 /*yield*/, api.postDataImportTasks({
data: taskUpdateData
})];
case 2:
res = _a.sent();
console.log('save', taskUpdateData, mapAttrs, res);
if (type === 'add') {
addNewRow();
}
else if (type === 'exit' || type === 'execute') {
setVisible(false);
}
if (type === 'exit')
message.success('保存成功');
resolve();
return [3 /*break*/, 4];
case 3:
err_1 = _a.sent();
if (err_1 && err_1.errorFields) {
message.error('信息输入不完整!');
}
reject();
return [3 /*break*/, 4];
case 4: return [2 /*return*/];
}
});
}); });
};
return (_jsxs("div", { children: [_jsx(ModalTitle, __assign({ current: 5, onClose: function () { return onExit('close'); } }, { children: "\u5EFA\u7ACBBOS\u5BF9\u8C61\u548C\u5173\u7CFB\u4E0E\u6570\u636E\u6E90\u6570\u636E\u6620\u5C04\u5173\u7CFB" }), void 0), _jsxs(Container, { children: [_jsx("div", __assign({ className: "page-left" }, { children: _jsxs(FormBox, { children: [_jsx(List, __assign({ header: "\u6570\u636E\u6620\u5C04" }, { children: mapList.map(function (item, index) { return (_jsxs(List.Item, __assign({ className: "list-item ".concat(item.code === currClassName
? 'active'
: '') }, { children: [_jsx("div", __assign({ className: "mappings-label ellipsis", onClick: function () { return onMapSwitch(item); } }, { children: item.label }), void 0), _jsx(Icon, { className: "icon", type: "iconicon_subtracting", onClick: function () { return onRemove(item); } }, void 0)] }), index)); }) }), void 0), _jsxs("div", __assign({ className: "add-btn", onClick: function () { return onSave('add'); } }, { children: [_jsx(Icon, { className: "icon", type: "iconicon_addto" }, void 0), _jsx("span", { children: "\u6DFB\u52A0\u65B0\u6620\u5C04" }, void 0)] }), void 0)] }, void 0) }), void 0), _jsx("div", __assign({ className: "page-right" }, { children: _jsx(FormBox, { children: _jsxs(Form, __assign({ form: form, labelCol: { span: 7 }, wrapperCol: { span: 17 }, labelAlign: "left" }, { children: [_jsx("div", __assign({ className: "title" }, { children: "\u57FA\u672C\u4FE1\u606F" }), void 0), _jsx(Item, __assign({ name: "bosclass", label: "BOS\u5BF9\u8C61\u7C7B\u6216\u5173\u7CFB\u7C7B", rules: [
{
required: true,
message: '请选择BOS对象类或关系类'
}
] }, { children: _jsxs(Select, __assign({ onChange: onSelectBosClass, placeholder: "\u8BF7\u9009\u62E9BOS\u5BF9\u8C61\u7C7B\u6216\u5173\u7CFB\u7C7B" }, { children: [_jsx(OptGroup, __assign({ label: "\u5BF9\u8C61\u7C7B" }, { children: docList.map(function (item, index) { return (_jsx(Option, __assign({ value: item.className, label: item.label, definition: item, disabled: existCode.includes(item.className) }, { children: item.label }), index)); }) }), void 0), _jsx(OptGroup, __assign({ label: "\u5173\u7CFB\u7C7B" }, { children: edgeList.map(function (item, index) { return (_jsx(Option, __assign({ value: item.className, label: "".concat(item.className, "\uFF08").concat(item.relType, "\uFF09"), definition: item, disabled: existCode.includes(item.className) }, { children: item.label }), index)); }) }), void 0)] }), void 0) }), void 0), _jsx(Item, __assign({ name: "source", label: "\u6570\u636E\u6E90/\u4E34\u65F6\u6570\u636E\u6E90", rules: [
{
required: true,
message: '请选择数据源或临时数据源'
}
] }, { children: _jsx(Select, { options: apiList, onChange: onApiSelectChange, placeholder: "\u8BF7\u9009\u62E9\u6570\u636E\u6E90\u6216\u4E34\u65F6\u6570\u636E\u6E90" }, void 0) }), void 0), _jsx("div", __assign({ className: "title" }, { children: "\u5B57\u6BB5\u6620\u5C04" }), void 0), _jsx("div", { children: _jsx(Table, { className: "field-table", rowKey: "code", size: "small", columns: columns, dataSource: tableData, pagination: false }, void 0) }, void 0), _jsx("div", __assign({ className: "title" }, { children: "\u6811\u8282\u70B9\u6620\u5C04" }), void 0), _jsx("div", { children: _jsx(Table, { className: "tree-table", rowKey: "code", size: "small", columns: treeColumns, dataSource: treeMapData, pagination: false }, void 0) }, void 0), _jsx("div", __assign({ className: "title" }, { children: "\u5BFC\u5165\u914D\u7F6E" }), void 0), _jsxs("div", __assign({ className: "import-option" }, { children: [_jsx(Item, __assign({ name: "insert", valuePropName: "checked", initialValue: true, className: "option-item" }, { children: _jsx(Checkbox, { children: "\u65B0\u589E\u6570\u636E" }, void 0) }), void 0), _jsx(Item, __assign({ name: "update", valuePropName: "checked", initialValue: true, className: "option-item" }, { children: _jsx(Checkbox, { children: "\u66F4\u65B0\u6570\u636E" }, void 0) }), void 0), _jsx(Item, __assign({ name: "rollback", initialValue: "none", className: "option-item rollback", label: "\u51FA\u73B0\u9519\u8BEF\u65F6", labelCol: { span: 4 } }, { children: _jsxs(Radio.Group, { children: [_jsx(Radio, __assign({ value: "all" }, { children: "\u9000\u51FA\u5BFC\u5165\uFF0C\u6570\u636E\u72B6\u6001\u56DE\u9000\u5230\u5BFC\u5165\u524D" }), void 0), _jsx(Radio, __assign({ value: "class" }, { children: "\u9000\u51FA\u5F53\u524DBOS\u5BF9\u8C61\u7684\u5BFC\u5165\uFF0C\u7EE7\u7EED\u4E0B\u4E00\u4E2ABOS\u5BF9\u8C61\u7684\u5BFC\u5165" }), void 0), _jsx(Radio, __assign({ value: "none" }, { children: "\u5FFD\u7565\u9519\u8BEF\uFF0C\u7EE7\u7EED\u672CBOS\u5BF9\u8C61\u7684\u5BFC\u5165" }), void 0)] }, void 0) }), void 0)] }), void 0)] }), void 0) }, void 0) }), void 0), _jsxs(FooterButtons, { children: [_jsx(Button, __assign({ className: "pre-step", type: "default", shape: "round", onClick: function () { return onExit('preStep'); } }, { children: "\u4E0A\u4E00\u6B65" }), void 0), _jsx(Button, __assign({ type: "primary", shape: "round", onClick: function () { return onSave('exit'); } }, { children: "\u4FDD\u5B58\u5E76\u9000\u51FA" }), void 0), _jsx(Button, __assign({ type: "default", shape: "round", onClick: function () { return onSave('execute'); } }, { children: "\u4FDD\u5B58\u5E76\u5F00\u59CB\u6267\u884C" }), void 0)] }, void 0)] }, void 0)] }, void 0));
};
var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n border: 1px solid #dfdfdf;\n & > .page-left {\n width: 240px;\n .", "-list-split .", "-list-header {\n font-size: 14px;\n font-weight: 500;\n padding: 10px 16px;\n }\n .list-item {\n padding: 9px 16px;\n .mappings-label {\n cursor: pointer;\n }\n &.active {\n background: rgba(40, 120, 255, 0.1);\n }\n .ellipsis {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n .icon {\n color: #ff0000;\n font-size: 16px;\n cursor: pointer;\n }\n }\n .add-btn {\n padding: 9px 16px;\n color: #2878ff;\n cursor: pointer;\n & > .icon {\n margin-right: 4px;\n }\n }\n }\n & > .page-right {\n flex: 1;\n padding-left: 20px;\n border-left: 1px solid #dedede;\n overflow: hidden;\n .title {\n font-size: 14px;\n font-weight: 500;\n padding: 10px 0;\n }\n .", "-table-wrapper {\n margin-bottom: 24px;\n .field-table {\n min-height: 460px;\n }\n .field-select {\n width: 100%;\n &.error .ant-select-selector {\n border-color: #ff0000;\n }\n }\n .", "-empty-normal {\n margin: 0;\n }\n }\n .", "-table-tbody {\n .required-mark {\n color: #ff0000;\n vertical-align: -3px;\n margin-right: 1px;\n }\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 .option-item {\n margin-bottom: 0;\n &.rollback {\n padding-bottom: 20px;\n }\n }\n .", "-form label {\n font-size: 12px;\n }\n }\n"], ["\n display: flex;\n border: 1px solid #dfdfdf;\n & > .page-left {\n width: 240px;\n .", "-list-split .", "-list-header {\n font-size: 14px;\n font-weight: 500;\n padding: 10px 16px;\n }\n .list-item {\n padding: 9px 16px;\n .mappings-label {\n cursor: pointer;\n }\n &.active {\n background: rgba(40, 120, 255, 0.1);\n }\n .ellipsis {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n .icon {\n color: #ff0000;\n font-size: 16px;\n cursor: pointer;\n }\n }\n .add-btn {\n padding: 9px 16px;\n color: #2878ff;\n cursor: pointer;\n & > .icon {\n margin-right: 4px;\n }\n }\n }\n & > .page-right {\n flex: 1;\n padding-left: 20px;\n border-left: 1px solid #dedede;\n overflow: hidden;\n .title {\n font-size: 14px;\n font-weight: 500;\n padding: 10px 0;\n }\n .", "-table-wrapper {\n margin-bottom: 24px;\n .field-table {\n min-height: 460px;\n }\n .field-select {\n width: 100%;\n &.error .ant-select-selector {\n border-color: #ff0000;\n }\n }\n .", "-empty-normal {\n margin: 0;\n }\n }\n .", "-table-tbody {\n .required-mark {\n color: #ff0000;\n vertical-align: -3px;\n margin-right: 1px;\n }\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 .option-item {\n margin-bottom: 0;\n &.rollback {\n padding-bottom: 20px;\n }\n }\n .", "-form label {\n font-size: 12px;\n }\n }\n"])), prefixCls, prefixCls, prefixCls, prefixCls, prefixCls, prefixCls);
var TipsIcon = styled(Icon)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: #2878ff;\n cursor: pointer;\n"], ["\n color: #2878ff;\n cursor: pointer;\n"])));
var templateObject_1, templateObject_2;