fix 80742
This commit is contained in:
+16
-3
@@ -58,7 +58,7 @@
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:dataSource="dataSource"
|
:dataSource="dataSource"
|
||||||
:pagination="ipagination"
|
:pagination="ipagination"
|
||||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio' }"
|
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: tableSelectType }"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@change="handleTableChange">
|
@change="handleTableChange">
|
||||||
</j-table>
|
</j-table>
|
||||||
@@ -100,7 +100,9 @@ export default {
|
|||||||
],
|
],
|
||||||
url: {
|
url: {
|
||||||
list: '/projectLibrary/lawsProjectLibrary/page'
|
list: '/projectLibrary/lawsProjectLibrary/page'
|
||||||
}
|
},
|
||||||
|
selectedProjects: [],
|
||||||
|
tableSelectType: 'radio'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -114,7 +116,7 @@ export default {
|
|||||||
this.$message.warning(this.$t('selectOne'))
|
this.$message.warning(this.$t('selectOne'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$emit('ok', this.selectedRowKeys, this.selectionRows)
|
this.$emit('ok', this.selectedRowKeys, this.selectedProjects)
|
||||||
this.close()
|
this.close()
|
||||||
},
|
},
|
||||||
handleCancel () {
|
handleCancel () {
|
||||||
@@ -127,6 +129,17 @@ export default {
|
|||||||
searchQuery () {
|
searchQuery () {
|
||||||
this.loadData(1)
|
this.loadData(1)
|
||||||
},
|
},
|
||||||
|
onSelectChange (selectedRowKeys) {
|
||||||
|
this.selectedRowKeys = selectedRowKeys
|
||||||
|
if (!this.selectedProjects.includes(tt => selectedRowKeys.includes(tt.id))) {
|
||||||
|
if (this.tableSelectType === 'radio') {
|
||||||
|
this.selectedProjects = [this.dataSource.find(tt => selectedRowKeys.includes(tt.id))]
|
||||||
|
} else {
|
||||||
|
this.selectedProjects.push(this.dataSource.find(tt => selectedRowKeys.includes(tt.id)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(this.selectedRowKeys, this.selectedProjects)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user