File tree Expand file tree Collapse file tree
packages/dag/src/components/migration Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -309,6 +309,9 @@ const sourceNodes = computed(() => {
309309 }))
310310})
311311
312+ // 缓存所有历史 syncPoint 设置,防止断线重连后丢失
313+ const syncPointsCache: Record <string , any > = {}
314+
312315const systemTimeZone = computed (() => {
313316 const timeZone = new Date ().getTimezoneOffset () / 60
314317 let systemTimeZone = ' '
@@ -502,15 +505,17 @@ watch(
502505
503506watch (sourceNodes , () => {
504507 const timeZone = systemTimeZone .value
505- const oldPoints = props .settings .syncPoints
506- const oldPointsMap = oldPoints ?.length
507- ? oldPoints .reduce ((map : Record <string , any >, point : any ) => {
508- if (point .nodeId ) map [point .nodeId ] = point
509- return map
510- }, {})
511- : {}
508+
509+ if (props .settings .syncPoints ?.length ) {
510+ props .settings .syncPoints .forEach ((point : any ) => {
511+ if (point .nodeId ) {
512+ syncPointsCache [point .nodeId ] = point
513+ }
514+ })
515+ }
516+
512517 const syncPoints = sourceNodes .value .map ((item : any ) => {
513- const old = oldPointsMap [item .nodeId ]
518+ const old = syncPointsCache [item .nodeId ]
514519 const point = {
515520 ... item ,
516521 timeZone ,
You can’t perform that action at this time.
0 commit comments