Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-marketing
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 2caec486
authored
Jun 15, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复bug
1 parent
08b85a68
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
35 deletions
src/views/customerTransform/addCustomer.vue
src/views/customerTransform/components/preview.vue
src/views/customerTransform/components/selectCrowd.vue
src/views/customerTransform/components/tag-textarea.vue
src/views/customerTransform/addCustomer.vue
View file @
2caec48
...
...
@@ -528,7 +528,7 @@ export default {
// 删除人群
removeCrowd
(
item
,
index
)
{
this
.
basicForm
.
crowdList
.
splice
(
index
,
1
)
this
.
$refs
.
selectCrowd
.
remove
(
item
)
//
this.$refs.selectCrowd.remove(item)
this
.
getCrowdData
(
this
.
basicForm
.
crowdList
)
if
(
!
this
.
basicForm
.
crowdList
.
length
)
{
this
.
basicForm
.
userList
=
[]
...
...
@@ -687,6 +687,14 @@ export default {
this
.
isUpdate
=
true
this
.
editStatus
=
true
})
}
else
{
this
.
basicForm
.
userList
=
[]
this
.
basicForm
.
crowdList
=
[]
this
.
selectData
=
[]
this
.
isSelectCrowd
=
false
this
.
isUpdate
=
true
this
.
editStatus
=
true
this
.
key
=
new
Date
()
}
}
}
...
...
src/views/customerTransform/components/preview.vue
View file @
2caec48
...
...
@@ -59,7 +59,7 @@ export default {
previewList
(
val
)
{
if
(
val
.
length
&&
val
[
0
].
attType
==
1
)
{
const
attContent
=
val
[
0
].
attContent
const
htm
=
attContent
.
replace
(
/
\[[\u
4E00-
\u
9FA56
]{1,4}
]/gi
,
function
(
res
)
{
const
htm
=
attContent
.
replace
(
/
\[[\u
4E00-
\u
9FA56
]{1,4}
]/gi
,
function
(
res
)
{
let
word
=
res
.
replace
(
/
\[
|
\]
/gi
,
''
)
const
list
=
emoji
.
flat
(
Infinity
)
let
index
=
parseInt
(
list
.
indexOf
(
word
))
+
1
...
...
@@ -128,14 +128,17 @@ export default {
word-break
:
break-all
;
display
:
flex
;
img
{
width
:
20px
;
height
:
20px
;
width
:
16px
;
height
:
16px
;
vertical-align
:
middle
;
}
}
.text
{
display
:
inline-block
;
font-size
:
1
6
px
;
font-size
:
1
2
px
;
padding
:
8px
11px
;
line-height
:
16px
;
white-space
:
pre-wrap
;
}
.preview-link
{
display
:
inline-flex
;
...
...
src/views/customerTransform/components/selectCrowd.vue
View file @
2caec48
...
...
@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2022-05-24 18:18:53
* @LastEditors: huyue
* @LastEditTime: 2022-06-1
3 16:51:03
* @LastEditTime: 2022-06-1
4 18:31:20
-->
<
template
>
<div>
<el-dialog
:title=
"'人群筛选'"
:width=
"'1080px'"
:visible
.
sync=
"crowdVisible"
>
<el-dialog
:title=
"'人群筛选'"
:width=
"'1080px'"
:visible
.
sync=
"crowdVisible"
v-if=
"crowdVisible"
>
<div
class=
"member-wrapper"
>
<div
class=
"member-left"
>
<div
class=
"member-title"
>
...
...
@@ -23,7 +23,7 @@
</el-form-item>
</el-form>
<div
class=
"table-content"
>
<GLTable
v-loading=
"loading"
ref=
"crowdTable"
:tableData=
"tableData"
@
refreshTable=
"search"
:tableTotal=
"tableTotal"
:layout=
"layout"
:tableParams=
"crowdTableParams"
:hasNum=
"true"
:pageConf=
"pageConf"
:noDataImg=
"url"
@
selectionTable=
"
s
electionTable"
@
row-click=
"rowClick"
></GLTable>
<GLTable
v-loading=
"loading"
ref=
"crowdTable"
:tableData=
"tableData"
@
refreshTable=
"search"
:tableTotal=
"tableTotal"
:layout=
"layout"
:tableParams=
"crowdTableParams"
:hasNum=
"true"
:pageConf=
"pageConf"
:noDataImg=
"url"
@
selectionTable=
"
handleS
electionTable"
@
row-click=
"rowClick"
></GLTable>
</div>
</div>
</div>
...
...
@@ -32,7 +32,7 @@
<div
class=
"member-name"
>
人群(
{{
innerTags
.
length
}}
项)
</div>
<div
class=
"input-tag-wrapper"
>
<div
class=
"tag-box"
>
<el-tag
v-for=
"(tag, idx) in innerTags"
:key=
"idx"
type=
"info"
closable
:disable-transitions=
"false"
@
close=
"remove(tag)"
>
<el-tag
v-for=
"(tag, idx) in innerTags"
:key=
"idx"
type=
"info"
closable
:disable-transitions=
"false"
@
close=
"remove(tag
, idx
)"
>
{{
tag
.
crowdName
}}
</el-tag>
</div>
...
...
@@ -97,7 +97,7 @@ export default {
},
methods
:
{
init
(
val
)
{
console
.
log
(
val
)
//
console.log(val)
this
.
inner
=
this
.
$common
.
utils
.
deepClone
(
val
)
this
.
innerTags
=
this
.
$common
.
utils
.
deepClone
(
val
)
this
.
crowdVisible
=
true
...
...
@@ -122,47 +122,103 @@ export default {
this
.
$apis
.
customerTransform
.
queryCrowdtree
(
params
).
then
(
res
=>
{
this
.
tableData
=
res
.
crowdUnitList
this
.
tableTotal
=
res
.
total
console
.
log
(
this
.
inner
)
console
.
log
(
this
.
tableData
)
this
.
tableData
.
forEach
(
item
=>
{
this
.
inner
.
forEach
((
itm
,
index
)
=>
{
if
(
itm
.
crowdId
==
item
.
crowdId
)
{
this
.
rowClick
(
item
)
}
// console.log(this.inner)
// console.log(this.tableData)
// this.tableData.forEach(item => {
// this.inner.forEach((itm, index) => {
// if (itm.crowdId == item.crowdId) {
// this.rowClick(item)
// }
// })
// })
this
.
recoverySelected
()
})
},
// selectionTable(val) {
// this.innerTags = []
// for (let i = 0; i < val.length; i++) {
// const tagArr = this.innerTags.map(item => item.crowdId + '')
// console.log(tagArr)
// if (!tagArr.includes(val[i].crowdId)) {
// this.innerTags.push(val[i])
// }
// console.log(this.innerTags)
// }
// },
// 选择/取消
handleSelectionTable
(
val
)
{
var
list
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
innerTags
))
this
.
innerTags
=
[]
val
.
forEach
(
item
=>
{
if
(
this
.
innerTags
.
findIndex
(
k
=>
k
.
crowdId
==
item
.
crowdId
)
==
'-1'
)
{
this
.
innerTags
.
push
(
item
)
}
})
list
.
forEach
(
item
=>
{
if
(
this
.
tableData
.
findIndex
(
k
=>
k
.
crowdId
==
item
.
crowdId
)
==
'-1'
&&
this
.
innerTags
.
findIndex
(
k
=>
k
.
crowdId
==
item
.
crowdId
)
==
'-1'
)
{
this
.
innerTags
.
push
(
item
)
}
})
},
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
Object
.
assign
(
this
.
searchForm
.
req
,
{})
resolve
()
// 恢复选择
addSelected
()
{
this
.
$nextTick
(()
=>
{
var
list
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
innerTags
))
if
(
list
&&
list
.
length
)
{
list
.
forEach
(
row
=>
{
var
idx
=
this
.
tableData
.
findIndex
(
k
=>
k
.
crowdId
==
row
.
crowdId
)
if
(
idx
!=
-
1
)
{
this
.
$refs
.
crowdTable
.
$refs
.
crowdlistMutiTable
.
toggleRowSelection
(
this
.
tableData
[
idx
],
true
)
}
})
}
})
},
selectionTable
(
val
)
{
this
.
innerTags
=
[]
for
(
let
i
=
0
;
i
<
val
.
length
;
i
++
)
{
console
.
log
(
i
)
const
tagArr
=
this
.
innerTags
.
map
(
item
=>
item
.
crowdId
)
if
(
!
tagArr
.
includes
(
val
[
i
].
crowdId
))
{
this
.
innerTags
.
push
(
val
[
i
])
recoverySelected
()
{
// 翻页,去掉已选项
var
selectedData
=
this
.
$refs
.
crowdTable
.
mutiSelectArr
.
crowdlist
var
deleteList
=
[]
this
.
addSelected
()
if
(
selectedData
)
{
selectedData
.
forEach
(
item
=>
{
if
(
this
.
innerTags
.
findIndex
(
subItem
=>
subItem
.
crowdId
==
item
.
crowdId
)
==
-
1
)
{
deleteList
.
push
(
item
)
}
})
this
.
deleteSelected
(
deleteList
)
}
},
// 删除选中
deleteSelected
(
deleteList
)
{
this
.
$nextTick
(()
=>
{
deleteList
.
forEach
(
row
=>
{
var
idx
=
this
.
tableData
.
findIndex
(
k
=>
k
.
crowdId
==
row
.
crowdId
)
if
(
idx
!=
-
1
)
{
this
.
$refs
.
crowdTable
.
$refs
.
crowdlistMutiTable
.
toggleRowSelection
(
this
.
tableData
[
idx
],
false
)
}
})
})
},
remove
(
item
)
{
this
.
$refs
.
crowdTable
.
$refs
.
crowdlistMutiTable
.
toggleRowSelection
(
item
)
var
idx
=
this
.
innerTags
.
findIndex
(
k
=>
k
.
crowdId
==
item
.
crowdId
)
this
.
innerTags
.
splice
(
idx
,
1
)
if
(
this
.
tableData
.
map
(
k
=>
k
.
crowdId
).
includes
(
item
.
crowdId
))
{
var
i
=
this
.
tableData
.
findIndex
(
k
=>
k
.
crowdId
==
item
.
crowdId
)
this
.
$refs
.
crowdTable
.
$refs
.
crowdlistMutiTable
.
toggleRowSelection
(
this
.
tableData
[
i
])
}
},
rowClick
(
row
)
{
console
.
log
(
this
.
$refs
.
crowdTable
)
this
.
$refs
.
crowdTable
.
$refs
.
crowdlistMutiTable
.
toggleRowSelection
(
row
)
},
search
()
{
this
.
getCrowdList
()
},
handleConfirm
()
{
// console.log(this.innerTags)
this
.
$emit
(
'crowdData'
,
this
.
innerTags
)
this
.
crowdVisible
=
false
this
.
searchForm
=
{
req
:
{}
}
this
.
searchForm
=
{
keyword
:
{}
}
}
}
}
...
...
@@ -197,7 +253,7 @@ export default {
/deep/
{
.el-table
{
height
:
40vh
;
//
height
:
40vh
;
overflow-y
:
auto
;
}
}
...
...
@@ -207,7 +263,7 @@ export default {
}
.table-content
{
max-height
:
456
px
;
max-height
:
500
px
;
overflow
:
auto
;
border-top
:
1px
solid
#eee
;
}
...
...
@@ -297,6 +353,7 @@ export default {
.el-dialog__close
{
width
:
24px
;
height
:
24px
;
font-size
:
24px
;
}
}
.el-pagination
{
...
...
src/views/customerTransform/components/tag-textarea.vue
View file @
2caec48
...
...
@@ -335,11 +335,12 @@ export default {
-webkit-user-modify
:
read-only
!important
;
}
img
{
width
:
24
px
;
height
:
24
px
;
width
:
18
px
;
height
:
18
px
;
-webkit-user-select
:
none
;
cursor
:
default
;
pointer-events
:
none
;
vertical-align
:
middle
;
}
.active
{
background
:
#dcdfe6
;
...
...
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