Commit a0b8da4d by 高源

表格优化

parent c51af5ef
......@@ -184,13 +184,15 @@ export default {
_this.SelectTableData = this.SelectTableData.filter(item => item._X_ROW_KEY
!== row._X_ROW_KEY
)
_this.setElementBackgroundColor(_this.$refs.xTableColumn.getCurrentRecord().xpath, '')
// 先将删除的元素清空,并且将背景色还原
_this.SelectTableData = _this.SelectTableData.filter(xpath => xpath.xpath !== row.xpath);
_this.setElementBackgroundColor(row.xpath, '')
// 将表格最后一个选中,添加背景色
if (_this.SelectTableData.length > 0) {
console.log(_this.SelectTableData)
if(_this.SelectTableData.length ==1) return
if (_this.SelectTableData.length == 1) return
_this.$refs.xTableColumn.setCurrentRow(_this.SelectTableData[_this.SelectTableData.length - 2])
_this.setElementBackgroundColor(_this.SelectTableData[_this.SelectTableData.length - 2].xpath, '#68C23A')
}
......@@ -294,7 +296,10 @@ export default {
// 将新加入的tableData添加高亮
// console.log(this.$refs.xTableColumn)
if (this.$refs.xTableColumn !== undefined) {
this.$refs.xTableColumn.setCurrentRow(_this.SelectTableData[_this.SelectTableData.length - 1])
// if (this.SelectTableData.length > 1) {
this.$refs.xTableColumn.setCurrentRow(_this.SelectTableData[0])
// }
}
// 移除先前元素的背景色(如果有)
......@@ -445,4 +450,5 @@ export default {
.vxe-table--filter-wrapper .vxe-input>.vxe-input--inner,
.vxe-table--filter-wrapper .vxe-textarea>.vxe-textarea--inner {
width: 145px !important;
}</style>
\ No newline at end of file
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment