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
b2c13510
authored
Jan 14, 2022
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
style
parent
3e149803
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
16 deletions
components/message.vue
utils/time/index.ts
components/message.vue
View file @
b2c13510
...
...
@@ -91,9 +91,12 @@
</div>
</div>
<span
v-if=
"showTs"
class=
"ts"
:class=
"{ right: isMyMessage }"
>
{{
ts
}}
</span>
<span
v-if=
"showTs"
class=
"ts"
:class=
"{ right: isMyMessage, offset: showWithdraw }"
>
{{ ts }}
</span
>
</div>
<i
...
...
@@ -103,17 +106,7 @@
></i>
<i
class=
"el-icon-loading"
v-else-if=
"isSendingMessage"
></i>
<span
class=
"withdraw"
v-if=
"
isMyMessage &&
canWithdraw &&
isWithdraw &&
!isWithdrawMessage &&
!isQuestionAnswerMessage &&
isChatMember
"
@
click=
"withdraw"
<span
class=
"withdraw"
v-if=
"showWithdraw"
@
click=
"withdraw"
>
撤回此消息
</span
>
...
...
@@ -285,7 +278,18 @@
private
showTsTimer
=
0
;
private
get
ts
()
{
return
this
.
data
&&
formatTime
(
this
.
data
.
ts
);
return
this
.
data
&&
formatTime
(
this
.
data
.
ts
,
{
mini
:
true
});
}
private
get
showWithdraw
()
{
return
(
this
.
isMyMessage
&&
this
.
canWithdraw
&&
this
.
isWithdraw
&&
!
this
.
isWithdrawMessage
&&
!
this
.
isQuestionAnswerMessage
&&
this
.
isChatMember
);
}
private
get
isSystemMessage
()
{
...
...
@@ -826,6 +830,10 @@
&.right
{
right
:
40px
;
left
:
unset
;
&.offset
{
right
:
70px
;
}
}
}
</
style
>
...
...
utils/time/index.ts
View file @
b2c13510
...
...
@@ -146,6 +146,7 @@ function formatTime2ShortYearMonthDate(time: Date) {
interface
FormatOption
{
rule
?:
TimeFormatRule
;
short
?:
boolean
;
mini
?:
boolean
;
}
/**
...
...
@@ -198,7 +199,7 @@ export function formatTime(
return
"昨天 "
+
format2DetailTime
(
hour
,
t
,
option
.
rule
);
}
if
(
isIn6Days
(
t
))
{
if
(
isIn6Days
(
t
)
&&
!
option
.
mini
)
{
if
(
option
.
short
)
{
return
`星期
${
getDayInWeek
(
t
)}
`
;
}
...
...
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