Commit bd7d823c by zhaochengxiang

推荐

parent 82c5dcfe
...@@ -1059,7 +1059,8 @@ export const ImportActionTable = (props) => { ...@@ -1059,7 +1059,8 @@ export const ImportActionTable = (props) => {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;支持拖拽方式调整模型字段顺序<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;支持拖拽方式调整模型字段顺序<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;点击表格外部任意位置退出字段编辑状态<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;点击表格外部任意位置退出字段编辑状态<br />
删除: 点击操作列垃圾桶图标删除该字段<br /> 删除: 点击操作列垃圾桶图标删除该字段<br />
保存: 页面右下角保存按钮 保存: 页面右下角保存按钮<br />
中/英文输入框回车键触发推荐浮窗
</span>}> </span>}>
<QuestionCircleOutlined className='pointer' /> <QuestionCircleOutlined className='pointer' />
</Popover> </Popover>
......
...@@ -14,14 +14,21 @@ const FC = (props) => { ...@@ -14,14 +14,21 @@ const FC = (props) => {
const [selectedRows, setSelectedRows] = React.useState() const [selectedRows, setSelectedRows] = React.useState()
const [havaMore, setMore] = React.useState(false) const [havaMore, setMore] = React.useState(false)
const [offset, setOffset] = React.useState(1) const [offset, setOffset] = React.useState(1)
const [animating, setAnimating] = React.useState(false)
React.useEffect(() => { React.useEffect(() => {
getSuggests() if (visible) {
setAnimating(true)
setTimeout(() => {
setAnimating(false)
getSuggests()
}, 300)
}
}, [visible]) }, [visible])
const onSourceClick = (id, name) => { const onSourceClick = (id, name) => {
const timestamp = new Date().getTime(); const timestamp = new Date().getTime();
const tempArray = id.split('='); const tempArray = (id??'').split('=');
if (tempArray.length>=3) { if (tempArray.length>=3) {
dispatch({ dispatch({
...@@ -30,7 +37,7 @@ const FC = (props) => { ...@@ -30,7 +37,7 @@ const FC = (props) => {
id id
}, },
callback: data => { callback: data => {
window.open(`/center-home/metadetail?mid=${encodeURIComponent(data._id)}&action=metadetail&type=detail&manager=false&activekey=1&name=${encodeURIComponent(name||'')}`); window.open(`/center-home/metadetail?mid=${encodeURIComponent(data?._id)}&action=metadetail&type=detail&manager=false&activekey=1&name=${encodeURIComponent(name||'')}`);
} }
}) })
} else { } else {
...@@ -45,8 +52,7 @@ const FC = (props) => { ...@@ -45,8 +52,7 @@ const FC = (props) => {
{ {
title: '中文名称', title: '中文名称',
dataIndex: 'cnName', dataIndex: 'cnName',
width: isSzseEnv?360:160, width: 200,
ellipsis: true,
render: (text, _, __) => { render: (text, _, __) => {
return ( return (
<Tooltip title={text||''}> <Tooltip title={text||''}>
...@@ -58,8 +64,6 @@ const FC = (props) => { ...@@ -58,8 +64,6 @@ const FC = (props) => {
{ {
title: '英文名称', title: '英文名称',
dataIndex: 'name', dataIndex: 'name',
width: isSzseEnv?360:160,
ellipsis: true,
render: (text, _, __) => { render: (text, _, __) => {
return ( return (
<Tooltip title={text||''}> <Tooltip title={text||''}>
...@@ -69,10 +73,29 @@ const FC = (props) => { ...@@ -69,10 +73,29 @@ const FC = (props) => {
} }
}, },
{ {
title: '类型',
dataIndex: 'datatype',
width: 160,
render: (_, record, __) => {
if (record?.datatype) {
if ((record?.datatype?.name==='Char'||record?.datatype?.name==='Varchar') && record?.datatype?.parameterValues?.length>0) {
return `${record?.datatype?.name||''}(${(record?.datatype?.parameterValues[0]?record.datatype.parameterValues[0]:0)})`;
} else if ((record?.datatype?.name==='Decimal'||record?.datatype?.name==='Numeric') && record?.datatype?.parameterValues?.length>1) {
return `${record?.datatype?.name||''}(${(record?.datatype?.parameterValues[0]?record.datatype.parameterValues[0]:0)},${(record?.datatype?.parameterValues[1]?record.datatype.parameterValues[1]:0)})`;
}
return record.datatype.name||'';
}
return '';
}
},
{
title: '业务含义', title: '业务含义',
dataIndex: 'remark', dataIndex: 'remark',
width: isSzseEnv?360:160,
ellipsis: true,
render: (text, _, __) => { render: (text, _, __) => {
return ( return (
<Tooltip title={text||''}> <Tooltip title={text||''}>
...@@ -98,7 +121,6 @@ const FC = (props) => { ...@@ -98,7 +121,6 @@ const FC = (props) => {
title: '使用次数', title: '使用次数',
dataIndex: 'referencesCount', dataIndex: 'referencesCount',
width: 80, width: 80,
ellipsis: true,
render: (_, record) => { render: (_, record) => {
return ( return (
<span>{record.recommendedStats?.referencesCount}</span> <span>{record.recommendedStats?.referencesCount}</span>
...@@ -108,7 +130,6 @@ const FC = (props) => { ...@@ -108,7 +130,6 @@ const FC = (props) => {
{ {
title: '来源', title: '来源',
dataIndex: 'source', dataIndex: 'source',
ellipsis: true,
render: (_, record) => { render: (_, record) => {
return ( return (
<SourceComponent data={record.recommendedStats?.sourceInfos||[]} name={record.name||''} onClick={onSourceClick} /> <SourceComponent data={record.recommendedStats?.sourceInfos||[]} name={record.name||''} onClick={onSourceClick} />
...@@ -159,6 +180,7 @@ const FC = (props) => { ...@@ -159,6 +180,7 @@ const FC = (props) => {
const close = () => { const close = () => {
setLoading(false) setLoading(false)
setAnimating(false)
setSuggests() setSuggests()
setOffset(1) setOffset(1)
setMore(false) setMore(false)
...@@ -196,34 +218,36 @@ const FC = (props) => { ...@@ -196,34 +218,36 @@ const FC = (props) => {
centered destroyOnClose centered destroyOnClose
onCancel={() => { close() }} onCancel={() => { close() }}
> >
<Spin spinning={loading}> {
<Table !animating && <Spin spinning={loading}>
extraColWidth='32px' <Table
size='small' extraColWidth={32}
rowKey='iid' size='small'
dataSource={suggests||[]} rowKey='iid'
columns={cols} dataSource={suggests||[]}
pagination={false} columns={cols}
rowClassName={(record, index) => { pagination={false}
return 'pointer'; rowClassName={(record, index) => {
}} return 'pointer';
onRowClick={(event, record) => { }}
setSelectedRows([record]) onRowClick={(event, record) => {
}} setSelectedRows([record])
rowSelection={{ }}
type: 'radio', rowSelection={{
selectedRowKeys: (selectedRows??[]).map(item => item.iid), type: 'radio',
onChange: (selectedRowKeys, selectedRows) => { selectedRowKeys: (selectedRows??[]).map(item => item.iid),
setSelectedRows(selectedRows) onChange: (selectedRowKeys, selectedRows) => {
}, setSelectedRows(selectedRows)
}} },
/> }}
<div className='flex pt-3' style={{ justifyContent: 'center' }}> />
<Tooltip title={!havaMore?'没有更多推荐字段':''}> <div className='flex pt-3' style={{ justifyContent: 'center' }}>
<Button onClick={getSuggests} disabled={!havaMore} >加载更多</Button> <Tooltip title={!havaMore?'没有更多推荐字段':''}>
</Tooltip> <Button onClick={getSuggests} disabled={!havaMore} >加载更多</Button>
</div> </Tooltip>
</Spin> </div>
</Spin>
}
</Modal> </Modal>
) )
} }
......
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