Commit b1dd0b6a by zhaochengxiang

bug fix

parent dbe0e74f
...@@ -69,7 +69,7 @@ const FC = (props) => { ...@@ -69,7 +69,7 @@ const FC = (props) => {
console.log('rangeRows', rangeRows) console.log('rangeRows', rangeRows)
console.log('strategyRows', strategyRows) console.log('strategyRows', strategyRows)
console.log('scheduleRows', scheduleRows) console.log('scheduleRows', scheduleRows)
if ((rangeRows??[]).length === 0) { if ((rangeRows??[]).length === 0) {
showMessage('warn', '请先填写对比范围') showMessage('warn', '请先填写对比范围')
return return
...@@ -731,6 +731,10 @@ const Range = React.forwardRef(function ({ type, task }, ref) { ...@@ -731,6 +731,10 @@ const Range = React.forwardRef(function ({ type, task }, ref) {
}, },
}), [ranges, isAdding]) }), [ranges, isAdding])
React.useEffect(() => {
setRanges(task?.jobCatalogItems)
}, [task])
const onAddClick = () => { const onAddClick = () => {
if (isAdding) return if (isAdding) return
...@@ -750,7 +754,6 @@ const Range = React.forwardRef(function ({ type, task }, ref) { ...@@ -750,7 +754,6 @@ const Range = React.forwardRef(function ({ type, task }, ref) {
...rows.metadataRange, ...rows.metadataRange,
}] }]
console.log('newRanges', newRanges)
setRanges(newRanges) setRanges(newRanges)
rangesRef.current = newRanges rangesRef.current = newRanges
...@@ -852,6 +855,10 @@ const Strategy = React.forwardRef(function ({ type, task }, ref) { ...@@ -852,6 +855,10 @@ const Strategy = React.forwardRef(function ({ type, task }, ref) {
return tableDataRef.current return tableDataRef.current
}, },
}), [tableData, editingKey]) }), [tableData, editingKey])
React.useEffect(() => {
setTableData(task?.strategyItemPropertyTypes)
}, [task])
React.useEffect(() => { React.useEffect(() => {
setSelectablePropertyTypes( setSelectablePropertyTypes(
...@@ -1209,6 +1216,7 @@ const ScheduleForm = React.forwardRef(function ({ type, task }, ref) { ...@@ -1209,6 +1216,7 @@ const ScheduleForm = React.forwardRef(function ({ type, task }, ref) {
React.useEffect(() => { React.useEffect(() => {
if (task?.jobSchedule) { if (task?.jobSchedule) {
setScheduleEnable(task?.jobSchedule?.active) setScheduleEnable(task?.jobSchedule?.active)
form?.setFieldsValue(task?.jobSchedule)
} }
}, [task]) }, [task])
...@@ -1332,7 +1340,7 @@ const CronItem = ({ value, onChange }) => { ...@@ -1332,7 +1340,7 @@ const CronItem = ({ value, onChange }) => {
React.useEffect(() => { React.useEffect(() => {
if (value) { if (value) {
setCycleKey(value?.cycleType) setCycleKey(value?.cycleType)
setCronSelectedKeys((value?.list??[]).map(item => item.itemType)) setCronSelectedKeys((value?.selectList??[]).map(item => item.itemType))
} else { } else {
setCycleKey() setCycleKey()
setCronSelectedKeys() setCronSelectedKeys()
...@@ -1376,7 +1384,7 @@ const CronItem = ({ value, onChange }) => { ...@@ -1376,7 +1384,7 @@ const CronItem = ({ value, onChange }) => {
let newValue = null let newValue = null
if (index !== -1) { if (index !== -1) {
newValue = cycleTypes[index] newValue = cycleTypes[index]
newValue = {...newValue, list: (newValue.list??[]).filter(item => (prevCronSelectedKeys??[]).indexOf(item.itemType) !== -1) } newValue = {...newValue, selectList: (newValue.list??[]).filter(item => (prevCronSelectedKeys??[]).indexOf(item.itemType) !== -1) }
} }
onChange?.(newValue) onChange?.(newValue)
......
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