Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3d47c0d0
authored
Dec 06, 2021
by
杨铁龙
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://gitlab.corp.qinqinxiaobao.com:9880/uniplat/customer-service
parents
6bdbdede
087b2b2b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
components/controller/index.ts
model/card.ts
components/controller/index.ts
View file @
3d47c0d0
import
{
MessageType
}
from
"@/customer-service/model"
;
import
{
CardMessage
}
from
'@/customer-service/model/card'
;
const
mapping
=
new
Map
<
MessageType
,
string
>
([
[
MessageType
.
Image
,
'图片'
],
...
...
@@ -29,6 +30,12 @@ export function parserMessage(type: MessageType, rawMsg: string) {
if
(
type
===
MessageType
.
Notify
)
{
return
rawMsg
;
}
if
(
type
===
MessageType
.
Card
)
{
const
p
=
JSON
.
parse
(
rawMsg
)
as
CardMessage
;
if
(
p
&&
p
.
title
)
{
return
p
.
title
||
'通知'
;
}
}
const
t
=
mapping
.
get
(
type
)
if
(
t
)
{
return
`[
${
t
}
]`
;
...
...
model/card.ts
0 → 100644
View file @
3d47c0d0
export
interface
CardMessage
{
title
:
string
;
date
:
string
;
desc
?:
string
;
desc1
?:
string
;
desc2
?:
string
;
values
?:
{
key
:
string
;
value
:
string
}[];
params
?:
any
;
path
?:
string
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment