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
c0732c6c
Commit
c0732c6c
authored
Nov 28, 2023
by
郁子恒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化采集表单
parent
4ca0469f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
98 additions
and
143 deletions
+98
-143
App.vue
src/App.vue
+1
-1
collectionForm.vue
src/components/collectionForm.vue
+50
-112
collectionTable.vue
src/components/collectionTable.vue
+6
-12
elOutput.vue
src/components/elOutput.vue
+1
-2
elclick.vue
src/components/elclick.vue
+20
-4
onInput.vue
src/components/onInput.vue
+20
-6
pageJavascript.vue
src/components/pageJavascript.vue
+0
-2
pageNavigates.vue
src/components/pageNavigates.vue
+0
-2
sysSleep.vue
src/components/sysSleep.vue
+0
-2
No files found.
src/App.vue
View file @
c0732c6c
...
@@ -425,7 +425,7 @@ export default {
...
@@ -425,7 +425,7 @@ export default {
/* 窗口整体样式 */
/* 窗口整体样式 */
.tooltips
{
.tooltips
{
min-width
:
460px
;
min-width
:
460px
;
min-height
:
50
0px
;
min-height
:
46
0px
;
background-color
:
white
;
background-color
:
white
;
border
:
solid
#3384FF
3px
;
border
:
solid
#3384FF
3px
;
position
:
fixed
;
position
:
fixed
;
...
...
src/components/collectionForm.vue
View file @
c0732c6c
...
@@ -2,53 +2,42 @@
...
@@ -2,53 +2,42 @@
<div
class=
"collectionForm"
>
<div
class=
"collectionForm"
>
<div
style=
"display: flex;height: 40px;padding-left: 15px;text-align: left;align-items: center;justify-content: space-between;"
>
<div
style=
"display: flex;height: 40px;padding-left: 15px;text-align: left;align-items: center;justify-content: space-between;"
>
<div
style=
"display: flex;"
>
<div
style=
"display: flex;"
>
<el-button
style=
"width: 80px;height: 30px;"
size=
"mini"
class=
"button-new-tag"
@
click=
"selectElement"
v-if=
"isSelectForm"
>
批量选择元素
</el-button>
<el-button
style=
"width: 80px;height: 30px;"
size=
"mini"
class=
"button-new-tag"
@
click=
"selectElement"
>
批量选择元素
</el-button>
<el-button
style=
"width: 60px;height: 30px;margin-left: 10px !important;"
size=
"small"
class=
"button-new-tag"
@
click=
"cancelSelect"
v-if=
"isSelectForm"
>
取消选择
</el-button>
<el-button
style=
"width: 60px;height: 30px;margin-left: 10px !important;"
size=
"small"
class=
"button-new-tag"
@
click=
"cancelSelect"
v-if=
"isSelectForm"
>
取消选择
</el-button>
<el-button
style=
"width: 60px;height: 30px;"
size=
"mini"
class=
"button-new-tag"
@
click=
"columnBack"
v-else
>
返回
</el-button>
</div>
</div>
<el-button
style=
"margin-right: 15px;"
size=
"small"
class=
"button-new-tag"
@
click=
"getForm"
v-if=
"isSelectForm"
>
获取表单信息
</el-button>
</div>
</div>
<!-- 全部表格信息 -->
<!-- 全部表格信息 -->
<div
style=
"overflow: auto;height: 305px;"
:style=
"
{ width: widthResize + 'px' }">
<div
style=
"overflow: auto;height: 230px;"
:style=
"
{ width: widthResize + 'px' }">
<vxe-table
key=
"1"
:data=
"SelectFormData"
ref=
"xTableColumn"
border
class=
"mytable-scrollbar"
height=
"250"
auto-resize
style=
"margin-bottom: 5px;"
v-if=
"isSelectForm"
>
<vxe-table
key=
"1"
:data=
"SelectFormData"
ref=
"xTableColumn"
border
class=
"mytable-scrollbar"
height=
"220"
auto-resize
style=
"margin-bottom: 5px;"
>
<vxe-column
field=
""
title=
"属性名"
min-width=
"150"
>
<vxe-column
field=
""
min-width=
"150"
>
<template
#
header
>
<span
style=
"font-size: 13px;"
>
属性名
</span>
</
template
>
<
template
v-slot=
"{ row }"
>
<
template
v-slot=
"{ row }"
>
<div
style=
"display: flex;flex-direction: column;"
>
<div
style=
"display: flex;flex-direction: column;"
>
<span>
选中内容:
{{
row
.
text
}}
</span>
<vxe-input
v-model=
"row.name"
placeholder=
"请填写属性名"
size=
"mini"
></vxe-input>
<vxe-input
v-model=
"row.name"
placeholder=
"请填写属性名"
size=
"mini"
></vxe-input>
</div>
</div>
</
template
>
</
template
>
</vxe-column>
</vxe-column>
<vxe-column
field=
""
title=
"值类型"
min-width=
"170"
>
<vxe-column
field=
""
min-width=
"170"
>
<
template
#
header
>
<span
style=
"font-size: 13px;"
>
值类型
</span>
</
template
>
<
template
v-slot=
"{ row }"
>
<
template
v-slot=
"{ row }"
>
<div
style=
"display: flex;flex-direction: column;"
>
<div
style=
"display: flex;flex-direction: column;"
>
<span>
选中内容:
{{
row
.
text
}}
</span>
<el-select
style=
"height: 28px;"
v-model=
"row.type"
placeholder=
"选择值类型"
v-if=
"row.typeOptions.length > 1"
:popper-append-to-body=
"false"
filterable
remote
>
<el-select
style=
"height: 28px;"
v-model=
"row.type"
placeholder=
"选择值类型"
v-if=
"row.typeOptions.length > 1"
:popper-append-to-body=
"false"
filterable
remote
>
<el-option
v-for=
"num in row.typeOptions"
:key=
"num.xpath"
:value=
"num.
value"
:label=
"num.label
"
></el-option>
<el-option
v-for=
"num in row.typeOptions"
:key=
"num.xpath"
:value=
"num.
label"
:label=
"num.value
"
></el-option>
</el-select>
</el-select>
<vxe-input
style=
"width: 100% !important;"
v-model=
"row.type"
:placeholder=
"row.typeOptions[0].
label
"
size=
"mini"
v-else
disabled
></vxe-input>
<vxe-input
style=
"width: 100% !important;"
v-model=
"row.type"
:placeholder=
"row.typeOptions[0].
value
"
size=
"mini"
v-else
disabled
></vxe-input>
</div>
</div>
</
template
>
</
template
>
</vxe-column>
</vxe-column>
<vxe-column
title=
"操作"
min-width=
"70"
fixed=
"right"
>
<vxe-column
min-width=
"70"
fixed=
"right"
>
<
template
#
default=
"{ row }"
>
<
template
#
header
>
<vxe-button
status=
"danger"
content=
"删除"
@
click=
"columnDelete(row)"
style=
"width: 50px;"
></vxe-button>
<span
style=
"font-size: 13px;"
>
操作
</span>
</
template
>
</vxe-column>
</vxe-table>
<vxe-table
key=
"2"
:data=
"formData"
ref=
"xTableColumn2"
border
class=
"mytable-scrollbar"
height=
"250"
auto-resize
style=
"margin-bottom: 5px;"
v-else
>
<vxe-column
field=
""
title=
"属性名"
min-width=
"150"
>
<
template
v-slot=
"{ row }"
>
<div
style=
"display: flex;flex-direction: column;"
>
<span>
{{
row
.
name
}}
</span>
</div>
</
template
>
</
template
>
</vxe-column>
<
template
#
default=
"{ row }"
>
<vxe-column
field=
""
title=
"内容"
min-width=
"150"
>
<img
style=
"width: 50px;height: 28px;vertical-align: bottom;"
src=
"../assets/close.svg"
@
click=
"columnDelete(row)"
>
<
template
v-slot=
"{ row }"
>
<div
style=
"display: flex;flex-direction: column;"
>
<span>
{{
row
.
content
}}
</span>
</div>
</
template
>
</
template
>
</vxe-column>
</vxe-column>
</vxe-table>
</vxe-table>
...
@@ -57,14 +46,14 @@
...
@@ -57,14 +46,14 @@
</template>
</template>
<
script
>
<
script
>
//
import VXETable, { t } from 'vxe-table'
import
VXETable
,
{
t
}
from
'vxe-table'
export
default
{
export
default
{
name
:
'collectionForm'
,
name
:
'collectionForm'
,
components
:
{},
components
:
{},
props
:
[
'activedAction'
,
'widthResize'
],
props
:
[
'activedAction'
,
'widthResize'
],
data
()
{
data
()
{
return
{
return
{
isSelectForm
:
tru
e
,
isSelectForm
:
fals
e
,
SelectFormData
:
[],
SelectFormData
:
[],
formData
:
[],
formData
:
[],
form
:
null
,
form
:
null
,
...
@@ -73,23 +62,17 @@ export default {
...
@@ -73,23 +62,17 @@ export default {
}
}
},
},
created
()
{
created
()
{
if
(
this
.
activedAction
.
form
!==
undefined
)
{
if
(
this
.
activedAction
.
formList
==
undefined
)
{
for
(
let
i
=
0
;
i
<
this
.
activedAction
.
form
.
cells
.
length
;
i
++
)
{
return
let
info
=
{};
}
info
.
type
=
this
.
activedAction
.
form
.
cells
[
i
].
type
;
if
(
this
.
activedAction
.
formList
.
length
!==
0
)
{
info
.
name
=
this
.
activedAction
.
form
.
cells
[
i
].
name
;
this
.
SelectFormData
=
this
.
activedAction
.
formList
info
.
title
=
this
.
activedAction
.
form
.
cells
[
i
].
title
;
info
.
typeOptions
=
this
.
activedAction
.
form
.
cells
[
i
].
types
;
info
.
xpath
=
this
.
activedAction
.
form
.
cells
[
i
].
xpath
;
this
.
SelectFormData
.
push
(
info
)
}
}
}
},
},
mounted
()
{
},
mounted
()
{
},
watch
:
{
watch
:
{
SelectFormData
:
{
SelectFormData
:
{
handler
(
newVal
)
{
handler
(
newVal
)
{
this
.
activedAction
.
formList
=
[];
this
.
activedAction
.
formList
=
this
.
SelectFormData
this
.
activedAction
.
formList
=
this
.
SelectFormData
this
.
$emit
(
'dataChanged'
,
this
.
activedAction
);
this
.
$emit
(
'dataChanged'
,
this
.
activedAction
);
console
.
log
(
this
.
activedAction
)
console
.
log
(
this
.
activedAction
)
...
@@ -103,35 +86,6 @@ export default {
...
@@ -103,35 +86,6 @@ export default {
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
},
},
methods
:
{
methods
:
{
getForm
()
{
let
_this
=
this
for
(
let
i
=
0
;
i
<
_this
.
SelectFormData
.
length
;
i
++
)
{
let
obj
=
{};
obj
.
name
=
_this
.
SelectFormData
[
i
].
name
;
obj
.
title
=
_this
.
SelectFormData
[
i
].
title
;
obj
.
typeOptions
=
_this
.
SelectFormData
[
i
].
typeOptions
;
obj
.
type
=
_this
.
SelectFormData
[
i
].
type
;
let
content
=
_this
.
getFormData
(
_this
.
SelectFormData
[
i
].
xpath
,
_this
.
SelectFormData
[
i
].
type
)
obj
.
content
=
content
_this
.
formData
.
push
(
obj
)
}
console
.
log
(
_this
.
SelectFormData
)
// 验证name属性是否唯一
_this
.
validateNames
(
_this
.
SelectFormData
)
},
getFormData
(
xpath
,
type
)
{
// 获取元素
let
result
=
document
.
evaluate
(
xpath
,
document
,
null
,
XPathResult
.
ANY_TYPE
,
null
);
// 获取查询结果的第一个元素
let
element
=
result
.
iterateNext
();
console
.
log
(
element
)
if
(
type
==
'xpath'
)
{
return
xpath
}
else
{
return
element
[
type
]
}
},
// 删除数据行
// 删除数据行
columnDelete
(
row
)
{
columnDelete
(
row
)
{
let
_this
=
this
let
_this
=
this
...
@@ -139,12 +93,6 @@ export default {
...
@@ -139,12 +93,6 @@ export default {
!==
row
.
_X_ROW_KEY
!==
row
.
_X_ROW_KEY
)
)
_this
.
SelectFormData
=
_this
.
SelectFormData
.
filter
(
xpath
=>
xpath
.
xpath
!==
row
.
xpath
);
_this
.
SelectFormData
=
_this
.
SelectFormData
.
filter
(
xpath
=>
xpath
.
xpath
!==
row
.
xpath
);
// _this.form.cells = _this.form.cells.filter(xpath => xpath !== row.xpath);
},
columnBack
()
{
let
_this
=
this
_this
.
isSelectForm
=
true
_this
.
formData
=
[]
},
},
// 定义事件处理函数
// 定义事件处理函数
contextMenuHandler
(
event
)
{
contextMenuHandler
(
event
)
{
...
@@ -167,9 +115,9 @@ export default {
...
@@ -167,9 +115,9 @@ export default {
if
(
targetElement
.
tagName
===
'A'
)
{
if
(
targetElement
.
tagName
===
'A'
)
{
// 定义一个对象info,用于存储提取的信息
// 定义一个对象info,用于存储提取的信息
info
=
{
info
=
{
xpath
:
'
xpath
'
,
xpath
:
'
元素路径
'
,
url
:
'
href
'
,
url
:
'
超链接
'
,
text
:
'
text
'
text
:
'
文本
'
};
};
// 将info对象的属性转换为选项数组,每个选项是一个对象包含label和value属性
// 将info对象的属性转换为选项数组,每个选项是一个对象包含label和value属性
typeOptions
=
Object
.
entries
(
info
).
map
(([
label
,
value
])
=>
{
typeOptions
=
Object
.
entries
(
info
).
map
(([
label
,
value
])
=>
{
...
@@ -188,9 +136,9 @@ export default {
...
@@ -188,9 +136,9 @@ export default {
}
else
if
(
targetElement
.
tagName
===
'IMG'
)
{
}
else
if
(
targetElement
.
tagName
===
'IMG'
)
{
// 定义一个对象info,用于存储提取的信息
// 定义一个对象info,用于存储提取的信息
info
=
{
info
=
{
xpath
:
'
xpath
'
,
xpath
:
'
元素路径
'
,
src
:
'
src
'
,
src
:
'
超链接
'
,
alt
:
'
alt
'
alt
:
'
属性
'
};
};
// 将info对象的属性转换为选项数组,每个选项是一个对象包含label和value属性
// 将info对象的属性转换为选项数组,每个选项是一个对象包含label和value属性
typeOptions
=
Object
.
entries
(
info
).
map
(([
label
,
value
])
=>
{
typeOptions
=
Object
.
entries
(
info
).
map
(([
label
,
value
])
=>
{
...
@@ -207,7 +155,7 @@ export default {
...
@@ -207,7 +155,7 @@ export default {
}
else
{
}
else
{
// 定义一个对象info,用于存储提取的信息
// 定义一个对象info,用于存储提取的信息
info
=
{
info
=
{
text
:
'
text
'
text
:
'
文本
'
};
};
// 将info对象的属性转换为选项数组,每个选项是一个对象包含label和value属性
// 将info对象的属性转换为选项数组,每个选项是一个对象包含label和value属性
typeOptions
=
Object
.
entries
(
info
).
map
(([
label
,
value
])
=>
{
typeOptions
=
Object
.
entries
(
info
).
map
(([
label
,
value
])
=>
{
...
@@ -220,7 +168,7 @@ export default {
...
@@ -220,7 +168,7 @@ export default {
info
.
xpath
=
_this
.
getElementXPath
(
targetElement
)
info
.
xpath
=
_this
.
getElementXPath
(
targetElement
)
// 获取目标元素的文本内容,赋值给info对象的contentText属性
// 获取目标元素的文本内容,赋值给info对象的contentText属性
info
.
text
=
targetElement
.
textContent
info
.
text
=
targetElement
.
textContent
//
info.title = 'columnName'
info
.
title
=
'columnName'
}
}
info
.
name
=
'ID'
+
_this
.
index
++
info
.
name
=
'ID'
+
_this
.
index
++
info
.
type
=
''
info
.
type
=
''
...
@@ -246,41 +194,16 @@ export default {
...
@@ -246,41 +194,16 @@ export default {
},
},
// 选择元素按钮调用
// 选择元素按钮调用
selectElement
()
{
selectElement
()
{
this
.
isSelectForm
=
true
;
// 添加事件监听器
// 添加事件监听器
document
.
addEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
,
false
);
document
.
addEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
,
false
);
},
},
// 取消按钮调用
// 取消按钮调用
cancelSelect
()
{
cancelSelect
()
{
this
.
isSelectForm
=
false
;
// 在取消按钮点击时移除事件监听器
// 在取消按钮点击时移除事件监听器
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
},
},
validateNames
(
arr
)
{
// let _this = this;
let
names
=
new
Set
();
// 检查元素是否为空
if
(
this
.
SelectFormData
.
length
==
0
)
{
this
.
$message
.
error
(
"还未选择元素"
);
return
}
// 遍历 arr
for
(
const
item
of
arr
)
{
// 检查 name 是否为空
if
(
!
item
.
name
)
{
this
.
$message
.
error
(
"属性名不能为空"
);
return
;
// 如果 name 为空,则退出函数
}
// 检查类型是否为空
if
(
item
.
typeOptions
.
length
==
1
)
{
item
.
type
=
item
.
typeOptions
[
0
].
value
}
else
if
(
item
.
typeOptions
.
length
>
1
)
{
if
(
item
.
type
==
''
)
{
this
.
$message
.
error
(
"类型值不能为空"
);
return
;
}
else
{
this
.
isSelectForm
=
false
}
}
names
.
add
(
item
.
name
);
}
}
},
},
}
}
</
script
>
</
script
>
...
@@ -292,4 +215,18 @@ export default {
...
@@ -292,4 +215,18 @@ export default {
.vxe-input--inner
{
.vxe-input--inner
{
width
:
120px
!important
;
width
:
120px
!important
;
}
}
.vxe-table--render-default
.vxe-body--column
,
.vxe-table--render-default
.vxe-footer--column
,
.vxe-table--render-default
.vxe-header--column
{
line-height
:
15px
;
text-align
:
center
;
}
.vxe-table--render-default
.vxe-body--column
:not
(
.col--ellipsis
),
.vxe-table--render-default
.vxe-footer--column
:not
(
.col--ellipsis
),
.vxe-table--render-default
.vxe-header--column
:not
(
.col--ellipsis
)
{
padding-top
:
5px
;
padding-bottom
:
5px
;
}
</
style
>
</
style
>
\ No newline at end of file
src/components/collectionTable.vue
View file @
c0732c6c
...
@@ -22,9 +22,7 @@
...
@@ -22,9 +22,7 @@
</div>
</div>
<!-- 全部表格信息 -->
<!-- 全部表格信息 -->
<div
style=
"overflow: auto;height: 290px;"
:style=
"{ width: widthResize + 'px' }"
>
<div
style=
"overflow: auto;height: 290px;"
:style=
"{ width: widthResize + 'px' }"
>
<vxe-table
:data=
"SelectTableData"
ref=
"xTableColumn"
border
class=
"mytable-scrollbar"
height=
"250"
<vxe-table
:data=
"SelectTableData"
ref=
"xTableColumn"
border
class=
"mytable-scrollbar"
height=
"250"
v-if=
"isSelectTable"
auto-resize
style=
"margin-bottom: 5px;"
@
current-change=
"currentChangeEvent"
highlight-hover-row
highlight-current-row
>
v-if=
"isSelectTable"
auto-resize
style=
"margin-bottom: 5px;"
@
current-change=
"currentChangeEvent"
highlight-hover-row
highlight-current-row
>
<vxe-column
field=
""
title=
"列名"
min-width=
"150"
>
<vxe-column
field=
""
title=
"列名"
min-width=
"150"
>
<
template
v-slot=
"{ row }"
>
<
template
v-slot=
"{ row }"
>
<div
style=
"display: flex;flex-direction: column;"
>
<div
style=
"display: flex;flex-direction: column;"
>
...
@@ -45,20 +43,16 @@
...
@@ -45,20 +43,16 @@
<
template
v-slot=
"{ row }"
>
<
template
v-slot=
"{ row }"
>
<div
style=
"display: flex;flex-direction: column;"
>
<div
style=
"display: flex;flex-direction: column;"
>
<!--
<span>
选中内容:
{{
row
.
contentText
}}
</span>
-->
<!--
<span>
选中内容:
{{
row
.
contentText
}}
</span>
-->
<el-select
style=
"height: 28px;"
v-model=
"row.type"
placeholder=
"选择值类型"
<el-select
style=
"height: 28px;"
v-model=
"row.type"
placeholder=
"选择值类型"
v-if=
"row.typeOptions.length > 1"
:popper-append-to-body=
"false"
filterable
remote
>
v-if=
"row.typeOptions.length > 1"
:popper-append-to-body=
"false"
filterable
remote
>
<el-option
v-for=
"num in row.typeOptions"
:key=
"num.xpath"
:value=
"num.label"
:label=
"num.value"
></el-option>
<el-option
v-for=
"num in row.typeOptions"
:key=
"num.xpath"
:value=
"num.label"
:label=
"num.value"
></el-option>
</el-select>
</el-select>
<vxe-input
style=
"width: 100% !important;"
v-model=
"row.type"
<vxe-input
style=
"width: 100% !important;"
v-model=
"row.type"
:placeholder=
"row.typeOptions[0].value"
size=
"mini"
v-else
disabled
></vxe-input>
:placeholder=
"row.typeOptions[0].value"
size=
"mini"
v-else
disabled
></vxe-input>
</div>
</div>
</
template
>
</
template
>
</vxe-column>
</vxe-column>
<vxe-column
title=
"操作"
min-width=
"70"
fixed=
"right"
>
<vxe-column
title=
"操作"
min-width=
"70"
fixed=
"right"
>
<
template
#
default=
"{ row }"
>
<
template
#
default=
"{ row }"
>
<img
style=
"width: 50px;height: 28px;vertical-align: bottom;"
src=
"../assets/close.svg"
<img
style=
"width: 50px;height: 28px;vertical-align: bottom;"
src=
"../assets/close.svg"
@
click=
"columnDelete(row)"
>
@
click=
"columnDelete(row)"
>
<!--
<vxe-button
status=
"danger"
content=
"删除"
@
click=
"columnDelete(row)"
<!--
<vxe-button
status=
"danger"
content=
"删除"
@
click=
"columnDelete(row)"
style=
"width: 50px;"
></vxe-button>
-->
style=
"width: 50px;"
></vxe-button>
-->
</
template
>
</
template
>
...
@@ -340,7 +334,7 @@ export default {
...
@@ -340,7 +334,7 @@ export default {
_this
.
activedAction
.
table
=
_this
.
table
;
_this
.
activedAction
.
table
=
_this
.
table
;
_this
.
$emit
(
'dataChanged'
,
_this
.
activedAction
);
_this
.
$emit
(
'dataChanged'
,
_this
.
activedAction
);
// _this.setElementBackgroundColor('/HTML/BODY/DIV[3]', 'orange')
// _this.setElementBackgroundColor('/HTML/BODY/DIV[3]', 'orange')
if
(
_this
.
selectedRow
==
null
)
return
if
(
_this
.
selectedRow
==
null
)
return
_this
.
setElementBackgroundColor
(
this
.
selectedRow
.
xpath
,
''
)
_this
.
setElementBackgroundColor
(
this
.
selectedRow
.
xpath
,
''
)
}
}
...
...
src/components/elOutput.vue
View file @
c0732c6c
...
@@ -48,7 +48,6 @@ export default {
...
@@ -48,7 +48,6 @@ export default {
};
};
},
},
created
()
{
created
()
{
// console.log(this.activedAction);
if
(
this
.
activedAction
.
Target
!==
undefined
)
{
if
(
this
.
activedAction
.
Target
!==
undefined
)
{
this
.
actionConfig
.
Target
=
this
.
activedAction
.
Target
;
this
.
actionConfig
.
Target
=
this
.
activedAction
.
Target
;
}
}
...
@@ -68,7 +67,6 @@ export default {
...
@@ -68,7 +67,6 @@ export default {
this
.
activedAction
.
Target
=
this
.
actionConfig
.
Target
;
this
.
activedAction
.
Target
=
this
.
actionConfig
.
Target
;
this
.
activedAction
.
Attributes
=
this
.
actionConfig
.
Attributes
;
this
.
activedAction
.
Attributes
=
this
.
actionConfig
.
Attributes
;
this
.
$emit
(
'dataChanged'
,
this
.
activedAction
);
this
.
$emit
(
'dataChanged'
,
this
.
activedAction
);
// console.log(this.activedAction)
},
},
deep
:
true
deep
:
true
}
}
...
@@ -102,6 +100,7 @@ export default {
...
@@ -102,6 +100,7 @@ export default {
},
},
// 取消按钮调用
// 取消按钮调用
cancelSelect
()
{
cancelSelect
()
{
this
.
outputState
=
false
;
// 在取消按钮点击时移除事件监听器
// 在取消按钮点击时移除事件监听器
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
},
},
...
...
src/components/elclick.vue
View file @
c0732c6c
...
@@ -8,9 +8,6 @@
...
@@ -8,9 +8,6 @@
</div>
</div>
<!-- 表单区域 -->
<!-- 表单区域 -->
<el-form
label-position=
"left"
:model=
"actionConfig"
>
<el-form
label-position=
"left"
:model=
"actionConfig"
>
<!--
<el-form-item
label=
"查找方式"
>
<el-input
v-model=
"actionConfig.Target.Type"
disabled
></el-input>
</el-form-item>
-->
<el-form-item>
<el-form-item>
<div
style=
"display: flex;width: 100%;"
>
<div
style=
"display: flex;width: 100%;"
>
<span
style=
"font-size: 13px;width: 85px;padding-left: 15px;"
>
内
容:
</span>
<span
style=
"font-size: 13px;width: 85px;padding-left: 15px;"
>
内
容:
</span>
...
@@ -53,7 +50,18 @@ export default {
...
@@ -53,7 +50,18 @@ export default {
this
.
actionConfig
.
Target
=
this
.
activedAction
.
Target
;
this
.
actionConfig
.
Target
=
this
.
activedAction
.
Target
;
}
}
},
},
mounted
()
{
},
mounted
()
{
let
_this
=
this
document
.
addEventListener
(
'click'
,
function
(
event
)
{
// 如果点击的不是当前高亮的元素,移除高亮
if
(
event
.
target
!==
window
.
currentlyHighlighted
)
{
if
(
window
.
currentlyHighlighted
)
{
window
.
currentlyHighlighted
.
style
.
backgroundColor
=
''
;
}
window
.
currentlyHighlighted
=
null
;
}
});
},
beforeDestroy
()
{
beforeDestroy
()
{
// 在组件销毁前移除事件监听器
// 在组件销毁前移除事件监听器
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
...
@@ -86,6 +94,13 @@ export default {
...
@@ -86,6 +94,13 @@ export default {
this
.
actionConfig
.
Target
.
Selector
=
elementInfo
.
Xpath
;
this
.
actionConfig
.
Target
.
Selector
=
elementInfo
.
Xpath
;
this
.
actionConfig
.
Target
.
InnerText
=
elementInfo
.
Text
;
this
.
actionConfig
.
Target
.
InnerText
=
elementInfo
.
Text
;
this
.
clickState
=
false
;
this
.
clickState
=
false
;
// 移除先前元素的背景色(如果有)
if
(
window
.
currentlyHighlighted
)
{
window
.
currentlyHighlighted
.
style
.
backgroundColor
=
''
;
}
// 更新背景色并保存当前元素
event
.
target
.
style
.
backgroundColor
=
'orange'
;
window
.
currentlyHighlighted
=
event
.
target
;
// 移除事件监听器
// 移除事件监听器
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
},
},
...
@@ -99,6 +114,7 @@ export default {
...
@@ -99,6 +114,7 @@ export default {
// 取消按钮调用
// 取消按钮调用
cancelSelect
()
{
cancelSelect
()
{
this
.
clickState
=
false
;
// 在取消按钮点击时移除事件监听器
// 在取消按钮点击时移除事件监听器
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
},
},
...
...
src/components/onInput.vue
View file @
c0732c6c
...
@@ -54,7 +54,6 @@ export default {
...
@@ -54,7 +54,6 @@ export default {
}
}
},
},
created
()
{
created
()
{
// console.log(this.activedAction);
if
(
this
.
activedAction
.
Target
!==
undefined
)
{
if
(
this
.
activedAction
.
Target
!==
undefined
)
{
this
.
actionConfig
.
Target
=
this
.
activedAction
.
Target
;
this
.
actionConfig
.
Target
=
this
.
activedAction
.
Target
;
}
}
...
@@ -62,7 +61,18 @@ export default {
...
@@ -62,7 +61,18 @@ export default {
this
.
actionConfig
.
InputValue
=
this
.
activedAction
.
InputValue
;
this
.
actionConfig
.
InputValue
=
this
.
activedAction
.
InputValue
;
}
}
},
},
mounted
()
{
},
mounted
()
{
let
_this
=
this
document
.
addEventListener
(
'click'
,
function
(
event
)
{
// 如果点击的不是当前高亮的元素,移除高亮
if
(
event
.
target
!==
window
.
currentlyHighlighted
)
{
if
(
window
.
currentlyHighlighted
)
{
window
.
currentlyHighlighted
.
style
.
backgroundColor
=
''
;
}
window
.
currentlyHighlighted
=
null
;
}
});
},
watch
:
{
watch
:
{
actionConfig
:
{
actionConfig
:
{
handler
(
newVal
)
{
handler
(
newVal
)
{
...
@@ -70,7 +80,6 @@ export default {
...
@@ -70,7 +80,6 @@ export default {
this
.
activedAction
.
InputValue
=
this
.
actionConfig
.
InputValue
;
this
.
activedAction
.
InputValue
=
this
.
actionConfig
.
InputValue
;
this
.
activedAction
.
Script
=
this
.
actionConfig
.
Script
;
this
.
activedAction
.
Script
=
this
.
actionConfig
.
Script
;
this
.
$emit
(
'dataChanged'
,
this
.
activedAction
);
this
.
$emit
(
'dataChanged'
,
this
.
activedAction
);
console
.
log
(
this
.
activedAction
)
},
},
deep
:
true
deep
:
true
}
}
...
@@ -89,7 +98,6 @@ export default {
...
@@ -89,7 +98,6 @@ export default {
Xpath
:
this
.
getElementXPath
(
element
),
Xpath
:
this
.
getElementXPath
(
element
),
TagName
:
element
.
tagName
TagName
:
element
.
tagName
};
};
console
.
log
(
elementInfo
.
TagName
)
if
(
elementInfo
.
TagName
!=
'INPUT'
)
{
if
(
elementInfo
.
TagName
!=
'INPUT'
)
{
this
.
$message
.
error
(
"请选择输入框"
);
this
.
$message
.
error
(
"请选择输入框"
);
this
.
actionConfig
.
Target
.
tagName
=
'未选择输入框'
;
this
.
actionConfig
.
Target
.
tagName
=
'未选择输入框'
;
...
@@ -98,10 +106,15 @@ export default {
...
@@ -98,10 +106,15 @@ export default {
this
.
actionConfig
.
Target
.
tagName
=
'已选择输入框'
;
this
.
actionConfig
.
Target
.
tagName
=
'已选择输入框'
;
}
}
this
.
elementInfos
=
elementInfo
;
this
.
elementInfos
=
elementInfo
;
console
.
log
(
event
);
this
.
actionConfig
.
Target
.
Selector
=
elementInfo
.
Xpath
;
this
.
actionConfig
.
Target
.
Selector
=
elementInfo
.
Xpath
;
this
.
inputState
=
false
;
this
.
inputState
=
false
;
// 移除先前元素的背景色(如果有)
if
(
window
.
currentlyHighlighted
)
{
window
.
currentlyHighlighted
.
style
.
backgroundColor
=
''
;
}
// 更新背景色并保存当前元素
event
.
target
.
style
.
backgroundColor
=
'orange'
;
window
.
currentlyHighlighted
=
event
.
target
;
// 移除事件监听器
// 移除事件监听器
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
},
},
...
@@ -115,6 +128,7 @@ export default {
...
@@ -115,6 +128,7 @@ export default {
// 取消按钮调用
// 取消按钮调用
cancelSelect
()
{
cancelSelect
()
{
this
.
inputState
=
false
;
// 在取消按钮点击时移除事件监听器
// 在取消按钮点击时移除事件监听器
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
document
.
removeEventListener
(
'contextmenu'
,
this
.
contextMenuHandler
);
},
},
...
...
src/components/pageJavascript.vue
View file @
c0732c6c
...
@@ -25,7 +25,6 @@ export default {
...
@@ -25,7 +25,6 @@ export default {
};
};
},
},
created
()
{
created
()
{
// console.log(this.activedAction);
if
(
this
.
activedAction
.
Script
!==
undefined
)
{
if
(
this
.
activedAction
.
Script
!==
undefined
)
{
this
.
actionConfig
.
Script
=
this
.
activedAction
.
Script
;
this
.
actionConfig
.
Script
=
this
.
activedAction
.
Script
;
}
}
...
@@ -36,7 +35,6 @@ export default {
...
@@ -36,7 +35,6 @@ export default {
handler
(
newVal
)
{
handler
(
newVal
)
{
this
.
activedAction
.
Script
=
this
.
actionConfig
.
Script
;
this
.
activedAction
.
Script
=
this
.
actionConfig
.
Script
;
this
.
$emit
(
'dataChanged'
,
this
.
activedAction
);
this
.
$emit
(
'dataChanged'
,
this
.
activedAction
);
console
.
log
(
this
.
activedAction
)
},
},
deep
:
true
deep
:
true
}
}
...
...
src/components/pageNavigates.vue
View file @
c0732c6c
...
@@ -33,7 +33,6 @@ export default {
...
@@ -33,7 +33,6 @@ export default {
};
};
},
},
created
()
{
created
()
{
console
.
log
(
this
.
activedAction
);
if
(
this
.
activedAction
.
Url
!==
undefined
)
{
if
(
this
.
activedAction
.
Url
!==
undefined
)
{
this
.
actionConfig
.
Url
=
this
.
activedAction
.
Url
;
this
.
actionConfig
.
Url
=
this
.
activedAction
.
Url
;
}
}
...
@@ -44,7 +43,6 @@ export default {
...
@@ -44,7 +43,6 @@ export default {
handler
(
newVal
)
{
handler
(
newVal
)
{
this
.
activedAction
.
Url
=
this
.
actionConfig
.
Url
;
this
.
activedAction
.
Url
=
this
.
actionConfig
.
Url
;
this
.
$emit
(
'dataChanged'
,
this
.
activedAction
);
this
.
$emit
(
'dataChanged'
,
this
.
activedAction
);
console
.
log
(
this
.
activedAction
)
},
},
deep
:
true
deep
:
true
}
}
...
...
src/components/sysSleep.vue
View file @
c0732c6c
...
@@ -26,7 +26,6 @@ export default {
...
@@ -26,7 +26,6 @@ export default {
};
};
},
},
created
()
{
created
()
{
// console.log(this.activedAction);
if
(
this
.
activedAction
.
PauseMilliseconds
!==
undefined
)
{
if
(
this
.
activedAction
.
PauseMilliseconds
!==
undefined
)
{
this
.
actionConfig
.
PauseMilliseconds
=
this
.
activedAction
.
PauseMilliseconds
;
this
.
actionConfig
.
PauseMilliseconds
=
this
.
activedAction
.
PauseMilliseconds
;
}
}
...
@@ -37,7 +36,6 @@ export default {
...
@@ -37,7 +36,6 @@ export default {
handler
(
newVal
)
{
handler
(
newVal
)
{
this
.
activedAction
.
PauseMilliseconds
=
this
.
actionConfig
.
PauseMilliseconds
;
this
.
activedAction
.
PauseMilliseconds
=
this
.
actionConfig
.
PauseMilliseconds
;
this
.
$emit
(
'dataChanged'
,
this
.
activedAction
);
this
.
$emit
(
'dataChanged'
,
this
.
activedAction
);
console
.
log
(
this
.
activedAction
)
},
},
deep
:
true
deep
:
true
}
}
...
...
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