Browse Source

change files status

master
godo 10 months ago
parent
commit
4d1cc402f4
  1. 6
      frontend/src/components/localchat/ChatContent.vue
  2. 14
      frontend/src/stores/localchat.ts

6
frontend/src/components/localchat/ChatContent.vue

@ -108,6 +108,12 @@ async function scroll({ scrollTop }: { scrollTop: number }) {
<span v-if="item.content.status === 'cannel'">
已拒绝
</span>
<span v-if="item.content.status === 'accessing'">
接收中
</span>
<span v-if="item.content.status === 'accessed'">
已接收
</span>
</template>
</el-card>
</div>

14
frontend/src/stores/localchat.ts

@ -370,7 +370,7 @@ export const useLocalChatStore = defineStore('localChatStore', () => {
console.log(saveMsg)
const msgId = await db.addOne('chatmsg', saveMsg)
//await getMsgList()
msgList.value.push(saveMsg)
const targetUser = userList.value.find((d: any) => d.ip === chatTargetIp.value)
//console.log(targetUser)
const messages = {
@ -401,23 +401,22 @@ export const useLocalChatStore = defineStore('localChatStore', () => {
console.log(completion)
notifyError("发送失败!")
} else {
saveMsg.content = messages.message
saveMsg.isRead = true
saveMsg.status = 'sended'
saveMsg.readAt = Date.now()
await db.update('chatmsg', msgId, saveMsg)
// if(type === 'applyfile'){
// notifySuccess("发送成功!")
// }
}
await updateContentList(saveMsg)
}else{
notifyError("对方不在线!")
}
msgList.value.push(saveMsg)
sendInfo.value = ""
}
async function cannelFile(item:any){
async function cannelFile(item:any){
const messages = {
type: 'cannelFile',
message: item.content.msgId,
@ -439,7 +438,8 @@ export const useLocalChatStore = defineStore('localChatStore', () => {
}
}
async function changeMsg(msg:any){
const msgId = msg.content.msgId
console.log(msg)
const msgId = msg.message
const item = await db.getOne('chatmsg', msgId)
item.content.status = 'cannel'
await db.update('chatmsg', item.id, item)

Loading…
Cancel
Save