Commit 6ad9d76e by 高源

优化

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