Commit 0b5a1d41 by zhaochengxiang

代理数据源信息

parent e2b9d6fe
......@@ -18,14 +18,30 @@ const ProxyDatasourceItem = ({ value = {}, datasources = [], onChange }) => {
return (
<Select
value={value}
style={{ width: 150 }}
value={value?.id}
onChange={onDatabaseChange}
>
{
datasources?.map((item, index) => {
let extra = '';
if (item.cnName) {
extra = extra.concat(`中文名称:${item.cnName}`);
}
if (item.remark) {
if (extra.length > 0) {
extra = extra.concat(' ');
}
extra = extra.concat(`描述: ${item.remark})`);
}
if (extra.length > 0) {
extra = `(${extra})`;
}
return (
<Option key={index} value={item.id}>{item.name}</Option>
<Option key={index} value={item.id}>{`${item.name}${extra}`}</Option>
);
})
}
......@@ -51,9 +67,7 @@ const UpdateDatasourceModal = (props) => {
const {env} = useContext(AppContext);
useEffect(() => {
if (visible) {
reset();
getAllSupportedDatasourceTypies();
}
......
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