Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-attachment-customer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ee16db82
authored
Nov 30, 2021
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
ccc32fa4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
31 deletions
src/views/tag/index.vue
src/views/tag/make.vue
src/views/tag/index.vue
View file @
ee16db8
...
...
@@ -46,7 +46,7 @@
全选
<label>
已选{{ checkList.length }}个客户
</label>
</div>
<van-button
class=
"my-button"
round
color=
"#5850FF"
@
click=
"handleTag"
>
批量打标签
</van-button>
<van-button
class=
"my-button"
round
color=
"#5850FF"
@
click=
"handleTag"
>
批量打标签
</van-button>
</div>
</template>
</div>
...
...
@@ -150,6 +150,8 @@ export default {
this
.
customerList
.
forEach
(
item
=>
{
item
.
isChecked
=
this
.
allChecked
})
this
.
allChecked
?
(
this
.
checkList
=
this
.
customerList
)
:
(
this
.
checkList
=
[])
},
searchkeyWord
(
e
)
{
this
.
keyWord
=
e
...
...
src/views/tag/make.vue
View file @
ee16db8
...
...
@@ -2,32 +2,34 @@
<van-popup
v-model=
"tagShow"
position=
"bottom"
:style=
"
{ height: '90%' }">
<div
class=
"container-pop"
>
<search
placeholder=
"请输入关键字"
:keyword=
"keyWord"
@
search=
"searchkeyWord"
></search>
<div
class=
"content"
ref=
"scrollView"
>
<div
class=
"close-container"
v-if=
"checkAll.length > 0"
>
<div
class=
"nav-icon"
>
<img
src=
"../../assets/images/icon/nav-icon.png"
/>
</div>
<template
v-for=
"(closeTag, i) in checkAll"
>
<div
class=
"close-tag"
@
click=
"close(closeTag, i)"
:key=
"i"
>
{{
closeTag
.
taggingName
}}
<img
src=
"../../assets/images/icon/close-icon.png"
/>
</div>
</
template
>
</div>
<div
class=
"tag-container"
>
<
template
v-if=
"tagList.length > 0"
>
<div
class=
"tag-type"
v-for=
"(item, index) in tagList"
:key=
"index"
>
<div
class=
"tag-title"
>
{{
item
.
groupName
}}
</div>
<div
class=
"tag-list"
>
<template
v-for=
"(tag, ids) in item.taggingList"
>
<div
:key=
"ids"
:class=
"
{ tag: true, active: tag.isChecked }" @click="chooseTag(index, ids)">
{{
tag
.
taggingName
}}
</div>
</
template
>
<div
class=
"contentWrap"
>
<van-list
:finished=
"finished"
finished-text=
""
offset=
"100"
:immediate-check=
"false"
>
<div
class=
"close-container"
v-if=
"checkAll.length > 0"
>
<div
class=
"nav-icon"
>
<img
src=
"../../assets/images/icon/nav-icon.png"
/>
</div>
<template
v-for=
"(closeTag, i) in checkAll"
>
<div
class=
"close-tag"
@
click=
"close(closeTag, i)"
:key=
"i"
>
{{
closeTag
.
taggingName
}}
<img
src=
"../../assets/images/icon/close-icon.png"
/>
</div>
</
template
>
</div>
<div
class=
"tag-container"
>
<
template
v-if=
"tagList.length > 0"
>
<div
class=
"tag-type"
v-for=
"(item, index) in tagList"
:key=
"index"
>
<div
class=
"tag-title"
>
{{
item
.
groupName
}}
</div>
<div
class=
"tag-list"
>
<template
v-for=
"(tag, ids) in item.taggingList"
>
<div
:key=
"ids"
:class=
"
{ tag: true, active: tag.isChecked }" @click="chooseTag(index, ids)">
{{
tag
.
taggingName
}}
</div>
</
template
>
</div>
</div>
</template>
<empty
v-else
description=
"没有找到你搜索的内容"
/>
</div>
</template>
<empty
v-else
description=
"没有找到你搜索的内容"
/>
</van-list>
</div>
</div>
<div
class=
"pop-footer"
>
<div
class=
"reset"
@
click=
"reset"
>
重置
</div>
<van-button
class=
"my-pop-button"
round
color=
"#5850FF"
@
click=
"handleTag"
>
打标签
</van-button>
...
...
@@ -42,6 +44,8 @@ export default {
name
:
'make'
,
data
()
{
return
{
loading
:
false
,
finished
:
false
,
keyWord
:
''
,
tagList
:
[],
checkAll
:
[],
...
...
@@ -75,7 +79,7 @@ export default {
},
add
(
index
,
ids
)
{
if
(
this
.
tagList
[
index
].
taggingList
[
ids
].
isChecked
)
{
this
.
checkAll
.
push
(
this
.
tagList
[
index
].
taggingList
[
ids
]
)
this
.
checkAll
.
push
(
{
...
this
.
tagList
[
index
].
taggingList
[
ids
]
}
)
}
else
{
this
.
checkAll
.
splice
(
index
,
1
)
}
...
...
@@ -99,8 +103,7 @@ export default {
keyWord
:
this
.
keyWord
}
groupTag
.
gettagList
(
obj
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
data
&&
res
.
data
.
length
>
0
)
{
if
(
res
.
data
&&
res
.
data
.
length
>
0
)
{
this
.
tagList
=
res
.
data
if
(
this
.
tagList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
tagList
.
length
;
i
++
)
{
...
...
@@ -110,16 +113,31 @@ export default {
}
}
}
if
(
this
.
checkAll
.
length
>
0
&&
this
.
tagList
.
length
>
0
)
{
this
.
saveTag
()
}
}
else
{
this
.
tagList
=
[]
}
console
.
log
(
this
.
tagList
)
})
},
searchkeyWord
(
e
)
{
this
.
keyWord
=
e
this
.
init
()
},
//搜素之后保留选中标签
saveTag
()
{
for
(
let
i
=
0
;
i
<
this
.
tagList
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
this
.
tagList
[
i
].
taggingList
.
length
;
j
++
)
{
this
.
checkAll
.
forEach
(
item
=>
{
if
(
item
.
taggingId
==
this
.
tagList
[
i
].
taggingList
[
j
].
taggingId
)
{
this
.
tagList
[
i
].
checked
=
true
this
.
tagList
[
i
].
taggingList
[
j
].
isChecked
=
true
}
})
}
}
},
clearData
()
{
if
(
this
.
tagList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
tagList
.
length
;
i
++
)
{
...
...
@@ -134,7 +152,6 @@ export default {
},
//打标签
handleTag
()
{
console
.
log
(
this
.
externalUserIds
)
let
taggingInfo
=
[]
for
(
let
i
=
0
;
i
<
this
.
tagList
.
length
;
i
++
)
{
if
(
this
.
tagList
[
i
].
checked
)
{
...
...
@@ -179,7 +196,7 @@ export default {
<
style
lang=
"scss"
scoped
>
.container-pop
{
width
:
100%
;
.content{
.content
Wrap
{
height
:
calc
(
90vh
-
120px
);
overflow-y
:
scroll
;
}
...
...
@@ -224,7 +241,7 @@ export default {
justify-content
:
space-between
;
padding
:
0
16px
;
position
:
fixed
;
bottom
:
35
px
;
bottom
:
20
px
;
box-sizing
:
border-box
;
.reset
{
font-size
:
16px
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment