Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
memberTag-web
Overview
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
memberTag
memberTag-web
Commits
6b2929db
Commit
6b2929db
authored
Apr 28, 2019
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
两个相同类型的标签不能拖动到同一个框中
parent
8ef54720
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
tags-group.vue
src/view/memberGroup/tags-group.vue
+20
-11
No files found.
src/view/memberGroup/tags-group.vue
View file @
6b2929db
...
...
@@ -18,7 +18,7 @@
</el-dropdown>
<!--展示选中的标签-->
<div
class=
"tags-group__show"
>
<draggable
group=
"article"
style=
"height: 100%"
@
end=
"dragTag
"
:data-index=
"tagsGroupIndex"
>
<draggable
v-model=
"tagsData"
group=
"article"
style=
"height: 100%"
@
end=
"dragTag"
:move=
"checkMove
"
:data-index=
"tagsGroupIndex"
>
<div
class=
"tags-group__tag"
v-for=
"(item, index) in tagsData"
:key=
"item.tagId"
>
<span>
{{
item
.
tagName
}}
</span>
<span
class=
"tags-group__tag-name"
>
【选择:
{{
item
.
newTagVal
}}
】
</span>
...
...
@@ -77,7 +77,8 @@ export default {
data
()
{
return
{
// 确认删除标签组的弹窗
showDelPop
:
false
showDelPop
:
false
,
changed
:
false
};
},
methods
:
{
...
...
@@ -121,12 +122,20 @@ export default {
},
// 拖拽标签
dragTag
(
evt
)
{
this
.
$emit
(
'dragTag'
,
{
fromTagIndex
:
evt
.
oldIndex
,
toTagIndex
:
evt
.
newIndex
,
fromTagsGroupIndex
:
parseInt
(
evt
.
from
.
getAttribute
(
'data-index'
)),
toTagsGroupIndex
:
parseInt
(
evt
.
to
.
getAttribute
(
'data-index'
))
});
if
(
this
.
changed
)
{
this
.
$emit
(
'dragTag'
,
{
fromTagIndex
:
evt
.
oldIndex
,
toTagIndex
:
evt
.
newIndex
,
fromTagsGroupIndex
:
parseInt
(
evt
.
from
.
getAttribute
(
'data-index'
)),
toTagsGroupIndex
:
parseInt
(
evt
.
to
.
getAttribute
(
'data-index'
))
});
}
},
checkMove
(
evt
)
{
const
relatedList
=
evt
.
relatedContext
.
list
;
const
draggedElement
=
evt
.
draggedContext
.
element
;
this
.
changed
=
!
relatedList
.
some
(
item
=>
item
.
tagId
===
draggedElement
.
tagId
);
return
this
.
changed
;
}
}
};
...
...
@@ -230,17 +239,17 @@ export default {
left
:
15px
;
z-index
:
1
;
width
:
40px
;
height
:
8
0px
;
height
:
6
0px
;
border-left
:
1px
solid
#dcdfe6
;
}
&
::before
{
top
:
-
8
5px
;
top
:
-
6
5px
;
border-top
:
1px
solid
#dcdfe6
;
}
&
::after
{
bottom
:
-
8
5px
;
bottom
:
-
6
5px
;
border-bottom
:
1px
solid
#dcdfe6
;
}
}
...
...
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