From e720ca1a407dd1e9ddbdd036d828c2dd2d4de405 Mon Sep 17 00:00:00 2001 From: bob <312777916@qq.com> Date: Tue, 19 Nov 2024 16:18:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=8D=E6=89=93=E6=89=B0=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E4=BC=98=E5=8C=96:muted=20=3D>=20dnd(Do=20No?= =?UTF-8?q?t=20Disturb)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/card/GroupCard.vue | 8 ++++---- src/stores/message.js | 6 +++--- src/views/message/components/SessionItem.vue | 16 ++++++++-------- src/views/message/components/SessionMenu.vue | 10 +++++----- src/views/message/components/SessionTag.vue | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/components/card/GroupCard.vue b/src/components/card/GroupCard.vue index 1c9d570..f4993bd 100644 --- a/src/components/card/GroupCard.vue +++ b/src/components/card/GroupCard.vue @@ -479,9 +479,9 @@ const handleChangeTop = () => { console.log(isTop.value) } -const isSilentMode = ref(false) //TODO -const handleChangeSilentMode = () => { - console.log(isSilentMode.value) +const isDnd = ref(false) //TODO +const handleChangeDnd = () => { + console.log(isDnd.value) } // const isAllMuted = ref(false) //TODO @@ -621,7 +621,7 @@ const handleAllInvite = () => {
设置免打扰 - +
{ // 云端更新成功再更新本地,保持数据同步 if (res.data.code === 0) { if ('top' in obj) mySession.top = obj.top - if ('muted' in obj) mySession.muted = obj.muted + if ('dnd' in obj) mySession.dnd = obj.dnd if ('draft' in obj) mySession.draft = obj.draft if ('mark' in obj) { mySession.mark = obj.mark diff --git a/src/views/message/components/SessionItem.vue b/src/views/message/components/SessionItem.vue index 8681bb6..3cc8e2d 100644 --- a/src/views/message/components/SessionItem.vue +++ b/src/views/message/components/SessionItem.vue @@ -28,7 +28,7 @@ const sessionInfo = computed(() => { }) const top = ref(sessionInfo.value.top) -const muted = ref(sessionInfo.value.muted) +const dnd = ref(sessionInfo.value.dnd) const hasBeenSelected = computed(() => { return props.sessionId === props.selectedSessionId @@ -101,7 +101,7 @@ const switchTag = (func) => { func() clearTimeout(timer) timer = setTimeout(() => { - if (top.value === sessionInfo.value.top && muted.value === sessionInfo.value.muted) { + if (top.value === sessionInfo.value.top && dnd.value === sessionInfo.value.dnd) { return } @@ -109,7 +109,7 @@ const switchTag = (func) => { messageData.updateSession({ sessionId: props.sessionId, top: top.value, - muted: muted.value + dnd: dnd.value }) }, 100) // 这个时间太长会影响置顶按钮的响应时长 } @@ -122,9 +122,9 @@ const handleSelectedMenuItem = async () => { top.value = !top.value }) break - case 'muted': + case 'dnd': switchTag(() => { - muted.value = !muted.value + dnd.value = !dnd.value }) break case 'delete': @@ -175,7 +175,7 @@ defineExpose({ - +
{{ showTime }} @@ -204,10 +204,10 @@ defineExpose({ /> { return messageData.sessionList[props.sessionId].top }) -const muted = computed(() => { - return messageData.sessionList[props.sessionId].muted +const dnd = computed(() => { + return messageData.sessionList[props.sessionId].dnd }) const menu = computed(() => { @@ -24,9 +24,9 @@ const menu = computed(() => { icon: top.value ? Bottom : Top }, { - label: 'muted', - desc: muted.value ? '取消免打扰' : '开启免打扰', - icon: muted.value ? Bell : MuteNotification + label: 'dnd', + desc: dnd.value ? '取消免打扰' : '开启免打扰', + icon: dnd.value ? Bell : MuteNotification }, { label: 'mark', diff --git a/src/views/message/components/SessionTag.vue b/src/views/message/components/SessionTag.vue index 9c10f77..8330e6e 100644 --- a/src/views/message/components/SessionTag.vue +++ b/src/views/message/components/SessionTag.vue @@ -6,7 +6,7 @@ const items = { organize: { color: '#E6A23C', label: '组' }, assistant: { color: '#E734F5', label: '助' }, top: { color: '#F56C6C', label: '顶' }, - mute: { color: '#73767a', label: '静' } + dnd: { color: '#73767a', label: '静' } } const props = defineProps(['tagType'])