Compare commits

..

No commits in common. "e27682badf0e2b8f1406449008fe6ea6516679df" and "e1e11b763339e613762436157f7e7fa89cdefc0c" have entirely different histories.

25 changed files with 61 additions and 96 deletions

View File

@ -883,8 +883,8 @@ packages:
'@types/ms@2.1.0':
resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==}
'@types/node@18.19.103':
resolution: {integrity: sha512-hHTHp+sEz6SxFsp+SA+Tqrua3AbmlAw+Y//aEwdHrdZkYVRWdvWD3y5uPZ0flYOkgskaFWqZ/YGFm3FaFQ0pRw==}
'@types/node@18.19.101':
resolution: {integrity: sha512-Ykg7fcE3+cOQlLUv2Ds3zil6DVjriGQaSN/kEpl5HQ3DIGM6W0F2n9+GkWV4bRt7KjLymgzNdTnSKCbFUUJ7Kw==}
'@types/node@18.19.99':
resolution: {integrity: sha512-tNGqoGjjI4vY5jfm3lnqgR6yS8wyT76SfsWefLWRyh/cEK4UHmPVyqHZdafI/SNu1PQzfo2JLBWfG8eMmD7KrQ==}
@ -3517,8 +3517,8 @@ packages:
warning@4.0.3:
resolution: {integrity: sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==}
watchpack@2.4.4:
resolution: {integrity: sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==}
watchpack@2.4.3:
resolution: {integrity: sha512-adBYQLivcg1jbdKEJeqScJJFvgm4qY9+3tXw+jdG6lkVeqRJEtiQmSWjmth8GKmDZuX7sYM4YFxQsf0AzMfGGw==}
engines: {node: '>=10.13.0'}
web-worker@1.5.0:
@ -3528,8 +3528,8 @@ packages:
resolution: {integrity: sha512-BCfKo2YkDe2ByqkEWe1Rw+zko4LsyS75LVr29C6xIrxAg9JHJ4pl8kaIZ396SUSNp6b4815dRZPSTAS8LlURRQ==}
deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
webpack-sources@3.3.0:
resolution: {integrity: sha512-77R0RDmJfj9dyv5p3bM5pOHa+X8/ZkO9c7kpDstigkC4nIDobadsfSGCwB4bKhMVxqAok8tajaoR8rirM7+VFQ==}
webpack-sources@3.2.3:
resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==}
engines: {node: '>=10.13.0'}
webpack-virtual-modules@0.6.2:
@ -4228,7 +4228,7 @@ snapshots:
'@types/ms@2.1.0': {}
'@types/node@18.19.103':
'@types/node@18.19.101':
dependencies:
undici-types: 5.26.5
@ -5895,7 +5895,7 @@ snapshots:
jest-worker@27.5.1:
dependencies:
'@types/node': 18.19.103
'@types/node': 18.19.101
merge-stream: 2.0.0
supports-color: 8.1.1
@ -7244,7 +7244,7 @@ snapshots:
dependencies:
loose-envify: 1.4.0
watchpack@2.4.4:
watchpack@2.4.3:
dependencies:
glob-to-regexp: 0.4.1
graceful-fs: 4.2.11
@ -7256,7 +7256,7 @@ snapshots:
deepmerge: 1.5.2
javascript-stringify: 1.6.0
webpack-sources@3.3.0: {}
webpack-sources@3.2.3: {}
webpack-virtual-modules@0.6.2: {}
@ -7284,8 +7284,8 @@ snapshots:
schema-utils: 4.3.2
tapable: 2.2.2
terser-webpack-plugin: 5.3.14(webpack@5.99.8)
watchpack: 2.4.4
webpack-sources: 3.3.0
watchpack: 2.4.3
webpack-sources: 3.2.3
transitivePeerDependencies:
- '@swc/core'
- esbuild

View File

