Commit b1dd0b6a by zhaochengxiang

bug fix

parent dbe0e74f
......@@ -731,6 +731,10 @@ const Range = React.forwardRef(function ({ type, task }, ref) {
},
}), [ranges, isAdding])
React.useEffect(() => {
setRanges(task?.jobCatalogItems)
}, [task])
const onAddClick = () => {
if (isAdding) return
......@@ -750,7 +754,6 @@ const Range = React.forwardRef(function ({ type, task }, ref) {
...rows.metadataRange,
}]
console.log('newRanges', newRanges)
setRanges(newRanges)
rangesRef.current = newRanges
......@@ -854,6 +857,10 @@ const Strategy = React.forwardRef(function ({ type, task }, ref) {
}), [tableData, editingKey])
React.useEffect(() => {
setTableData(task?.strategyItemPropertyTypes)
}, [task])
React.useEffect(() => {
setSelectablePropertyTypes(
(propertyTypes??[]).filter(item =>
(tableData??[]).map(_item => _item.modelType?.name).indexOf(item.modelType?.name)===-1 || item.modelType?.name === editingKey
......@@ -1209,6 +1216,7 @@ const ScheduleForm = React.forwardRef(function ({ type, task }, ref) {
React.useEffect(() => {
if (task?.jobSchedule) {
setScheduleEnable(task?.jobSchedule?.active)
form?.setFieldsValue(task?.jobSchedule)
}
}, [task])
......@@ -1332,7 +1340,7 @@ const CronItem = ({ value, onChange }) => {
React.useEffect(() => {
if (value) {
setCycleKey(value?.cycleType)
setCronSelectedKeys((value?.list??[]).map(item => item.itemType))
setCronSelectedKeys((value?.selectList??[]).map(item => item.itemType))
} else {
setCycleKey()
setCronSelectedKeys()
......@@ -1376,7 +1384,7 @@ const CronItem = ({ value, onChange }) => {
let newValue = null
if (index !== -1) {
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)
......
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