Commit f966f357 by zhaochengxiang

支持hive

parent ef3e32e8
......@@ -100,7 +100,7 @@ const ImportActionHeader = (props) => {
//分桶字段
const distributionBucketDescription = useMemo(() => {
if (modelerData && modelerData.distributionKey) {
if (modelerData && modelerData.distributionKey && modelerData.distributionKey.bucketCount) {
const keyNamesString = (modelerData.distributionKey.keys??[]).map(item => item.name).toString()
return `${keyNamesString} 分桶数${modelerData.distributionKey.bucketCount}`
}
......@@ -407,6 +407,24 @@ const ImportActionHeader = (props) => {
label="分桶字段"
name="distributionKey"
style={{ marginBottom }}
rules={[
{
required: true,
validator: (_, value) => {
if ((value?.keys??[]).length >0) {
if (value?.bucketCount === 0) {
return Promise.reject(new Error('分桶数不能为0'));
} else if (!value?.bucketCount) {
return Promise.reject(new Error('请输入分桶数'));
}
}
if (value?.bucketCount && (value?.keys??[]).length===0) {
return Promise.reject(new Error('请选择字段名称'));
}
return Promise.resolve();
}
},
]}
>
{
editable ? <DistributionBucketItem modelerData={modelerData} /> : <span className='word-wrap'>{highlightSearchContentByTerms(distributionBucketDescription, terms)}</span>
......@@ -896,7 +914,11 @@ const DistributionBucketItem = ({ value, modelerData, onChange, ...restProps })
const onAttributeChange = (value) => {
const newKeys = (modelerData?.easyDataModelerDataModelAttributes||[]).filter(attribute => (value||[]).indexOf(attribute.iid)!==-1);
triggerChange({ keys: newKeys });
if ((newKeys??[]).length === 0) {
triggerChange({ keys: newKeys, bucketCount: null });
} else {
triggerChange({ keys: newKeys });
}
}
const onBucketChange = (e) => {
......@@ -914,7 +936,7 @@ const DistributionBucketItem = ({ value, modelerData, onChange, ...restProps })
return (
<Row gutter={10}>
<Col span={12}>
<Col span={(value?.keys??[]).length>0?12:24}>
<Select
onChange={(val) => {
onAttributeChange(val)
......@@ -930,14 +952,16 @@ const DistributionBucketItem = ({ value, modelerData, onChange, ...restProps })
}
</Select>
</Col>
<Col span={12}>
<Input
onChange={onBucketChange}
value={value.bucketCount}
style={{ width: '100%' }}
placeholder='分桶数'
/>
</Col>
{
(value?.keys??[]).length>0 && <Col span={12}>
<Input
onChange={onBucketChange}
value={value.bucketCount}
style={{ width: '100%' }}
placeholder='分桶数'
/>
</Col>
}
</Row>
);
}
......
......@@ -131,7 +131,7 @@ export const DatatypeInput = ({ value = {}, datatypes = [], onChange }) => {
onChange={(e) => {
onParameterValuesChange(e, index);
}}
value={value.parameterValues[index] || ''}
value={value.parameterValues[index]}
style={{ width: '100%' }}
placeholder={parameterCnName}
/>
......
......@@ -12,9 +12,9 @@ import { isSzseEnv } from '../../../../util';
const importModes = [
{ name: '快速创建', key: 'excel-copy' },
{ name: '空白创建', key: 'no-condition' },
{ name: 'Word导入', key: 'word' },
{ name: 'Excel导入', key: 'excel' },
{ name: 'DDL导入', key: 'ddl' },
// { name: 'Word导入', key: 'word' },
// { name: 'Excel导入', key: 'excel' },
// { name: 'DDL导入', key: 'ddl' },
]
const ImportModal = (props) => {
......
......@@ -478,7 +478,7 @@ const ModelTree = (props) => {
borderBottom: "1px solid #EFEFEF",
height: 57,
alignItems: 'center',
justifyContent: (viewSelectedKey==='dir')?'space-between':'',
// justifyContent: (viewSelectedKey==='dir')?'space-between':'',
}}
>
<Dropdown overlay={exportMenu} placement="bottomLeft">
......@@ -489,39 +489,39 @@ const ModelTree = (props) => {
{
viewSelectedKey==='dir' && (
<Tooltip title="新增目录" className='ml-2'>
<Tooltip title="新增目录" className='ml-5'>
<PlusOutlined className='default' onClick={add} style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip>
)
}
{
viewSelectedKey==='dir' && (
<Tooltip title="存量模型导入" className='ml-2'>
<ImportOutlined className='default' onClick={() => { importStockModel && importStockModel() }} style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip>
)
// viewSelectedKey==='dir' && (
// <Tooltip title="存量模型导入" className='ml-2'>
// <ImportOutlined className='default' onClick={() => { importStockModel && importStockModel() }} style={{ fontSize:16,cursor:'pointer' }} />
// </Tooltip>
// )
}
<Tooltip title="刷新目录" className='ml-2'>
<Tooltip title="刷新目录" className='ml-5'>
<Button type='text' icon={<ReloadOutlined className='default' />} size='small' onClick={refresh} />
</Tooltip>
{
(viewSelectedKey==='dir') && !isSetRootId && (
<Dropdown overlay={syncMenu} placement="bottomLeft">
<Tooltip title="同步目录">
<SyncOutlined className='default ml-2' style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip>
</Dropdown>
)
// (viewSelectedKey==='dir') && !isSetRootId && (
// <Dropdown overlay={syncMenu} placement="bottomLeft">
// <Tooltip title="同步目录">
// <SyncOutlined className='default ml-2' style={{ fontSize:16,cursor:'pointer' }} />
// </Tooltip>
// </Dropdown>
// )
}
{
(viewSelectedKey==='dir') && isSetRootId && (
<Tooltip title="同步目录" className='ml-2'>
<Button type='text' icon={<SyncOutlined className='default' />} size='small' onClick={sync} />
</Tooltip>
)
// (viewSelectedKey==='dir') && isSetRootId && (
// <Tooltip title="同步目录" className='ml-2'>
// <Button type='text' icon={<SyncOutlined className='default' />} size='small' onClick={sync} />
// </Tooltip>
// )
}
</div>
}
......
......@@ -647,11 +647,11 @@ class Model extends React.Component {
{
(currentView!=='requirement') && <React.Fragment>
<Space>
{/* <Space>
<Tooltip title={(selectModelerIds||[]).length===0?'请先选择模型':''}>
<Button onClick={this.onExportOtherBtnClick} disabled={(selectModelerIds||[]).length===0}>导出</Button>
</Tooltip>
</Space>
</Space> */}
<Space>
<Tooltip title={startFlowTip}>
......
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