Commit 72c47ed7 by 高源

选中高亮优化

parent b5e95943
...@@ -263,14 +263,16 @@ export default { ...@@ -263,14 +263,16 @@ export default {
info.contentText = targetElement.textContent info.contentText = targetElement.textContent
info.title = 'columnName' info.title = 'columnName'
if (_this.selectTableData.length >= 2) { if (_this.selectTableData.length >= 2) {
this.selectTableData.splice(_this.selectTableData.length - 1, 0, info) _this.selectTableData.splice(_this.selectTableData.length - 1, 0, info)
} else { } else {
this.selectTableData.splice(0, 0, info) _this.selectTableData.splice(0, 0, info)
} }
if (this.$refs.xTableColumn !== undefined) { if (this.$refs.xTableColumn !== undefined) {
// if (this.SelectTableData.length > 1) { if (_this.selectTableData.length <= 2) {
this.$refs.xTableColumn.setCurrentRow(_this.selectTableData[0]) this.$refs.xTableColumn.setCurrentRow(_this.selectTableData[0])
// } } else {
this.$refs.xTableColumn.setCurrentRow(_this.selectTableData[_this.selectTableData.length - 2])
}
} }
// 移除先前元素的背景色(如果有) // 移除先前元素的背景色(如果有)
if (window.currentlyHighlighted) { if (window.currentlyHighlighted) {
...@@ -384,6 +386,7 @@ export default { ...@@ -384,6 +386,7 @@ export default {
this.table.cells.forEach(cell => { this.table.cells.forEach(cell => {
for (let k = 1; k <= this.tableData.length; k++) { for (let k = 1; k <= this.tableData.length; k++) {
let path = `${cell.tableXpath}[${k}]/${cell.relativeXpath}`; let path = `${cell.tableXpath}[${k}]/${cell.relativeXpath}`;
this.setElementBackgroundColor(path, ''); this.setElementBackgroundColor(path, '');
setTimeout(() => { setTimeout(() => {
this.setElementBackgroundColor(path, '#68C23A'); this.setElementBackgroundColor(path, '#68C23A');
......
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