From 365fdf2babb106a90fc1d5634e0b535119b61ff2 Mon Sep 17 00:00:00 2001 From: LH_R Date: Fri, 25 Apr 2025 16:32:38 +0800 Subject: [PATCH] feat(ui): RelationView - AddTableModal checkbox config add range --- .../relation_views/modules/AddTableModal.vue | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/cmdb-ui/src/modules/cmdb/views/relation_views/modules/AddTableModal.vue b/cmdb-ui/src/modules/cmdb/views/relation_views/modules/AddTableModal.vue index a8c0b58..b21eec9 100644 --- a/cmdb-ui/src/modules/cmdb/views/relation_views/modules/AddTableModal.vue +++ b/cmdb-ui/src/modules/cmdb/views/relation_views/modules/AddTableModal.vue @@ -30,13 +30,13 @@ >新增 - {{ JSON.stringify(row[col.field]) }} - + { - const _table = this.$refs.xTable + const _table = this.$refs.xTable?.getVxetableRef?.() if (_table) { _table.refreshColumn() } @@ -316,7 +316,11 @@ export default { onSelectChange() {}, handleClose() { - this.$refs.xTable.clearCheckboxRow() + const _table = this.$refs.xTable?.getVxetableRef?.() + if (_table) { + _table.clearCheckboxRow() + } + this.currentPage = 1 this.expression = '' this.isFocusExpression = false @@ -324,8 +328,10 @@ export default { this.showCreateBtn = true }, async handleOk() { - const selectRecordsCurrent = this.$refs.xTable.getCheckboxRecords() - const selectRecordsReserved = this.$refs.xTable.getCheckboxReserveRecords() + const _table = this.$refs.xTable?.getVxetableRef?.() + const selectRecordsCurrent = _table?.getCheckboxRecords?.() || [] + const selectRecordsReserved = _table?.getCheckboxReserveRecords?.() || [] + const ciIds = [...selectRecordsCurrent, ...selectRecordsReserved].map((record) => record._id) if (ciIds.length) { if (this.type === 'children') {