Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 97a50434
authored
Jan 31, 2023
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
短链
1 parent
41205160
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
344 additions
and
110 deletions
linkwe-pc/src/components/SelectQrCode.vue
linkwe-pc/src/components/SelectStaffQrCode.vue
linkwe-pc/src/views/intelligentShortLink/addEdit.vue
linkwe-pc/src/views/intelligentShortLink/components/Add.vue
linkwe-pc/src/views/intelligentShortLink/components/PhonePreview.vue
linkwe-pc/src/components/SelectQrCode.vue
View file @
97a5043
...
...
@@ -3,21 +3,21 @@ import { getList } from '@/api/drainageCode/group'
import
SelectTag
from
'@/components/SelectTag.vue'
export
default
{
components
:
{
SelectTag
},
components
:
{
SelectTag
},
props
:
{
// 添加标签显隐
visible
:
{
type
:
Boolean
,
default
:
false
default
:
false
,
},
title
:
{
type
:
String
,
default
:
'选择群活码'
default
:
'选择群活码'
,
},
selected
:
{
type
:
Array
,
default
:
()
=>
[]
}
default
:
()
=>
[]
,
}
,
},
data
()
{
return
{
...
...
@@ -26,7 +26,7 @@ export default {
pageNum
:
1
,
pageSize
:
10
,
activityName
:
''
,
tagIds
:
''
tagIds
:
''
,
// createBy: '',
// beginTime: '',
// endTime: ''
...
...
@@ -45,7 +45,7 @@ export default {
},
list
(
val
)
{
this
.
setSelected
()
}
}
,
},
computed
:
{
Pvisible
:
{
...
...
@@ -54,25 +54,25 @@ export default {
},
set
(
val
)
{
this
.
$emit
(
'update:visible'
,
val
)
}
}
}
,
}
,
},
created
()
{
this
.
getList
()
},
mounted
()
{},
methods
:
{
getSelectTag
(
list
)
{
this
.
taglist
=
list
let
arr
=
[]
let
arr1
=
[]
list
.
forEach
(
dd
=>
{
arr
.
push
(
dd
.
name
)
arr1
.
push
(
dd
.
tagId
)
})
this
.
tagNames
=
arr
.
join
(
','
)
this
.
query
.
tagIds
=
arr1
.
join
(
','
)
},
getSelectTag
(
list
)
{
this
.
taglist
=
list
let
arr
=
[]
let
arr1
=
[]
list
.
forEach
((
dd
)
=>
{
arr
.
push
(
dd
.
name
)
arr1
.
push
(
dd
.
tagId
)
})
this
.
tagNames
=
arr
.
join
(
','
)
this
.
query
.
tagIds
=
arr1
.
join
(
','
)
},
// 获取列表
getList
(
page
)
{
page
&&
(
this
.
query
.
pageNum
=
page
)
...
...
@@ -99,87 +99,76 @@ export default {
this
.
radio
=
code
}
})
}
}
}
,
}
,
}
</
script
>
<
template
>
<div>
<el-dialog
:title=
"title"
:visible
.
sync=
"Pvisible"
width=
"750px"
append-to-body
:close-on-click-modal=
"false"
>
<div>
<el-form
ref=
"form"
:model=
"query"
label-width=
""
>
<el-form-item
label=
""
>
<el-input
v-model=
"query.activityName"
class=
"ml10 mr10"
style=
"width: 150px;"
placeholder=
"请输入名称"
@
keydown
.
enter=
"getList(1)"
></el-input>
<!-- v-hasPermi="['contacts:organization:query']" -->
<!--
<el-form-item
label=
" "
prop=
"tagIds"
>
-->
<el-input
class=
"ml10 mr10"
style=
"width: 150px;"
:value=
"tagNames"
readonly
@
focus=
"showSelectTag = true"
placeholder=
"请选择客群标签"
/>
<!--
</el-form-item>
-->
<el-button
icon=
"el-icon-search"
circle
@
click=
"getList(1)"
></el-button>
<el-pagination
class=
"fr"
@
current-change=
"getList"
:current-page=
"query.pageNum"
:page-size=
"query.pageSize"
layout=
"prev, pager, next"
:total=
"total"
></el-pagination>
</el-form-item>
</el-form>
<el-table
:data=
"list"
v-loading=
"loading"
>
<el-table-column
width=
"30"
>
<template
slot-scope=
"scope"
>
<el-radio
v-model=
"radio"
:label=
"scope.row"
>
'
</el-radio>
</
template
>
</el-table-column>
<div>
<el-dialog
:title=
"title"
:visible
.
sync=
"Pvisible"
width=
"750px"
append-to-body
:close-on-click-modal=
"false"
>
<div>
<el-form
ref=
"form"
:model=
"query"
label-width=
""
>
<el-form-item
label=
""
>
<el-input
v-model=
"query.activityName"
class=
"mr10"
style=
"width: 150px"
placeholder=
"请输入名称"
@
keydown
.
enter=
"getList(1)"
></el-input>
<el-input
class=
"mr10"
style=
"width: 150px"
:value=
"tagNames"
readonly
@
focus=
"showSelectTag = true"
placeholder=
"请选择客群标签"
/>
<el-button
icon=
"el-icon-search"
circle
@
click=
"getList(1)"
></el-button>
<el-table-column
prop=
"activityName"
label=
"活码名称"
align=
"center"
></el-table-column>
<el-table-column
prop=
"codeUrl"
label=
"二维码"
align=
"center"
width=
"130"
>
<
template
#
default=
"{ row }"
>
<el-popover
placement=
"bottom"
trigger=
"hover"
>
<el-image
slot=
"reference"
:src=
"row.codeUrl"
class=
"code-image--small"
></el-image>
<el-image
:src=
"row.codeUrl"
class=
"code-image"
>
</el-image>
</el-popover>
</
template
>
</el-table-column>
<el-table-column
label=
"客群标签"
>
<
template
#
default=
"{ row }"
>
<div>
<tag-ellipsis
limit=
"1"
:list=
"row.tags.split(',')"
></tag-ellipsis>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"活码客群数"
align=
"center"
prop=
"chatGroupNum"
></el-table-column>
<el-table-column
prop=
"chatGroupMemberTotalNum"
label=
"群总人数"
align=
"center"
></el-table-column>
</el-table>
</div>
<div
slot=
"footer"
>
<el-button
@
click=
"Pvisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submit"
>
确 定
</el-button>
</div>
<div
style=
"z-index: 9999999"
>
</div>
</el-dialog>
<select-tag
:visible
.
sync=
"showSelectTag"
type=
"2"
:selected=
"tagList"
@
success=
"getSelectTag"
></select-tag>
</div>
<el-pagination
class=
"fr"
@
current-change=
"getList"
:current-page=
"query.pageNum"
:page-size=
"query.pageSize"
layout=
"prev, pager, next"
:total=
"total"
></el-pagination>
</el-form-item>
</el-form>
<el-table
:data=
"list"
v-loading=
"loading"
>
<el-table-column
width=
"30"
>
<template
slot-scope=
"scope"
>
<el-radio
v-model=
"radio"
:label=
"scope.row"
>
'
</el-radio>
</
template
>
</el-table-column>
<el-table-column
prop=
"activityName"
label=
"活码名称"
align=
"center"
></el-table-column>
<el-table-column
prop=
"codeUrl"
label=
"二维码"
align=
"center"
width=
"130"
>
<
template
#
default=
"{ row }"
>
<el-popover
placement=
"bottom"
trigger=
"hover"
>
<el-image
slot=
"reference"
:src=
"row.codeUrl"
class=
"code-image--small"
></el-image>
<el-image
:src=
"row.codeUrl"
class=
"code-image"
></el-image>
</el-popover>
</
template
>
</el-table-column>
<el-table-column
label=
"客群标签"
>
<
template
#
default=
"{ row }"
>
<div>
<tag-ellipsis
limit=
"1"
:list=
"row.tags.split(',')"
></tag-ellipsis>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"活码客群数"
align=
"center"
prop=
"chatGroupNum"
></el-table-column>
<el-table-column
prop=
"chatGroupMemberTotalNum"
label=
"群总人数"
align=
"center"
></el-table-column>
</el-table>
</div>
<div
slot=
"footer"
>
<el-button
@
click=
"Pvisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submit"
>
确 定
</el-button>
</div>
<div
style=
"z-index: 9999999"
></div>
</el-dialog>
<select-tag
:visible
.
sync=
"showSelectTag"
type=
"2"
:selected=
"tagList"
@
success=
"getSelectTag"
></select-tag>
</div>
</template>
<
style
lang=
"scss"
scoped
>
...
...
linkwe-pc/src/components/SelectStaffQrCode.vue
0 → 100644
View file @
97a5043
<
script
>
import
{
getList
}
from
'@/api/drainageCode/staff'
export
default
{
components
:
{},
props
:
{
// 添加标签显隐
visible
:
{
type
:
Boolean
,
default
:
false
,
},
title
:
{
type
:
String
,
default
:
'选择员工活码'
,
},
selected
:
{
type
:
Array
,
default
:
()
=>
[],
},
},
data
()
{
return
{
loading
:
true
,
// 遮罩层
query
:
{
pageNum
:
1
,
pageSize
:
10
,
// createBy: '',
// beginTime: '',
// endTime: ''
orderByColumn
:
'wqc.update_time'
,
isAsc
:
'desc'
,
},
list
:
[],
// 列表
userArray
:
[],
//
total
:
0
,
// 总条数
radio
:
''
,
qrUserName
:
''
,
dialogVisible
:
false
,
}
},
watch
:
{
selected
(
val
)
{
this
.
setSelected
()
},
list
(
val
)
{
this
.
setSelected
()
},
},
computed
:
{
Pvisible
:
{
get
()
{
return
this
.
visible
},
set
(
val
)
{
this
.
$emit
(
'update:visible'
,
val
)
},
},
},
created
()
{
this
.
getList
()
},
mounted
()
{},
methods
:
{
// 获取列表
getList
(
page
)
{
page
&&
(
this
.
query
.
pageNum
=
page
)
this
.
loading
=
true
getList
(
this
.
query
)
.
then
(({
rows
,
total
})
=>
{
this
.
list
=
rows
this
.
total
=
+
total
this
.
loading
=
false
})
.
catch
(()
=>
{
this
.
loading
=
false
})
},
getSelectUser
(
data
)
{
this
.
userArray
=
data
this
.
qrUserName
=
data
.
map
((
e
)
=>
e
.
name
)
+
''
this
.
query
.
qrUserIds
=
data
.
map
((
e
)
=>
e
.
userId
)
+
''
},
submit
()
{
this
.
Pvisible
=
false
this
.
$emit
(
'success'
,
this
.
radio
)
},
setSelected
()
{
if
(
!
this
.
selected
.
length
)
return
this
.
list
.
forEach
((
code
)
=>
{
if
(
code
.
id
==
this
.
selected
[
0
].
id
)
{
this
.
radio
=
code
}
})
},
},
}
</
script
>
<
template
>
<div>
<el-dialog
:title=
"title"
:visible
.
sync=
"Pvisible"
width=
"750px"
append-to-body
:close-on-click-modal=
"false"
>
<div>
<el-form
ref=
"form"
:model=
"query"
label-width=
""
>
<el-form-item
label=
""
>
<el-input
v-model=
"query.qrName"
class=
"mr10"
clearable
style=
"width: 150px"
placeholder=
"请输入活码名称"
@
keydown
.
enter=
"getList(1)"
></el-input>
<el-input
:value=
"userArray.map((e) => e.name) + ''"
clearable
@
clear=
"userArray = []"
@
focus=
"dialogVisible = true"
class=
"mr10"
style=
"width: 150px"
placeholder=
"请选择员工"
/>
<el-button
icon=
"el-icon-search"
circle
@
click=
"getList(1)"
></el-button>
<el-pagination
class=
"fr"
@
current-change=
"getList"
:current-page=
"query.pageNum"
:page-size=
"query.pageSize"
layout=
"prev, pager, next"
:total=
"total"
></el-pagination>
</el-form-item>
</el-form>
<el-table
:data=
"list"
v-loading=
"loading"
>
<el-table-column
width=
"30"
>
<template
slot-scope=
"
{ row }">
<el-radio
v-model=
"radio"
:label=
"row"
></el-radio>
</
template
>
</el-table-column>
<el-table-column
prop=
"name"
label=
"活码名称"
align=
"center"
></el-table-column>
<el-table-column
prop=
"qrCode"
label=
"二维码"
align=
"center"
width=
"130"
>
<
template
#
default=
"{ row }"
>
<el-popover
placement=
"bottom"
trigger=
"hover"
>
<el-image
slot=
"reference"
:src=
"row.qrCode"
class=
"code-image--small"
></el-image>
<el-image
:src=
"row.qrCode"
class=
"code-image"
></el-image>
</el-popover>
</
template
>
</el-table-column>
<el-table-column
label=
"标签"
align=
"center"
>
<
template
#
default=
"{ row }"
>
<tag-ellipsis
limit=
"1"
:list=
"row.qrTags"
></tag-ellipsis>
</
template
>
</el-table-column>
<el-table-column
label=
"使用员工"
align=
"center"
min-width=
"140"
prop=
"qrUserInfos"
show-overflow-tooltip
>
<
template
slot-scope=
"{ row }"
>
<div
v-for=
"(unit, key) in row.qrUserInfos"
:key=
"key"
style=
"display: inline"
>
<template
v-for=
"(item, index) in unit.weQrUserList"
>
<span
:key=
"index"
>
{{
item
.
userName
+
' '
}}
</span>
</
template
>
</div>
</template>
</el-table-column>
<el-table-column
label=
"最近更新时间"
align=
"center"
prop=
"updateTime"
width=
"180"
></el-table-column>
</el-table>
</div>
<div
slot=
"footer"
>
<el-button
@
click=
"Pvisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submit"
>
确 定
</el-button>
</div>
<div
style=
"z-index: 9999999"
></div>
</el-dialog>
<SelectWeUser
:visible
.
sync=
"dialogVisible"
title=
"组织架构"
:defaultValues=
"userArray"
@
success=
"getSelectUser"
></SelectWeUser>
</div>
</template>
<
style
lang=
"scss"
scoped
>
.code-image
{
width
:
200px
;
height
:
200px
;
}
.code-image--small
{
width
:
50px
;
height
:
50px
;
}
.expire-icon
{
color
:
red
;
}
</
style
>
linkwe-pc/src/views/intelligentShortLink/addEdit.vue
View file @
97a5043
...
...
@@ -48,6 +48,9 @@ export default {
this
.
loading
=
false
})
},
goStep
(
type
)
{
this
.
$refs
.
add
.
$refs
.
form
.
clearValidate
()
},
submit
()
{
this
.
$refs
.
add
.
$refs
[
'form'
].
validate
((
validate
)
=>
{
if
(
validate
)
{
...
...
@@ -59,7 +62,7 @@ export default {
this
.
loading
=
true
;(
this
.
form
.
id
?
update
:
add
)(
this
.
form
)
.
then
((
res
)
=>
{
this
.
data
=
res
this
.
data
=
res
.
data
this
.
currentActive
++
})
.
catch
((
e
)
=>
{
...
...
@@ -72,11 +75,17 @@ export default {
})
},
download
()
{
const
name
=
this
.
form
.
shortLinkName
+
'.png'
const
link
=
document
.
createElement
(
'a'
)
// 创建a标签
link
.
href
=
this
.
data
.
shortUrl
link
.
download
=
name
// 重命名文件
link
.
click
()
let
canvas
=
document
.
createElement
(
'canvas'
)
this
.
$refs
.
qrCode
.
setAttribute
(
'crossOrigin'
,
'anonymous'
)
canvas
.
getContext
(
'2d'
).
drawImage
(
this
.
$refs
.
qrCode
,
0
,
0
)
canvas
.
toBlob
((
blob
)
=>
{
let
url
=
URL
.
createObjectURL
(
blob
)
const
link
=
document
.
createElement
(
'a'
)
// 创建a标签
link
.
href
=
link
.
download
=
url
link
.
click
()
link
.
remove
()
URL
.
revokeObjectURL
(
url
)
})
},
},
}
...
...
@@ -101,7 +110,14 @@ export default {
<el-form-item
label=
"跳转类型"
>
<el-radio-group
v-model=
"form.jumpType"
>
<el-radio-button
:label=
"1"
>
跳入微信
</el-radio-button>
<el-tooltip
:value=
"true"
manual
class=
"item"
effect=
"light"
content=
"尽情期待"
placement=
"top"
>
<el-tooltip
:value=
"currentActive == 0"
manual
class=
"item"
transition=
"normal"
effect=
"light"
content=
"尽情期待"
placement=
"top"
>
<el-radio-button
:label=
"2"
disabled
>
跳出微信
</el-radio-button>
</el-tooltip>
</el-radio-group>
...
...
@@ -146,20 +162,20 @@ export default {
<div
class=
"g-card g-pad20"
style=
"background: #eee; width: 50%; margin: 30px auto"
>
<span>
{{ data.shortUrl }}
</span>
</div>
<
el-image
style=
"width: 120px; height: 120px"
:src=
"data.qrCode"
fit=
"fit"
></el-image
>
<
img
ref=
"qrCode"
style=
"width: 120px; height: 120px"
:src=
"data.qrCode"
fit=
"fit"
crossOrigin=
"anonymous"
/
>
<div>
<el-button
type=
"text"
class=
"copy-btn"
:data-clipboard-text=
"data.shortUrl"
>
复制链接
</el-button>
<el-button
type=
"text"
@
click=
"download(
row
)"
>
下载二维码
</el-button>
<el-button
type=
"text"
@
click=
"download()"
>
下载二维码
</el-button>
</div>
</div>
<el-footer
class=
"mt20 ar"
style=
"padding: 0"
height=
""
>
<
template
v-if=
"currentActive == 0"
>
<el-button
plain
@
click=
"$router.back()"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"
currentActive++
"
>
下一步
</el-button>
<el-button
type=
"primary"
@
click=
"
goStep(currentActive++)
"
>
下一步
</el-button>
</
template
>
<
template
v-else-if=
"currentActive == 1"
>
<el-button
type=
"primary"
@
click=
"
currentActive--
"
>
上一步
</el-button>
<el-button
type=
"primary"
@
click=
"
goStep(currentActive--)
"
>
上一步
</el-button>
<el-button
type=
"primary"
@
click=
"submit()"
>
生成短链
</el-button>
</
template
>
<
template
v-else-if=
"currentActive == 2"
>
...
...
linkwe-pc/src/views/intelligentShortLink/components/Add.vue
View file @
97a5043
<
script
>
import
{
touchTypeDict
}
from
'./mixin'
export
default
{
components
:
{},
components
:
{
SelectQrCode
:
()
=>
import
(
'@/components/SelectQrCode.vue'
),
SelectStaffQrCode
:
()
=>
import
(
'@/components/SelectStaffQrCode.vue'
),
},
props
:
{
form
:
{
type
:
Object
,
...
...
@@ -36,6 +39,8 @@ export default {
3
:
'微信群'
,
10
:
'小程序'
,
}),
selectQrCodeVisible
:
false
,
selectStaffQrCodeVisible
:
false
,
}
},
computed
:
{
...
...
@@ -46,7 +51,18 @@ export default {
watch
:
{},
created
()
{},
mounted
()
{},
methods
:
{},
methods
:
{
choiceQqcode
(
type
)
{
this
[
type
==
4
?
'selectStaffQrCodeVisible'
:
'selectQrCodeVisible'
]
=
true
},
// 选择二维码确认按钮
submitSelectQrCode
(
data
)
{
this
.
form
.
qrCodeId
=
data
.
id
// this.form.qrCodeName = data.activityName
this
.
form
.
qrCode
=
data
.
codeUrl
||
data
.
qrCode
// this.$refs.form.validateField('groupCodeId')
},
},
}
</
script
>
...
...
@@ -97,7 +113,14 @@ export default {
</
template
>
<!-- 员工活码,客群活码 -->
<
template
v-else-if=
"[4, 5].includes(+form.type)"
>
<el-form-item
prop=
"qrCodeId"
:label=
"'选择' + touchTypeDict[form.type].name"
>
<el-form-item
prop=
"5"
:label=
"'选择' + touchTypeDict[form.type].name"
>
<el-image
v-if=
"form.qrCode"
class=
"mr10"
style=
"width: 100px; height: 100px; vertical-align: middle"
:src=
"form.qrCode"
fit=
"fit"
></el-image>
<!--
<span>
{{
form
.
qrCodeName
}}
</span>
-->
<el-button
type=
"primary"
plain
@
click=
"choiceQqcode(form.type, '选择' + touchTypeDict[form.type].name)"
>
选择
{{
touchTypeDict
[
form
.
type
].
name
}}
</el-button>
...
...
@@ -148,6 +171,16 @@ export default {
</el-form-item>
</
template
>
</el-form>
<SelectQrCode
:visible
.
sync=
"selectQrCodeVisible"
@
success=
"submitSelectQrCode"
:selected=
"[form.qrCodeId]"
></SelectQrCode>
<SelectStaffQrCode
:visible
.
sync=
"selectStaffQrCodeVisible"
@
success=
"submitSelectQrCode"
:selected=
"[form.qrCodeId]"
></SelectStaffQrCode>
</div>
</template>
...
...
linkwe-pc/src/views/intelligentShortLink/components/PhonePreview.vue
View file @
97a5043
...
...
@@ -49,7 +49,7 @@ export default {
:src=
"data.avatar"
error=
"头像"
fit=
"fit"
></el-image>
<div
class=
"toe"
>
{{
data
.
n
ame
||
'名称'
}}
</div>
<div
class=
"toe"
>
{{
data
.
shortLinkN
ame
||
'名称'
}}
</div>
<div
class=
"tips mt20 toe"
>
{{
data
.
describe
||
'描述'
}}
</div>
</div>
<el-image
style=
"width: 120px; height: 120px; margin: 20px 0"
:src=
"data.qrCode"
fit=
"fit"
></el-image>
...
...
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