Commit 9c1212d2 by zhaochengxiang

模型问题

parent 2b13e598
...@@ -308,4 +308,12 @@ export function* getMaintenanceRecords(payload) { ...@@ -308,4 +308,12 @@ export function* getMaintenanceRecords(payload) {
export function* getSystemAllGraph(payload) { export function* getSystemAllGraph(payload) {
return yield call(metadataService.getSystemAllGraph, payload); return yield call(metadataService.getSystemAllGraph, payload);
}
export function* dataTypeList() {
return yield call(datamodelerService.dataTypeList);
}
export function* bindingLoadRangeList(payload) {
return yield call(datamodelerService.bindingLoadRangeList, payload);
} }
\ No newline at end of file
...@@ -261,3 +261,10 @@ export function autoCreateTable(payload) { ...@@ -261,3 +261,10 @@ export function autoCreateTable(payload) {
return PostJSON("/metadataharvester/datasource/createTableByDDLList", payload); return PostJSON("/metadataharvester/datasource/createTableByDDLList", payload);
} }
export function dataTypeList() {
return GetJSON("/datamodeler/easyDataModelerDataType/dataTypeList");
}
export function bindingLoadRangeList(payload) {
return GetJSON("/datamodeler/easyDataModelerDataType/bindingLoadRangeList", payload);
}
\ No newline at end of file
...@@ -93,12 +93,14 @@ const ImportAction = (props) => { ...@@ -93,12 +93,14 @@ const ImportAction = (props) => {
dispatch({ dispatch({
type: 'datamodel.getDraft', type: 'datamodel.getDraft',
payload: { payload: {
params: {
dataCatalogId: catalogId,
},
data: { data: {
hints: _hints, hints: _hints,
modelerModelingConstraint: _constraint, modelerModelingConstraint: _constraint,
easyDataModelerModelingTemplate: _template, easyDataModelerModelingTemplate: _template,
dataCatalogId: catalogId, }
}
}, },
callback: data => { callback: data => {
setLoading(false); setLoading(false);
...@@ -262,14 +264,16 @@ const ImportAction = (props) => { ...@@ -262,14 +264,16 @@ const ImportAction = (props) => {
getConsult(newModelerData); getConsult(newModelerData);
} }
const onTemplateChange = (value) => { const onTemplateChange = (value, isCustom = false) => {
let currentTemplate = null; let currentTemplate = null;
(templates||[]).forEach((_template, index) => { if (!isCustom) {
if (_template.cnName === value) { (templates||[]).forEach((_template, index) => {
currentTemplate = _template; if (_template.cnName === value) {
} currentTemplate = _template;
}); }
});
}
form.setFieldsValue({ form.setFieldsValue({
easyDataModelerModelingTemplate: currentTemplate||{}, easyDataModelerModelingTemplate: currentTemplate||{},
......
...@@ -58,8 +58,8 @@ const etlTableTypeData = { ...@@ -58,8 +58,8 @@ const etlTableTypeData = {
full: ['chain', 'daily', 'current', 'chain,current', 'daily,current', 'chain,daily,current'], full: ['chain', 'daily', 'current', 'chain,current', 'daily,current', 'chain,daily,current'],
change: ['chain', 'current', 'chain,current', 'daily,current', 'chain,daily,current'], change: ['chain', 'current', 'chain,current', 'daily,current', 'chain,daily,current'],
}; };
const etlTableTypeRemark = '描述ETL框架中目标表的数据类型'; const dataTypeRemark = '描述ETL框架中目标表的数据类型';
const etlLoadRemark = '描述ETL框架绑定加载列表,如chain、daily、current等'; const bindingLoadRemark = '描述ETL框架绑定加载列表,如chain、daily、current等';
const ConstraintSelect = ({ value = {}, constraints = [], onChange, ...restProps }) => { const ConstraintSelect = ({ value = {}, constraints = [], onChange, ...restProps }) => {
...@@ -105,11 +105,13 @@ const TemplateSelect = ({ value = '', modelerData = undefined, templates = [], o ...@@ -105,11 +105,13 @@ const TemplateSelect = ({ value = '', modelerData = undefined, templates = [], o
allowClear allowClear
defaultValue={modelerData?.tableType} defaultValue={modelerData?.tableType}
onChange={(val) => { onChange={(val) => {
onChange?.(val); onChange?.(val, true);
}} }}
style={{ flex: 1 }} style={{ flex: 1 }}
/> : <Select /> : <Select
onChange={onChange} onChange={(val) => {
onChange?.(val);
}}
defaultValue={value || undefined} defaultValue={value || undefined}
placeholder='请选择数据表类型' placeholder='请选择数据表类型'
allowClear allowClear
...@@ -366,6 +368,15 @@ const ImportActionHeader = (props) => { ...@@ -366,6 +368,15 @@ const ImportActionHeader = (props) => {
const [ autoTranslate, setAutoTranslate ] = useState(false); const [ autoTranslate, setAutoTranslate ] = useState(false);
const [ onlyShowRequireChange, setOnlyShowRequireChange ] = useState(true); const [ onlyShowRequireChange, setOnlyShowRequireChange ] = useState(true);
const [ maintenanceRecords, setMaintenanceRecords ] = useState(null); const [ maintenanceRecords, setMaintenanceRecords ] = useState(null);
const [ dataTypeList, setDataTypeList ] = useState(null);
const [ bindingLoadRangeList, setBindingLoadRangeList ] = useState(null);
useEffect(() => {
getDataTypeList();
if (modelerData?.dataType) {
getBindingLoadRangeList(modelerData?.dataType);
}
}, [])
useEffect(() => { useEffect(() => {
...@@ -507,6 +518,27 @@ const ImportActionHeader = (props) => { ...@@ -507,6 +518,27 @@ const ImportActionHeader = (props) => {
}) })
} }
const getDataTypeList = () => {
dispatch({
type: 'datamodel.dataTypeList',
callback: data => {
setDataTypeList(data);
}
})
}
const getBindingLoadRangeList = (dataTypeName) => {
dispatch({
type: 'datamodel.bindingLoadRangeList',
payload: {
dataTypeName
},
callback: data => {
setBindingLoadRangeList(data);
}
})
}
const onSearch = (searchText) => { const onSearch = (searchText) => {
const _searchText = searchText.replace(/ /g,''); const _searchText = searchText.replace(/ /g,'');
...@@ -571,6 +603,14 @@ const ImportActionHeader = (props) => { ...@@ -571,6 +603,14 @@ const ImportActionHeader = (props) => {
} }
}) })
} }
} else if (changedValues.hasOwnProperty('dataType')) {
if (changedValues.dataType) {
getBindingLoadRangeList(changedValues.dataType);
onChange?.({...changedValues, bindingLoadRange: ''}, {...allValues, bindingLoadRange: ''});
} else {
setBindingLoadRangeList([]);
onChange?.({...changedValues, bindingLoadRange: ''}, {...allValues, bindingLoadRange: ''});
}
} }
} }
...@@ -690,21 +730,21 @@ const ImportActionHeader = (props) => { ...@@ -690,21 +730,21 @@ const ImportActionHeader = (props) => {
<AttributesSelect modelerData={modelerData} /> <AttributesSelect modelerData={modelerData} />
</Form.Item> </Form.Item>
</Col> </Col>
{/* <Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
<Form.Item <Form.Item
label="数据类型" label="数据类型"
name="" name="dataType"
tooltip={etlTableTypeRemark} tooltip={dataTypeRemark}
> >
<Select allowClear placeholder='请选择数据类型'> <Select allowClear placeholder='请选择数据类型'>
{ {
Object.keys(etlTableTypeData).map((item, index) => <Option key={index} value={item}> dataTypeList?.map((item, index) => <Option key={index} value={item}>
{item} {item}
</Option>) </Option>)
} }
</Select> </Select>
</Form.Item> </Form.Item>
</Col> */} </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
<Form.Item <Form.Item
label="更新时间" label="更新时间"
...@@ -721,21 +761,21 @@ const ImportActionHeader = (props) => { ...@@ -721,21 +761,21 @@ const ImportActionHeader = (props) => {
<PartitionSelect modelerData={modelerData} partitionTypes={supportedPartitionTypes} /> <PartitionSelect modelerData={modelerData} partitionTypes={supportedPartitionTypes} />
</Form.Item> </Form.Item>
</Col> </Col>
{/* <Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
<Form.Item <Form.Item
label="绑定加载范围" label="绑定加载范围"
name="" name="bindingLoadRange"
tooltip={etlLoadRemark} tooltip={bindingLoadRemark}
> >
<Select allowClear placeholder='请选择绑定加载范围'> <Select allowClear placeholder='请选择绑定加载范围'>
{ {
// Object.keys(etlTableTypeData).map((item, index) => <Option key={index} value={item}> bindingLoadRangeList?.map((item, index) => <Option key={index} value={item}>
// {item} {item}
// </Option>) </Option>)
} }
</Select> </Select>
</Form.Item> </Form.Item>
</Col> */} </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
<Form.Item <Form.Item
label="维护历史" label="维护历史"
...@@ -797,10 +837,10 @@ const ImportActionHeader = (props) => { ...@@ -797,10 +837,10 @@ const ImportActionHeader = (props) => {
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>数据平台</div>} >{highlightSearchContentByTerms(modelerData.dataResidence||'', terms)}</Descriptions.Item> <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>数据平台</div>} >{highlightSearchContentByTerms(modelerData.dataResidence||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>数据情况</div>} >{highlightSearchContentByTerms(modelerData.dataCircumstances||'', terms)}</Descriptions.Item> <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>数据情况</div>} >{highlightSearchContentByTerms(modelerData.dataCircumstances||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>分布键</div>} >{highlightSearchContentByTerms(distributionDescription||'', terms)}</Descriptions.Item> <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>分布键</div>} >{highlightSearchContentByTerms(distributionDescription||'', terms)}</Descriptions.Item>
{/* <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>数据类型</div>} ></Descriptions.Item> */} <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>数据类型</div>} >{highlightSearchContentByTerms(modelerData.dataType||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>更新时间</div>} >{highlightSearchContentByTerms(modelerData.dataUpdatingTiming||'', terms)}</Descriptions.Item> <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>更新时间</div>} >{highlightSearchContentByTerms(modelerData.dataUpdatingTiming||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>分区键</div>} >{highlightSearchContentByTerms(partitionsDescription||'', terms)}</Descriptions.Item> <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>分区键</div>} >{highlightSearchContentByTerms(partitionsDescription||'', terms)}</Descriptions.Item>
{/* <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>绑定加载范围</div>} ></Descriptions.Item> */} <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>绑定加载范围</div>} >{highlightSearchContentByTerms(modelerData.bindingLoadRange||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>维护历史</div>} > <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>维护历史</div>} >
<div> <div>
{ {
......
...@@ -70,6 +70,12 @@ class UpdateTreeItemForm extends React.Component { ...@@ -70,6 +70,12 @@ class UpdateTreeItemForm extends React.Component {
> >
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item
label="数据平台"
name="platformInfo"
>
<Input />
</Form.Item>
</Form> </Form>
); );
} }
...@@ -89,12 +95,12 @@ const UpdateTreeItemModal = (props) => { ...@@ -89,12 +95,12 @@ const UpdateTreeItemModal = (props) => {
_action = item ? 'sub' : 'root'; _action = item ? 'sub' : 'root';
} }
form.setFields([{ name: 'name', errors: [] }, { name: 'remark', errors: [] }]); form.setFields([{ name: 'name', errors: [] }, { name: 'remark', errors: [] }, { name: 'platformInfo', errors: [] }]);
if (type === 'add') { if (type === 'add') {
form.setFieldsValue({ action: _action, name: '', remark: '' }); form.setFieldsValue({ action: _action, name: '', remark: '', platformInfo: '' });
} else { } else {
form.setFieldsValue({ action: '', name: item?item.name:'', remark: item?item.remark:'' }); form.setFieldsValue({ action: '', name: item?item.name:'', remark: item?item.remark:'', platformInfo: item?.platformInfo });
} }
} }
//eslint-disable-next-line react-hooks/exhaustive-deps //eslint-disable-next-line react-hooks/exhaustive-deps
...@@ -112,12 +118,14 @@ const UpdateTreeItemModal = (props) => { ...@@ -112,12 +118,14 @@ const UpdateTreeItemModal = (props) => {
payload = { payload = {
name: values.name||'', name: values.name||'',
remark: values.remark||'', remark: values.remark||'',
platformInfo: values.platformInfo||'',
parentId: rootId parentId: rootId
}; };
} else if (type === 'add') { } else if (type === 'add') {
payload = { payload = {
name: values.name||'', name: values.name||'',
remark: values.remark||'', remark: values.remark||'',
platformInfo: values.platformInfo||'',
parentId: item.id parentId: item.id
}; };
} else { } else {
...@@ -125,6 +133,7 @@ const UpdateTreeItemModal = (props) => { ...@@ -125,6 +133,7 @@ const UpdateTreeItemModal = (props) => {
...item, ...item,
name: values.name||'', name: values.name||'',
remark: values.remark||'', remark: values.remark||'',
platformInfo: values.platformInfo||'',
} }
} }
......
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