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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
37 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 {
...
@@ -528,7 +528,7 @@ export default {
// 删除人群
// 删除人群
removeCrowd
(
item
,
index
)
{
removeCrowd
(
item
,
index
)
{
this
.
basicForm
.
crowdList
.
splice
(
index
,
1
)
this
.
basicForm
.
crowdList
.
splice
(
index
,
1
)
this
.
$refs
.
selectCrowd
.
remove
(
item
)
//
this.$refs.selectCrowd.remove(item)
this
.
getCrowdData
(
this
.
basicForm
.
crowdList
)
this
.
getCrowdData
(
this
.
basicForm
.
crowdList
)
if
(
!
this
.
basicForm
.
crowdList
.
length
)
{
if
(
!
this
.
basicForm
.
crowdList
.
length
)
{
this
.
basicForm
.
userList
=
[]
this
.
basicForm
.
userList
=
[]
...
@@ -687,6 +687,14 @@ export default {
...
@@ -687,6 +687,14 @@ export default {
this
.
isUpdate
=
true
this
.
isUpdate
=
true
this
.
editStatus
=
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 {
...
@@ -59,7 +59,7 @@ export default {
previewList
(
val
)
{
previewList
(
val
)
{
if
(
val
.
length
&&
val
[
0
].
attType
==
1
)
{
if
(
val
.
length
&&
val
[
0
].
attType
==
1
)
{
const
attContent
=
val
[
0
].
attContent
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
,
''
)
let
word
=
res
.
replace
(
/
\[
|
\]
/gi
,
''
)
const
list
=
emoji
.
flat
(
Infinity
)
const
list
=
emoji
.
flat
(
Infinity
)
let
index
=
parseInt
(
list
.
indexOf
(
word
))
+
1
let
index
=
parseInt
(
list
.
indexOf
(
word
))
+
1
...
@@ -128,14 +128,17 @@ export default {
...
@@ -128,14 +128,17 @@ export default {
word-break
:
break-all
;
word-break
:
break-all
;
display
:
flex
;
display
:
flex
;
img
{
img
{
width
:
20px
;
width
:
16px
;
height
:
20px
;
height
:
16px
;
vertical-align
:
middle
;
}
}
}
}
.text
{
.text
{
display
:
inline-block
;
display
:
inline-block
;
font-size
:
1
6
px
;
font-size
:
1
2
px
;
padding
:
8px
11px
;
padding
:
8px
11px
;
line-height
:
16px
;
white-space
:
pre-wrap
;
}
}
.preview-link
{
.preview-link
{
display
:
inline-flex
;
display
:
inline-flex
;
...
...
src/views/customerTransform/components/selectCrowd.vue
View file @
2caec48
...
@@ -3,11 +3,11 @@
...
@@ -3,11 +3,11 @@
* @Author: huyue
* @Author: huyue
* @Date: 2022-05-24 18:18:53
* @Date: 2022-05-24 18:18:53
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2022-06-1
3 16:51:03
* @LastEditTime: 2022-06-1
4 18:31:20
-->
-->
<
template
>
<
template
>
<div>
<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-wrapper"
>
<div
class=
"member-left"
>
<div
class=
"member-left"
>
<div
class=
"member-title"
>
<div
class=
"member-title"
>
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<div
class=
"table-content"
>
<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>
</div>
</div>
</div>
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
<div
class=
"member-name"
>
人群(
{{
innerTags
.
length
}}
项)
</div>
<div
class=
"member-name"
>
人群(
{{
innerTags
.
length
}}
项)
</div>
<div
class=
"input-tag-wrapper"
>
<div
class=
"input-tag-wrapper"
>
<div
class=
"tag-box"
>
<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
}}
{{
tag
.
crowdName
}}
</el-tag>
</el-tag>
</div>
</div>
...
@@ -97,7 +97,7 @@ export default {
...
@@ -97,7 +97,7 @@ export default {
},
},
methods
:
{
methods
:
{
init
(
val
)
{
init
(
val
)
{
console
.
log
(
val
)
//
console.log(val)
this
.
inner
=
this
.
$common
.
utils
.
deepClone
(
val
)
this
.
inner
=
this
.
$common
.
utils
.
deepClone
(
val
)
this
.
innerTags
=
this
.
$common
.
utils
.
deepClone
(
val
)
this
.
innerTags
=
this
.
$common
.
utils
.
deepClone
(
val
)
this
.
crowdVisible
=
true
this
.
crowdVisible
=
true
...
@@ -122,47 +122,103 @@ export default {
...
@@ -122,47 +122,103 @@ export default {
this
.
$apis
.
customerTransform
.
queryCrowdtree
(
params
).
then
(
res
=>
{
this
.
$apis
.
customerTransform
.
queryCrowdtree
(
params
).
then
(
res
=>
{
this
.
tableData
=
res
.
crowdUnitList
this
.
tableData
=
res
.
crowdUnitList
this
.
tableTotal
=
res
.
total
this
.
tableTotal
=
res
.
total
console
.
log
(
this
.
inner
)
// console.log(this.inner)
console
.
log
(
this
.
tableData
)
// console.log(this.tableData)
this
.
tableData
.
forEach
(
item
=>
{
// this.tableData.forEach(item => {
this
.
inner
.
forEach
((
itm
,
index
)
=>
{
// this.inner.forEach((itm, index) => {
if
(
itm
.
crowdId
==
item
.
crowdId
)
{
// if (itm.crowdId == item.crowdId) {
this
.
rowClick
(
item
)
// this.rowClick(item)
}
// }
})
// })
})
// })
this
.
recoverySelected
()
})
})
},
},
beforeSearchFn
()
{
// selectionTable(val) {
return
new
Promise
(
resolve
=>
{
// this.innerTags = []
Object
.
assign
(
this
.
searchForm
.
req
,
{})
// for (let i = 0; i < val.length; i++) {
resolve
()
// 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
)
}
})
})
},
},
selectionTable
(
val
)
{
this
.
innerTags
=
[]
// 恢复选择
for
(
let
i
=
0
;
i
<
val
.
length
;
i
++
)
{
addSelected
()
{
console
.
log
(
i
)
this
.
$nextTick
(()
=>
{
const
tagArr
=
this
.
innerTags
.
map
(
item
=>
item
.
crowdId
)
var
list
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
innerTags
))
if
(
!
tagArr
.
includes
(
val
[
i
].
crowdId
))
{
if
(
list
&&
list
.
length
)
{
this
.
innerTags
.
push
(
val
[
i
])
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
)
}
})
}
}
})
},
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
)
{
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
)
{
rowClick
(
row
)
{
console
.
log
(
this
.
$refs
.
crowdTable
)
this
.
$refs
.
crowdTable
.
$refs
.
crowdlistMutiTable
.
toggleRowSelection
(
row
)
this
.
$refs
.
crowdTable
.
$refs
.
crowdlistMutiTable
.
toggleRowSelection
(
row
)
},
},
search
()
{
search
()
{
this
.
getCrowdList
()
this
.
getCrowdList
()
},
},
handleConfirm
()
{
handleConfirm
()
{
// console.log(this.innerTags)
this
.
$emit
(
'crowdData'
,
this
.
innerTags
)
this
.
$emit
(
'crowdData'
,
this
.
innerTags
)
this
.
crowdVisible
=
false
this
.
crowdVisible
=
false
this
.
searchForm
=
{
req
:
{}
}
this
.
searchForm
=
{
keyword
:
{}
}
}
}
}
}
}
}
...
@@ -197,7 +253,7 @@ export default {
...
@@ -197,7 +253,7 @@ export default {
/deep/
{
/deep/
{
.el-table
{
.el-table
{
height
:
40vh
;
//
height
:
40vh
;
overflow-y
:
auto
;
overflow-y
:
auto
;
}
}
}
}
...
@@ -207,7 +263,7 @@ export default {
...
@@ -207,7 +263,7 @@ export default {
}
}
.table-content
{
.table-content
{
max-height
:
456
px
;
max-height
:
500
px
;
overflow
:
auto
;
overflow
:
auto
;
border-top
:
1px
solid
#eee
;
border-top
:
1px
solid
#eee
;
}
}
...
@@ -297,6 +353,7 @@ export default {
...
@@ -297,6 +353,7 @@ export default {
.el-dialog__close
{
.el-dialog__close
{
width
:
24px
;
width
:
24px
;
height
:
24px
;
height
:
24px
;
font-size
:
24px
;
}
}
}
}
.el-pagination
{
.el-pagination
{
...
...
src/views/customerTransform/components/tag-textarea.vue
View file @
2caec48
...
@@ -335,11 +335,12 @@ export default {
...
@@ -335,11 +335,12 @@ export default {
-webkit-user-modify
:
read-only
!important
;
-webkit-user-modify
:
read-only
!important
;
}
}
img
{
img
{
width
:
24
px
;
width
:
18
px
;
height
:
24
px
;
height
:
18
px
;
-webkit-user-select
:
none
;
-webkit-user-select
:
none
;
cursor
:
default
;
cursor
:
default
;
pointer-events
:
none
;
pointer-events
:
none
;
vertical-align
:
middle
;
}
}
.active
{
.active
{
background
:
#dcdfe6
;
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