Unverified Commit a44b08df authored by aiwenmo's avatar aiwenmo Committed by GitHub

[Fix-541] Fix the problem that the datasource && metadata does not set alias

[Fix-541]  Fix the problem that the datasource && metadata does not set alias 
parents 841296da 019eb858
......@@ -31,7 +31,7 @@ const StudioDataBase = (props: any) => {
key: "alias",
sorter: true,
render: (dom, entity) => {
return <a onClick={() => setRow(entity)}>{dom}</a>;
return <a onClick={() => setRow(entity)}>{entity.alias === "" ? entity.name : entity.alias}</a>;
},
}];
};
......@@ -186,7 +186,7 @@ const StudioDataBase = (props: any) => {
const onDeleteDataBase = (record) => {
Modal.confirm({
title: '删除数据源',
content: `确定删除该数据源【${record.alias}】吗?`,
content: `确定删除该数据源【${record.alias === "" ? record.name : record.alias}】吗?`,
okText: '确认',
cancelText: '取消',
onOk: async () => {
......
......@@ -55,9 +55,9 @@ const StudioMetaData = (props: any) => {
};
const getDataBaseOptions = ()=>{
return <>{database.map(({ id, alias, type, enabled }) => (
<Option value={id} label={<><Tag color={enabled ? "processing" : "error"}>{type}</Tag>{alias}</>}>
<Tag color={enabled ? "processing" : "error"}>{type}</Tag>{alias}
return <>{database.map(({ id, name, alias, type, enabled }) => (
<Option value={id} label={<><Tag color={enabled ? "processing" : "error"}>{type}</Tag>{ alias === "" ? name:alias}</>}>
<Tag color={enabled ? "processing" : "error"}>{type}</Tag>{ alias === "" ? name:alias}
</Option>
))}</>
};
......@@ -77,7 +77,7 @@ const StudioMetaData = (props: any) => {
return (
<>
<Select
// style={{width: '100%'}}
style={{width: '90%'}}
placeholder="选择数据源"
optionLabelProp="label"
onChange={onChangeDataBase}
......
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