const { createGenericGroupConfig, createGenericGroupDialogState, createGenericModbusDialogState, createGenericRegisterChangedData, createGenericRegisterDialogState, findGenericGroup, findGenericRegister, getActiveGenericGroup, getGenericDialogDataTypeState, getGenericOption, getPageState, getSettingsPageState, getTransportPageState, getVisiblePageState, resolveActiveParamView } = require('../../features/private-protocol/params-view-model.js') const { createGenericModbusPoller, genericModbusService } = require('../../features/generic-modbus/index.js') const settingsService = require('../../store/settings-store.js') const themeService = require('../../store/theme-store.js') const transport = require('../../transport/ble-core.js') const { createPageToast } = require('../../utils/page-toast.js') const GENERIC_REGISTER_DRAG_THRESHOLD_PX = 12 const GENERIC_REGISTER_ROW_HEIGHT_RPX = 112 function clampIndex(value, min, max) { return Math.min(Math.max(value, min), max) } function getWindowWidth() { try { if (typeof wx !== 'undefined' && wx && typeof wx.getWindowInfo === 'function') { const info = wx.getWindowInfo() if (info && Number.isFinite(info.windowWidth)) return info.windowWidth } } catch (error) {} try { if (typeof wx !== 'undefined' && wx && typeof wx.getSystemInfoSync === 'function') { const info = wx.getSystemInfoSync() if (info && Number.isFinite(info.windowWidth)) return info.windowWidth } } catch (error) {} return 375 } function rpxToPx(rpx, windowWidth) { return Math.round(Number(rpx || 0) * Number(windowWidth || 375) / 750) } function getFallbackDragRowOffsetPx(windowWidth) { return Math.max(44, rpxToPx(GENERIC_REGISTER_ROW_HEIGHT_RPX, windowWidth)) } function resolveDragTargetIndex(drag, currentY, totalCount) { if (!drag || !Number.isInteger(totalCount) || totalCount <= 0) return 0 const sourceIndex = clampIndex(Number(drag.index) || 0, 0, totalCount - 1) const rowCenters = Array.isArray(drag.rowCenters) ? drag.rowCenters : [] const sourceCenter = Number(rowCenters[sourceIndex]) if (rowCenters.length === totalCount && Number.isFinite(sourceCenter)) { const currentCenter = sourceCenter + (Number(currentY) - Number(drag.startY || currentY)) let targetIndex = sourceIndex if (currentCenter >= sourceCenter) { for (let index = sourceIndex + 1; index < totalCount; index += 1) { if (currentCenter > Number(rowCenters[index])) targetIndex = index } } else { for (let index = sourceIndex - 1; index >= 0; index -= 1) { if (currentCenter < Number(rowCenters[index])) targetIndex = index } } return clampIndex(targetIndex, 0, totalCount - 1) } const rowOffset = Math.max(1, Number(drag.rowOffset) || 1) const step = Math.round((Number(currentY) - Number(drag.startY || currentY)) / rowOffset) return clampIndex(sourceIndex + step, 0, totalCount - 1) } function buildActiveGenericRegisterRows(group, dragState) { if (!group || !Array.isArray(group.registers)) return [] const drag = dragState && dragState.groupId === group.id ? dragState : null const activeIndex = drag ? clampIndex(Number(drag.index) || 0, 0, group.registers.length - 1) : -1 const targetIndex = drag ? clampIndex(Number(drag.targetIndex) || activeIndex, 0, group.registers.length - 1) : -1 const rowOffset = drag ? Math.max(1, Math.round(Number(drag.rowOffset) || 0)) : 0 const translateY = drag ? Math.round(Number(drag.translateY) || 0) : 0 return group.registers.map((register, index) => { const row = { ...register, sourceIndex: index, dragClass: '', dragHandleClass: '', dragStyle: '' } if (!drag) return row const isActive = index === activeIndex let shiftY = 0 if (drag.moved && rowOffset) { if (activeIndex < targetIndex && index > activeIndex && index <= targetIndex) { shiftY = -rowOffset } else if (activeIndex > targetIndex && index >= targetIndex && index < activeIndex) { shiftY = rowOffset } } if (isActive) { row.dragClass = drag.moved ? 'is-dragging' : 'is-drag-armed' row.dragHandleClass = drag.moved ? 'is-dragging' : 'is-drag-armed' row.dragStyle = drag.moved ? `transform: translate3d(0, ${translateY}px, 0) scale(1.02); z-index: 8;` : 'z-index: 3;' return row } if (shiftY) { row.dragClass = shiftY > 0 ? 'is-shift-down' : 'is-shift-up' row.dragStyle = `transform: translate3d(0, ${shiftY}px, 0);` } return row }) } Page({ data: { ...getPageState(), activeParamView: 'genericModbus', activeGenericGroupId: '', activeGenericRegisterRows: [], genericModbusDialog: createGenericModbusDialogState() }, onTabItemTap() { this.backToParamsHome() }, onLoad() { this.pageToast = createPageToast(this, this.data) this.genericModbusPoller = createGenericModbusPoller(() => this.data) this.genericModbusTouchStarts = {} this.genericWindowWidth = getWindowWidth() genericModbusService.init() themeService.init() settingsService.init() this.unsubscribeTheme = themeService.subscribe((themeState) => { this.setData(themeState) }) this.unsubscribeTransport = transport.subscribe((transportState) => { this.setData(getTransportPageState(transportState)) if (transportState.connectedDevice) { setTimeout(() => this.scheduleVisibleGenericAutoReads(), 0) } else { this.clearGenericAutoTimers() } }) this.unsubscribeGenericModbus = genericModbusService.subscribe((genericState) => { const activeGenericGroup = getActiveGenericGroup(genericState.genericModbusGroups, this.data.activeGenericGroupId) this.setData({ ...genericState, activeGenericGroup, activeGenericRegisterRows: buildActiveGenericRegisterRows(activeGenericGroup, this.genericModbusRegisterDrag), activeParamView: this.data.activeParamView === 'genericModbusGroup' && !activeGenericGroup ? 'genericModbus' : this.data.activeParamView }) }) this.unsubscribeSettings = settingsService.subscribe((settingsState) => { const nextState = getSettingsPageState(this.data, settingsState) const activeParamView = nextState.activeParamView const activeGenericGroup = getActiveGenericGroup(this.data.genericModbusGroups, this.data.activeGenericGroupId) const safeActiveView = activeParamView === 'genericModbusGroup' && !activeGenericGroup ? 'genericModbus' : activeParamView this.setData({ ...nextState, activeParamView: safeActiveView, activeGenericGroup, activeGenericRegisterRows: buildActiveGenericRegisterRows(activeGenericGroup, this.genericModbusRegisterDrag) }) if (safeActiveView === 'genericModbus' || safeActiveView === 'genericModbusGroup') { setTimeout(() => this.scheduleVisibleGenericAutoReads(), 0) } else { this.clearGenericAutoTimers() } }) }, onShow() { if (this.pageToast) { this.pageToast.setActive(true) } const pageState = getVisiblePageState(this.data) this.setData({ ...pageState, activeGenericGroup: getActiveGenericGroup(pageState.genericModbusGroups, this.data.activeGenericGroupId), activeGenericRegisterRows: buildActiveGenericRegisterRows( getActiveGenericGroup(pageState.genericModbusGroups, this.data.activeGenericGroupId), this.genericModbusRegisterDrag ) }) this.pageToast.showFromState(pageState) this.scheduleVisibleGenericAutoReads() }, onHide() { if (this.pageToast) { this.pageToast.setActive(false) } this.clearGenericRegisterDrag() this.clearGenericAutoTimers() }, onUnload() { if (this.pageToast) { this.pageToast.destroy() this.pageToast = null } if (this.unsubscribeTheme) { this.unsubscribeTheme() this.unsubscribeTheme = null } if (this.unsubscribeTransport) { this.unsubscribeTransport() this.unsubscribeTransport = null } if (this.unsubscribeGenericModbus) { this.unsubscribeGenericModbus() this.unsubscribeGenericModbus = null } if (this.unsubscribeSettings) { this.unsubscribeSettings() this.unsubscribeSettings = null } this.clearGenericAutoTimers() }, openParamView(event) { if (this.pageToast) this.pageToast.clear() this.closeGenericModbusDraft() this.clearGenericRegisterDrag() const activeParamView = event.currentTarget.dataset.view if (!activeParamView) return this.setData({ activeParamView }) if (activeParamView === 'genericModbus') { setTimeout(() => this.scheduleVisibleGenericAutoReads(), 0) } }, openGenericModbusGroup(event) { const groupId = event.currentTarget.dataset.groupId const group = findGenericGroup(this.data.genericModbusGroups, groupId) if (!group) return if (this.pageToast) this.pageToast.clear() this.closeGenericModbusDraft() this.setData({ activeGenericGroup: group, activeGenericGroupId: groupId, activeParamView: 'genericModbusGroup', activeGenericRegisterRows: buildActiveGenericRegisterRows(group, this.genericModbusRegisterDrag) }) }, backToParamsHome() { if (this.pageToast) this.pageToast.clear() this.closeGenericModbusDraft() this.clearGenericRegisterDrag() this.clearGenericAutoTimers() const activeParamView = resolveActiveParamView('', this.data) this.setData({ activeGenericGroup: null, activeGenericGroupId: '', activeParamView, activeGenericRegisterRows: [] }) if (activeParamView === 'genericModbus') { setTimeout(() => this.scheduleVisibleGenericAutoReads(), 0) } }, noop() {}, updateGenericModbusDialog(changedData) { this.setData({ genericModbusDialog: { ...this.data.genericModbusDialog, ...changedData } }) }, openGenericModbusDraft(event) { const groupId = event && event.currentTarget && event.currentTarget.dataset ? event.currentTarget.dataset.groupId : '' const group = groupId ? findGenericGroup(this.data.genericModbusGroups, groupId) : null this.updateGenericModbusDialog(createGenericGroupDialogState(group)) }, closeGenericModbusDraft() { this.genericModbusGroupLongPressGuard = '' this.genericModbusRegisterLongPressGuard = '' this.updateGenericModbusDialog(createGenericModbusDialogState()) }, onGenericDraftInput(event) { const field = event.currentTarget.dataset.field if (!field) return const value = event.detail.value this.updateGenericModbusDialog({ [field]: value, ...(field === 'structDefinition' ? { parsedStructRegisters: [], structParsedSummary: '' } : {}) }) }, parseGenericStructDefinition() { const dialog = this.data.genericModbusDialog || createGenericModbusDialogState() const sourceText = dialog.structDefinition || '' if (!sourceText.trim()) { if (this.pageToast) this.pageToast.show('请先粘贴结构体定义', 'error') return } const registerType = getGenericOption(this.data.genericModbusRegisterTypeOptions, dialog.registerTypeIndex) if (registerType.key === 'coil' || registerType.key === 'discrete') { if (this.pageToast) this.pageToast.show('结构体解析仅支持寄存器类型', 'error') return } try { const parsed = genericModbusService.parseStructDefinition(sourceText) const inputRegisterIndex = Math.max( 0, this.data.genericModbusRegisterTypeOptions.findIndex((item) => item.key === 'input') ) const inputRegisterType = getGenericOption(this.data.genericModbusRegisterTypeOptions, inputRegisterIndex) this.updateGenericModbusDialog({ groupName: parsed.name || dialog.groupName, parsedStructRegisters: parsed.registers, quantity: String(parsed.registers.length), registerTypeIndex: inputRegisterIndex, registerTypeText: inputRegisterType.label || '', structParsedSummary: `${parsed.structName} · ${parsed.registers.length} 个字段` }) if (this.pageToast) this.pageToast.show('结构体解析完成') } catch (error) { if (this.pageToast) this.pageToast.show(error.message || '结构体解析失败', 'error') } }, onGenericDraftTypeChange(event) { const registerTypeIndex = Number(event.detail.value) const registerType = getGenericOption(this.data.genericModbusRegisterTypeOptions, registerTypeIndex) const clearParsedStruct = registerType.key === 'coil' || registerType.key === 'discrete' this.updateGenericModbusDialog({ ...(clearParsedStruct ? { parsedStructRegisters: [], structParsedSummary: '' } : {}), registerTypeIndex, registerTypeText: registerType.label || '' }) }, onGenericDialogDataTypeChange(event) { const dataTypeIndex = Number(event.detail.value) this.updateGenericModbusDialog(getGenericDialogDataTypeState( this.data.genericModbusDialog, this.data.genericModbusDataTypeOptions, dataTypeIndex )) }, openGenericGroupEdit(event) { const groupId = event.currentTarget.dataset.groupId const group = findGenericGroup(this.data.genericModbusGroups, groupId) if (!group) return this.genericModbusGroupLongPressGuard = groupId this.updateGenericModbusDialog(createGenericGroupDialogState(group)) }, openGenericRegisterInfo(event) { const groupId = event.currentTarget.dataset.groupId const registerIndex = Number(event.currentTarget.dataset.index) const registerKey = `${groupId}:${registerIndex}` if (this.genericModbusRegisterLongPressGuard === registerKey) { this.genericModbusRegisterLongPressGuard = '' return } const { group, register } = findGenericRegister(this.data.genericModbusGroups, groupId, registerIndex) if (!register) return this.updateGenericModbusDialog(createGenericRegisterDialogState('viewRegister', group, register, registerIndex)) }, openGenericRegisterEdit(event) { const groupId = event.currentTarget.dataset.groupId const registerIndex = Number(event.currentTarget.dataset.index) const { group, register } = findGenericRegister(this.data.genericModbusGroups, groupId, registerIndex) if (!register) return this.genericModbusRegisterLongPressGuard = `${groupId}:${registerIndex}` this.updateGenericModbusDialog(createGenericRegisterDialogState('editRegister', group, register, registerIndex)) }, async confirmGenericModbusDialog() { const dialog = this.data.genericModbusDialog || createGenericModbusDialogState() const mode = dialog.mode if (mode === 'createGroup') { const group = genericModbusService.addGroupFromConfig(createGenericGroupConfig(dialog)) if (group) { if (this.pageToast) this.pageToast.show(`${group.name}已添加`) this.closeGenericModbusDraft() this.setData({ activeGenericGroup: group, activeGenericGroupId: group.id, activeParamView: 'genericModbusGroup', activeGenericRegisterRows: buildActiveGenericRegisterRows(group, this.genericModbusRegisterDrag) }) } return } if (mode === 'editGroup') { const group = genericModbusService.updateGroupConfig(dialog.groupId, createGenericGroupConfig(dialog)) if (group) { if (this.pageToast) this.pageToast.show(`${group.name}已更新`) this.closeGenericModbusDraft() if (this.data.activeGenericGroupId === group.id) { this.setData({ activeGenericGroup: group, activeGenericRegisterRows: buildActiveGenericRegisterRows(group, this.genericModbusRegisterDrag) }) } } return } if (mode === 'editRegister') { const changedData = createGenericRegisterChangedData(dialog, this.data.genericModbusDataTypeOptions) genericModbusService.updateRegister(dialog.groupId, dialog.registerIndex, changedData) if (this.pageToast) this.pageToast.show(`${dialog.name || '寄存器'}已更新`) this.closeGenericModbusDraft() } }, async importGenericModbusJson() { const count = await genericModbusService.importJsonFromMessageFile() if (count && this.pageToast) this.pageToast.show(`已导入 ${count} 个寄存器组`) }, async syncGenericModbusGroups() { if (this.data.isGenericProtocol) return if (!this.data.connectedDevice) return const result = await genericModbusService.queryCodeInfoBlock({ maxPacketLength: this.data.genericModbusMaxPacketLength }) if (result && result.ok && this.pageToast) { const addressText = Number(result.address || 0).toString(16).toUpperCase().padStart(4, '0') const addedCount = Number(result.addedGroups || 0) + Number(result.addedRegisters || 0) const updatedCount = Number(result.updatedGroups || 0) + Number(result.updatedRegisters || 0) const changedText = [ addedCount ? `新增 ${addedCount}` : '', updatedCount ? `更新 ${updatedCount}` : '' ].filter(Boolean).join(',') this.pageToast.show(`同步完成 0x${addressText},${result.structCount} 项${changedText ? `,${changedText}` : ''}`) } }, async completeGenericModbusStructs() { const result = await genericModbusService.completeStructInstanceGroupsWithStructFile() if (result && result.completedCount && this.pageToast) { this.pageToast.show(`已补全 ${result.completedCount} 个寄存器组`) } }, toggleGenericModbusPolling() { if (this.data.isPrivateProtocol && !this.data.connectedDevice) return const enabled = !this.data.genericModbusAutoPollEnabled settingsService.setGenericModbusAutoPollEnabled(enabled) if (enabled) { this.scheduleGenericAutoPoll(0) } else { this.clearGenericAutoTimers() } }, async saveGenericModbusJson() { const count = await genericModbusService.saveJsonToChat() if (count && this.pageToast) this.pageToast.show(`已保存 ${count} 个寄存器组`) }, toggleGenericModbusGroup(event) { const groupId = event.currentTarget.dataset.groupId if (this.genericModbusGroupLongPressGuard === groupId) { this.genericModbusGroupLongPressGuard = '' return } const group = findGenericGroup(this.data.genericModbusGroups, groupId) if (!group) return genericModbusService.setGroupExpanded(groupId, !group.expanded) }, onGenericRegisterValueInput(event) { genericModbusService.updateRegisterValue( event.currentTarget.dataset.groupId, Number(event.currentTarget.dataset.index), event.detail.value ) }, async onGenericRegisterValueBlur(event) { const groupId = event.currentTarget.dataset.groupId const registerIndex = Number(event.currentTarget.dataset.index) try { genericModbusService.validateRegisterInputValue(groupId, registerIndex, event.detail.value) } catch (error) { if (this.pageToast) this.pageToast.show(error.message || '输入值无效', 'error') return } if (!this.data.isPrivateProtocol || !this.data.connectedDevice) return const group = findGenericGroup(this.data.genericModbusGroups, groupId) const register = group && group.registers ? group.registers[registerIndex] : null if (!group || !register || !register.isDirty || !group.writable || group.addressOverflow) return this.clearGenericAutoTimers() const ok = await genericModbusService.writeRegister(groupId, registerIndex) if (this.data.genericModbusAutoPollEnabled) { this.scheduleGenericAutoPoll(this.data.genericModbusPollInterval || 100) } if (ok && this.pageToast) { this.pageToast.show(`${register.name || '变量'}已写入`) } }, async readGenericModbusGroup(event) { if (!this.data.connectedDevice) return const groupId = event.currentTarget.dataset.groupId const ok = await genericModbusService.readGroup(groupId, { maxPacketLength: this.data.genericModbusMaxPacketLength }) if (ok && this.pageToast) this.pageToast.show('通用Modbus读取完成') }, async writeGenericModbusGroup(event) { if (!this.data.connectedDevice) return const groupId = event.currentTarget.dataset.groupId const ok = await genericModbusService.writeGroup(groupId) if (ok && this.pageToast) this.pageToast.show('通用Modbus写入完成') }, onGenericGroupTouchStart(event) { const groupId = event.currentTarget.dataset.groupId const touch = (event.changedTouches || [])[0] if (!groupId || !touch) return this.genericModbusTouchStarts[groupId] = touch.clientX }, onGenericGroupTouchEnd(event) { const groupId = event.currentTarget.dataset.groupId const group = findGenericGroup(this.data.genericModbusGroups, groupId) const touch = (event.changedTouches || [])[0] const startX = this.genericModbusTouchStarts[groupId] if (!groupId || !group || group.expanded || !touch || !Number.isFinite(startX)) return const deltaX = touch.clientX - startX if (deltaX > 42) { genericModbusService.setGroupDeleteVisible(groupId, true) } else if (deltaX < -24) { genericModbusService.setGroupDeleteVisible(groupId, false) } }, onGenericRegisterDragStart(event) { const touch = (event.changedTouches || [])[0] if (!touch) return const groupId = event.currentTarget.dataset.groupId const index = Number(event.currentTarget.dataset.index) const activeGenericGroup = findGenericGroup(this.data.genericModbusGroups, groupId) if (!groupId || !activeGenericGroup || !Number.isInteger(index)) return this.genericModbusRegisterDrag = { groupId, index, moved: false, rowCenters: [], rowOffset: getFallbackDragRowOffsetPx(this.genericWindowWidth), startY: touch.clientY, targetIndex: index, translateY: 0 } if (this.data.activeGenericGroupId === groupId) { this.setData({ activeGenericRegisterRows: buildActiveGenericRegisterRows(activeGenericGroup, this.genericModbusRegisterDrag) }) } this.measureGenericRegisterRows(this.genericModbusRegisterDrag) }, onGenericRegisterDragMove(event) { const touch = (event.changedTouches || [])[0] if (!touch || !this.genericModbusRegisterDrag) return const drag = this.genericModbusRegisterDrag const group = findGenericGroup(this.data.genericModbusGroups, drag.groupId) if (!group) return const translateY = Math.round(touch.clientY - drag.startY) const moved = Math.abs(translateY) > GENERIC_REGISTER_DRAG_THRESHOLD_PX const targetIndex = moved ? resolveDragTargetIndex(drag, touch.clientY, group.registers.length) : drag.index if ( drag.translateY === translateY && drag.moved === moved && drag.targetIndex === targetIndex ) { return } drag.translateY = translateY drag.moved = moved drag.targetIndex = targetIndex if (this.data.activeGenericGroupId === group.id) { this.setData({ activeGenericRegisterRows: buildActiveGenericRegisterRows(group, drag) }) } }, onGenericRegisterDragEnd(event) { const drag = this.genericModbusRegisterDrag this.genericModbusRegisterDrag = null if (!drag || !drag.groupId) return const group = findGenericGroup(this.data.genericModbusGroups, drag.groupId) if (!group) return if (this.data.activeGenericGroupId === group.id) { this.setData({ activeGenericRegisterRows: buildActiveGenericRegisterRows(group, null) }) } if (!drag.moved) return const targetIndex = clampIndex( Number(drag.targetIndex) || drag.index, 0, group.registers.length - 1 ) if (targetIndex === drag.index) return const updatedGroup = genericModbusService.reorderRegister(drag.groupId, drag.index, targetIndex) if (!updatedGroup) return this.genericModbusRegisterLongPressGuard = `${drag.groupId}:${targetIndex}` setTimeout(() => { if (this.genericModbusRegisterLongPressGuard === `${drag.groupId}:${targetIndex}`) { this.genericModbusRegisterLongPressGuard = '' } }, 260) if (this.data.activeGenericGroupId === updatedGroup.id) { this.setData({ activeGenericGroup: updatedGroup, activeGenericRegisterRows: buildActiveGenericRegisterRows(updatedGroup, null) }) } }, onGenericRegisterDragCancel() { const drag = this.genericModbusRegisterDrag this.genericModbusRegisterDrag = null if (!drag || !drag.groupId) return const group = findGenericGroup(this.data.genericModbusGroups, drag.groupId) if (!group || this.data.activeGenericGroupId !== group.id) return this.setData({ activeGenericRegisterRows: buildActiveGenericRegisterRows(group, null) }) }, deleteGenericModbusGroup(event) { const groupId = event.currentTarget.dataset.groupId this.clearGenericAutoTimer(groupId) genericModbusService.removeGroup(groupId) if (this.data.activeGenericGroupId === groupId) { this.setData({ activeGenericGroup: null, activeGenericGroupId: '', activeParamView: 'genericModbus' }) } if (this.pageToast) this.pageToast.show('寄存器组已删除') }, clearGenericAutoTimer(groupId) { if (this.genericModbusPoller) this.genericModbusPoller.clearTimer(groupId) }, clearGenericAutoTimers() { if (this.genericModbusPoller) this.genericModbusPoller.clearAll() }, scheduleVisibleGenericAutoReads() { if (this.genericModbusPoller) this.genericModbusPoller.scheduleVisible() }, scheduleGenericAutoPoll(delay) { if (this.genericModbusPoller) this.genericModbusPoller.schedule(delay) }, clearGenericRegisterDrag() { if (!this.genericModbusRegisterDrag) return const drag = this.genericModbusRegisterDrag this.genericModbusRegisterDrag = null const group = findGenericGroup(this.data.genericModbusGroups, drag.groupId) this.setData({ activeGenericRegisterRows: buildActiveGenericRegisterRows(group, null) }) }, measureGenericRegisterRows(dragReference) { const query = this.createSelectorQuery() query.selectAll('.generic-register-row').boundingClientRect((rects) => { if (!this.genericModbusRegisterDrag || this.genericModbusRegisterDrag !== dragReference) return if (!Array.isArray(rects) || !rects.length) return dragReference.rowCenters = rects.map((rect) => Number(rect.top || 0) + Number(rect.height || 0) / 2) dragReference.rowOffset = Math.max( 1, Math.round(Number((rects[dragReference.index] || {}).height) || dragReference.rowOffset || 0) ) const group = findGenericGroup(this.data.genericModbusGroups, dragReference.groupId) if (!group || this.data.activeGenericGroupId !== group.id) return this.setData({ activeGenericRegisterRows: buildActiveGenericRegisterRows(group, dragReference) }) }).exec() } })