Compare commits
13 Commits
451974a84f
...
32aa5f7d81
Author | SHA1 | Date | |
---|---|---|---|
32aa5f7d81 | |||
78009bc5e7 | |||
21f413d6e3 | |||
6e0322e2c7 | |||
2d7f2492af | |||
6543ac0607 | |||
6c63946d37 | |||
13830d748b | |||
7999499702 | |||
429c30808b | |||
|
111f303b2a | ||
|
a438174af4 | ||
03e84eab94 |
@ -20,6 +20,7 @@
|
|||||||
"@iconify-json/ion": "^1.2.3",
|
"@iconify-json/ion": "^1.2.3",
|
||||||
"@kangc/v-md-editor": "^2.3.18",
|
"@kangc/v-md-editor": "^2.3.18",
|
||||||
"@onlyoffice/document-editor-vue": "^1.5.0",
|
"@onlyoffice/document-editor-vue": "^1.5.0",
|
||||||
|
"@soerenmartius/vue3-clipboard": "^0.1.2",
|
||||||
"@tiptap/core": "^2.23.1",
|
"@tiptap/core": "^2.23.1",
|
||||||
"@tiptap/extension-blockquote": "^2.23.1",
|
"@tiptap/extension-blockquote": "^2.23.1",
|
||||||
"@tiptap/extension-emoji": "^2.23.1",
|
"@tiptap/extension-emoji": "^2.23.1",
|
||||||
|
@ -26,6 +26,9 @@ importers:
|
|||||||
'@onlyoffice/document-editor-vue':
|
'@onlyoffice/document-editor-vue':
|
||||||
specifier: ^1.5.0
|
specifier: ^1.5.0
|
||||||
version: 1.5.0(vue@3.5.17(typescript@5.2.2))
|
version: 1.5.0(vue@3.5.17(typescript@5.2.2))
|
||||||
|
'@soerenmartius/vue3-clipboard':
|
||||||
|
specifier: ^0.1.2
|
||||||
|
version: 0.1.2
|
||||||
'@tiptap/core':
|
'@tiptap/core':
|
||||||
specifier: ^2.23.1
|
specifier: ^2.23.1
|
||||||
version: 2.23.1(@tiptap/pm@2.23.1)
|
version: 2.23.1(@tiptap/pm@2.23.1)
|
||||||
@ -898,6 +901,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==}
|
resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
|
'@soerenmartius/vue3-clipboard@0.1.2':
|
||||||
|
resolution: {integrity: sha512-a5er6cFGcFIQ/3qg6kWvU0yFqIz9iWoQGEVs9azjevyRyMAKvj1w3JuLH9y6+u0WhMNby3kn7nuR8nktSnDesg==}
|
||||||
|
|
||||||
'@tiptap/core@2.23.1':
|
'@tiptap/core@2.23.1':
|
||||||
resolution: {integrity: sha512-EURGKGsEPrwxvOPi9gA+BsczvsECJNV+xgTAGWHmEtU4YJ0AulYrCX3b7FK+aiduVhThIHDoG/Mmvmb/HPLRhQ==}
|
resolution: {integrity: sha512-EURGKGsEPrwxvOPi9gA+BsczvsECJNV+xgTAGWHmEtU4YJ0AulYrCX3b7FK+aiduVhThIHDoG/Mmvmb/HPLRhQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@ -1613,6 +1619,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==}
|
resolution: {integrity: sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
|
|
||||||
|
clipboard@2.0.11:
|
||||||
|
resolution: {integrity: sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==}
|
||||||
|
|
||||||
cliui@8.0.1:
|
cliui@8.0.1:
|
||||||
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
|
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@ -2347,6 +2356,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==}
|
resolution: {integrity: sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
|
|
||||||
|
good-listener@1.2.2:
|
||||||
|
resolution: {integrity: sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==}
|
||||||
|
|
||||||
gopd@1.2.0:
|
gopd@1.2.0:
|
||||||
resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}
|
resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@ -3358,6 +3370,9 @@ packages:
|
|||||||
seemly@0.3.10:
|
seemly@0.3.10:
|
||||||
resolution: {integrity: sha512-2+SMxtG1PcsL0uyhkumlOU6Qo9TAQ/WyH7tthnPIOQB05/12jz9naq6GZ6iZ6ApVsO3rr2gsnTf3++OV63kE1Q==}
|
resolution: {integrity: sha512-2+SMxtG1PcsL0uyhkumlOU6Qo9TAQ/WyH7tthnPIOQB05/12jz9naq6GZ6iZ6ApVsO3rr2gsnTf3++OV63kE1Q==}
|
||||||
|
|
||||||
|
select@1.1.2:
|
||||||
|
resolution: {integrity: sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==}
|
||||||
|
|
||||||
semver@5.7.2:
|
semver@5.7.2:
|
||||||
resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==}
|
resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@ -3543,6 +3558,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A==}
|
resolution: {integrity: sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A==}
|
||||||
engines: {node: '>=12.22'}
|
engines: {node: '>=12.22'}
|
||||||
|
|
||||||
|
tiny-emitter@2.1.0:
|
||||||
|
resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==}
|
||||||
|
|
||||||
tinyexec@1.0.1:
|
tinyexec@1.0.1:
|
||||||
resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==}
|
resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==}
|
||||||
|
|
||||||
@ -4559,6 +4577,10 @@ snapshots:
|
|||||||
|
|
||||||
'@sindresorhus/merge-streams@4.0.0': {}
|
'@sindresorhus/merge-streams@4.0.0': {}
|
||||||
|
|
||||||
|
'@soerenmartius/vue3-clipboard@0.1.2':
|
||||||
|
dependencies:
|
||||||
|
clipboard: 2.0.11
|
||||||
|
|
||||||
'@tiptap/core@2.23.1(@tiptap/pm@2.23.1)':
|
'@tiptap/core@2.23.1(@tiptap/pm@2.23.1)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@tiptap/pm': 2.23.1
|
'@tiptap/pm': 2.23.1
|
||||||
@ -5518,6 +5540,12 @@ snapshots:
|
|||||||
isobject: 3.0.1
|
isobject: 3.0.1
|
||||||
static-extend: 0.1.2
|
static-extend: 0.1.2
|
||||||
|
|
||||||
|
clipboard@2.0.11:
|
||||||
|
dependencies:
|
||||||
|
good-listener: 1.2.2
|
||||||
|
select: 1.1.2
|
||||||
|
tiny-emitter: 2.1.0
|
||||||
|
|
||||||
cliui@8.0.1:
|
cliui@8.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
string-width: 4.2.3
|
string-width: 4.2.3
|
||||||
@ -6299,6 +6327,10 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
|
good-listener@1.2.2:
|
||||||
|
dependencies:
|
||||||
|
delegate: 3.2.0
|
||||||
|
|
||||||
gopd@1.2.0: {}
|
gopd@1.2.0: {}
|
||||||
|
|
||||||
graceful-fs@4.2.11: {}
|
graceful-fs@4.2.11: {}
|
||||||
@ -7430,6 +7462,8 @@ snapshots:
|
|||||||
|
|
||||||
seemly@0.3.10: {}
|
seemly@0.3.10: {}
|
||||||
|
|
||||||
|
select@1.1.2: {}
|
||||||
|
|
||||||
semver@5.7.2:
|
semver@5.7.2:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
@ -7609,6 +7643,8 @@ snapshots:
|
|||||||
|
|
||||||
throttle-debounce@5.0.2: {}
|
throttle-debounce@5.0.2: {}
|
||||||
|
|
||||||
|
tiny-emitter@2.1.0: {}
|
||||||
|
|
||||||
tinyexec@1.0.1: {}
|
tinyexec@1.0.1: {}
|
||||||
|
|
||||||
tinyglobby@0.2.14:
|
tinyglobby@0.2.14:
|
||||||
|
BIN
src/assets/image/bofang1.png
Normal file
BIN
src/assets/image/bofang1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
BIN
src/assets/image/yuyin1.png
Normal file
BIN
src/assets/image/yuyin1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu" ref="dropdownMenuRef">
|
||||||
<n-virtual-list
|
<n-virtual-list
|
||||||
ref="virtualListRef"
|
ref="virtualListRef"
|
||||||
style="max-height: 240px"
|
style="max-height: 240px"
|
||||||
@ -20,7 +20,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch, defineProps, defineExpose } from 'vue'
|
import { ref, watch, defineProps, defineExpose, onMounted, onUnmounted } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
items: {
|
items: {
|
||||||
@ -35,6 +35,40 @@ const props = defineProps({
|
|||||||
|
|
||||||
const selectedIndex = ref(0)
|
const selectedIndex = ref(0)
|
||||||
const virtualListRef = ref(null)
|
const virtualListRef = ref(null)
|
||||||
|
const dropdownMenuRef = ref(null)
|
||||||
|
|
||||||
|
let observer = null
|
||||||
|
|
||||||
|
let isViewport = ref(true)
|
||||||
|
const handleIntersection = (entries, observer) => {
|
||||||
|
entries.forEach(entry => {
|
||||||
|
if (entry.isIntersecting) {
|
||||||
|
isViewport.value = true
|
||||||
|
// 在这里处理元素可见的逻辑
|
||||||
|
} else {
|
||||||
|
isViewport.value = false
|
||||||
|
// 在这里处理元素不可见的逻辑
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
observer = new IntersectionObserver(handleIntersection, {
|
||||||
|
root: null, // null 值表示视口
|
||||||
|
rootMargin: '0px',
|
||||||
|
threshold: 0.1 // 元素至少有 10% 可见时触发回调
|
||||||
|
})
|
||||||
|
|
||||||
|
if (dropdownMenuRef.value) {
|
||||||
|
observer.observe(dropdownMenuRef.value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
if (observer && dropdownMenuRef.value) {
|
||||||
|
observer.unobserve(dropdownMenuRef.value)
|
||||||
|
observer.disconnect()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.items,
|
() => props.items,
|
||||||
@ -45,6 +79,7 @@ watch(
|
|||||||
|
|
||||||
const onKeyDown = ({ event }) => {
|
const onKeyDown = ({ event }) => {
|
||||||
console.log('event', event)
|
console.log('event', event)
|
||||||
|
if(!isViewport.value) return false
|
||||||
if (event.key === 'ArrowUp') {
|
if (event.key === 'ArrowUp') {
|
||||||
upHandler()
|
upHandler()
|
||||||
return true
|
return true
|
||||||
@ -100,6 +135,7 @@ defineExpose({
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 0.4rem;
|
padding: 0.4rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
max-height: 200px;
|
max-height: 200px;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
button {
|
button {
|
||||||
|
@ -9,7 +9,7 @@ import { computePosition, flip, shift } from '@floating-ui/dom'
|
|||||||
import Link from '@tiptap/extension-link'
|
import Link from '@tiptap/extension-link'
|
||||||
import { Extension, Node } from '@tiptap/core'
|
import { Extension, Node } from '@tiptap/core'
|
||||||
import { Plugin, PluginKey } from '@tiptap/pm/state'
|
import { Plugin, PluginKey } from '@tiptap/pm/state'
|
||||||
|
import { IosSend } from '@vicons/ionicons4'
|
||||||
|
|
||||||
import { reactive, watch, ref, markRaw, computed, onMounted, onUnmounted, shallowRef } from 'vue'
|
import { reactive, watch, ref, markRaw, computed, onMounted, onUnmounted, shallowRef } from 'vue'
|
||||||
|
|
||||||
@ -61,6 +61,9 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
uid:{
|
||||||
|
type: Number
|
||||||
|
},
|
||||||
members: {
|
members: {
|
||||||
default: () => []
|
default: () => []
|
||||||
}
|
}
|
||||||
@ -216,6 +219,7 @@ const editor = useEditor({
|
|||||||
return suggestion.items({
|
return suggestion.items({
|
||||||
query,
|
query,
|
||||||
props: {
|
props: {
|
||||||
|
uid: props.uid,
|
||||||
members: props.members,
|
members: props.members,
|
||||||
isGroupManager: (dialogueStore.groupInfo).is_manager
|
isGroupManager: (dialogueStore.groupInfo).is_manager
|
||||||
}
|
}
|
||||||
@ -236,7 +240,8 @@ const editor = useEditor({
|
|||||||
},
|
},
|
||||||
editorProps: {
|
editorProps: {
|
||||||
handlePaste: (view, event) => {
|
handlePaste: (view, event) => {
|
||||||
const items = (event.clipboardData || event.originalEvent.clipboardData).items
|
const clipboardData = event.clipboardData || event.originalEvent.clipboardData
|
||||||
|
const items = clipboardData.items
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
if (item.type.indexOf('image') === 0) {
|
if (item.type.indexOf('image') === 0) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
@ -261,9 +266,7 @@ const editor = useEditor({
|
|||||||
const pos = findImagePos(tempUrl)
|
const pos = findImagePos(tempUrl)
|
||||||
if (pos !== -1) {
|
if (pos !== -1) {
|
||||||
const { tr } = view.state
|
const { tr } = view.state
|
||||||
view.dispatch(
|
view.dispatch(tr.setNodeMarkup(pos, null, { src: data.ori_url }))
|
||||||
tr.setNodeMarkup(pos, null, { src: data.ori_url })
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
window['$message'].error(message || '图片上传失败')
|
window['$message'].error(message || '图片上传失败')
|
||||||
@ -279,10 +282,21 @@ const editor = useEditor({
|
|||||||
URL.revokeObjectURL(tempUrl)
|
URL.revokeObjectURL(tempUrl)
|
||||||
})
|
})
|
||||||
|
|
||||||
return true
|
return true // Handled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
|
||||||
|
// If no image was handled, check for text and paste as plain text.
|
||||||
|
const text = clipboardData.getData('text/plain')
|
||||||
|
if (text) {
|
||||||
|
event.preventDefault()
|
||||||
|
const { state, dispatch } = view
|
||||||
|
// dispatch(state.tr.insertContent(text).replace(/\n/g, '<br>'))
|
||||||
|
editor.value.commands.insertContent(text.replace(/\r/g, '').replace(/\n/g, '<br>'))
|
||||||
|
return true // Handled
|
||||||
|
}
|
||||||
|
|
||||||
|
return false // Fallback for other cases
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -388,7 +402,11 @@ async function onUploadFile(e) {
|
|||||||
|
|
||||||
if (file.type.indexOf('image/') === 0) {
|
if (file.type.indexOf('image/') === 0) {
|
||||||
|
|
||||||
let fn = emitCall('image_event', file, () => {})
|
const form = new FormData()
|
||||||
|
form.append('file', file)
|
||||||
|
form.append('source', 'fonchain-chat')
|
||||||
|
const { data } = await uploadImg(form)
|
||||||
|
let fn = emitCall('image_event', { url: data.ori_url, size: file.size }, () => { })
|
||||||
emit('editor-event', fn)
|
emit('editor-event', fn)
|
||||||
|
|
||||||
return
|
return
|
||||||
@ -513,6 +531,8 @@ function tiptapToString() {
|
|||||||
result += node.attrs.alt || ''
|
result += node.attrs.alt || ''
|
||||||
} else if (node.type === 'hardBreak') {
|
} else if (node.type === 'hardBreak') {
|
||||||
result += '\n'
|
result += '\n'
|
||||||
|
} else if (node.type === 'image') {
|
||||||
|
result += '[图片]'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -696,7 +716,8 @@ function onSubscribeEdit(data) {
|
|||||||
editor.value.commands.clearContent(true)
|
editor.value.commands.clearContent(true)
|
||||||
|
|
||||||
|
|
||||||
editor.value.commands.insertContent(data.content)
|
editor.value.commands.insertContent(data.content.replace(/\n/g, '<br>'))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
editor.value.commands.focus('end')
|
editor.value.commands.focus('end')
|
||||||
@ -775,6 +796,16 @@ useEventBus([
|
|||||||
<p class="tip-title">{{ nav.title }}</p>
|
<p class="tip-title">{{ nav.title }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="h-[45px] flex justify-center items-center">
|
||||||
|
<n-button class="w-80px h-30px mr-[22px]" type="primary" @click="onSendMessage">
|
||||||
|
<template #icon>
|
||||||
|
<n-icon>
|
||||||
|
<IosSend />
|
||||||
|
</n-icon>
|
||||||
|
</template>
|
||||||
|
发送
|
||||||
|
</n-button>
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div v-if="quoteData" class="quote-card-wrapper">
|
<div v-if="quoteData" class="quote-card-wrapper">
|
||||||
@ -962,6 +993,7 @@ html[theme-mode='dark'] {
|
|||||||
outline: none;
|
outline: none;
|
||||||
.tiptap.ProseMirror{
|
.tiptap.ProseMirror{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
.image-upload-loading {
|
.image-upload-loading {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -39,6 +39,8 @@ export default {
|
|||||||
if (props.isGroupManager) {
|
if (props.isGroupManager) {
|
||||||
list.unshift({ id: 0, nickname: '所有人', avatar: defAvatar })
|
list.unshift({ id: 0, nickname: '所有人', avatar: defAvatar })
|
||||||
}
|
}
|
||||||
|
// 排除掉自己
|
||||||
|
list.splice(list.findIndex((item) => item.id === props.uid), 1)
|
||||||
|
|
||||||
const filteredItems = list.filter(
|
const filteredItems = list.filter(
|
||||||
(item) => item.nickname.toLowerCase().includes(query.toLowerCase())
|
(item) => item.nickname.toLowerCase().includes(query.toLowerCase())
|
||||||
@ -99,10 +101,14 @@ export default {
|
|||||||
this.onExit()
|
this.onExit()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if(!component?.props.items?.length){
|
||||||
|
return false
|
||||||
|
}
|
||||||
return component.ref.onKeyDown(props)
|
return component.ref.onKeyDown(props)
|
||||||
},
|
},
|
||||||
|
|
||||||
onExit() {
|
onExit() {
|
||||||
|
console.log('component.element',component.element)
|
||||||
component.element.remove()
|
component.element.remove()
|
||||||
component.destroy()
|
component.destroy()
|
||||||
},
|
},
|
||||||
|
@ -55,8 +55,7 @@ const onConvertText =async (data: ITalkRecord) => {
|
|||||||
const res = await voiceToText({ msgId: data.msg_id, voiceUrl: data.extra.url })
|
const res = await voiceToText({ msgId: data.msg_id, voiceUrl: data.extra.url })
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
data.extra.content = res.data.convText
|
data.extra.content = res.data.convText
|
||||||
|
}else data.is_convert_text = 0
|
||||||
}
|
|
||||||
}
|
}
|
||||||
const onloseConvertText=(data: ITalkRecord)=>{
|
const onloseConvertText=(data: ITalkRecord)=>{
|
||||||
data.is_convert_text = 0
|
data.is_convert_text = 0
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive, computed } from 'vue'
|
||||||
import { PlayOne, PauseOne } from '@icon-park/vue-next'
|
import { PlayOne, PauseOne } from '@icon-park/vue-next'
|
||||||
import { ITalkRecordExtraAudio, ITalkRecord } from '@/types/chat'
|
import { ITalkRecordExtraAudio, ITalkRecord } from '@/types/chat'
|
||||||
|
import { onClickOutside } from '@vueuse/core'
|
||||||
|
import { useTemplateRef } from 'vue'
|
||||||
|
import yuyin from "@/assets/image/yuyin.png"
|
||||||
|
import yuyin1 from "@/assets/image/yuyin1.png"
|
||||||
|
import bofang from "@/assets/image/bofang.png"
|
||||||
|
import bofang1 from "@/assets/image/bofang1.png"
|
||||||
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
extra: ITalkRecordExtraAudio
|
extra: ITalkRecordExtraAudio
|
||||||
@ -22,15 +29,22 @@ const state = reactive({
|
|||||||
showText: false
|
showText: false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const target = useTemplateRef<HTMLElement>('target')
|
||||||
const onPlay = () => {
|
const onPlay = () => {
|
||||||
if (state.isAudioPlay) {
|
if (state.isAudioPlay) {
|
||||||
audioRef.value.pause()
|
audioRef.value.pause()
|
||||||
|
state.isAudioPlay = false
|
||||||
} else {
|
} else {
|
||||||
audioRef.value.play()
|
audioRef.value.play()
|
||||||
|
state.isAudioPlay = true
|
||||||
|
onClickOutside(target, () => {
|
||||||
|
console.log('点击了外部区域')
|
||||||
|
audioRef.value.pause() // 关闭当前语音播放
|
||||||
|
state.isAudioPlay = false
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
state.isAudioPlay = !state.isAudioPlay
|
|
||||||
}
|
|
||||||
|
|
||||||
const onPlayEnd = () => {
|
const onPlayEnd = () => {
|
||||||
state.isAudioPlay = false
|
state.isAudioPlay = false
|
||||||
@ -70,10 +84,18 @@ const formatTime = (value: number = 0) => {
|
|||||||
|
|
||||||
return `${Math.floor(value)}"`
|
return `${Math.floor(value)}"`
|
||||||
}
|
}
|
||||||
|
const right = computed(() => props.data.float === 'right')
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="pointer w-200px bg-#F3F4FD rounded-10px px-11px">
|
<div
|
||||||
<div class="im-message-audio h-44px">
|
class="pointer w-200px bg-#F3F4FD rounded-10px px-11px"
|
||||||
|
:class="{
|
||||||
|
'!bg-[var(--im-message-right-bg-color)] !text-[var(--im-message-right-text-color)]': right
|
||||||
|
}"
|
||||||
|
@click.stop="onPlay"
|
||||||
|
ref="target"
|
||||||
|
>
|
||||||
|
<div class="im-message-audio h-44px" :class="{ right }">
|
||||||
<aTrumpet :isPlay="false" color="black" :size="30"></aTrumpet>
|
<aTrumpet :isPlay="false" color="black" :size="30"></aTrumpet>
|
||||||
<audio
|
<audio
|
||||||
ref="audioRef"
|
ref="audioRef"
|
||||||
@ -87,15 +109,16 @@ const formatTime = (value: number = 0) => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="play">
|
<div class="play">
|
||||||
<div class="btn pointer" @click.stop="onPlay">
|
<div class="btn pointer">
|
||||||
<!-- <n-icon :size="18" :component="state.isAudioPlay ? PauseOne : PlayOne" /> -->
|
<!-- <n-icon :size="18" :component="state.isAudioPlay ? PauseOne : PlayOne" /> -->
|
||||||
<img
|
<img
|
||||||
v-if="!state.isAudioPlay"
|
v-if="!state.isAudioPlay"
|
||||||
src="@/assets/image/yuyin.png"
|
:src="right ? yuyin1 : yuyin"
|
||||||
class="w-[16px] h-[16px]"
|
class="w-[16px] h-[16px]"
|
||||||
alt=""
|
alt=""
|
||||||
|
:style="{ transform: right && 'rotate(180deg)' }"
|
||||||
/>
|
/>
|
||||||
<img v-else src="@/assets/image/bofang.png" class="w-[16px] h-[16px]" alt="" />
|
<img v-else :src="right ? bofang1 : bofang" class="w-[16px] h-[16px]" alt="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="desc">
|
<!-- <div class="desc">
|
||||||
@ -129,6 +152,9 @@ const formatTime = (value: number = 0) => {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
.right {
|
||||||
|
flex-direction: row-reverse !important;
|
||||||
|
}
|
||||||
.im-message-audio {
|
.im-message-audio {
|
||||||
--audio-bg-color: #f5f5f5;
|
--audio-bg-color: #f5f5f5;
|
||||||
--audio-btn-bg-color: #ffffff;
|
--audio-btn-bg-color: #ffffff;
|
||||||
|
@ -17,7 +17,7 @@ let textContent = props.extra?.content || ''
|
|||||||
textContent = textReplaceLink(textContent)
|
textContent = textReplaceLink(textContent)
|
||||||
|
|
||||||
if (props.data.talk_type == 2) {
|
if (props.data.talk_type == 2) {
|
||||||
textContent = textReplaceMention(textContent, float==='right'?'#462AA0':'#fff',float==='right'?'#EEE9F9':'#462AA0')
|
textContent = textReplaceMention(textContent, float==='right'?'':'black',float==='right'?'':'')
|
||||||
}
|
}
|
||||||
|
|
||||||
textContent = textReplaceEmoji(textContent)
|
textContent = textReplaceEmoji(textContent)
|
||||||
|
@ -170,7 +170,7 @@ if(newVal){
|
|||||||
<div class="w-260px h-517px rounded-4px border-1px border-solid border-#E5E5E5 px-12px">
|
<div class="w-260px h-517px rounded-4px border-1px border-solid border-#E5E5E5 px-12px">
|
||||||
<div class="border-b-2px border-b-solid border-b-#FBFBFB h-35px flex items-center justify-end">
|
<div class="border-b-2px border-b-solid border-b-#FBFBFB h-35px flex items-center justify-end">
|
||||||
<n-button text color="#46299D" class="text-14px" @click="changeSelectType">
|
<n-button text color="#46299D" class="text-14px" @click="changeSelectType">
|
||||||
{{ selectType === 1 ? '多选' : '单选' }}
|
{{ selectType === 1 ? '多选' : '取消多选' }}
|
||||||
</n-button>
|
</n-button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@ -190,9 +190,10 @@ if(newVal){
|
|||||||
:customStyle="{width:'42px',height:'42px'}"></avatarModule>
|
:customStyle="{width:'42px',height:'42px'}"></avatarModule>
|
||||||
<!-- <n-image class="w-42px h-42px rounded-full" :src="item.avatar" /> -->
|
<!-- <n-image class="w-42px h-42px rounded-full" :src="item.avatar" /> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center overflow-hidden flex">
|
||||||
<span class="text-ellipsis">{{ item.name }}</span>
|
<span class="text-ellipsis">{{ item.name }}</span>
|
||||||
<span v-if="item.type == 2" class="badge group ml-2">群</span>
|
<!-- <span v-if="item.type == 2" class="badge group ml-2">群</span> -->
|
||||||
|
<span v-if="item.talk_type === 2" class="flex-shrink-0">{{ `(${item.group_member_num})` }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -217,9 +218,10 @@ if(newVal){
|
|||||||
:groupType="item.group_type"
|
:groupType="item.group_type"
|
||||||
:customStyle="{width:'42px',height:'42px'}"></avatarModule>
|
:customStyle="{width:'42px',height:'42px'}"></avatarModule>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center overflow-hidden flex">
|
||||||
<span class="text-ellipsis">{{ item.name }}</span>
|
<span class="text-ellipsis">{{ item.name }}</span>
|
||||||
<span v-if="item.type == 2" class="badge group ml-2">群</span>
|
<!-- <span v-if="item.type == 2" class="badge group ml-2">群</span> -->
|
||||||
|
<span v-if="item.talk_type === 2" class="flex-shrink-0">{{ `(${item.group_member_num})` }}</span>
|
||||||
</div>
|
</div>
|
||||||
<n-button class="ml-auto" text color="#C7C7C9" @click="onRemoveContact(item)">
|
<n-button class="ml-auto" text color="#C7C7C9" @click="onRemoveContact(item)">
|
||||||
<n-icon :component="CloseCircle" size="18" />
|
<n-icon :component="CloseCircle" size="18" />
|
||||||
|
@ -259,10 +259,16 @@ class Talk extends Base {
|
|||||||
updated_at: parseTime(new Date())
|
updated_at: parseTime(new Date())
|
||||||
})
|
})
|
||||||
|
|
||||||
if (this.talk_type == 1 && this.getAccountId() !== this.sender_id) {
|
if (this.getAccountId() !== this.sender_id) {
|
||||||
ServeClearTalkUnreadNum({
|
ServeClearTalkUnreadNum({
|
||||||
talk_type: 1,
|
talk_type: this.talk_type,
|
||||||
receiver_id: this.sender_id
|
receiver_id: this.talk_type == 1 ? this.sender_id : this.receiver_id
|
||||||
|
}).then(() => {
|
||||||
|
useTalkStore().updateItem({
|
||||||
|
index_name: item.index_name,
|
||||||
|
unread_num: 0,
|
||||||
|
atsign_num: 0
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,11 +77,11 @@ export function useSessionMenu() {
|
|||||||
// key: 'delete_contact'
|
// key: 'delete_contact'
|
||||||
// })
|
// })
|
||||||
} else {
|
} else {
|
||||||
options.push({
|
// options.push({
|
||||||
|
|
||||||
label: '退出群聊',
|
// label: '退出群聊',
|
||||||
key: 'signout_group'
|
// key: 'signout_group'
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
dropdown.options = [...options]
|
dropdown.options = [...options]
|
||||||
|
@ -383,6 +383,9 @@ export const useDialogueStore = defineStore('dialogue', {
|
|||||||
|
|
||||||
// 从全局列表中移除
|
// 从全局列表中移除
|
||||||
this.globalUploadList.splice(taskIndex, 1)
|
this.globalUploadList.splice(taskIndex, 1)
|
||||||
|
// 移除消息记录
|
||||||
|
|
||||||
|
this.batchDelDialogueRecord([uploadId])
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ export const useUploadsStore = defineStore('uploads', {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("初始化分片上传失败:", error);
|
console.error("初始化分片上传失败:", error);
|
||||||
message.error("初始化上传失败,请重试")
|
message.error("上传失败,请重试")
|
||||||
this.handleUploadError(upload_id, clientUploadId)
|
this.handleUploadError(upload_id, clientUploadId)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
|
import { toClipboard } from '@soerenmartius/vue3-clipboard'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 防抖函数
|
* 防抖函数
|
||||||
@ -51,12 +52,12 @@ export function throttle(fn, delay, call = function () {}) {
|
|||||||
* @param {String} text 复制内容
|
* @param {String} text 复制内容
|
||||||
* @param {Function} callback 复制成功回调方法
|
* @param {Function} callback 复制成功回调方法
|
||||||
*/
|
*/
|
||||||
export function clipboard(text, callback) {
|
export async function clipboard(text, callback) {
|
||||||
// 在wujie环境下使用主应用的clipboard
|
// 在wujie环境下使用主应用的clipboard
|
||||||
const clipboardObj = window.__POWERED_BY_WUJIE__
|
const clipboardObj = window.__POWERED_BY_WUJIE__
|
||||||
? window.parent.navigator.clipboard
|
? window.parent.navigator.clipboard
|
||||||
: navigator.clipboard
|
: navigator.clipboard
|
||||||
|
try {
|
||||||
clipboardObj
|
clipboardObj
|
||||||
.writeText(text)
|
.writeText(text)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -65,6 +66,11 @@ export function clipboard(text, callback) {
|
|||||||
.catch(() => {
|
.catch(() => {
|
||||||
alert('Oops, unable to copy')
|
alert('Oops, unable to copy')
|
||||||
})
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
await toClipboard(text)
|
||||||
|
callback && callback()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function clipboardImage(src, callback) {
|
export async function clipboardImage(src, callback) {
|
||||||
|
@ -48,7 +48,9 @@ request.interceptors.request.use((config) => {
|
|||||||
if (token) {
|
if (token) {
|
||||||
config.headers['Authorization'] = `Bearer ${token}`
|
config.headers['Authorization'] = `Bearer ${token}`
|
||||||
}
|
}
|
||||||
|
if(config.url.indexOf('api/v1/upload/multipart') > -1){
|
||||||
|
config.timeout = 600000
|
||||||
|
}
|
||||||
return config
|
return config
|
||||||
}, errorHandler)
|
}, errorHandler)
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ const onConvertText = async (data: ITalkRecord) => {
|
|||||||
const res = await voiceToText({ msgId: data.msg_id, voiceUrl: data.extra.url })
|
const res = await voiceToText({ msgId: data.msg_id, voiceUrl: data.extra.url })
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
data.extra.content = res.data.convText
|
data.extra.content = res.data.convText
|
||||||
}
|
} else data.is_convert_text = 0
|
||||||
}
|
}
|
||||||
const onloseConvertText = (data: ITalkRecord) => {
|
const onloseConvertText = (data: ITalkRecord) => {
|
||||||
data.is_convert_text = 0
|
data.is_convert_text = 0
|
||||||
@ -354,6 +354,10 @@ const onRowClick = (item: ITalkRecord) => {
|
|||||||
if (!isOneMonthBefore(item.created_at.split(' ')[0])) {
|
if (!isOneMonthBefore(item.created_at.split(' ')[0])) {
|
||||||
return useMessage.info('只支持转发近一个月内的消息')
|
return useMessage.info('只支持转发近一个月内的消息')
|
||||||
}
|
}
|
||||||
|
// 语音消息和群公告不支持转发
|
||||||
|
if ([4, 13].includes(item.msg_type)) {
|
||||||
|
return useMessage.info('语音消息和群公告不支持转发')
|
||||||
|
}
|
||||||
console.log('item.msg_type', item.msg_type)
|
console.log('item.msg_type', item.msg_type)
|
||||||
if (ForwardableMessageType.includes(item.msg_type)) {
|
if (ForwardableMessageType.includes(item.msg_type)) {
|
||||||
item.isCheck = !item.isCheck
|
item.isCheck = !item.isCheck
|
||||||
@ -435,12 +439,15 @@ const retry = (item: any) => {
|
|||||||
confirmBox({
|
confirmBox({
|
||||||
content: '确定重发吗'
|
content: '确定重发吗'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
item.extra.percentage = 0
|
||||||
uploadsStore.retryCommonUpload(item.extra.upload_id)
|
uploadsStore.retryCommonUpload(item.extra.upload_id)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const onContextMenuAvatar = (e: any, item: any) => {
|
const onContextMenuAvatar = (e: any, item: any) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
// 单聊不需要@
|
||||||
|
if (+props.talk_type === 1) return
|
||||||
if (item.float !== 'right') {
|
if (item.float !== 'right') {
|
||||||
bus.emit(EditorConst.Mention, {
|
bus.emit(EditorConst.Mention, {
|
||||||
id: item.user_id,
|
id: item.user_id,
|
||||||
@ -840,7 +847,7 @@ const onCustomSkipBottomEvent = () => {
|
|||||||
<!-- 近一个月外的消息多选框禁用 {{ item }} -->
|
<!-- 近一个月外的消息多选框禁用 {{ item }} -->
|
||||||
<n-checkbox
|
<n-checkbox
|
||||||
size="small"
|
size="small"
|
||||||
:disabled="!isOneMonthBefore(item.created_at.split(' ')[0])"
|
:disabled="!isOneMonthBefore(item.created_at.split(' ')[0]) || [4, 13].includes(item.msg_type)"
|
||||||
:checked="item.isCheck"
|
:checked="item.isCheck"
|
||||||
@update:checked="item.isCheck = !item.isCheck"
|
@update:checked="item.isCheck = !item.isCheck"
|
||||||
/>
|
/>
|
||||||
@ -940,7 +947,13 @@ const onCustomSkipBottomEvent = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 已读回执 -->
|
<!-- 已读回执 -->
|
||||||
<div class="talk_read_num" v-if="item.user_id === props.uid">
|
<!-- item.user_id:发送这条消息的人id -->
|
||||||
|
<!-- props.uid:当前登录人id -->
|
||||||
|
<!-- props.receiver_id:当前消息要发送的人id -->
|
||||||
|
<div
|
||||||
|
class="talk_read_num"
|
||||||
|
v-if="item.user_id === props.uid && props.uid !== props.receiver_id"
|
||||||
|
>
|
||||||
<span v-if="props.talk_type === 1">{{
|
<span v-if="props.talk_type === 1">{{
|
||||||
item.read_total_num > 0 ? '已读' : '未读'
|
item.read_total_num > 0 ? '已读' : '未读'
|
||||||
}}</span>
|
}}</span>
|
||||||
|
@ -66,7 +66,7 @@ const onSendMessage = (data = {}, callBack: any) => {
|
|||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
callBack(true)
|
callBack(true)
|
||||||
} else {
|
} else {
|
||||||
window['$message'].warning(message || msg)
|
// window['$message'].warning(message || msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -75,7 +75,7 @@ const onSendMessage = (data = {}, callBack: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 发送文本消息
|
// 发送文本消息
|
||||||
const onSendTextEvent = throttle((value: any) => {
|
const onSendTextEvent = (value: any) => {
|
||||||
let { data, callBack } = value
|
let { data, callBack } = value
|
||||||
|
|
||||||
let message = {
|
let message = {
|
||||||
@ -93,7 +93,7 @@ const onSendTextEvent = throttle((value: any) => {
|
|||||||
|
|
||||||
callBack(true)
|
callBack(true)
|
||||||
})
|
})
|
||||||
}, 1000)
|
}
|
||||||
|
|
||||||
// 发送图片消息
|
// 发送图片消息
|
||||||
const onSendImageEvent = ({ data, callBack }) => {
|
const onSendImageEvent = ({ data, callBack }) => {
|
||||||
@ -297,7 +297,7 @@ onMounted(() => {
|
|||||||
<MultiSelectFooter v-if="dialogueStore.isOpenMultiSelect" />
|
<MultiSelectFooter v-if="dialogueStore.isOpenMultiSelect" />
|
||||||
<!-- <Editor v-else @editor-event="onEditorEvent" :vote="talk_type == 2" :members="members" /> -->
|
<!-- <Editor v-else @editor-event="onEditorEvent" :vote="talk_type == 2" :members="members" /> -->
|
||||||
<!-- <CustomEditor v-else @editor-event="onEditorEvent" :vote="talk_type == 2" :members="members" /> -->
|
<!-- <CustomEditor v-else @editor-event="onEditorEvent" :vote="talk_type == 2" :members="members" /> -->
|
||||||
<TiptapEditor v-else @editor-event="onEditorEvent" :vote="talk_type == 2" :members="members" />
|
<TiptapEditor v-else @editor-event="onEditorEvent" :uid="uid" :vote="talk_type == 2" :members="members" />
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<HistoryRecord
|
<HistoryRecord
|
||||||
|
@ -71,11 +71,14 @@ export function useMenu() {
|
|||||||
dropdown.options.push({ label: '复制', key: 'copy' })
|
dropdown.options.push({ label: '复制', key: 'copy' })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isOneMonthBefore(new Date(item.created_at.split(' ')[0]))) {
|
if (isOneMonthBefore(new Date(item.created_at.split(' ')[0])) && ![4,13].includes(item.msg_type)) {
|
||||||
// 根据时间判断只有近一个月内的消息才能支持多选
|
// 根据时间判断只有近一个月内的消息才能支持多选 // 语音消息和群公告不支持转发
|
||||||
dropdown.options.push({ label: '多选', key: 'multiSelect' })
|
dropdown.options.push({ label: '多选', key: 'multiSelect' })
|
||||||
}
|
}
|
||||||
|
if (isOneMonthBefore(new Date(item.created_at.split(' ')[0]))) {
|
||||||
|
// 根据时间判断只有近一个月内的消息才能支持引用
|
||||||
dropdown.options.push({ label: '引用', key: 'quote' })
|
dropdown.options.push({ label: '引用', key: 'quote' })
|
||||||
|
}
|
||||||
if (canAddRevokeOption(uid, item, (dialogueStore.groupInfo as any).is_manager)) {
|
if (canAddRevokeOption(uid, item, (dialogueStore.groupInfo as any).is_manager)) {
|
||||||
dropdown.options.push({ label: '撤回', key: 'revoke' });
|
dropdown.options.push({ label: '撤回', key: 'revoke' });
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user