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
b5e95943
Commit
b5e95943
authored
Feb 19, 2024
by
高源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表格高亮异常问题解决
parent
49f247f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
22 deletions
+5
-22
collectionTable.vue
src/components/collectionTable.vue
+5
-22
No files found.
src/components/collectionTable.vue
View file @
b5e95943
...
@@ -234,9 +234,6 @@ export default {
...
@@ -234,9 +234,6 @@ export default {
});
});
info
.
typeOptions
=
[]
info
.
typeOptions
=
[]
info
.
typeOptions
=
typeOptions
info
.
typeOptions
=
typeOptions
// info.xpath = _this.getElementXPath(targetElement)
// info.contentText = targetElement.textContent
// info.title = 'columnName'
}
else
if
(
targetElement
.
tagName
===
'IMG'
)
{
}
else
if
(
targetElement
.
tagName
===
'IMG'
)
{
// 图片
// 图片
info
=
{
info
=
{
...
@@ -249,9 +246,6 @@ export default {
...
@@ -249,9 +246,6 @@ export default {
});
});
info
.
typeOptions
=
[]
info
.
typeOptions
=
[]
info
.
typeOptions
=
typeOptions
info
.
typeOptions
=
typeOptions
// info.xpath = _this.getElementXPath(targetElement)
// info.contentText = targetElement.textContent
// info.title = 'columnName'
}
else
{
}
else
{
// 其他标签
// 其他标签
info
=
{
info
=
{
...
@@ -262,30 +256,17 @@ export default {
...
@@ -262,30 +256,17 @@ export default {
});
});
info
.
typeOptions
=
[]
info
.
typeOptions
=
[]
info
.
typeOptions
=
typeOptions
info
.
typeOptions
=
typeOptions
// info.xpath = _this.getElementXPath(targetElement)
// info.contentText = targetElement.textContent
// info.title = 'columnName'
}
}
info
.
name
=
'ID'
+
_this
.
index
++
info
.
name
=
'ID'
+
_this
.
index
++
info
.
type
=
''
info
.
type
=
''
info
.
xpath
=
_this
.
getElementXPath
(
targetElement
)
info
.
xpath
=
_this
.
getElementXPath
(
targetElement
)
info
.
contentText
=
targetElement
.
textContent
info
.
contentText
=
targetElement
.
textContent
info
.
title
=
'columnName'
info
.
title
=
'columnName'
// _this.selectTableData.unshift(info)
// _this.selectTableData.unshift(info)
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
)
}
}
// 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
.
$refs
.
xTableColumn
!==
undefined
)
{
// if (this.SelectTableData.length > 1) {
// if (this.SelectTableData.length > 1) {
this
.
$refs
.
xTableColumn
.
setCurrentRow
(
_this
.
selectTableData
[
0
])
this
.
$refs
.
xTableColumn
.
setCurrentRow
(
_this
.
selectTableData
[
0
])
...
@@ -331,6 +312,7 @@ export default {
...
@@ -331,6 +312,7 @@ export default {
let
result
=
document
.
evaluate
(
xpath
,
document
,
null
,
XPathResult
.
FIRST_ORDERED_NODE_TYPE
,
null
);
let
result
=
document
.
evaluate
(
xpath
,
document
,
null
,
XPathResult
.
FIRST_ORDERED_NODE_TYPE
,
null
);
let
selectedElement
=
result
.
singleNodeValue
;
let
selectedElement
=
result
.
singleNodeValue
;
if
(
selectedElement
)
{
if
(
selectedElement
)
{
// selectedElement.style.backgroundColor = '';
selectedElement
.
style
.
backgroundColor
=
color
;
selectedElement
.
style
.
backgroundColor
=
color
;
}
}
},
},
...
@@ -375,8 +357,6 @@ export default {
...
@@ -375,8 +357,6 @@ export default {
});
});
this
.
table
.
verify
();
this
.
table
.
verify
();
this
.
tableData
=
this
.
table
.
getData
();
this
.
tableData
=
this
.
table
.
getData
();
console
.
log
(
this
.
tableData
)
console
.
log
(
this
.
table
)
},
},
// 动态建立tablecolumn
// 动态建立tablecolumn
setTableProperties
()
{
setTableProperties
()
{
...
@@ -404,7 +384,10 @@ export default {
...
@@ -404,7 +384,10 @@ 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
,
'#68C23A'
);
this
.
setElementBackgroundColor
(
path
,
''
);
setTimeout
(()
=>
{
this
.
setElementBackgroundColor
(
path
,
'#68C23A'
);
},
200
);
}
}
});
});
},
},
...
...
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