Commit 0648f3d2 by zhaochengxiang

数据源管理问题

parent 44d72e0a
...@@ -72,7 +72,7 @@ const DatasourceManage = (props) => { ...@@ -72,7 +72,7 @@ const DatasourceManage = (props) => {
domain.value = domain.key; domain.value = domain.key;
(domain.children||[]).forEach(system => { (domain.children||[]).forEach(system => {
system.id = system.value; system.id = system.scopeId;
system.value = system.key; system.value = system.key;
}) })
}) })
......
import React, { useState, useCallback, useRef, useEffect } from 'react'; import React, { useState, useCallback, useRef, useEffect } from 'react';
import { Input, Form, Typography, Button, Select, Row, Col, Popover, Checkbox, Tooltip, Table, Pagination, Space } from 'antd'; import { Input, Form, Typography, Button, Select, Row, Col, Popover, Checkbox, Tooltip, Table, Pagination, Space } from 'antd';
import { CloseOutlined, CheckOutlined, PlusOutlined, QuestionCircleOutlined, DeleteOutlined } from '@ant-design/icons'; import { CheckOutlined, PlusOutlined, QuestionCircleOutlined, DeleteOutlined } from '@ant-design/icons';
import { DndProvider, useDrag, useDrop } from 'react-dnd'; import { DndProvider, useDrag, useDrop } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend'; import { HTML5Backend } from 'react-dnd-html5-backend';
import update from 'immutability-helper'; import update from 'immutability-helper';
...@@ -749,23 +749,6 @@ const ImportActionTable = (props) => { ...@@ -749,23 +749,6 @@ const ImportActionTable = (props) => {
return ''; return '';
} }
}, },
// {
// title: '分布键',
// width: 60,
// dataIndex: 'partOfDistributionKey',
// editable: (type==='model'?true:false),
// render: (partOfDistributionKey, record, index) => {
// if (!partOfDistributionKey) {
// return '-';
// } else if (partOfDistributionKey === true) {
// return (
// <CheckOutlined />
// )
// }
// return '';
// }
// },
{ {
title: '外键', title: '外键',
width: 50, width: 50,
......
...@@ -8,7 +8,7 @@ import { useContextMenu, Menu as RcMenu, Item as RcItem } from "react-contexify" ...@@ -8,7 +8,7 @@ import { useContextMenu, Menu as RcMenu, Item as RcItem } from "react-contexify"
import ResizeObserver from 'rc-resize-observer'; import ResizeObserver from 'rc-resize-observer';
import { dispatch } from '../../../../model'; import { dispatch } from '../../../../model';
import { showMessage, getQueryParam, paginate, isSzseEnv, getTextLength, getTextWidth } from '../../../../util'; import { showMessage, getQueryParam, paginate, isSzseEnv } from '../../../../util';
import { AnchorId, AnchorTimestamp, Action, CatalogId, ModelerId } from '../../../../util/constant'; import { AnchorId, AnchorTimestamp, Action, CatalogId, ModelerId } from '../../../../util/constant';
// import Tag from "../../Tag"; // import Tag from "../../Tag";
...@@ -67,7 +67,7 @@ const ModelNameColumn = (props) => { ...@@ -67,7 +67,7 @@ const ModelNameColumn = (props) => {
pagination={false} pagination={false}
size='small' size='small'
/> />
</div> </div>;
} }
return ( return (
......
...@@ -38,6 +38,51 @@ const ResizeableHeaderCell = props => { ...@@ -38,6 +38,51 @@ const ResizeableHeaderCell = props => {
); );
}; };
const SourceComponent = (props) => {
const { data, onClick } = props;
const moreSourceComponent = <div style={{ maxWidth: 400, maxHeight: 300, overflow: 'auto' }}>
{
(data||[]).map((source, index) => {
return (
<div
className='pointer'
key={index}
style={{
textDecoration: 'underline',
}}
onClick={(e) => {
e.stopPropagation();
onClick && onClick(source.sourceId);
}}
>
{source.sourcePath||''}
</div>
);
})
}
</div>;
return (
<Tooltip
title={moreSourceComponent}
overlayClassName='tooltip-common'
>
<a
href='#'
onClick={(e) => {
e.stopPropagation();
onClick && onClick(data[0].sourceId);
}}
>
{
(data||[]).length>0 && <span>{data[0].sourcePath||''}</span>
}
</a>
</Tooltip>
);
}
const SuggestTable = (props) => { const SuggestTable = (props) => {
const { suggests, onSelect } = props; const { suggests, onSelect } = props;
...@@ -110,19 +155,9 @@ const SuggestTable = (props) => { ...@@ -110,19 +155,9 @@ const SuggestTable = (props) => {
{ {
title: '来源', title: '来源',
dataIndex: 'source', dataIndex: 'source',
ellipsis: true,
render: (_, record) => { render: (_, record) => {
return ( return (
<Tooltip title={record.recommendedStats?.pathInSource||''}> <SourceComponent data={record.recommendedStats?.sourceInfos||[]} onClick={sourceOnClick} />
<a
href='#'
onClick={(e) => {
e.stopPropagation();
sourceOnClick(record.recommendedStats?.idInSource||'');
}}
>
{record.recommendedStats?.pathInSource||''}</a>
</Tooltip>
); );
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment