精简私信记录时间显示
This commit is contained in:
@@ -121,6 +121,17 @@ export function userCardComponent() {
|
||||
return operatorPositionRank >= targetPositionRank;
|
||||
},
|
||||
|
||||
/** 格式化私信记录时间,只保留到秒。 */
|
||||
formatWhisperTime(value) {
|
||||
if (!value) {
|
||||
return "";
|
||||
}
|
||||
|
||||
const normalizedValue = String(value).replace("T", " ").replace(/\.\d+Z?$/, "").replace(/Z$/, "");
|
||||
|
||||
return normalizedValue.slice(0, 19);
|
||||
},
|
||||
|
||||
/** 返回名片资产字段的中文名称。 */
|
||||
assetValueLabel(asset) {
|
||||
return {
|
||||
|
||||
@@ -572,7 +572,7 @@
|
||||
<span style="color: #6366f1;" x-text="w.from_user"></span>
|
||||
→ <span style="color: #059669;" x-text="w.to_user"></span>:
|
||||
<span x-text="w.content"></span>
|
||||
<span style="color: #aaa; font-size: 10px;" x-text="'(' + w.sent_at + ')'"></span>
|
||||
<span style="color: #aaa; font-size: 10px;" x-text="'(' + formatWhisperTime(w.sent_at) + ')'"></span>
|
||||
</div>
|
||||
</template>
|
||||
<div x-show="whisperList.length === 0" style="font-size: 11px; color: #aaa;">暂无悄悄话记录</div>
|
||||
|
||||
Reference in New Issue
Block a user