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
cd4d4c7f
Commit
cd4d4c7f
authored
Nov 13, 2023
by
高源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签删除优化
parent
61b8c8de
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
17 deletions
+57
-17
App.vue
src/App.vue
+57
-17
close.png
src/assets/close.png
+0
-0
No files found.
src/App.vue
View file @
cd4d4c7f
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
</div>
</div>
<div
style=
"display: flex;flex-direction: column;"
>
<div
style=
"display: flex;flex-direction: column;"
>
<el-button
size=
"mini"
style=
"width: 60px;height: 25px;margin-bottom: 5px;margin-left: 10px;"
<el-button
size=
"mini"
style=
"width: 60px;height: 25px;margin-bottom: 5px;margin-left: 10px;"
@
click=
"submit
Form
"
>
保存任务
</el-button>
@
click=
"submit
Plan
"
>
保存任务
</el-button>
<el-button
size=
"mini"
style=
"width: 60px;height: 25px;"
@
click=
"newAction"
>
新建动作
</el-button>
<el-button
size=
"mini"
style=
"width: 60px;height: 25px;"
@
click=
"newAction"
>
新建动作
</el-button>
</div>
</div>
</div>
</div>
...
@@ -40,17 +40,17 @@
...
@@ -40,17 +40,17 @@
</div>
</div>
<!-- 动作标签 -->
<!-- 动作标签 -->
<div
<div
style=
"margin-bottom: 5px;margin-left: 15px;margin-right: 15px;width: 470px;overflow: auto;white-space: nowrap;display: flex;"
>
style=
"margin-bottom: 5px;margin-left: 15px;margin-right: 15px;width: 470px;overflow: auto;white-space: nowrap;display: flex;
padding-top: 5px;
"
>
<!--
<el-button
@
click=
"goback"
>
返回
</el-button>
-->
<!--
<el-button
@
click=
"goback"
>
返回
</el-button>
-->
<draggable
v-model=
"treeNode"
chosenClass=
"chosen"
forceFallback=
"true"
group=
"people"
animation=
"1000"
<draggable
v-model=
"treeNode"
chosenClass=
"chosen"
forceFallback=
"true"
group=
"people"
animation=
"1000"
@
start=
"onStart"
@
end=
"onEnd"
v-if=
"isChildrenTree == false"
>
@
start=
"onStart"
@
end=
"onEnd"
v-if=
"isChildrenTree == false"
>
<transition-group>
<transition-group>
<!--
<div
class=
"item"
v-for=
"element in myArray"
:key=
"element.id"
>
{{
element
.
name
}}
</div>
-->
<!--
<div
class=
"item"
v-for=
"element in myArray"
:key=
"element.id"
>
{{
element
.
name
}}
</div>
-->
<el-tag
class=
"boxtags"
:key=
"tag.tagId"
v-for=
"(tag, index) in treeNode"
@
click=
"selectTag(tag)"
>
<el-tag
class=
"boxtags"
:key=
"tag.tagId"
v-for=
"(tag, index) in treeNode"
@
click=
"selectTag(tag)"
>
<div
style=
"display: flex;align-items: center;"
>
<div
style=
"display: flex;align-items: center;
height: 30px;position: relative;
"
>
<span
style=
"margin-left: 3px;"
>
{{
tag
.
actionName
}}
</span>
<span
style=
"margin-left: 3px;
min-width: 20px;
"
>
{{
tag
.
actionName
}}
</span>
<img
id=
"closeimg"
@
click=
"handleClose(
index)"
style=
"width: 15px;
"
<img
id=
"closeimg"
@
click=
"handleClose(
tag)
"
src=
"./assets/close.png"
>
s
tyle=
"width: 20px;position: absolute;top: -8px;right: -18px;"
s
rc=
"./assets/close.png"
>
</div>
</div>
</el-tag>
</el-tag>
</transition-group>
</transition-group>
...
@@ -60,10 +60,10 @@
...
@@ -60,10 +60,10 @@
<transition-group>
<transition-group>
<el-tag
class=
"boxtags"
:key=
"item.tagId"
v-for=
"(item, index) in childrenTreeNode"
<el-tag
class=
"boxtags"
:key=
"item.tagId"
v-for=
"(item, index) in childrenTreeNode"
@
click=
"selectTag(item)"
>
@
click=
"selectTag(item)"
>
<div
style=
"display: flex;align-items: center;"
>
<div
style=
"display: flex;align-items: center;
height: 30px;position: relative;
"
>
<span
style=
"margin-left: 3px;"
>
{{
item
.
actionName
}}
</span>
<span
style=
"margin-left: 3px;"
>
{{
item
.
actionName
}}
</span>
<img
id=
"closeimg"
@
click=
"handleClose(i
ndex)"
style=
"width: 15px;
"
<img
id=
"closeimg"
@
click=
"handleClose(i
tem)
"
src=
"./assets/close.png"
>
s
tyle=
"width: 20px;position: absolute;top: -8px;right: -18px;"
s
rc=
"./assets/close.png"
>
</div>
</div>
</el-tag>
</el-tag>
</transition-group>
</transition-group>
...
@@ -312,6 +312,7 @@ export default {
...
@@ -312,6 +312,7 @@ export default {
obj
.
name
=
activeItem
.
actionName
obj
.
name
=
activeItem
.
actionName
obj
.
Kvid
=
activeItem
.
Kvid
obj
.
Kvid
=
activeItem
.
Kvid
obj
.
children
=
[]
obj
.
children
=
[]
console
.
log
(
this
.
treeNode
)
for
(
let
i
=
0
;
i
<
this
.
treeNode
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
treeNode
.
length
;
i
++
)
{
this
.
actionAll
[
0
].
children
.
push
(
this
.
treeNode
[
i
])
this
.
actionAll
[
0
].
children
.
push
(
this
.
treeNode
[
i
])
...
@@ -413,14 +414,55 @@ export default {
...
@@ -413,14 +414,55 @@ export default {
},
},
// 删除标签
// 删除标签
handleClose
(
tag
)
{
handleClose
(
tag
)
{
let
_this
=
this
if
(
this
.
childrenTreeNode
.
length
>
0
)
{
if
(
_this
.
childrenTreeNode
.
length
>
0
&&
_this
.
isChildrenTree
==
true
)
{
this
.
childrenTreeNode
.
splice
(
this
.
childrenTreeNode
.
indexOf
(
tag
),
1
);
let
filteredArray
=
_this
.
childrenTreeNode
.
filter
(
item
=>
item
.
Kvid
!==
tag
.
Kvid
);
_this
.
childrenTreeNode
=
[]
for
(
let
i
=
0
;
i
<
filteredArray
.
length
;
i
++
)
{
_this
.
childrenTreeNode
.
push
(
filteredArray
[
i
])
}
let
activeItem
=
_this
.
findObjectByKvid
(
_this
.
actionAll
[
0
].
children
,
tag
.
Kvid
);
let
activeParentItem
=
null
// 根目录下处理
if
(
activeItem
!==
null
)
{
activeParentItem
=
_this
.
findObjectByKvid
(
_this
.
actionAll
[
0
].
children
,
activeItem
.
parentKvid
);
}
else
{
}
else
{
this
.
treeNode
.
splice
(
this
.
treeNode
.
indexOf
(
tag
),
1
);
let
filteredArray
=
_this
.
treeNode
.
filter
(
item
=>
item
.
Kvid
!==
tag
.
Kvid
);
_this
.
treeNode
=
[]
for
(
let
i
=
0
;
i
<
filteredArray
.
length
;
i
++
)
{
_this
.
treeNode
.
push
(
filteredArray
[
i
])
}
}
this
.
isShowAction
=
false
}
if
(
activeParentItem
==
null
)
{
let
filteredArray
=
_this
.
childrenTreeNode
.
filter
(
item
=>
item
.
Kvid
!==
tag
.
Kvid
);
_this
.
childrenTreeNode
=
[]
for
(
let
i
=
0
;
i
<
filteredArray
.
length
;
i
++
)
{
_this
.
childrenTreeNode
.
push
(
filteredArray
[
i
])
}
}
else
{
let
filteredArray
=
activeParentItem
.
children
.
filter
(
item
=>
item
.
Kvid
!==
tag
.
Kvid
);
activeParentItem
.
children
=
[]
for
(
let
i
=
0
;
i
<
filteredArray
.
length
;
i
++
)
{
activeParentItem
.
children
.
push
(
filteredArray
[
i
])
}
}
}
else
if
(
_this
.
treeNode
.
length
>
0
&&
_this
.
isChildrenTree
==
false
)
{
let
filteredArray
=
_this
.
treeNode
.
filter
(
item
=>
item
.
Kvid
!==
tag
.
Kvid
);
_this
.
treeNode
=
[]
for
(
let
i
=
0
;
i
<
filteredArray
.
length
;
i
++
)
{
_this
.
treeNode
.
push
(
filteredArray
[
i
])
}
let
activeItem
=
_this
.
findObjectByKvid
(
_this
.
childrenTreeNode
,
tag
.
parentKvid
);
if
(
activeItem
==
null
)
{
let
filteredArray
=
_this
.
childrenTreeNode
.
filter
(
item
=>
item
.
Kvid
!==
tag
.
Kvid
);
_this
.
childrenTreeNode
=
[]
for
(
let
i
=
0
;
i
<
filteredArray
.
length
;
i
++
)
{
_this
.
childrenTreeNode
.
push
(
filteredArray
[
i
])
}
}
}
_this
.
isShowAction
=
false
},
},
// 根据 Kvid 找到对应的对象,并将匹配到的对象后面的所有对象数据删除
// 根据 Kvid 找到对应的对象,并将匹配到的对象后面的所有对象数据删除
deleteObjectsAfterKvid
(
dataArray
,
targetKvid
)
{
deleteObjectsAfterKvid
(
dataArray
,
targetKvid
)
{
...
@@ -486,7 +528,7 @@ export default {
...
@@ -486,7 +528,7 @@ export default {
}
}
},
},
// 计划任务提交
// 计划任务提交
submit
Form
(
formName
)
{
submit
Plan
(
formName
)
{
this
.
isShowAction
=
true
this
.
isShowAction
=
true
},
},
// 根据parentKvid找当前节点
// 根据parentKvid找当前节点
...
@@ -559,8 +601,6 @@ export default {
...
@@ -559,8 +601,6 @@ export default {
// 拖拽完最终结果
// 拖拽完最终结果
console
.
log
(
this
.
treeNode
)
console
.
log
(
this
.
treeNode
)
},
},
},
},
}
}
</
script
>
</
script
>
...
...
src/assets/close.png
View replaced file @
61b8c8de
View file @
cd4d4c7f
212 Bytes
|
W:
|
H:
6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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