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
28897b6b
Commit
28897b6b
authored
Apr 29, 2024
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 提交
parent
cd1f4c91
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
30 deletions
+47
-30
src/App.vue
+13
-12
src/api/alova-instance.ts
+8
-0
src/hooks/locale.ts
+13
-13
src/store/app/index.ts
+3
-1
src/store/app/types.ts
+3
-1
src/views/remote/contacts/contactsInfo.vue
+1
-1
src/views/remote/contacts/eventList.vue
+5
-1
src/views/remote/contacts/multiCallModel.vue
+1
-1
No files found.
src/App.vue
View file @
28897b6b
<
template
>
<a-config-provider
:locale=
"localeVal"
>
<router-view/>
<global-setting/>
<a-spin
:loading=
"loading"
:tip=
"loadText"
class=
"w-full h-full"
>
<router-view
/>
</a-spin>
<global-setting
/>
</a-config-provider>
</
template
>
<
script
lang=
"ts"
setup
>
import
enUS
from
'@arco-design/web-vue/es/locale/lang/en-us'
import
zhCN
from
'@arco-design/web-vue/es/locale/lang/zh-cn'
import
GlobalSetting
from
'@/components/global-setting/index.vue'
import
useLocale
from
'@/hooks/locale'
import
useAppStore
from
'@/store/app/index'
import
{
activedTheme
}
from
'../project.ui.config'
import
{
activedTheme
}
from
'../project.ui.config'
import
config
from
'../project.app.config'
import
useUserStore
from
'@/store/user'
import
{
wsShouldOpen
}
from
"AnyR/states/coreState"
;
import
{
wsShouldOpen
}
from
'AnyR/states/coreState'
import
{
storeToRefs
}
from
'pinia'
const
{
changeTheme
}
=
useAppStore
(
)
const
{
loading
,
loadText
}
=
storeToRefs
(
useAppStore
()
)
const
{
changeTheme
}
=
useAppStore
()
// 国际化
const
{
currentLocale
}
=
useLocale
()
const
{
currentLocale
}
=
useLocale
()
const
localeVal
=
computed
(()
=>
{
switch
(
currentLocale
.
value
)
{
case
'zh-CN'
:
...
...
@@ -53,10 +54,10 @@ router.beforeEach(async (to, from, next) => {
const
userStore
=
useUserStore
()
const
token
=
userStore
.
token
if
(
token
)
{
wsShouldOpen
.
value
=
true
;
wsShouldOpen
.
value
=
true
// 登录
if
(
to
.
name
==
'Login'
)
{
next
({
path
:
'./'
})
next
({
path
:
'./'
})
}
else
{
next
()
}
...
...
@@ -65,7 +66,7 @@ router.beforeEach(async (to, from, next) => {
if
(
to
.
name
==
'Login'
)
{
next
()
}
else
{
next
({
name
:
'Login'
})
next
({
name
:
'Login'
})
}
}
})
...
...
src/api/alova-instance.ts
View file @
28897b6b
...
...
@@ -6,6 +6,7 @@ import qs from 'qs'
import
{
createAlovaMockAdapter
}
from
'@alova/mock'
import
mock
from
'./mock'
import
useUserStore
from
'@/store/user'
import
{
Message
}
from
'@arco-design/web-vue'
// 创建模拟请求适配器
const
mockAdapter
=
createAlovaMockAdapter
([
mock
],
{
...
...
@@ -50,11 +51,18 @@ export const alova = createAlova({
return
await
response
.
blob
()
}
const
json
=
await
response
.
json
()
if
([
402
].
includes
(
json
.
code
))
{
Message
.
error
(
json
.
message
)
const
userStore
=
useUserStore
()
userStore
.
handleLogOut
()
return
Promise
.
reject
(
new
Error
(
json
.
message
))
}
else
{
if
(
json
.
code
===
200
)
{
return
json
[
'data'
]
}
else
{
return
json
}
}
},
// 请求错误时将会进入该拦截器
onError
(
error
)
{
...
...
src/hooks/locale.ts
View file @
28897b6b
import
{
computed
}
from
'vue'
;
import
{
useI18n
}
from
'vue-i18n'
;
import
{
Message
}
from
'@arco-design/web-vue'
;
import
{
computed
}
from
'vue'
import
{
useI18n
}
from
'vue-i18n'
import
{
Message
}
from
'@arco-design/web-vue'
export
default
function
useLocale
()
{
const
i18
=
useI18n
();
const
i18
=
useI18n
()
const
currentLocale
=
computed
(()
=>
{
return
i18
.
locale
.
value
;
});
return
i18
.
locale
.
value
})
const
changeLocale
=
(
value
:
string
)
=>
{
if
(
i18
.
locale
.
value
===
value
)
{
return
;
return
}
i18
.
locale
.
value
=
value
localStorage
.
setItem
(
'arco-locale'
,
value
)
Message
.
success
(
i18
.
t
(
'action.locale'
))
}
i18
.
locale
.
value
=
value
;
localStorage
.
setItem
(
'arco-locale'
,
value
);
Message
.
success
(
i18
.
t
(
'action.locale'
));
};
return
{
currentLocale
,
changeLocale
,
};
changeLocale
}
}
src/store/app/index.ts
View file @
28897b6b
...
...
@@ -6,7 +6,9 @@ import { changeTailwindTheme } from '@/configs/tailwind.ui.config'
const
useAppStore
=
defineStore
(
'app'
,
{
state
:
():
AppState
=>
{
return
{
theme
:
'light'
theme
:
'light'
,
loading
:
false
,
loadText
:
'加载中...'
}
},
...
...
src/store/app/types.ts
View file @
28897b6b
export
interface
AppState
{
theme
:
string
;
theme
:
string
loading
:
boolean
loadText
:
string
}
src/views/remote/contacts/contactsInfo.vue
View file @
28897b6b
...
...
@@ -77,7 +77,7 @@ const searchParams = reactive({
const
getUserListGroup
=
computed
(()
=>
{
return
userList
.
value
?.
sort
((
a
,
b
)
=>
a
.
videoGroup
-
b
.
videoGroup
)
.
reduce
((
result
:
any
,
item
)
=>
{
?
.
reduce
((
result
:
any
,
item
)
=>
{
const
groupName
=
videoGroup
[
item
.
videoGroup
]
if
(
!
result
[
groupName
])
{
result
[
groupName
]
=
[]
...
...
src/views/remote/contacts/eventList.vue
View file @
28897b6b
...
...
@@ -3,7 +3,7 @@
<!-- 搜索条件 -->
<div
class=
"flex items-center justify-between mb-4 px-4"
>
<range-pickey
v-model:start-date=
"beginTime"
v-model:end-date=
"endTime"
></range-pickey>
<a-input-search
placeholder=
"搜索"
class=
"w-[240px]"
></a-input-search>
<a-input-search
placeholder=
"搜索"
class=
"w-[240px]"
v-model=
"keyword"
></a-input-search>
</div>
<!-- table展示 -->
<div
class=
"flex-auto overflow-y-auto px-4"
>
...
...
@@ -31,6 +31,7 @@ import { storeToRefs } from 'pinia'
const
beginTime
=
ref
(
''
)
const
endTime
=
ref
(
''
)
const
keyword
=
ref
(
''
)
//当前联系人
const
{
chooseUser
}
=
storeToRefs
(
useContactsStore
())
//表格搜索
...
...
@@ -48,6 +49,9 @@ const getEventList = (pageIndex: number, pageSize: number) => {
if
(
endTime
.
value
)
{
params
.
endTime
=
endTime
.
value
}
if
(
keyword
.
value
)
{
params
.
keyword
=
keyword
.
value
}
return
alova
.
Post
<
any
>
(
'/call/getEventList'
,
params
)
}
const
{
...
...
src/views/remote/contacts/multiCallModel.vue
View file @
28897b6b
...
...
@@ -39,7 +39,7 @@ const { userList } = storeToRefs(useContactsStore())
const
getUserListGroup
=
computed
(()
=>
{
return
cloneDeep
(
userList
.
value
)
?.
sort
((
a
,
b
)
=>
a
.
videoGroup
-
b
.
videoGroup
)
.
reduce
((
result
:
any
,
item
)
=>
{
?
.
reduce
((
result
:
any
,
item
)
=>
{
const
groupName
=
videoGroup
[
item
.
videoGroup
]
if
(
!
result
[
groupName
])
{
result
[
groupName
]
=
[]
...
...
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