Commit 0f78ff1c by zhaochengxiang

bug fix

parent 06237d5a
...@@ -291,7 +291,7 @@ const DDLDetail = ({ config, setConfig }) => { ...@@ -291,7 +291,7 @@ const DDLDetail = ({ config, setConfig }) => {
if (config?.easyDataModelerDataModelId) { if (config?.easyDataModelerDataModelId) {
getVersions() getVersions()
} }
}, [config?.easyDataModelerDataModelId]) }, [config?.alertDLL, config?.easyDataModelerDataModelId])
React.useEffect(() => { React.useEffect(() => {
if ((config?.alertDLL&&config?.leftVersionId&&config?.rightVersionId) if ((config?.alertDLL&&config?.leftVersionId&&config?.rightVersionId)
...@@ -300,29 +300,6 @@ const DDLDetail = ({ config, setConfig }) => { ...@@ -300,29 +300,6 @@ const DDLDetail = ({ config, setConfig }) => {
} }
}, [config?.alertDLL, config?.dbType, config?.leftVersionId, config?.rightVersionId, config?.ddlFilter]) }, [config?.alertDLL, config?.dbType, config?.leftVersionId, config?.rightVersionId, config?.ddlFilter])
React.useEffect(() => {
if (config?.alertDLL) {
//增量
if ((versions??[]).length > 1) {
setIncVersions((versions??[]).slice(0, 1))
setConfig?.({
...config,
leftVersionId: versions[1].id,
rightVersionId: versions[0].id,
})
}
} else {
//全量
if ((versions??[]).length > 0) {
setConfig?.({
...config,
leftVersionId: versions[0].id,
rightVersionId: null,
})
}
}
}, [versions, config?.alertDLL])
const getVersions = () => { const getVersions = () => {
setLoadingVersions(true) setLoadingVersions(true)
setVersions() setVersions()
...@@ -347,6 +324,27 @@ const DDLDetail = ({ config, setConfig }) => { ...@@ -347,6 +324,27 @@ const DDLDetail = ({ config, setConfig }) => {
newData.push({ ...item, name }) newData.push({ ...item, name })
} }
setVersions(newData) setVersions(newData)
if (config?.alertDLL) {
//增量
if ((newData??[]).length > 1) {
setIncVersions((newData??[]).slice(0, 1))
setConfig?.({
...config,
leftVersionId: newData[1].id,
rightVersionId: newData[0].id,
})
}
} else {
//全量
if ((newData??[]).length > 0) {
setConfig?.({
...config,
leftVersionId: newData[0].id,
rightVersionId: null,
})
}
}
}, },
error: () => { error: () => {
setLoadingVersions(false) setLoadingVersions(false)
......
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