Merge branch 'dev' of github.com:jumpserver/lina into dev

This commit is contained in:
ibuler
2021-09-27 15:40:02 +08:00
2 changed files with 18 additions and 3 deletions

View File

@@ -26,10 +26,10 @@
>
<div class="msg-item-head">
<span class="msg-item-head-type">
<i :class="msg.has_read ? 'fa-envelope-open-o' : 'fa-envelope'" class="fa msg-icon" />
<i :class="msg['has_read'] ? 'fa-envelope-open-o' : 'fa-envelope'" class="fa msg-icon" />
{{ msg.subject }}
</span>
<span v-if="hoverMsgId !== msg.id || msg.has_read" class="msg-item-head-time">
<span v-if="hoverMsgId !== msg.id || msg['has_read']" class="msg-item-head-time">
{{ formatDate(msg.date_created) }}
</span>
<div v-else class="msg-item-read-btn" @click.stop="markAsRead(msg)">
@@ -225,7 +225,7 @@ export default {
.msg-item-head-type {
float: left;
width: 240px;
width: 220px;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;

View File

@@ -239,6 +239,21 @@ export function getUpdateObjURL(url, objId) {
return urlObj.href
}
export function truncateCenter(s, l) {
if (s.length <= l) {
return s
}
const centerIndex = Math.ceil(l / 2)
return s.slice(0, centerIndex - 2) + '...' + s.slice(centerIndex + 1, l)
}
export function truncateEnd(s, l) {
if (s.length <= l) {
return s
}
return s.slice(0, l - 3) + '...'
}
export const assignIfNot = _.partialRight(_.assignInWith, customizer)
const scheme = document.location.protocol