Commit 6ad9d76e by 高源

优化

parent fe8f30b6
......@@ -117,7 +117,7 @@ export default {
// 将表格最后一个选中,添加背景色
if (_this.SelectFormData.length > 0) {
_this.$refs.xTableColumn.setCurrentRow(_this.SelectFormData[_this.SelectFormData.length - 1])
_this.setElementBackgroundColor(_this.SelectFormData[_this.SelectFormData.length - 1].xpath, 'orange')
_this.setElementBackgroundColor(_this.SelectFormData[_this.SelectFormData.length - 1].xpath, '#68C23A')
}
if (_this.table == null) return
},
......@@ -207,7 +207,7 @@ export default {
window.currentlyHighlighted.style.backgroundColor = '';
}
// 更新背景色并保存当前元素
event.target.style.backgroundColor = 'orange';
event.target.style.backgroundColor = '#68C23A';
window.currentlyHighlighted = event.target;
console.log(_this.SelectFormData)
},
......@@ -219,9 +219,9 @@ export default {
if (this.selectedRow.xpath !== row.xpath) {
this.setElementBackgroundColor(this.selectedRow.xpath, '')
this.selectedRow = row
this.setElementBackgroundColor(row.xpath, 'orange')
this.setElementBackgroundColor(row.xpath, '#68C23A')
} else {
this.setElementBackgroundColor(row.xpath, 'orange')
this.setElementBackgroundColor(row.xpath, '#68C23A')
}
},
setElementBackgroundColor (xpath, color) {
......
......@@ -11,11 +11,9 @@
<span>新增</span>
</el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="点击取消选择" placement="top">
<el-button style="width: 50px;height: 20px;" size="small" class="button-new-tag" @click="cancelSelect" v-if="selectTable">取消选择</el-button>
</el-tooltip>
<el-button style="width: 50px;height: 20px;" size="small" class="button-new-tag" @click="cancelSelect" v-if="selectTable">取消选择</el-button>
</template>
<el-button style="width: 60px;height: 30px;" size="mini" class="button-new-tag" @click="columnBack" v-else>返回</el-button>
<el-button style="width: 50px;height: 20px;" size="mini" class="button-new-tag" @click="columnBack" v-else>返回</el-button>
<div style="display: flex;align-items: center;">
<span style="margin-left: 45px;font-size: 13px;" v-if="isSelectTable">表名:</span>
<vxe-input style="margin-left: 10px;" v-if="isSelectTable" v-model="tableName" placeholder="请填写表名" size="mini"></vxe-input>
......@@ -155,7 +153,7 @@ export default {
// 将表格最后一个选中,添加背景色
if (_this.SelectTableData.length > 0) {
_this.$refs.xTableColumn.setCurrentRow(_this.SelectTableData[_this.SelectTableData.length - 1])
_this.setElementBackgroundColor(_this.SelectTableData[_this.SelectTableData.length - 1].xpath, 'orange')
_this.setElementBackgroundColor(_this.SelectTableData[_this.SelectTableData.length - 1].xpath, '#68C23A')
}
if (_this.table == null) return
......@@ -171,7 +169,6 @@ export default {
for (let i = 0; i < _this.table.cells.length; i++) {
for (let k = 1; k <= _this.tableData.length; k++) {
let path = _this.table.cells[i].tableXpath + '[' + k + ']/' + _this.table.cells[i].relativeXpath
console.log(path)
_this.setElementBackgroundColor(path, '')
}
......@@ -186,9 +183,9 @@ export default {
if (this.selectedRow.xpath !== row.xpath) {
this.setElementBackgroundColor(this.selectedRow.xpath, '')
this.selectedRow = row
this.setElementBackgroundColor(row.xpath, 'orange')
this.setElementBackgroundColor(row.xpath, '#68C23A')
} else {
this.setElementBackgroundColor(row.xpath, 'orange')
this.setElementBackgroundColor(row.xpath, '#68C23A')
}
......@@ -262,7 +259,7 @@ export default {
window.currentlyHighlighted.style.backgroundColor = '';
}
// 更新背景色并保存当前元素
event.target.style.backgroundColor = 'orange';
event.target.style.backgroundColor = '#68C23A';
window.currentlyHighlighted = event.target;
_this.selectTable = false;
// 移除事件监听器
......@@ -375,19 +372,14 @@ export default {
let tablePath = _this.table.xpath.split('/');
tablePath.pop()
tablePath = tablePath.join("/")
_this.setElementBackgroundColor(tablePath, 'green')
console.log(_this.tableData)
console.log(_this.table)
_this.setElementBackgroundColor(tablePath, '#AED7E5')
for (let i = 0; i < _this.table.cells.length; i++) {
for (let k = 1; k <= _this.tableData.length; k++) {
let path = _this.table.cells[i].tableXpath + '[' + k + ']/' + _this.table.cells[i].relativeXpath
console.log(path)
_this.setElementBackgroundColor(path, 'orange')
_this.setElementBackgroundColor(path, '#68C23A')
}
}
// if (_this.selectedRow == null) return
// _this.setElementBackgroundColor(_this.selectedRow.xpath, '')
}
},
}
......
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