Commit 0b5a1d41 by zhaochengxiang

代理数据源信息

parent e2b9d6fe
...@@ -18,14 +18,30 @@ const ProxyDatasourceItem = ({ value = {}, datasources = [], onChange }) => { ...@@ -18,14 +18,30 @@ const ProxyDatasourceItem = ({ value = {}, datasources = [], onChange }) => {
return ( return (
<Select <Select
value={value} value={value?.id}
style={{ width: 150 }}
onChange={onDatabaseChange} onChange={onDatabaseChange}
> >
{ {
datasources?.map((item, index) => { 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 ( 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) => { ...@@ -51,9 +67,7 @@ const UpdateDatasourceModal = (props) => {
const {env} = useContext(AppContext); const {env} = useContext(AppContext);
useEffect(() => { useEffect(() => {
if (visible) { if (visible) {
reset(); reset();
getAllSupportedDatasourceTypies(); 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