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') {