Commit b5e95943 by 高源

表格高亮异常问题解决

parent 49f247f4
......@@ -234,9 +234,6 @@ export default {
});
info.typeOptions = []
info.typeOptions = typeOptions
// info.xpath = _this.getElementXPath(targetElement)
// info.contentText = targetElement.textContent
// info.title = 'columnName'
} else if (targetElement.tagName === 'IMG') {
// 图片
info = {
......@@ -249,9 +246,6 @@ export default {
});
info.typeOptions = []
info.typeOptions = typeOptions
// info.xpath = _this.getElementXPath(targetElement)
// info.contentText = targetElement.textContent
// info.title = 'columnName'
} else {
// 其他标签
info = {
......@@ -262,30 +256,17 @@ export default {
});
info.typeOptions = []
info.typeOptions = typeOptions
// info.xpath = _this.getElementXPath(targetElement)
// info.contentText = targetElement.textContent
// info.title = 'columnName'
}
info.name = 'ID' + _this.index++
info.type = ''
info.xpath = _this.getElementXPath(targetElement)
info.contentText = targetElement.textContent
info.title = 'columnName'
// _this.selectTableData.unshift(info)
// _this.selectTableData.unshift(info)
if (_this.selectTableData.length >= 2) {
this.selectTableData.splice(_this.selectTableData.length - 1, 0, info)
} else {
this.selectTableData.splice(0, 0, info)
}
// console.log(_this.selectTableData)
// if (_this.selectTableData.length == 2) {
// _this.selectTableData = _this.getList(0, _this.selectTableData)
// } else {
// _this.selectTableData = _this.getList(_this.selectTableData.length - 1, _this.selectTableData)
// }
console.log(_this.selectTableData)
if (this.$refs.xTableColumn !== undefined) {
// if (this.SelectTableData.length > 1) {
this.$refs.xTableColumn.setCurrentRow(_this.selectTableData[0])
......@@ -331,6 +312,7 @@ export default {
let result = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
let selectedElement = result.singleNodeValue;
if (selectedElement) {
// selectedElement.style.backgroundColor = '';
selectedElement.style.backgroundColor = color;
}
},
......@@ -375,8 +357,6 @@ export default {
});
this.table.verify();
this.tableData = this.table.getData();
console.log(this.tableData)
console.log(this.table)
},
// 动态建立tablecolumn
setTableProperties () {
......@@ -404,7 +384,10 @@ export default {
this.table.cells.forEach(cell => {
for (let k = 1; k <= this.tableData.length; k++) {
let path = `${cell.tableXpath}[${k}]/${cell.relativeXpath}`;
this.setElementBackgroundColor(path, '#68C23A');
this.setElementBackgroundColor(path, '');
setTimeout(() => {
this.setElementBackgroundColor(path, '#68C23A');
}, 200);
}
});
},
......
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