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
5a016285
authored
Nov 05, 2021
by
杨铁龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
新增action消息类型
parent
e02e153e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
2 deletions
components/message-item/action-message.vue
components/message.vue
components/message-item/action-message.vue
0 → 100644
View file @
5a016285
<
template
>
<div
class=
"msg-detail inline-text"
v-html=
"format2Link(messageBody.msg.text || emptyText)"
></div>
</
template
>
<
script
lang=
"ts"
>
import
{
replaceText2Link
}
from
"@/customer-service/utils"
;
import
xim
from
"@/customer-service/xim"
;
import
{
Component
}
from
"vue-property-decorator"
;
import
BaseMessage
from
"./index"
;
@
Component
({
components
:
{}
})
export
default
class
Index
extends
BaseMessage
{
protected
readonly
emptyText
=
" "
;
protected
format2Link
(
text
:
string
)
{
let
t
=
replaceText2Link
(
text
);
const
keywords
=
xim
.
getMatchedTextKeywords
();
for
(
const
item
of
keywords
)
{
const
r
=
new
RegExp
(
item
,
"g"
);
t
=
t
.
replace
(
r
,
`<span class="highlight">
${
item
}
</span>`
);
}
return
t
;
}
}
</
script
>
<
style
lang=
"less"
scoped
>
.inline-text
{
display
:
inline-block
;
white-space
:
pre-wrap
;
text-align
:
left
;
padding
:
20px
30px
;
color
:
#409eff
;
/deep/
.highlight
{
color
:
#e87005
;
}
}
</
style
>
\ No newline at end of file
components/message.vue
View file @
5a016285
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
<div
<div
class=
"message-con d-flex align-items-center"
class=
"message-con d-flex align-items-center"
:class=
"
{
:class=
"
{
'my-message flex-row-reverse': isMyMessage
&&
!isQuestionAnswerMessage,
'my-message flex-row-reverse':
isMyMessage
&&
!isQuestionAnswerMessage,
'justify-content-center': isWithdrawMessage,
'justify-content-center': isWithdrawMessage,
'offset-bottom': matchKeywords,
'offset-bottom': matchKeywords,
}"
}"
...
@@ -33,7 +34,11 @@
...
@@ -33,7 +34,11 @@
@open="openFile"
@open="openFile"
/>
/>
<avatar
<avatar
v-if=
"(avatar || showHostAvatar) && !isQuestionAnswerMessage && !isWithdrawMessage"
v-if=
"
(avatar || showHostAvatar) &&
!isQuestionAnswerMessage &&
!isWithdrawMessage
"
:src=
"
:src=
"
chatRole === 'default'
chatRole === 'default'
? avatar
? avatar
...
@@ -133,6 +138,7 @@
...
@@ -133,6 +138,7 @@
import
AudioMessage
from
"./message-item/audio-message.vue"
;
import
AudioMessage
from
"./message-item/audio-message.vue"
;
import
VideoMessage
from
"./message-item/video-message.vue"
;
import
VideoMessage
from
"./message-item/video-message.vue"
;
import
TextMessage
from
"./message-item/text-message.vue"
;
import
TextMessage
from
"./message-item/text-message.vue"
;
import
ActionMessage
from
"./message-item/action-message.vue"
;
import
WithdrawMessage
from
"./message-item/withdraw-message.vue"
;
import
WithdrawMessage
from
"./message-item/withdraw-message.vue"
;
import
PurchasePlanMessage
from
"./message-item/purchase-plan-message.vue"
;
import
PurchasePlanMessage
from
"./message-item/purchase-plan-message.vue"
;
import
MyWelfareMessage
from
"./message-item/my-welfare-message.vue"
;
import
MyWelfareMessage
from
"./message-item/my-welfare-message.vue"
;
...
@@ -153,6 +159,7 @@
...
@@ -153,6 +159,7 @@
[
dto
.
MessageType
.
MyPurchasePlan
,
"purchase-plan-message"
],
[
dto
.
MessageType
.
MyPurchasePlan
,
"purchase-plan-message"
],
[
dto
.
MessageType
.
MyWelfare
,
"my-welfare-message"
],
[
dto
.
MessageType
.
MyWelfare
,
"my-welfare-message"
],
[
dto
.
MessageType
.
QuestionAnswer
,
"question-answer-message"
],
[
dto
.
MessageType
.
QuestionAnswer
,
"question-answer-message"
],
[
dto
.
MessageType
.
Action
,
"action-message"
],
]);
]);
@
Component
({
@
Component
({
...
@@ -168,6 +175,7 @@
...
@@ -168,6 +175,7 @@
PurchasePlanMessage
,
PurchasePlanMessage
,
MyWelfareMessage
,
MyWelfareMessage
,
QuestionAnswerMessage
,
QuestionAnswerMessage
,
ActionMessage
,
},
},
})
})
export
default
class
Message
extends
Vue
{
export
default
class
Message
extends
Vue
{
...
...
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