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 deb247d6
authored
Nov 24, 2022
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
应用消息
1 parent
dc85c3b1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
123 additions
and
103 deletions
linkwe-pc/src/api/internalCollaborate/appManage.js
linkwe-pc/src/views/internalCollaborate/appManage/HistoryMsg.vue
linkwe-pc/src/views/internalCollaborate/appManage/list.vue
linkwe-pc/src/views/internalCollaborate/appManage/MsgForm.vue → linkwe-pc/src/views/internalCollaborate/components/MsgForm.vue
linkwe-pc/vue.config.js
linkwe-pc/src/api/internalCollaborate/appManage.js
View file @
deb247d
...
...
@@ -130,7 +130,6 @@ export const appMsg = {
content: '', // string 文本内容(文本消息必传)
description: '', // string 消息的描述(视频、文本卡片、图文 必传)
linkUrl: '', // string 点击后跳转的链接。最长2048字节,请确保包含了协议头(http/https) (文本卡片、图文 必传)
mediaId: '', // string 素材id(语音、视频、文件 必传)
msgType: '', // string 消息类型 文本:text, 图片:image, 语音:voice, 视频:video, 文件:file, 文本卡片:textcard, 图文:news, 图文消息:link, 小程序:miniprogram
picUrl: '', // string 图文消息的图片链接,支持JPG、PNG格式,较好的效果为大图 1068*455,小图150*150。(文本卡片、图文 必传)
title: '', // string 消息的标题(视频、文本卡片、图文 必传)
...
...
linkwe-pc/src/views/internalCollaborate/appManage/HistoryMsg.vue
View file @
deb247d
<
script
>
import
{
appMsg
}
from
'@/api/internalCollaborate/appManage'
import
MsgForm
from
'../components/MsgForm'
export
default
{
name
:
''
,
components
:
{},
components
:
{
MsgForm
},
props
:
{
id
:
{
type
:
String
,
...
...
@@ -17,14 +18,14 @@ export default {
pageSize
:
10
,
title
:
''
,
status
:
''
,
i
d
:
this
.
id
,
agentI
d
:
this
.
id
,
},
total
:
0
,
list
:
[],
loading
:
false
,
dialogVisible
HistoryMsg
:
false
,
status
:
{
''
:
'全部状态'
,
0
:
'草稿'
,
1
:
'待发送'
,
2
:
'已发送'
,
3
:
'已撤回'
},
dialogVisible
:
false
,
status
:
{
''
:
'全部状态'
,
0
:
'草稿'
,
1
:
'待发送'
,
2
:
'已发送'
,
3
:
'
发送失败'
,
4
:
'
已撤回'
},
type
:
[
'图片'
,
'语音'
,
...
...
@@ -43,13 +44,6 @@ export default {
'客服话术'
,
],
form
:
{},
rules
:
Object
.
freeze
({
agentId
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
secret
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
name
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
description
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
logoUrl
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'change'
}],
}),
}
},
computed
:
{},
...
...
@@ -100,6 +94,7 @@ export default {
}
})
},
// 删除和撤销
removke
(
id
,
action
,
tip
)
{
// const operIds = id || this.ids + ''
this
.
$confirm
(
'是否确认'
+
tip
+
'?该操作不可撤销,请谨慎操作。'
,
{
...
...
linkwe-pc/src/views/internalCollaborate/appManage/list.vue
View file @
deb247d
<
script
>
import
{
getList
,
update
,
add
,
remove
,
sync
}
from
'@/api/internalCollaborate/appManage'
// import clipboard from "clipboard";
export
default
{
components
:
{
HistoryMsg
:
()
=>
import
(
'./HistoryMsg'
)
},
components
:
{
HistoryMsg
:
()
=>
import
(
'./HistoryMsg'
)
,
MsgForm
:
()
=>
import
(
'../components/MsgForm'
)
},
props
:
{},
data
()
{
return
{
...
...
@@ -28,7 +27,7 @@ export default {
id
:
''
,
dialogVisibleHistoryMsg
:
false
,
// dialogVisibleSelectMaterial
: false,
dialogVisibleSendMsg
:
false
,
}
},
watch
:
{},
...
...
@@ -116,12 +115,12 @@ export default {
// })
// },
//
选择素材
确认按钮
// submitSelectMaterial
(text, image, file) {
//
this.form.logoMediaid = image.id
//
this.form.squareLogoUrl = image.materialUrl
// this.dialogVisibleSelectMaterial
= false
//
},
//
发送消息
确认按钮
submitSendMsg
(
text
,
image
,
file
)
{
this
.
form
.
logoMediaid
=
image
.
id
this
.
form
.
squareLogoUrl
=
image
.
materialUrl
this
.
dialogVisibleSendMsg
=
false
},
},
}
</
script
>
...
...
@@ -155,7 +154,14 @@ export default {
<TagEllipsis
:list=
"item.allowPartyName"
></TagEllipsis>
</div>
<div
class=
"list-action fxbw"
>
<!--
<el-button
type=
"text"
>
发送消息
</el-button>
-->
<el-button
type=
"text"
@
click=
"
id = item.id
dialogVisibleSendMsg = true
"
>
发送消息
</el-button>
<el-button
type=
"text"
@
click=
"
...
...
@@ -269,6 +275,11 @@ export default {
@success="submitSelectMaterial"
>
</SelectMaterial> -->
<!-- 编辑/详情发送消息 弹窗 -->
<el-dialog
title=
"发送消息"
:visible
.
sync=
"dialogVisibleSendMsg"
:close-on-click-modal=
"false"
>
<MsgForm
v-if=
"dialogVisibleSendMsg"
:form=
"form"
/>
</el-dialog>
</div>
</template>
...
...
linkwe-pc/src/views/internalCollaborate/
appManage
/MsgForm.vue
→
linkwe-pc/src/views/internalCollaborate/
components
/MsgForm.vue
View file @
deb247d
<
script
>
var
validateHttp
=
(
rule
,
value
,
callback
)
=>
{
if
(
/^https
?
:
\/\/
/gi
.
test
(
value
))
{
callback
()
}
else
{
callback
(
new
Error
(
'必须以 http://或 https://开头'
))
}
}
export
default
{
name
:
''
,
components
:
{},
data
()
{
return
{
form
:
{},
form
:
{
weMessageTemplate
:
{}
},
// 表单校验
rules
:
Object
.
freeze
({
content
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}],
fileUrl
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'change'
}],
title
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}],
description
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}],
picUrl
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}],
linkUrl
:
[
{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
},
{
validator
:
validateHttp
,
trigger
:
'blur'
},
],
}),
typeDict
:
{
text
:
'文本'
,
image
:
'图片'
,
text
:
'图文'
,
text
:
'视频'
,
text
:
'文件'
,
news
:
'图文'
,
video
:
'视频'
,
file
:
'文件'
,
},
dialogVisible
:
false
,
}
},
computed
:
{},
...
...
@@ -24,50 +45,36 @@ export default {
<
template
>
<div>
<el-form
style=
"width: 60%; margin: 0 auto"
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"100px"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"100px"
>
<div
class=
"g-pad20"
>
<div
class=
"title"
>
<span>
消息设置
</span>
<span>
将通过应用 【应用名称】 发送消息
</span>
</div>
<el-form-item
:label=
"typeTitle[type] + '标题'"
prop=
"materialName"
v-if=
"type === '4'"
>
<el-input
v-model=
"form.materialName"
placeholder=
"请输入标题"
maxlength=
"30"
show-word-limit
></el-input>
<el-form-item
label=
"消息标题"
prop=
"title"
>
<el-input
v-model=
"form.title"
placeholder=
"请输入标题"
maxlength=
"30"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
label=
"发送范围"
required
prop=
"
pushRang
e"
>
<el-radio-group
v-model=
"form.
pushRang
e"
>
<el-radio
:label=
"
0
"
>
全部
</el-radio>
<el-radio
:label=
"
1
"
>
<el-form-item
label=
"发送范围"
required
prop=
"
scopeTyp
e"
>
<el-radio-group
v-model=
"form.
scopeTyp
e"
>
<el-radio
:label=
"
1
"
>
全部
</el-radio>
<el-radio
:label=
"
2
"
>
自定义
<
div
v-if=
"form.pushRange == 1
"
>
<
template
v-if=
"form.scopeType == 2
"
>
<TagEllipsis
:list=
"form.sendClientUserList"
/>
<el-button
class=
"mr10"
size=
"mini"
icon=
"el-icon-circle-plus-outline"
type=
"primary"
plain
@
click=
"onSelectUser(2)"
>
<el-button
class=
"mr10"
size=
"mini"
type=
"primary"
plain
@
click=
"dialogVisible = true"
>
选择范围
</el-button>
</
div
>
</
template
>
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"发送类型"
required
prop=
"
isTask
"
>
<el-radio-group
v-model=
"form.
isTask
"
>
<el-radio
:label=
"
0
"
>
立即发送
</el-radio>
<el-radio
:label=
"
1
"
>
<el-form-item
label=
"发送类型"
required
prop=
"
sendType
"
>
<el-radio-group
v-model=
"form.
sendType
"
>
<el-radio
:label=
"
1
"
>
立即发送
</el-radio>
<el-radio
:label=
"
2
"
>
定时发送
<div
v-if=
"form.
isTask == 1
"
>
<div
v-if=
"form.
sendType == 2
"
>
<el-date-picker
v-model=
"form.sendTime"
type=
"datetime"
...
...
@@ -82,56 +89,55 @@ export default {
<div
class=
"g-pad20"
>
<div
class=
"title"
>
消息设置
</div>
<el-form-item
label=
"发送类型"
required
prop=
"
isTask
"
>
<el-radio-group
v-model=
"form.
isTask
"
>
<el-form-item
label=
"发送类型"
required
prop=
"
msgType
"
>
<el-radio-group
v-model=
"form.
weMessageTemplate.msgType
"
>
<el-radio
v-for=
"(item, label, index) in typeDict"
:key=
"index"
:label=
"label"
>
{{ item }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"文本内容"
prop=
"content"
v-if=
"
type === '4
'"
>
<el-form-item
label=
"文本内容"
prop=
"content"
v-if=
"
form.msgType === 'text
'"
>
<el-input
v-model=
"form.content"
v-model=
"form.
weMessageTemplate.
content"
type=
"textarea"
:autosize=
"{ minRows: 2, maxRows: 50 }"
placeholder=
"请输入内容"
maxlength=
"2000"
show-word-limit
@input="contentChange">
</el-input>
show-word-limit
></el-input>
</el-form-item>
<!-- 图片 -->
<el-form-item
label=
"图片"
prop=
"
materialUrl"
v-else-if=
"type === '0
'"
>
<Upload
ToCos
:fileUrl
.
sync=
"form.
material
Url"
:fileName
.
sync=
"form.materialName"
<el-form-item
label=
"图片"
prop=
"
fileUrl"
v-else-if=
"form.msgType === 'image
'"
>
<Upload
:fileUrl
.
sync=
"form.
weMessageTemplate.file
Url"
:fileName
.
sync=
"form.
weMessageTemplate.
materialName"
:maxSize=
"20"
type=
"0"
v-if=
"dialogVisible"
>
<div
slot=
"tip"
>
支持jpg/jpeg/png格式,图片大小不超过2M
</div>
</Upload
ToCos
>
</Upload>
</el-form-item>
<!-- 图文 -->
<template
v-else-if=
"
type === '9
'"
>
<el-form-item
label=
"图文地址"
prop=
"
materialUrl"
:rules=
"rules.http
"
>
<
template
v-else-if=
"
form.msgType === 'news
'"
>
<el-form-item
label=
"图文地址"
prop=
"
linkUrl
"
>
<el-input
v-model=
"form.
material
Url"
v-model=
"form.
weMessageTemplate.link
Url"
type=
"text"
placeholder=
"请输入图文地址,以http://或https://开头"
></el-input>
</el-form-item>
<el-form-item
label=
"图文标题"
prop=
"
materialNam
e"
>
<el-form-item
label=
"图文标题"
prop=
"
titl
e"
>
<el-input
v-model=
"form.
materialNam
e"
v-model=
"form.
weMessageTemplate.titl
e"
type=
"text"
:maxlength=
"64"
show-word-limit
placeholder=
"请输入图文标题"
></el-input>
</el-form-item>
<el-form-item
label=
"图文描述"
>
<el-form-item
label=
"图文描述"
prop=
"description"
>
<el-input
v-model=
"form.
content
"
v-model=
"form.
weMessageTemplate.description
"
type=
"textarea"
:maxlength=
"200"
show-word-limit
...
...
@@ -139,38 +145,48 @@ export default {
placeholder="请输入">
</el-input>
</el-form-item>
<el-form-item
label=
"图文封面"
>
<Upload
ToCos
:fileUrl
.
sync=
"form.cover
Url"
type=
"0"
v-if=
"dialogVisible"
>
<Upload
:fileUrl
.
sync=
"form.weMessageTemplate.pic
Url"
type=
"0"
v-if=
"dialogVisible"
>
<div
slot=
"tip"
>
支持jpg/jpeg/png格式,建议200*200
</div>
</Upload
ToCos
>
</Upload>
</el-form-item>
</
template
>
<el-form-item
v-else-if=
"
type === '9
'"
label=
"上传视频"
prop=
"materialUrl"
>
<Upload
ToCos
:fileUrl
.
sync=
"form.
material
Url"
:fileName
.
sync=
"form.materialName"
:type=
"
type
"
<el-form-item
v-else-if=
"
form.msgType === 'video
'"
label=
"上传视频"
prop=
"materialUrl"
>
<Upload
:fileUrl
.
sync=
"form.
weMessageTemplate.file
Url"
:fileName
.
sync=
"form.
weMessageTemplate.
materialName"
:type=
"
2
"
@
getPicUrl=
"getPicUrl"
v-if=
"dialogVisible"
>
<div
slot=
"tip"
>
支持mp4/mov格式,视频大小不超过100M
</div>
</Upload
ToCos
>
</Upload>
</el-form-item>
<el-form-item
v-else-if=
"
type === '9
'"
label=
"上传文件"
prop=
"materialUrl"
>
<Upload
ToCos
:fileUrl
.
sync=
"form.
material
Url"
:fileName
.
sync=
"form.materialName"
:type=
"
type
"
<el-form-item
v-else-if=
"
form.msgType === 'file
'"
label=
"上传文件"
prop=
"materialUrl"
>
<Upload
:fileUrl
.
sync=
"form.
weMessageTemplate.file
Url"
:fileName
.
sync=
"form.
weMessageTemplate.
materialName"
:type=
"
3
"
v-if=
"dialogVisible"
:isThree=
"true"
>
<div
slot=
"tip"
>
支持pdf/ppt/word文件,单个文件大小不超过50M
</div>
</Upload
ToCos
>
</Upload>
</el-form-item>
<
template
>
<div></div>
</
template
>
</div>
</el-form>
<div>
<el-button
@
click=
"$emit('submit')"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"$emit('submit', form)"
>
确 定
</el-button>
</div>
<!-- 选择发起员工弹窗 -->
<SelectWeUser
:visible
.
sync=
"dialogVisible"
append-to-body
title=
"选择成员"
:isOnlyLeaf=
"false"
:isSigleSelect=
"false"
@
success=
"selectedUser"
></SelectWeUser>
</div>
</template>
...
...
linkwe-pc/vue.config.js
View file @
deb247d
...
...
@@ -137,21 +137,20 @@ module.exports = {
args
[
0
].
cdn
=
cdn
return
args
})
config
.
plugin
(
'ScriptExtHtmlWebpackPlugin'
)
.
after
(
'html'
)
.
use
(
'script-ext-html-webpack-plugin'
,
[
{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline
:
/runtime
\.
.*
\.
js$/
,
},
])
.
end
()
}
config
.
plugin
(
'ScriptExtHtmlWebpackPlugin'
)
.
after
(
'html'
)
.
use
(
'script-ext-html-webpack-plugin'
,
[
{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline
:
/runtime
\.
.*
\.
js$/
,
},
])
.
end
()
config
.
optimization
.
minimizer
(
'terser'
).
tap
((
options
)
=>
{
options
[
0
].
terserOptions
.
compress
.
drop_console
=
false
options
[
0
].
terserOptions
.
compress
.
drop_console
=
!
env
.
_ISLOG
options
[
0
].
terserOptions
.
compress
.
drop_debugger
=
false
return
options
})
...
...
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