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
3216fafd
Commit
3216fafd
authored
Nov 22, 2023
by
郁子恒
Browse files
Options
Browse Files
Download
Plain Diff
新增跳转页面动作,完善点击、输入动作,单个动作导出软件可执行
parents
541697ee
a2fe75d9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
61 deletions
+86
-61
App.vue
src/App.vue
+86
-61
No files found.
src/App.vue
View file @
3216fafd
...
...
@@ -50,6 +50,7 @@
<draggable
v-model=
"treeNode"
chosenClass=
"chosen"
forceFallback=
"true"
group=
"people"
animation=
"1000"
@
start=
"onStart"
@
end=
"onEnd"
v-if=
"isChildrenTree == false"
>
<transition-group>
<el-tag
class=
"boxtags"
:key=
"tag.tagId"
v-for=
"(tag, index) in treeNode"
@
click=
"selectTag(tag)"
:style=
"
{ backgroundColor: tag.Kvid == Kvid ? '#68C23A!important' : '#409EFF' }">
>>>>>>> a2fe75d9465a60707de78a267eed1fecb935958e
<div
style=
"display: flex;align-items: center;height: 25px;position: relative;"
>
<span
style=
"min-width: 40px;display: flex;align-items: center;"
>
<div
class=
"circle"
>
{{
index
+
1
}}
</div>
...
...
@@ -79,7 +80,9 @@
<!-- 容器配置 -->
<div
v-if=
"isShowAction"
>
<div
style=
"height: 35px;display: flex;justify-content: space-between;align-items: center;border-bottom: 1px solid #888888;"
>
<div
style=
"width: 211px;display: flex;align-items: center;margin-left: 15px;"
>
<div
style=
"height: 35px;display: flex;justify-content: space-between;align-items: center;margin-left: 15px;margin-right: 15px;"
>
<div
style=
"width: 211px;display: flex;align-items: center;"
>
>>>>>>> a2fe75d9465a60707de78a267eed1fecb935958e
<span
style=
"width: 90px;"
>
动作名称:
</span>
<el-input
class=
"input-new-tag dongzuo"
v-model=
"actionName"
size=
"small"
placeholder=
"请输入动作名称"
>
</el-input>
...
...
@@ -99,6 +102,7 @@
</div>
</div>
</div>
</div>
</
template
>
<
script
>
...
...
@@ -178,7 +182,8 @@ export default {
Kvid
:
123123
,
actions
:
[]
}],
actionConfigs
:
{}
actionConfigs
:
{},
selectTagItem
:
{}
}
},
...
...
@@ -197,8 +202,7 @@ export default {
actionName
(
newVal
,
oldVal
)
{
// 在输入值发生变化时触发
if
(
newVal
!==
oldVal
)
{
// console.log(newVal)
// console.log(this.dynamicTags)
const
targetObject
=
this
.
dynamicTags
.
find
(
obj
=>
obj
.
tagId
===
this
.
dynamicTagObj
.
tagId
);
if
(
targetObject
)
{
if
(
newVal
==
undefined
)
return
...
...
@@ -292,7 +296,7 @@ export default {
// console.log(this.subData);
// console.log('接收到的数据:', newData);
const
targetObject
=
this
.
dynamicTags
.
find
(
obj
=>
obj
.
Kvid
===
this
.
dynamicTagObj
.
Kvid
);
console
.
log
(
targetObject
)
//
console.log(targetObject)
if
(
targetObject
)
{
// if (newVal == undefined) return
// // 找到匹配的对象
...
...
@@ -312,6 +316,7 @@ export default {
this
.
actionName
=
"新建动作"
this
.
actionType
=
""
this
.
Kvid
=
null
this
.
selectTagItem
=
{}
let
obj
=
{}
obj
.
taskName
=
this
.
taskName
obj
.
taskAddress
=
this
.
taskAddress
...
...
@@ -342,43 +347,86 @@ export default {
},
// 进入容器
toActions
()
{
this
.
isShowAction
=
false
if
(
this
.
actionType
==
'actions'
)
{
// this.actionType = ''
// this.actionName = ''
this
.
parentKvid
=
this
.
Kvid
let
activeItem
=
this
.
findObjectByKvid
(
this
.
treeNode
,
this
.
Kvid
);
this
.
childrenTreeNode
=
[]
this
.
isChildrenTree
=
true
console
.
log
(
activeItem
)
let
activeParentItem
=
this
.
findObjectByKvid
(
this
.
treeNode
,
activeItem
.
parentKvid
);
activeItem
.
actions
=
[]
let
_this
=
this
_this
.
isShowAction
=
false
if
(
_this
.
actionType
==
'actions'
)
{
if
(
Object
.
keys
(
_this
.
selectTagItem
).
length
==
0
)
{
_this
.
parentKvid
=
_this
.
Kvid
}
let
activeItem
=
_this
.
findObjectByKvid
(
_this
.
treeNode
,
_this
.
Kvid
);
_this
.
childrenTreeNode
=
[]
_this
.
isChildrenTree
=
true
let
activeParentItem
=
_this
.
findObjectByKvid
(
_this
.
treeNode
,
activeItem
.
parentKvid
);
if
(
activeParentItem
==
null
)
{
console
.
log
(
'已经有容器了'
)
// if (this.actionAll[0].actions.length > 0) return
//根节点再次进容器
if
(
Object
.
keys
(
_this
.
selectTagItem
).
length
!==
0
)
{
_this
.
Kvid
=
_this
.
selectTagItem
.
Kvid
let
obj
=
{}
obj
.
name
=
_this
.
selectTagItem
.
actionName
obj
.
Kvid
=
_this
.
selectTagItem
.
Kvid
obj
.
actions
=
[]
// console.log(_this.treeNode)
for
(
let
i
=
0
;
i
<
_this
.
treeNode
.
length
;
i
++
)
{
_this
.
actionAll
[
0
].
actions
.
push
(
_this
.
treeNode
[
i
])
}
_this
.
actionAll
.
push
(
obj
)
_this
.
findOrPushObject
(
_this
.
actionAll
[
0
].
actions
,
obj
)
_this
.
childrenTreeNode
=
[]
_this
.
isChildrenTree
=
true
if
(
_this
.
selectTagItem
.
actions
!=
undefined
&&
_this
.
selectTagItem
.
actions
.
length
>
0
)
{
_this
.
childrenTreeNode
=
[]
for
(
let
i
=
0
;
i
<
_this
.
selectTagItem
.
actions
.
length
;
i
++
)
{
_this
.
childrenTreeNode
.
push
(
_this
.
selectTagItem
.
actions
[
i
])
}
_this
.
isChildrenTree
=
true
}
}
else
{
let
obj
=
{}
obj
.
name
=
activeItem
.
actionName
obj
.
Kvid
=
activeItem
.
Kvid
obj
.
actions
=
[]
console
.
log
(
this
.
treeNode
)
for
(
let
i
=
0
;
i
<
this
.
treeNode
.
length
;
i
++
)
{
this
.
actionAll
[
0
].
actions
.
push
(
this
.
treeNode
[
i
])
// console.log(_this.treeNode)
for
(
let
i
=
0
;
i
<
_this
.
treeNode
.
length
;
i
++
)
{
_this
.
actionAll
[
0
].
actions
.
push
(
_this
.
treeNode
[
i
])
}
_this
.
actionAll
.
push
(
obj
)
_this
.
findOrPushObject
(
_this
.
actionAll
[
0
].
actions
,
obj
)
}
}
else
{
// 子节点再次进入容器
if
(
Object
.
keys
(
_this
.
selectTagItem
).
length
!==
0
)
{
_this
.
childrenTreeNode
=
[]
let
obj
=
{}
obj
.
name
=
_this
.
selectTagItem
.
actionName
obj
.
Kvid
=
_this
.
selectTagItem
.
Kvid
obj
.
actions
=
[]
for
(
let
i
=
0
;
i
<
_this
.
selectTagItem
.
actions
.
length
;
i
++
)
{
obj
.
actions
.
push
(
_this
.
selectTagItem
.
actions
[
i
])
_this
.
childrenTreeNode
.
push
(
_this
.
selectTagItem
.
actions
[
i
])
}
_this
.
findOrPushObject
(
_this
.
actionAll
,
obj
)
_this
.
isChildrenTree
=
true
if
(
_this
.
selectTagItem
.
actions
!=
undefined
&&
_this
.
selectTagItem
.
actions
.
length
>
0
)
{
_this
.
childrenTreeNode
=
[]
for
(
let
i
=
0
;
i
<
_this
.
selectTagItem
.
actions
.
length
;
i
++
)
{
_this
.
childrenTreeNode
.
push
(
_this
.
selectTagItem
.
actions
[
i
])
}
_this
.
isChildrenTree
=
true
}
this
.
actionAll
.
push
(
obj
)
this
.
findOrPushObject
(
this
.
actionAll
[
0
].
actions
,
obj
)
}
else
{
// this.actionType = ''
// this.actionName = ''
let
obj
=
{}
obj
.
name
=
activeItem
.
actionName
obj
.
Kvid
=
activeItem
.
Kvid
obj
.
actions
=
[]
activeItem
.
actions
=
[]
for
(
let
i
=
0
;
i
<
activeItem
.
actions
.
length
;
i
++
)
{
obj
.
actions
.
push
(
activeItem
.
actions
[
i
])
}
this
.
childrenTreeNode
=
obj
.
actions
this
.
findOrPushObject
(
this
.
actionAll
,
obj
)
// console.log(this.actionAll)
_this
.
childrenTreeNode
=
obj
.
actions
_this
.
findOrPushObject
(
_this
.
actionAll
,
obj
)
}
}
}
else
{
this
.
parentKvid
=
null
...
...
@@ -421,42 +469,25 @@ export default {
this
.
parentKvid
=
item
.
Kvid
this
.
isShowAction
=
false
}
console
.
log
()
//
console.log()
},
// 单击标签
selectTag
(
item
)
{
// this.parentTree = item
// console.log(item)
let
_this
=
this
_this
.
selectTagItem
=
item
if
(
item
.
actionType
==
'actions'
)
{
if
(
_this
.
parentKvid
==
null
&&
item
.
parentKvid
==
undefined
)
{
_this
.
parentKvid
=
item
.
Kvid
console
.
log
(
item
)
let
obj
=
{}
obj
.
name
=
item
.
actionName
obj
.
Kvid
=
item
.
Kvid
obj
.
actions
=
[]
for
(
let
i
=
0
;
i
<
_this
.
treeNode
.
length
;
i
++
)
{
_this
.
actionAll
[
0
].
actions
.
push
(
_this
.
treeNode
[
i
])
}
_this
.
actionAll
.
push
(
obj
)
_this
.
findOrPushObject
(
_this
.
actionAll
[
0
].
actions
,
obj
)
_this
.
childrenTreeNode
=
[]
_this
.
isChildrenTree
=
true
_this
.
actionType
=
item
.
actionType
_this
.
actionName
=
item
.
actionName
_this
.
isShowAction
=
true
}
else
{
_this
.
parentKvid
=
item
.
Kvid
_this
.
childrenTreeNode
=
[]
_this
.
isShowAction
=
false
let
obj
=
{}
obj
.
name
=
item
.
actionName
obj
.
Kvid
=
item
.
Kvid
obj
.
actions
=
[]
for
(
let
i
=
0
;
i
<
item
.
actions
.
length
;
i
++
)
{
obj
.
actions
.
push
(
item
.
actions
[
i
])
_this
.
childrenTreeNode
.
push
(
item
.
actions
[
i
])
}
_this
.
findOrPushObject
(
_this
.
actionAll
,
obj
)
_this
.
isChildrenTree
=
true
_this
.
actionName
=
item
.
actionName
_this
.
actionType
=
item
.
actionType
_this
.
isShowAction
=
true
}
}
else
{
_this
.
actionName
=
item
.
actionName
...
...
@@ -464,13 +495,6 @@ export default {
_this
.
isShowAction
=
true
}
_this
.
Kvid
=
item
.
Kvid
if
(
item
.
actions
!=
undefined
&&
item
.
actions
.
length
>
0
)
{
_this
.
childrenTreeNode
=
[]
for
(
let
i
=
0
;
i
<
item
.
actions
.
length
;
i
++
)
{
_this
.
childrenTreeNode
.
push
(
item
.
actions
[
i
])
}
_this
.
isChildrenTree
=
true
}
_this
.
dynamicTagObj
=
item
// 点击切换组件
_this
.
loadComponent
(
item
.
actionType
)
...
...
@@ -592,6 +616,7 @@ export default {
submitPlan
(
formName
)
{
this
.
isShowAction
=
true
console
.
log
(
this
.
subData
)
// console.log(this.treeNode)
// 将JSON对象转换为JSON字符串
// const arrayOfObjects = [this.subData];
const
jsonString
=
JSON
.
stringify
(
this
.
subData
,
null
,
2
);
...
...
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