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
b482b5fb
Commit
b482b5fb
authored
Apr 30, 2024
by
qlintonger xeno
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
76a6f6b3
3482024b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
82 additions
and
34 deletions
+82
-34
src/constants/common/user.ts
+6
-0
src/store/contacts/index.ts
+27
-7
src/store/contacts/types.ts
+1
-0
src/views/remote/contacts/contactsInfo.vue
+18
-11
src/views/remote/contacts/contactsList.vue
+3
-1
src/views/remote/contacts/contactsListChoose.vue
+1
-1
src/views/remote/contacts/eventList.vue
+5
-2
src/views/remote/contacts/multiCallModel.vue
+11
-9
src/views/remote/videoCall/videoSlider.vue
+10
-3
No files found.
src/constants/common/user.ts
View file @
b482b5fb
export
const
CallState
=
{
callIn
:
'callIn'
,
callOut
:
'callout'
,
calling
:
'calling'
,
idle
:
'idle'
}
export
const
videoGroup
=
{
export
const
videoGroup
=
{
0
:
'专家'
,
0
:
'专家'
,
1
:
'维修人'
1
:
'维修人'
...
...
src/store/contacts/index.ts
View file @
b482b5fb
import
{
defineStore
}
from
'pinia'
import
{
defineStore
}
from
'pinia'
import
{
ContactsState
,
UserItemDto
}
from
'./types'
import
{
ContactsState
,
UserItemDto
}
from
'./types'
const
CallState
=
{
import
{
userStates
}
from
'AnyR/states/wsStates'
callIn
:
'callIn'
,
callOut
:
'callout'
,
calling
:
'calling'
,
idle
:
'idle'
}
const
useContactsStore
=
defineStore
(
'contacts'
,
{
const
useContactsStore
=
defineStore
(
'contacts'
,
{
state
:
():
ContactsState
=>
{
state
:
():
ContactsState
=>
{
return
{
return
{
...
@@ -16,7 +11,32 @@ const useContactsStore = defineStore('contacts', {
...
@@ -16,7 +11,32 @@ const useContactsStore = defineStore('contacts', {
},
},
getters
:
{
getters
:
{
//获取通话用户
//获取合并ws后的所有用户列表
getAllOnlineContacts
(
state
)
{
const
userList
=
[]
as
UserItemDto
[]
state
.
userList
.
forEach
((
item1
)
=>
{
userStates
.
value
.
onlineContacts
.
forEach
((
item2
:
any
)
=>
{
if
(
item1
.
id
==
item2
.
fromID
)
{
Object
.
assign
(
item1
,
item2
)
}
})
userList
.
push
(
item1
)
})
return
userList
},
//获取ws的用户列表
getOnlineContacts
(
state
)
{
const
userList
=
[]
as
UserItemDto
[]
userStates
.
value
.
onlineContacts
.
forEach
((
item1
:
any
)
=>
{
state
.
userList
.
forEach
((
item2
)
=>
{
if
(
item1
.
fromID
==
item2
.
id
)
{
Object
.
assign
(
item1
,
item2
)
}
})
userList
.
push
(
item1
)
})
return
userList
}
},
},
actions
:
{
actions
:
{
...
...
src/store/contacts/types.ts
View file @
b482b5fb
...
@@ -4,6 +4,7 @@ export interface UserItemDto {
...
@@ -4,6 +4,7 @@ export interface UserItemDto {
remark
:
string
remark
:
string
videoGroup
:
0
|
1
videoGroup
:
0
|
1
choose
?:
boolean
choose
?:
boolean
[
propName
:
string
]:
any
}
}
export
interface
ContactsState
{
export
interface
ContactsState
{
showWait
:
boolean
showWait
:
boolean
...
...
src/views/remote/contacts/contactsInfo.vue
View file @
b482b5fb
...
@@ -2,12 +2,12 @@
...
@@ -2,12 +2,12 @@
<a-spin
class=
"g-block"
:loading=
"loading"
tip=
"加载中..."
>
<a-spin
class=
"g-block"
:loading=
"loading"
tip=
"加载中..."
>
<div
class=
"flex justify-between items-center h-10 px-4"
>
<div
class=
"flex justify-between items-center h-10 px-4"
>
<span
class=
"text-base"
>
联系人
</span>
<span
class=
"text-base"
>
联系人
</span>
<a-checkbox
v
alue=
"1
"
>
只显示在线人员
</a-checkbox>
<a-checkbox
v
-model=
"searchParams.isOnline
"
>
只显示在线人员
</a-checkbox>
</div>
</div>
<a-tabs
class=
"h-full"
>
<a-tabs
class=
"h-full"
>
<a-tab-pane
title=
"默认列表"
>
<a-tab-pane
title=
"默认列表"
>
<div
class=
"px-4"
>
<div
class=
"px-4"
>
<a-input-search
placeholder=
"搜索"
v-model=
"searchParams.
group
Name"
></a-input-search>
<a-input-search
placeholder=
"搜索"
v-model=
"searchParams.
user
Name"
></a-input-search>
<a-button
class=
"rounded-full my-4"
type=
"primary"
long
@
click=
"multiCall"
>
<a-button
class=
"rounded-full my-4"
type=
"primary"
long
@
click=
"multiCall"
>
<template
#
icon
>
<template
#
icon
>
<global-icon
icon=
"plus-circle"
:size=
"14"
color=
"var(--color-bg-white)"
/>
<global-icon
icon=
"plus-circle"
:size=
"14"
color=
"var(--color-bg-white)"
/>
...
@@ -37,6 +37,7 @@ import type { UserItemDto } from '@/store/contacts/types'
...
@@ -37,6 +37,7 @@ import type { UserItemDto } from '@/store/contacts/types'
import
useContactsStore
from
'@/store/contacts/index'
import
useContactsStore
from
'@/store/contacts/index'
import
{
useRequest
}
from
'alova'
import
{
useRequest
}
from
'alova'
import
{
videoGroup
}
from
'@/constants/common/user'
import
{
videoGroup
}
from
'@/constants/common/user'
import
{
storeToRefs
}
from
'pinia'
interface
Props
{
interface
Props
{
showGroup
?:
boolean
showGroup
?:
boolean
...
@@ -48,11 +49,7 @@ const ps = withDefaults(defineProps<Props>(), {
...
@@ -48,11 +49,7 @@ const ps = withDefaults(defineProps<Props>(), {
const
getShowGroup
=
computed
(()
=>
{
const
getShowGroup
=
computed
(()
=>
{
return
ps
.
showGroup
?
'block'
:
'none'
return
ps
.
showGroup
?
'block'
:
'none'
})
})
const
{
const
{
loading
,
data
,
onSuccess
}
=
useRequest
(
loading
,
data
:
userList
,
onSuccess
}
=
useRequest
(
()
=>
()
=>
alova
.
Post
(
alova
.
Post
(
'/admin/getUserListVideo'
,
'/admin/getUserListVideo'
,
...
@@ -69,23 +66,33 @@ const {
...
@@ -69,23 +66,33 @@ const {
}
}
)
)
const
{
setUserList
}
=
useContactsStore
()
const
{
setUserList
}
=
useContactsStore
()
const
{
getAllOnlineContacts
,
getOnlineContacts
}
=
storeToRefs
(
useContactsStore
())
onSuccess
(({
data
})
=>
{
onSuccess
(({
data
})
=>
{
setUserList
(
data
)
setUserList
(
data
)
})
})
const
searchParams
=
reactive
({
const
searchParams
=
reactive
({
groupName
:
''
userName
:
''
,
isOnline
:
false
})
})
//获取联系人分组
//获取联系人分组
const
getUserListGroup
=
computed
(()
=>
{
const
getUserListGroup
=
computed
(()
=>
{
return
userList
.
value
return
getAllOnlineContacts
.
value
?.
sort
((
a
,
b
)
=>
a
.
videoGroup
-
b
.
videoGroup
)
?.
sort
((
a
,
b
)
=>
a
.
videoGroup
-
b
.
videoGroup
)
?.
reduce
((
result
:
any
,
item
)
=>
{
?.
reduce
((
result
:
any
,
item
)
=>
{
const
groupName
=
videoGroup
[
item
.
videoGroup
]
const
groupName
=
videoGroup
[
item
.
videoGroup
]
if
(
!
result
[
groupName
])
{
if
(
!
result
[
groupName
])
{
result
[
groupName
]
=
[]
result
[
groupName
]
=
[]
}
}
if
(
item
.
nickname
.
indexOf
(
searchParams
.
groupName
)
!=
-
1
)
{
// 名字搜索
result
[
groupName
].
push
(
item
)
if
(
item
.
nickname
.
indexOf
(
searchParams
.
userName
)
!=
-
1
)
{
if
(
searchParams
.
isOnline
)
{
//在线人员
if
(
getOnlineContacts
.
value
.
find
((
_item
)
=>
_item
.
id
==
item
.
id
))
{
result
[
groupName
].
push
(
item
)
}
}
else
{
result
[
groupName
].
push
(
item
)
}
}
}
return
result
return
result
},
{})
},
{})
...
...
src/views/remote/contacts/contactsList.vue
View file @
b482b5fb
...
@@ -8,7 +8,9 @@
...
@@ -8,7 +8,9 @@
<global-icon
icon=
"mic"
:size=
"14"
></global-icon>
<global-icon
icon=
"mic"
:size=
"14"
></global-icon>
</div>
</div>
<div
class=
"flex-auto text-right"
>
<div
class=
"flex-auto text-right"
>
<a-button
type=
"primary"
shape=
"circle"
@
click
.
stop=
"changeWait(true)"
><global-icon
icon=
"phone"
:size=
"14"
color=
"var(--color-bg-white)"
></global-icon></a-button>
<a-button
type=
"primary"
shape=
"circle"
@
click
.
stop=
"changeWait(true)"
:disabled=
"!(item.callState == 'callState' && item.hasCamera == 1 && item.hasMike == 1)"
>
<global-icon
icon=
"phone"
:size=
"14"
color=
"var(--color-bg-white)"
></global-icon>
</a-button>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
...
src/views/remote/contacts/contactsListChoose.vue
View file @
b482b5fb
...
@@ -21,7 +21,7 @@ interface Props {
...
@@ -21,7 +21,7 @@ interface Props {
const
ps
=
withDefaults
(
defineProps
<
Props
>
(),
{
const
ps
=
withDefaults
(
defineProps
<
Props
>
(),
{
data
:
()
=>
[]
data
:
()
=>
[]
})
})
const
checkbox
=
defineModel
()
const
checkbox
=
defineModel
<
string
[]
>
()
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.item.active
,
.item.active
,
...
...
src/views/remote/contacts/eventList.vue
View file @
b482b5fb
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
</div>
</div>
<!-- table展示 -->
<!-- table展示 -->
<div
class=
"flex-auto overflow-y-auto px-4"
>
<div
class=
"flex-auto overflow-y-auto px-4"
>
<a-table
:columns=
"columns"
:data=
"tableData"
:bordered=
"false"
:loading=
"loading"
>
<a-table
:columns=
"columns"
:data=
"tableData"
:bordered=
"false"
:loading=
"loading"
:pagination=
"false"
>
<template
#
initiator=
"
{ record }">
<template
#
initiator=
"
{ record }">
<div
class=
"flex items-center"
>
<div
class=
"flex items-center"
>
<global-avatar
:avatar-size=
"24"
:icon-size=
"12"
></global-avatar>
<global-avatar
:avatar-size=
"24"
:icon-size=
"12"
></global-avatar>
...
@@ -19,6 +19,9 @@
...
@@ -19,6 +19,9 @@
</
template
>
</
template
>
</a-table>
</a-table>
</div>
</div>
<div
class=
"px-4"
>
<a-pagination
class=
"justify-end"
show-total
show-page-size
:total=
"total!"
v-model:current=
"page"
v-model:page-size=
"pageSize"
/>
</div>
</div>
</div>
</template>
</template>
...
@@ -84,7 +87,7 @@ const {
...
@@ -84,7 +87,7 @@ const {
initialPageSize
:
10
,
// 初始每页数据条数,默认为10
initialPageSize
:
10
,
// 初始每页数据条数,默认为10
debounce
:
[
800
],
debounce
:
[
800
],
abortLast
:
true
,
abortLast
:
true
,
total
:
(
res
)
=>
res
.
data
.
total
,
total
:
(
res
)
=>
parseInt
(
res
.
data
.
total
)
,
data
:
(
res
)
=>
res
.
data
.
list
,
data
:
(
res
)
=>
res
.
data
.
list
,
sendable
:
()
=>
{
sendable
:
()
=>
{
return
chooseUser
?.
value
?.
id
?
true
:
false
return
chooseUser
?.
value
?.
id
?
true
:
false
...
...
src/views/remote/contacts/multiCallModel.vue
View file @
b482b5fb
...
@@ -3,12 +3,12 @@
...
@@ -3,12 +3,12 @@
<div
class=
"h-80 overflow-y-auto"
>
<div
class=
"h-80 overflow-y-auto"
>
<a-collapse
:bordered=
"false"
>
<a-collapse
:bordered=
"false"
>
<a-collapse-item
:header=
"key + '列表'"
:key=
"index"
v-for=
"(value, key, index) in getUserListGroup"
>
<a-collapse-item
:header=
"key + '列表'"
:key=
"index"
v-for=
"(value, key, index) in getUserListGroup"
>
<contacts-list-choose
:data=
"value"
v-model=
"chooseUsers"
></contacts-list-choose>
<contacts-list-choose
:data=
"value"
v-model=
"chooseUser
Id
s"
></contacts-list-choose>
</a-collapse-item>
</a-collapse-item>
</a-collapse>
</a-collapse>
</div>
</div>
<template
#
footer
>
<template
#
footer
>
<a-button
size=
"large"
type=
"primary"
@
click=
"showModel = false"
:disabled=
"chooseUser
s.length == 0"
>
呼叫
{{
chooseUser
s
.
length
}}
人
</a-button>
<a-button
size=
"large"
type=
"primary"
@
click=
"showModel = false"
:disabled=
"chooseUser
Ids.length == 0"
>
呼叫
{{
chooseUserId
s
.
length
}}
人
</a-button>
<a-button
size=
"large"
@
click=
"showModel = false"
>
取消
</a-button>
<a-button
size=
"large"
@
click=
"showModel = false"
>
取消
</a-button>
</
template
>
</
template
>
</global-model>
</global-model>
...
@@ -17,30 +17,32 @@
...
@@ -17,30 +17,32 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
storeToRefs
}
from
'pinia'
import
{
storeToRefs
}
from
'pinia'
import
useContactsStore
from
'@/store/contacts/index'
import
useContactsStore
from
'@/store/contacts/index'
import
{
UserItemDto
}
from
'@/store/contacts/types'
import
contactsListChoose
from
'./contactsListChoose.vue'
import
contactsListChoose
from
'./contactsListChoose.vue'
import
{
cloneDeep
}
from
'lodash'
import
{
cloneDeep
}
from
'lodash'
import
{
videoGroup
}
from
'@/constants/common/user'
import
{
videoGroup
}
from
'@/constants/common/user'
//选中的联系人数组id
//选中的联系人数组id
const
chooseUsers
=
ref
([])
const
chooseUser
Id
s
=
ref
([])
const
showModel
=
ref
(
false
)
const
showModel
=
ref
(
false
)
const
open
=
()
=>
{
const
open
=
()
=>
{
showModel
.
value
=
true
showModel
.
value
=
true
chooseUsers
.
value
=
[]
chooseUser
Id
s
.
value
=
[]
}
}
//
当前
联系人
//
所有
联系人
const
{
userList
}
=
storeToRefs
(
useContactsStore
())
const
{
getAllOnlineContacts
,
getOnlineContacts
}
=
storeToRefs
(
useContactsStore
())
//获取联系人分组
//获取联系人分组
const
getUserListGroup
=
computed
(()
=>
{
const
getUserListGroup
=
computed
(()
=>
{
return
cloneDeep
(
userList
.
value
)
return
cloneDeep
(
getAllOnlineContacts
.
value
)
?.
sort
((
a
,
b
)
=>
a
.
videoGroup
-
b
.
videoGroup
)
?.
sort
((
a
,
b
)
=>
a
.
videoGroup
-
b
.
videoGroup
)
?.
reduce
((
result
:
any
,
item
)
=>
{
?.
reduce
((
result
:
any
,
item
)
=>
{
const
groupName
=
videoGroup
[
item
.
videoGroup
]
const
groupName
=
videoGroup
[
item
.
videoGroup
]
if
(
!
result
[
groupName
])
{
if
(
!
result
[
groupName
])
{
result
[
groupName
]
=
[]
result
[
groupName
]
=
[]
}
}
result
[
groupName
].
push
(
item
)
//在线人员
if
(
getOnlineContacts
.
value
.
find
((
_item
)
=>
_item
.
id
==
item
.
id
))
{
result
[
groupName
].
push
(
item
)
}
return
result
return
result
},
{})
},
{})
})
})
...
...
src/views/remote/videoCall/videoSlider.vue
View file @
b482b5fb
...
@@ -16,22 +16,29 @@
...
@@ -16,22 +16,29 @@
import
VideoItem
from
'./videoItem.vue'
import
VideoItem
from
'./videoItem.vue'
import
{
IconLeft
,
IconRight
}
from
'@arco-design/web-vue/es/icon'
import
{
IconLeft
,
IconRight
}
from
'@arco-design/web-vue/es/icon'
const
slidePosition
=
ref
(
0
)
const
sliderWidth
=
ref
(
150
)
//滑块宽度
const
slidePosition
=
ref
(
0
)
//初始位置
const
slideDistance
=
150
// 滑动距离
const
slideDistance
=
150
// 滑动距离
const
animationDuration
=
500
// 动画持续时间(毫秒)
const
animationDuration
=
500
// 动画持续时间(毫秒)
//动画效果
const
sliderStyles
=
computed
(()
=>
{
const
sliderStyles
=
computed
(()
=>
{
return
{
return
{
transform
:
`translateX(
${
slidePosition
.
value
}
px)`
,
transform
:
`translateX(
${
slidePosition
.
value
}
px)`
,
transition
:
`transform
${
animationDuration
}
ms`
transition
:
`transform
${
animationDuration
}
ms`
}
}
})
})
//点击左滑
const
slideLeft
=
()
=>
{
const
slideLeft
=
()
=>
{
slidePosition
.
value
+=
slideDistance
slidePosition
.
value
+=
slideDistance
}
}
//点击右滑
const
slideRight
=
()
=>
{
const
slideRight
=
()
=>
{
slidePosition
.
value
-=
slideDistance
slidePosition
.
value
-=
slideDistance
}
}
//获取宽度
const
getSliderWidth
=
computed
(()
=>
{
return
sliderWidth
.
value
+
'px'
})
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.slider-container
{
.slider-container
{
...
@@ -41,7 +48,7 @@ const slideRight = () => {
...
@@ -41,7 +48,7 @@ const slideRight = () => {
white-space
:
nowrap
;
white-space
:
nowrap
;
position
:
relative
;
position
:
relative
;
.slider-item
{
.slider-item
{
width
:
150px
;
width
:
v-bind
(
'getSliderWidth'
)
;
}
}
}
}
</
style
>
</
style
>
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