Compare commits
2 Commits
18871db6b6
...
4b5c160e94
Author | SHA1 | Date | |
---|---|---|---|
|
4b5c160e94 | ||
|
ebd567a757 |
@ -132,14 +132,22 @@ const handleInput = (event) => {
|
||||
|
||||
// 更新HTML内容
|
||||
editorHtml.value = target.innerHTML || ''
|
||||
|
||||
const currentEditor= parseEditorContent().items
|
||||
// 后续操作
|
||||
checkMention(target)
|
||||
saveDraft()
|
||||
|
||||
emit('editor-event', {
|
||||
event: 'input_event',
|
||||
data: editorContent.value
|
||||
data: currentEditor.map(x=>{
|
||||
let text=''
|
||||
if(x.type===3){
|
||||
text='[图片]'
|
||||
}else if(x.type===1){
|
||||
text=x.content
|
||||
}
|
||||
return text
|
||||
})?.join('')
|
||||
})
|
||||
}
|
||||
|
||||
@ -1244,17 +1252,34 @@ const saveDraft = () => {
|
||||
// 获取不包含引用的内容
|
||||
const contentToSave = tempDiv.textContent || ''
|
||||
const htmlToSave = tempDiv.innerHTML || ''
|
||||
|
||||
const currentEditor= parseEditorContent().items
|
||||
// 检查是否有实际内容(不包括引用)
|
||||
const hasContent = contentToSave.trim().length > 0 ||
|
||||
htmlToSave.includes('<img') ||
|
||||
htmlToSave.includes('editor-file')
|
||||
|
||||
// 根据内容状态保存或删除草稿
|
||||
if (hasContent) {
|
||||
if (currentEditor.length>0) {
|
||||
console.log('保存到草稿',currentEditor.map(x=>{
|
||||
let text=''
|
||||
if(x.type===3){
|
||||
text='[图片]'
|
||||
}else if(x.type===1){
|
||||
text=x.content
|
||||
}
|
||||
return text
|
||||
})?.join(''))
|
||||
// 保存草稿到store,不包括引用数据
|
||||
editorDraftStore.items[indexName.value] = JSON.stringify({
|
||||
content: contentToSave,
|
||||
content: currentEditor.map(x=>{
|
||||
let text=''
|
||||
if(x.type===3){
|
||||
text='[图片]'
|
||||
}else if(x.type===1){
|
||||
text=x.content
|
||||
}
|
||||
return text
|
||||
})?.join(''),
|
||||
html: htmlToSave
|
||||
})
|
||||
} else {
|
||||
|
@ -45,7 +45,7 @@ const onRevoke = () => {
|
||||
<div class="content">
|
||||
<div v-if="login_uid === user_id">
|
||||
<span> 你撤回了一条消息 | {{ formatTime(datetime) }} </span>
|
||||
<n-button @click="onRevoke" v-if="data.msg_type === 1&&data.extra?.content" text class="text-#46299D text-11px">重新编辑</n-button>
|
||||
<n-button @click="onRevoke" v-if="data.msg_type === 1&&data.extra?.content&&data.is_self_action" text class="text-#46299D text-11px">重新编辑</n-button>
|
||||
</div>
|
||||
<span v-else-if="talk_type == 1"> 对方撤回了一条消息 | {{ formatTime(datetime) }} </span>
|
||||
<span v-else>
|
||||
|
@ -18,7 +18,7 @@ export function isLoggedIn() {
|
||||
*/
|
||||
export function getAccessToken() {
|
||||
// return storage.get(AccessToken) || ''
|
||||
return JSON.parse(localStorage.getItem('token'))||'46d71a72d8d845ad7ed23eba9bdde260e635407190c2ce1bf7fd22088e41682ea07773ec65cae8946d2003f264d55961f96e0fc5da10eb96d3a348c1664e9644ce2108c311309f398ae8ea1b8200bfd490e5cb6e8c52c9e5d493cbabb163368f8351420451a631dbfa749829ee4cda49b77b5ed2d3dced5d0f2b7dd9ee76ba5465c84a17c23af040cd92b6b2a4ea48befbb5c729dcdad0a9c9668befe84074cc24f78899c1d947f8e7f94c7eda5325b8ed698df729e76febb98549ef3482ae942fb4f4a1c92d21836fa784728f0c5483aab2760a991b6b36e6b10c84f840a6433a6ecc31dee36e8f1c6158818bc89d22c9c2f9b60a57573e8b08cdf47105e1ba85550c21fa55526e8a00bf316c623eb67abf749622c48beab908d61d3db7b22ed3eb6aa8a08c77680ad4d8a3458c1e72f97ba2b8480674df77f0501a34e82b58'
|
||||
return JSON.parse(localStorage.getItem('token'))||'79b5c732d96d2b27a48a99dfd4a5566c43aaa5796242e854ebe3ffc198d6876b9628e7b764d9af65ab5dbb2d517ced88170491b74b048c0ba827c0d3741462cb89dc59ed46653a449af837a8262941caaef1334d640773710f8cd96473bacfb190cba595a5d6a9c87d70f0999a3ebb41147213b31b4bdccffca66a56acf3baab5af0154f0dce360079f37709f78e13711036899344bddb0fb4cf0f2890287cb62c3fcbe33368caa5e213624577be8b8420ab75b1f50775ee16142a4321c5d56995f37354a66a969da98d95ba6e65d142ed097e04b411c1ebad2f62866d0ec7e1838420530a9941dbbcd00490199f8b891a491a664540c3af42964b31bedf8b1c93e8a754bb71e4b95d53ad8e6b16ac1575f536a9e7a062e44f3bb48a367623d38bd875a10afa3a53e79374ffda424138ed9ad4cab0d972432567ae7149b2bf3c'
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,6 +33,7 @@ export function useMenu() {
|
||||
const showDropdownMenu = (e: any, uid: number, item: any) => {
|
||||
// dropdown.item = Object.assign({}, item)
|
||||
dropdown.item = item
|
||||
dropdown.item.is_self_action = true
|
||||
dropdown.options = []
|
||||
if ([4].includes(item.msg_type)) {
|
||||
if(item.is_convert_text === 1){
|
||||
|
Loading…
Reference in New Issue
Block a user