@ -29,7 +29,7 @@ html {
// 黑色主题
html[theme-mode='dark'] {
--im-primary-color: #462AA0;
--im-primary-color: #1890ff;
--im-bg-color: #202124;
--line-border-color: rgb(255 255 255 / 9%);
--border-color: rgb(255 255 255 / 9%);

View File

@ -12,7 +12,7 @@
&:hover,
&.dropsize-resizing {
background-color: #462AA0;
background-color: #1890ff;
}
&.dropsize-line-top {

View File

@ -44,7 +44,7 @@
font-feature-settings: 'tnum';
position: absolute;
display: none;
color: #462AA0;
color: #1890ff;
text-align: center;
vertical-align: middle;
opacity: 0;
@ -177,7 +177,7 @@
display: block;
width: 9px;
height: 9px;
background-color: #462AA0;
background-color: #1890ff;
border-radius: 100%;
-webkit-transform: scale(0.75);
transform: scale(0.75);

View File

@ -143,7 +143,6 @@ const editorOption = {
},
//
source: function (searchTerm: string, renderList: any) {
console.log("source")
if (!props.members.length) {
return renderList([])
}

View File

@ -1068,7 +1068,7 @@ const onDisturbChange = (value: boolean) => {
margin: 3px 0;
&:hover {
.nickname {
color: #462AA0;
color: #1890ff;
}
}
}

View File

@ -89,7 +89,7 @@ const onContextMenu = (e:any,item: ITalkRecord) => {
<Loading v-if="items.length === 0" />
<div v-for="item in items" :key="item.msg_id" class="message-item">
<div class="left-box pointer" @click="showUserInfoModal(item.erp_user_id)">
<div class="left-box pointer" @click="showUserInfoModal(item.user_id)">
<im-avatar :src="item.avatar" :size="38" :username="item.nickname" />
</div>

View File

@ -86,14 +86,12 @@ const strokeDashoffset = computed(() =>
//
const handleClick = () => {
if(!props.extra.is_uploading){
window.open(
console.log('handleClick')
window.open(
`${window.location.origin}/office?url=${props.extra.path}`,
'_blank',
'width=1200,height=900,left=200,top=200,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no'
);
}
}
function downloadFileWithProgress(resourceUrl, filename) {

View File

@ -27,7 +27,7 @@ let textContent = props.extra?.content || ''
textContent = textReplaceLink(textContent)
if (props.data.talk_type == 2) {
textContent = textReplaceMention(textContent, '#462AA0')
textContent = textReplaceMention(textContent, '#1890ff')
}
textContent = textReplaceEmoji(textContent)

View File

@ -17,7 +17,7 @@ let textContent = props.extra?.content || ''
textContent = textReplaceLink(textContent)
if (props.data.talk_type == 2) {
textContent = textReplaceMention(textContent, '#462AA0')
textContent = textReplaceMention(textContent, '#1890ff')
}
textContent = textReplaceEmoji(textContent)

View File

@ -121,7 +121,7 @@ onMounted(() => {
:height="5"
:show-indicator="false"
:percentage="parseInt(option.progress)"
color="#462AA0"
color="#1890ff"
/>
</p>
</div>

View File

@ -28,7 +28,7 @@
font-weight: 400;
&:hover {
color: #462AA0;
color: #1890ff;
}
}
}

View File

@ -1514,7 +1514,7 @@ const numWidth = computed(() => {
.x-upload-preview-button:hover {
background-color: #e6f7ff;
color: #462AA0;
color: #1890ff;
}
.x-upload-download-button:hover {

View File

@ -45,7 +45,7 @@
font-feature-settings: 'tnum';
position: absolute;
display: none;
color: #462AA0;
color: #1890ff;
text-align: center;
vertical-align: middle;
opacity: 0;
@ -103,7 +103,7 @@
display: block;
width: 9px;
height: 9px;
background-color: #462AA0;
background-color: #1890ff;
border-radius: 100%;
transform: scale(0.75);
transform-origin: 50% 50%;

View File

@ -7,7 +7,6 @@ import { formatTalkItem, palyMusic, formatTalkRecord } from '@/utils/talk'
import { isElectronMode } from '@/utils/common'
import { ServeClearTalkUnreadNum, ServeCreateTalkList } from '@/api/chat'
import { useTalkStore, useDialogueStore, useSettingsStore } from '@/store'
import { isScrollAtBottom, scrollToBottom } from '@/utils/dom'
/**
* 好友状态事件
@ -190,10 +189,12 @@ class Talk extends Base {
if (!el) return
// 判断的滚动条是否在底部
const isBottom = isScrollAtBottom(el)
const isBottom = Math.ceil(el.scrollTop) + el.clientHeight >= el.scrollHeight
if (isBottom || record.user_id == this.getAccountId()) {
scrollToBottom()
nextTick(() => {
el.scrollTop = el.scrollHeight + 1000
})
} else {
useDialogueStore().setUnreadBubble()
}

View File

@ -3,7 +3,7 @@ import { ServeTalkRecords } from '@/api/chat'
import { useDialogueStore } from '@/store'
import { ITalkRecord } from '@/types/chat'
import { formatTalkRecord } from '@/utils/talk'
import { addClass, removeClass, scrollToBottom, isScrollAtBottom } from '@/utils/dom'
import { addClass, removeClass } from '@/utils/dom'
interface Params {
receiver_id: number
@ -142,13 +142,15 @@ export const useTalkRecord = (uid: number) => {
if (el) {
if (request.cursor == 0) {
// el.scrollTop = el.scrollHeight
// setTimeout(() => {
// el.scrollTop = el.scrollHeight + 1000
// }, 500)
scrollToBottom()
el.scrollTop = el.scrollHeight
setTimeout(() => {
console.log('el.scrollHeight', el.scrollHeight)
console.log('request.cursor == 0')
el.scrollTop = el.scrollHeight + 1000
}, 500)
} else {
console.log('request.cursor !== 0')
el.scrollTop = el.scrollHeight - scrollHeight
}
}
@ -261,8 +263,7 @@ export const useTalkRecord = (uid: number) => {
setTimeout(() => removeClass(target, 'border'), 3000)
}
} else if (el) {
// el.scrollTop = el.scrollHeight
scrollToBottom()
el.scrollTop = el.scrollHeight
}
})
})

View File

@ -119,7 +119,7 @@ const isActive = (menu) => {
<component
:is="nav.icon"
:theme="isActive(nav) ? 'filled' : 'outline'"
:fill="isActive(nav) ? '#462AA0' : color"
:fill="isActive(nav) ? '#1890ff' : color"
:strokeWidth="2"
:size="22"
/>

View File

@ -18,7 +18,7 @@ export function isLoggedIn() {
*/
export function getAccessToken() {
// return storage.get(AccessToken) || ''
return JSON.parse(localStorage.getItem('token'))||'46d71a72d8d845ad7ed23eba9bdde260e635407190c2ce1bf7fd22088e41682ea07773ec65cae8946d2003f264d55961f96e0fc5da10eb96d3a348c1664e9644ce2108c311309f398ae8ea1b8200bfd490e5cb6e8c52c9e5d493cbabb163368f8351420451a631dbfa749829ee4cda49b77b5ed2d3dced5d0f2b7dd9ee76ba5465c84a17c23af040cd92b6b2a4ea48befbb5c729dcdad0a9c9668befe84074cc24f78899c1d947f8e7f94c7eda5325b8ed698df729e76febb98549ef3482ae942fb4f4a1c92d21836fa784728f0c5483aab2760a991b6b36e6b10c84f840a6433a6ecc31dee36e8f1c6158818bc89d227de310c4e6f5d7ff11a9e1ea73aba3f6c749f75a50a2aeaed07b14bc0d8b1db6428caf891f0a0b0c84a49697f4a4e7c8b87d972340ecbf02ddbc4d4f1e51b057c822f8351524e19d52a3ec5ce8c83e2f'
return JSON.parse(localStorage.getItem('token'))||'46d71a72d8d845ad7ed23eba9bdde260e635407190c2ce1bf7fd22088e41682ea07773ec65cae8946d2003f264d55961f96e0fc5da10eb96d3a348c1664e9644ce2108c311309f398ae8ea1b8200bfd490e5cb6e8c52c9e5d493cbabb163368f8351420451a631dbfa749829ee4cda49b77b5ed2d3dced5d0f2b7dd9ee76ba5465c84a17c23af040cd92b6b2a4ea48befbb5c729dcdad0a9c9668befe84074cc24f78899c1d947f8e7f94c7eda5325b8ed698df729e76febb98549ef3482ae942fb4f4a1c92d21836fa784728f0c5483aab2760a991b6b36e6b10c84f840a6433a6ecc31dee36e8f1c6158818bc89d22ab23a552e0c3f606946dcb914a52b692e10d823cc7f43027127359e7ee8555d956e7e095946931ceaa3877675584b0a0a4fc690c8018712b306050ebbdea92037aea31d66d65004be26d3c696abc4c29'
}
/**

View File

@ -52,12 +52,7 @@ export function throttle(fn, delay, call = function () {}) {
* @param {Function} callback 复制成功回调方法
*/
export function clipboard(text, callback) {
// 在wujie环境下使用主应用的clipboard
const clipboardObj = window.__POWERED_BY_WUJIE__
? window.parent.navigator.clipboard
: navigator.clipboard
clipboardObj
navigator.clipboard
.writeText(text)
.then(() => {
callback && callback()

View File

@ -1,5 +1,3 @@
import { nextTick } from 'vue'
function trim(string: string) {
return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '')
}
@ -56,26 +54,3 @@ export function removeClass(el: Element, cls: string) {
el.className = trim(curClass)
}
}
/**
*
* @param el DOM元素
* @returns boolean
*/
export function isScrollAtBottom(el: HTMLElement): boolean {
return Math.ceil(el.scrollTop) + el.clientHeight >= el.scrollHeight
}
/**
*
* @param id DOM id 'imChatPanel'
* @param offset 0
*/
export function scrollToBottom(id = 'imChatPanel', offset = 0) {
nextTick(() => {
const el = document.getElementById(id)
if (el) {
el.scrollTop = el.scrollHeight + offset
}
})
}

View File

@ -289,6 +289,7 @@ const onClickNickname = (data: ITalkRecord) => {
//
const onContextMenu = (e: any, item: ITalkRecord) => {
console.log('item', item)
if (!dialogueStore.isShowEditor || dialogueStore.isOpenMultiSelect) {
return e.preventDefault()
}
@ -299,7 +300,7 @@ const onContextMenu = (e: any, item: ITalkRecord) => {
}
const onConvertText = async (data: ITalkRecord) => {
console.log('data', data)
data.is_convert_text = 1
const res = await voiceToText({ msgId: data.msg_id, voiceUrl: data.extra.url })
if (res.code == 200) {

View File

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { ref, onMounted, nextTick } from 'vue'
import { ref, onMounted } from 'vue'
import {
useTalkStore,
useDialogueStore,
@ -15,8 +15,7 @@ import { parseTime } from '@/utils/datetime'
import Editor from '@/components/editor/Editor.vue'
import MultiSelectFooter from './MultiSelectFooter.vue'
import HistoryRecord from '@/components/talk/HistoryRecord.vue'
import {scrollToBottom} from '@/utils/dom.ts'
// import SimpleEditorExample from '@/components/editor/SimpleEditorExample.vue'
import { uploadImg } from '@/api/upload'
const userStore = useUserStore()
const talkStore = useTalkStore()
const editorStore = useEditorStore()
@ -136,9 +135,6 @@ const onSendVideoEvent = async ({ data }) => {
//
dialogueStore.addDialogueRecord(tempMessage)
nextTick(()=>{
scrollToBottom()
})
uploadsStore.initUploadFile(
data,
props.talk_type,
@ -149,7 +145,6 @@ const onSendVideoEvent = async ({ data }) => {
},
async () => {
dialogueStore.batchDelDialogueRecord([uploadId])
}
)
}
@ -190,16 +185,13 @@ const onSendFileEvent = ({ data }) => {
float: 'right'
}
dialogueStore.addDialogueRecord(tempMessage)
nextTick(()=>{
scrollToBottom()
})
uploadsStore.initUploadFile(data, props.talk_type, props.receiver_id,clientUploadId,
async (percentage) => {
dialogueStore.updateUploadProgress(clientUploadId, percentage)
},
async () => {
dialogueStore.batchDelDialogueRecord([clientUploadId])
}
)
}
@ -290,7 +282,6 @@ onMounted(() => {
<template>
<footer class="el-footer">
<MultiSelectFooter v-if="dialogueStore.isOpenMultiSelect" />
<Editor v-else @editor-event="onEditorEvent" :vote="talk_type == 2" :members="members" />
</footer>

View File

@ -156,7 +156,7 @@ const onSetMenu = () => {
text-align: center;
&.color {
color: #462AA0;
color: #1890ff;
}
.online-status {
@ -168,7 +168,7 @@ const onSetMenu = () => {
vertical-align: middle;
border-radius: 50%;
position: relative;
background-color: #462AA0;
background-color: #1890ff;
margin-right: 5px;
&:after {
@ -177,7 +177,7 @@ const onSetMenu = () => {
left: -1px;
width: 100%;
height: 100%;
border: 1px solid #462AA0;
border: 1px solid #1890ff;
border-radius: 50%;
-webkit-animation: antStatusProcessing 1.2s ease-in-out infinite;
animation: antStatusProcessing 1.2s ease-in-out infinite;

View File

@ -1,8 +1,6 @@
<script lang="ts" setup>
import { useDialogueStore } from '@/store'
import { DoubleDown } from '@icon-park/vue-next'
import { scrollToBottom } from '@/utils/dom'
defineProps(['modelValue'])
const dialogueStore = useDialogueStore()
@ -10,7 +8,13 @@ const dialogueStore = useDialogueStore()
//
const onSkipBottom = () => {
console.log('onSkipBottom')
scrollToBottom()
let el = document.getElementById('imChatPanel')
if (el) {
el.scrollTo({
top: el.scrollHeight + 1000,
behavior: 'smooth'
})
}
}
</script>
@ -31,7 +35,7 @@ const onSkipBottom = () => {
min-width: 100px;
height: 28px;
font-size: 12px;
background-color: #462AA0;
background-color: #1ebafc;
color: #ffffff;
display: flex;
align-items: center;

View File

@ -47,7 +47,7 @@ export default defineConfig(({ mode }) => {
compressPlugin(),
UnoCSS(),
vueDevTools({
launchEditor: 'trae',
launchEditor: 'cursor',
})
],
define: {