Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
standalone-anyremote
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qlintonger xeno
standalone-anyremote
Commits
530084ab
Commit
530084ab
authored
May 06, 2024
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 发送消息
parent
f7a042f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
36 deletions
+60
-36
src/api/alova-instance.ts
+2
-3
src/views/layout/gHeader.vue
+0
-17
src/views/remote/videoCall/videoChat.vue
+58
-16
No files found.
src/api/alova-instance.ts
View file @
530084ab
...
...
@@ -28,7 +28,6 @@ export const alova = createAlova({
// 请求拦截器
beforeRequest
(
method
)
{
console
.
log
(
method
)
//开启加载动画
const
appStore
=
useAppStore
()
const
loading
=
method
.
meta
?.
loading
...
...
@@ -39,8 +38,8 @@ export const alova = createAlova({
appStore
.
count
++
}
// 设置请求头application/json;charset=UTF-8
const
is
Download
=
method
.
meta
?.
isDown
load
if
(
is
Down
load
&&
method
.
data
)
{
const
is
Upload
=
method
.
meta
?.
isUp
load
if
(
is
Up
load
&&
method
.
data
)
{
method
.
data
=
Object
.
entries
(
method
.
data
).
reduce
(
function
(
q
,
w
)
{
if
(
!
(
w
[
1
]
instanceof
File
))
{
q
.
set
(
w
[
0
],
w
[
1
])
...
...
src/views/layout/gHeader.vue
View file @
530084ab
...
...
@@ -2,11 +2,6 @@
<a-layout-header
class=
"h-[60px] flex items-center px-4 justify-between bg-theme-bg2"
>
<a-image
:src=
"logo"
:preview=
"false"
fit=
"fill"
/>
<a-space
size=
"large"
>
<a-upload
:show-file-list=
"false"
:custom-request=
"uploadMuFile"
>
<template
#
upload-button
>
<a-button
type=
"outline"
shape=
"circle"
><global-icon
icon=
"question-circle"
:size=
"14"
></global-icon></a-button>
</
template
>
</a-upload>
<a-button
type=
"outline"
shape=
"circle"
><global-icon
icon=
"question-circle"
:size=
"14"
></global-icon></a-button>
<a-button
type=
"outline"
shape=
"circle"
><global-icon
icon=
"safe"
:size=
"14"
></global-icon></a-button>
<!--
<a-dropdown
@
select=
"handleLanguage"
>
...
...
@@ -40,7 +35,6 @@ import logo from '@/assets/images/header/logo.png'
import
useLocale
from
'@/hooks/locale'
import
{
activedTheme
}
from
'../../../project.ui.config'
import
useUserStore
from
'@/store/user'
import
{
alova
}
from
'@/api/alova-instance'
const
{
changeLocale
}
=
useLocale
()
//切换语言
...
...
@@ -56,17 +50,6 @@ const userStore = useUserStore()
const
logOut
=
()
=>
{
userStore
.
handleLogOut
()
}
const
uploadMuFile
=
(
option
:
any
)
=>
{
const
{
onProgress
,
onError
,
onSuccess
,
fileItem
,
name
}
=
option
var
params
=
{
apiPwd
:
'Ifar$2_0160_525_Mocp'
,
file
:
fileItem
.
file
,
requestFrom
:
6
,
uid
:
4
}
alova
.
Post
(
'/admin/uploadMuFile'
,
params
,
{
meta
:
{
isDownload
:
true
}
}).
then
(()
=>
{})
}
</
script
>
<
style
lang=
"less"
scoped
>
.arco-btn
{
...
...
src/views/remote/videoCall/videoChat.vue
View file @
530084ab
...
...
@@ -7,25 +7,25 @@
<a-col
:span=
"12"
>
<div
class=
"flex items-center p-1.5 leading-7"
>
<global-icon
icon=
"wifi"
:size=
"16"
></global-icon>
<span
class=
"text-xs ml-1 text-theme-text2"
>
网络状态
{{
NetworkQualityLevel
.
label
}}
</span>
<span
class=
"text-xs ml-1 text-theme-text2"
>
网络状态
{{
NetworkQualityLevel
.
label
}}
</span>
</div>
</a-col>
<a-col
:span=
"12"
>
<div
class=
"flex items-center p-1.5 leading-7"
>
<global-icon
icon=
"user-group"
:size=
"16"
></global-icon>
<span
class=
"text-xs ml-1 text-theme-text2"
>
房间已有
{{
chatChannelState
.
currentChatters
.
length
}}
人
</span>
<span
class=
"text-xs ml-1 text-theme-text2"
>
房间已有
{{
chatChannelState
.
currentChatters
.
length
}}
人
</span>
</div>
</a-col>
<a-col
:span=
"12"
>
<div
class=
"flex items-center p-1.5 leading-7"
>
<global-icon
icon=
"mic"
:size=
"16"
></global-icon>
<span
class=
"text-xs ml-1 text-theme-text2"
>
{{
webrtcStates
.
isMicroAttached
?
"麦克风已开启"
:
"麦克风未开启"
}}
</span>
<span
class=
"text-xs ml-1 text-theme-text2"
>
{{
webrtcStates
.
isMicroAttached
?
'麦克风已开启'
:
'麦克风未开启'
}}
</span>
</div>
</a-col>
<a-col
:span=
"12"
>
<div
class=
"flex items-center p-1.5 leading-7"
>
<global-icon
icon=
"camera"
:size=
"16"
></global-icon>
<span
class=
"text-xs ml-1 text-theme-text2"
>
{{
webrtcStates
.
isCameraAttached
?
'摄像头已开启'
:
"摄像头未开启"
}}
</span>
<span
class=
"text-xs ml-1 text-theme-text2"
>
{{
webrtcStates
.
isCameraAttached
?
'摄像头已开启'
:
'摄像头未开启'
}}
</span>
</div>
</a-col>
</a-row>
...
...
@@ -39,15 +39,27 @@
</div>
<div
class=
"px-4 py-2"
>
<a-space
size=
"medium"
>
<div
class=
"flex-center px-3 py-1 rounded cursor-pointer bg-fill-bg1"
>
<global-icon
icon=
"image"
:size=
"15"
></global-icon>
</div>
<div
class=
"flex-center px-3 py-1 rounded cursor-pointer bg-fill-bg1"
>
<global-icon
icon=
"pdf"
:size=
"15"
></global-icon>
</div>
<div
class=
"flex-center px-3 py-1 rounded cursor-pointer bg-fill-bg1"
>
<global-icon
icon=
"video"
:size=
"15"
></global-icon>
</div>
<a-upload
:show-file-list=
"false"
accept=
"image/*"
:custom-request=
"uploadMuFile"
@
change=
"handleChange"
>
<template
#
upload-button
>
<div
class=
"flex-center px-3 py-1 rounded cursor-pointer bg-fill-bg1"
>
<global-icon
icon=
"image"
:size=
"15"
></global-icon>
</div>
</
template
>
</a-upload>
<a-upload
:show-file-list=
"false"
accept=
".pdf"
:custom-request=
"uploadMuFile"
@
change=
"handleChange"
>
<
template
#
upload-button
>
<div
class=
"flex-center px-3 py-1 rounded cursor-pointer bg-fill-bg1"
>
<global-icon
icon=
"pdf"
:size=
"15"
></global-icon>
</div>
</
template
>
</a-upload>
<a-upload
:show-file-list=
"false"
accept=
"video/*"
:custom-request=
"uploadMuFile"
@
change=
"handleChange"
>
<
template
#
upload-button
>
<div
class=
"flex-center px-3 py-1 rounded cursor-pointer bg-fill-bg1"
>
<global-icon
icon=
"video"
:size=
"15"
></global-icon>
</div>
</
template
>
</a-upload>
</a-space>
<a-textarea
class=
"h-16 mt-2"
placeholder=
"请输入"
allow-clear
/>
</div>
...
...
@@ -57,9 +69,39 @@
<
script
setup
lang=
"ts"
>
import
VideoItem
from
'./videoItem.vue'
import
ChatDetails
from
'./chatDetails.vue'
import
{
webrtcStates
}
from
"AnyR/states/webrtcStates"
;
import
{
chatChannelState
}
from
"AnyR/states/chatChannelStates"
;
import
{
NetworkQualityLevel
}
from
"AnyR/states/webrtcStates"
;
import
{
webrtcStates
}
from
'AnyR/states/webrtcStates'
import
{
chatChannelState
}
from
'AnyR/states/chatChannelStates'
import
{
NetworkQualityLevel
}
from
'AnyR/states/webrtcStates'
import
{
alova
}
from
'@/api/alova-instance'
import
{
Message
}
from
'@arco-design/web-vue'
const
uploadMuFile
=
(
option
:
any
)
=>
{
const
{
onProgress
,
onError
,
onSuccess
,
fileItem
,
name
}
=
option
var
params
=
{
apiPwd
:
'Ifar$2_0160_525_Mocp'
,
file
:
fileItem
.
file
,
requestFrom
:
6
,
uid
:
4
}
return
alova
.
Post
<
any
>
(
'/admin/uploadMuFile'
,
params
,
{
meta
:
{
isUpload
:
true
}
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
onSuccess
(
res
)
Message
.
success
(
'发送成功'
)
}
else
{
onError
(
new
Error
(
'Upload failed'
))
Message
.
success
(
'发送失败'
)
}
})
.
catch
((
error
)
=>
{
onError
(
error
)
})
as
any
}
const
handleChange
=
(
fileList
:
any
,
file
:
any
)
=>
{
console
.
log
(
'FileList:'
,
fileList
)
console
.
log
(
'Current file:'
,
file
)
}
</
script
>
<
style
lang=
"less"
scoped
>
.chat-list
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment