feat(ui): RelationView - AddTableModal checkbox config add range

This commit is contained in:
LH_R
2025-04-25 16:32:38 +08:00
parent 6bf01786d8
commit 365fdf2bab

View File

@@ -30,13 +30,13 @@
>新增</a-button >新增</a-button
> >
</SearchForm> </SearchForm>
<vxe-table <ops-table
ref="xTable" ref="xTable"
row-id="_id" row-id="_id"
:data="tableData" :data="tableData"
:height="tableHeight" :height="tableHeight"
highlight-hover-row highlight-hover-row
:checkbox-config="{ reserve: true }" :checkbox-config="{ reserve: true, highlight: true, range: true }"
@checkbox-change="onSelectChange" @checkbox-change="onSelectChange"
@checkbox-all="onSelectChange" @checkbox-all="onSelectChange"
show-overflow="tooltip" show-overflow="tooltip"
@@ -76,7 +76,7 @@
<span v-if="col.value_type == '6' && row[col.field]">{{ JSON.stringify(row[col.field]) }}</span> <span v-if="col.value_type == '6' && row[col.field]">{{ JSON.stringify(row[col.field]) }}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
</vxe-table> </ops-table>
<a-pagination <a-pagination
v-model="currentPage" v-model="currentPage"
size="small" size="small"
@@ -216,7 +216,7 @@ export default {
this.totalNumber = res.numfound this.totalNumber = res.numfound
this.columns = this.getColumns(res.result, this.preferenceAttrList) this.columns = this.getColumns(res.result, this.preferenceAttrList)
this.$nextTick(() => { this.$nextTick(() => {
const _table = this.$refs.xTable const _table = this.$refs.xTable?.getVxetableRef?.()
if (_table) { if (_table) {
_table.refreshColumn() _table.refreshColumn()
} }
@@ -316,7 +316,11 @@ export default {
onSelectChange() {}, onSelectChange() {},
handleClose() { handleClose() {
this.$refs.xTable.clearCheckboxRow() const _table = this.$refs.xTable?.getVxetableRef?.()
if (_table) {
_table.clearCheckboxRow()
}
this.currentPage = 1 this.currentPage = 1
this.expression = '' this.expression = ''
this.isFocusExpression = false this.isFocusExpression = false
@@ -324,8 +328,10 @@ export default {
this.showCreateBtn = true this.showCreateBtn = true
}, },
async handleOk() { async handleOk() {
const selectRecordsCurrent = this.$refs.xTable.getCheckboxRecords() const _table = this.$refs.xTable?.getVxetableRef?.()
const selectRecordsReserved = this.$refs.xTable.getCheckboxReserveRecords() const selectRecordsCurrent = _table?.getCheckboxRecords?.() || []
const selectRecordsReserved = _table?.getCheckboxReserveRecords?.() || []
const ciIds = [...selectRecordsCurrent, ...selectRecordsReserved].map((record) => record._id) const ciIds = [...selectRecordsCurrent, ...selectRecordsReserved].map((record) => record._id)
if (ciIds.length) { if (ciIds.length) {
if (this.type === 'children') { if (this.type === 'children') {