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
a7df8659
Commit
a7df8659
authored
Apr 28, 2019
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决单个框里面可以添加相同标签的问题
parent
ab14657f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
memberGroupEdit.vue
src/view/memberGroup/memberGroupEdit.vue
+23
-3
No files found.
src/view/memberGroup/memberGroupEdit.vue
View file @
a7df8659
...
...
@@ -71,7 +71,7 @@
<div
class=
"tags-search"
>
<el-input
type=
"search"
placeholder=
"请输入关键词回车搜索标签"
prefix-icon=
"el-icon-search"
v-model=
"searchData"
@
keydown
.
native
.
enter=
"searchTags"
></el-input>
</div>
<tag-container
:data=
"tagsGroupList"
@
addTag=
"selectedTag"
></tag-container>
<tag-container
:data=
"tagsGroupList"
:refresh=
"refershList"
@
addTag=
"selectedTag"
></tag-container>
<div
class=
"page-box"
>
<el-pagination
background
...
...
@@ -89,7 +89,7 @@
</div>
</el-dialog>
<!-- 添加标签、编辑标签 -->
<edit-tag
:showEditTagPop
.
sync=
"showEditTagPop"
:tagData=
"tagData"
:title=
"editPopType === 'add' ? '添加标签' : '编辑标签'"
@
returnTagData=
"returnTagData"
></edit-tag>
<edit-tag
:showEditTagPop
.
sync=
"showEditTagPop"
:tagData=
"tagData"
:title=
"editPopType === 'add' ? '添加标签' : '编辑标签'"
@
returnTagData=
"returnTagData"
@
refresh=
"refresh"
></edit-tag>
<vue-gic-footer></vue-gic-footer>
</div>
</template>
...
...
@@ -169,6 +169,7 @@ export default {
updateDay
:
''
,
effectiveStatus
:
1
},
refershList
:
{},
// 标签组的索引
activeTagsGroupIndex
:
0
,
...
...
@@ -292,6 +293,11 @@ export default {
changeRoute
(
route
)
{
this
.
$router
.
push
(
route
);
},
refresh
(
list
)
{
console
.
log
(
'list'
,
list
);
list
.
changeRefersh
=
true
;
this
.
refershList
=
list
;
},
// 添加标签
addTags
()
{
...
...
@@ -323,7 +329,21 @@ export default {
switch
(
this
.
editPopType
)
{
case
'add'
:
this
.
ruleForm
.
selectedTags
[
this
.
activeTagsGroupIndex
].
push
(
data
);
const
isHad
=
this
.
ruleForm
.
selectedTags
.
some
(
group
=>
{
return
group
.
some
(
item
=>
item
.
tagId
===
data
.
tagId
);
});
if
(
isHad
)
{
this
.
ruleForm
.
selectedTags
=
this
.
ruleForm
.
selectedTags
.
map
(
group
=>
{
return
group
.
map
(
tag
=>
{
if
(
tag
.
tagId
===
data
.
tagId
)
{
tag
=
data
;
}
return
tag
;
});
});
}
else
{
this
.
ruleForm
.
selectedTags
[
this
.
activeTagsGroupIndex
].
push
(
data
);
}
break
;
case
'edit'
:
// 注意有坑
...
...
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