Commit ce8a7960 by zhaochengxiang

bug fix

parent 171f2f2c
...@@ -589,7 +589,7 @@ const ImportAction = React.forwardRef((props, ref) => { ...@@ -589,7 +589,7 @@ const ImportAction = React.forwardRef((props, ref) => {
setActiveValue(val); setActiveValue(val);
var targetElement = container?.querySelector(`.${val}`); // 找到目标元素 var targetElement = container?.querySelector(`.${val}`); // 找到目标元素
if (targetElement) { if (targetElement) {
importActionSubject.next({ type: 'expand', key: val }) importActionSubject.next({ type: 'expand', key: val, action })
setTimeout(() => { setTimeout(() => {
animating.current = true; animating.current = true;
targetElement.scrollIntoView(); targetElement.scrollIntoView();
...@@ -619,6 +619,7 @@ const ImportAction = React.forwardRef((props, ref) => { ...@@ -619,6 +619,7 @@ const ImportAction = React.forwardRef((props, ref) => {
onChange={onHeaderChange} onChange={onHeaderChange}
terms={terms} terms={terms}
supportedPartitionTypes={supportedPartitionTypes} supportedPartitionTypes={supportedPartitionTypes}
action={action}
/> />
<ImportActionTable <ImportActionTable
modelerData={modelerData||{}} modelerData={modelerData||{}}
...@@ -641,11 +642,13 @@ const ImportAction = React.forwardRef((props, ref) => { ...@@ -641,11 +642,13 @@ const ImportAction = React.forwardRef((props, ref) => {
onChange={onIndexChange} onChange={onIndexChange}
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'} editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'}
terms={terms} terms={terms}
action={action}
/> />
<ImportActionManage <ImportActionManage
form={form} form={form}
modelerData={modelerData||{}} modelerData={modelerData||{}}
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'} editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'}
action={action}
/> />
<ImportActionRelation <ImportActionRelation
modelerData={modelerData} action={action} modelerData={modelerData} action={action}
...@@ -653,6 +656,7 @@ const ImportAction = React.forwardRef((props, ref) => { ...@@ -653,6 +656,7 @@ const ImportAction = React.forwardRef((props, ref) => {
{ {
modelerData?.id && <ImportActionComment modelerData?.id && <ImportActionComment
modelerData={modelerData} modelerData={modelerData}
action={action}
/> />
} }
</div> </div>
......
...@@ -8,7 +8,7 @@ import './ImportActionComment.less' ...@@ -8,7 +8,7 @@ import './ImportActionComment.less'
import { importActionSubject } from "./ImportAction" import { importActionSubject } from "./ImportAction"
const FC = (props) => { const FC = (props) => {
const { modelerData } = props const { modelerData, action } = props
const [isCollapse, setCollapse] = React.useState(true) const [isCollapse, setCollapse] = React.useState(true)
const [uploading, setUploading] = React.useState(false) const [uploading, setUploading] = React.useState(false)
const [fileList, setFileList] = React.useState() const [fileList, setFileList] = React.useState()
...@@ -18,7 +18,7 @@ const FC = (props) => { ...@@ -18,7 +18,7 @@ const FC = (props) => {
React.useEffect(() => { React.useEffect(() => {
const $importActionSubject = importActionSubject.subscribe((props) => { const $importActionSubject = importActionSubject.subscribe((props) => {
if (props.type === 'expand' && props.key === 'model-import-action-comment') { if (props.type === 'expand' && props.key === 'model-import-action-comment' && props.action === action) {
setCollapse(false) setCollapse(false)
} }
}) })
...@@ -26,7 +26,7 @@ const FC = (props) => { ...@@ -26,7 +26,7 @@ const FC = (props) => {
return () => { return () => {
$importActionSubject.unsubscribe() $importActionSubject.unsubscribe()
} }
}, []) }, [action])
React.useEffect(() => { React.useEffect(() => {
if (modelerData?.id) { if (modelerData?.id) {
......
...@@ -50,7 +50,7 @@ const dataTypeRemark = '描述ETL框架中目标表的数据类型'; ...@@ -50,7 +50,7 @@ const dataTypeRemark = '描述ETL框架中目标表的数据类型';
const bindingLoadRemark = '描述ETL框架绑定加载列表,如chain、daily、current等'; const bindingLoadRemark = '描述ETL框架绑定加载列表,如chain、daily、current等';
const ImportActionHeader = (props) => { const ImportActionHeader = (props) => {
const { editable, form, modelerData, constraints, templates, onConstraintChange, onTemplateChange, validateReports, onChange, terms, supportedPartitionTypes } = props; const { editable, form, modelerData, constraints, templates, onConstraintChange, onTemplateChange, validateReports, onChange, terms, supportedPartitionTypes, action } = props;
const [ options, setOptions ] = useState([]); const [ options, setOptions ] = useState([]);
...@@ -64,7 +64,7 @@ const ImportActionHeader = (props) => { ...@@ -64,7 +64,7 @@ const ImportActionHeader = (props) => {
useEffect(() => { useEffect(() => {
const $importActionSubject = importActionSubject.subscribe((props) => { const $importActionSubject = importActionSubject.subscribe((props) => {
if (props.type === 'expand' && props.key === 'model-import-action-technical') { if (props.type === 'expand' && props.key === 'model-import-action-technical' && props.action === action) {
setCollapse(false) setCollapse(false)
} }
}) })
...@@ -72,7 +72,7 @@ const ImportActionHeader = (props) => { ...@@ -72,7 +72,7 @@ const ImportActionHeader = (props) => {
return () => { return () => {
$importActionSubject.unsubscribe() $importActionSubject.unsubscribe()
} }
}, []) }, [action])
useEffect(() => { useEffect(() => {
getDataTypeList(); getDataTypeList();
......
...@@ -340,7 +340,7 @@ const DragableBodyRow = ({ index, moveRow, className, style, ...restProps }) => ...@@ -340,7 +340,7 @@ const DragableBodyRow = ({ index, moveRow, className, style, ...restProps }) =>
}; };
const ImportActionIndex = (props) => { const ImportActionIndex = (props) => {
const { modelerData, onChange, editable, constraint, template, validateReports, terms, types } = props; const { modelerData, onChange, editable, constraint, template, validateReports, terms, types, action } = props;
const [ attributes, setAttributes ] = useState([]); const [ attributes, setAttributes ] = useState([]);
const [ data, setData ] = useState([]); const [ data, setData ] = useState([]);
...@@ -369,7 +369,7 @@ const ImportActionIndex = (props) => { ...@@ -369,7 +369,7 @@ const ImportActionIndex = (props) => {
useEffect(() => { useEffect(() => {
const $importActionSubject = importActionSubject.subscribe((props) => { const $importActionSubject = importActionSubject.subscribe((props) => {
if (props.type === 'expand' && props.key === 'model-import-action-index') { if (props.type === 'expand' && props.key === 'model-import-action-index' && props.action === action) {
setCollapse(false) setCollapse(false)
} }
}) })
...@@ -377,7 +377,7 @@ const ImportActionIndex = (props) => { ...@@ -377,7 +377,7 @@ const ImportActionIndex = (props) => {
return () => { return () => {
$importActionSubject.unsubscribe() $importActionSubject.unsubscribe()
} }
}, []) }, [action])
useClickAway(() => { useClickAway(() => {
save(); save();
......
...@@ -9,13 +9,13 @@ import { importActionSubject } from './ImportAction'; ...@@ -9,13 +9,13 @@ import { importActionSubject } from './ImportAction';
export const ImportActionHeaderSubject = new Subject(); export const ImportActionHeaderSubject = new Subject();
const FC = (props) => { const FC = (props) => {
const { editable, form, modelerData } = props const { editable, form, modelerData, action } = props
const [isCollapse, setCollapse] = React.useState(true) const [isCollapse, setCollapse] = React.useState(true)
const [maintenanceRecords, setMaintenanceRecords] = React.useState() const [maintenanceRecords, setMaintenanceRecords] = React.useState()
React.useEffect(() => { React.useEffect(() => {
const $importActionSubject = importActionSubject.subscribe((props) => { const $importActionSubject = importActionSubject.subscribe((props) => {
if (props.type === 'expand' && props.key === 'model-import-action-manage') { if (props.type === 'expand' && props.key === 'model-import-action-manage' && props.action === action) {
setCollapse(false) setCollapse(false)
} }
}) })
...@@ -23,7 +23,7 @@ const FC = (props) => { ...@@ -23,7 +23,7 @@ const FC = (props) => {
return () => { return () => {
$importActionSubject.unsubscribe() $importActionSubject.unsubscribe()
} }
}, []) }, [action])
React.useEffect(() => { React.useEffect(() => {
if (modelerData?.id) { if (modelerData?.id) {
......
...@@ -15,7 +15,7 @@ const FC = (props) => { ...@@ -15,7 +15,7 @@ const FC = (props) => {
React.useEffect(() => { React.useEffect(() => {
const $importActionSubject = importActionSubject.subscribe((props) => { const $importActionSubject = importActionSubject.subscribe((props) => {
if (props.type === 'expand' && props.key === 'model-import-action-relation') { if (props.type === 'expand' && props.key === 'model-import-action-relation' && props.action === action) {
setCollapse(false) setCollapse(false)
} }
}) })
...@@ -23,7 +23,7 @@ const FC = (props) => { ...@@ -23,7 +23,7 @@ const FC = (props) => {
return () => { return () => {
$importActionSubject.unsubscribe() $importActionSubject.unsubscribe()
} }
}, []) }, [action])
React.useEffect(() => { React.useEffect(() => {
if (modelerData?.inheritedFromEasyDataModelerDataModel) { if (modelerData?.inheritedFromEasyDataModelerDataModel) {
......
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