Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
Vue-WebDriver
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高源
Vue-WebDriver
Commits
6ad9d76e
Commit
6ad9d76e
authored
Nov 28, 2023
by
高源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
fe8f30b6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
19 deletions
+11
-19
collectionForm.vue
src/components/collectionForm.vue
+4
-4
collectionTable.vue
src/components/collectionTable.vue
+7
-15
No files found.
src/components/collectionForm.vue
View file @
6ad9d76e
...
...
@@ -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
)
{
...
...
src/components/collectionTable.vue
View file @
6ad9d76e
...
...
@@ -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>
</
template
>
<el-button
style=
"width:
60px;height: 3
0px;"
size=
"mini"
class=
"button-new-tag"
@
click=
"columnBack"
v-else
>
返回
</el-button>
<el-button
style=
"width:
50px;height: 2
0px;"
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, '')
}
},
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment