Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
Project
Project
Details
Activity
Releases
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
viitto
pptist
Commits
b918ca45
Commit
b918ca45
authored
Apr 25, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化首页空状态
parent
2a27b914
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
11 deletions
+25
-11
menu.ts
src/store/menu.ts
+13
-3
user.ts
src/store/user.ts
+1
-2
common.ts
src/utils/common.ts
+6
-0
Index.vue
src/views/Market/Index.vue
+4
-4
Layout.vue
src/views/TemplateCenter/Layout.vue
+1
-2
No files found.
src/store/menu.ts
View file @
b918ca45
...
...
@@ -49,16 +49,26 @@ export const useMenuStore = defineStore('menu', {
if
(
userInfo
.
iv
){
userPermissions
.
push
(
'V'
)
}
if
(
userInfo
.
im
){
userPermissions
.
push
(
'M'
)
const
findFreeMenu
=
menus
.
filter
(
x
=>
userPermissions
.
includes
(
x
.
owner
))
if
(
findFreeMenu
){
state
.
userMenu
=
findFreeMenu
.
map
(
x
=>
x
.
menu
)
}
}
return
state
.
userMenu
},
getTemplateMenu
:(
state
)
=>
{
if
(
!
state
.
userMenu
||
state
.
userMenu
.
length
==
0
)
{
const
userStore
=
useUserStore
()
const
userInfo
=
userStore
.
getUser
let
userPermissions
:
MenuOwner
[]
=
[
'M'
]
const
findFreeMenu
=
menus
.
filter
(
x
=>
userPermissions
.
includes
(
x
.
owner
))
if
(
findFreeMenu
){
state
.
userMenu
=
findFreeMenu
.
map
(
x
=>
x
.
menu
)
}
}
return
state
.
userMenu
}
}
,
},
// actions:{
// setUserMenu()
...
...
src/store/user.ts
View file @
b918ca45
...
...
@@ -39,7 +39,7 @@ export const useUserStore = defineStore('user', {
let
rate
:
CustomerRate
=
'FREE'
if
(
state
.
userInfo
.
it
)
rate
=
'EN'
else
if
(
state
.
userInfo
.
iv
)
rate
=
'VIP'
else
if
(
state
.
userInfo
.
i
m
)
rate
=
'TME'
else
if
(
state
.
userInfo
.
i
sTemplate
)
rate
=
'TME'
const
theme
=
CustomerThemeConfig
.
find
(
x
=>
x
.
name
==
rate
)
return
theme
},
...
...
@@ -58,7 +58,6 @@ export const useUserStore = defineStore('user', {
d
.
isTemplate
=
d
.
IsEditTripTemplate
d
.
ia
=
0
d
.
it
=
true
d
.
im
=
true
this
.
userInfo
=
d
return
true
...
...
src/utils/common.ts
View file @
b918ca45
...
...
@@ -122,4 +122,10 @@ export const formatDateTimeToRead = (dateStr:string,prefix:string='') =>{
}
else
result
=
"刚刚"
;
return
prefix
+
result
;
}
// 暂无数据img
export
const
noDataImg
=
(
type
:
Number
)
=>
{
if
(
type
==
1
)
return
require
(
'@/assets/img/noData.png'
)
if
(
type
==
2
)
return
require
(
'@/assets/img/theEend.png'
)
}
\ No newline at end of file
src/views/Market/Index.vue
View file @
b918ca45
...
...
@@ -206,11 +206,9 @@
</div>
<div
v-else-if=
"dataList.length == 0 && !loading"
class=
"q-mt-lg bg-white rounded"
style=
"padding: 30px 10px 30px 10px;"
>
<el-empty
description=
"暂无数据"
/>
<el-empty
description=
"暂无数据"
:image=
"noDataImg(1)"
/>
</div>
<el-divider
class=
"no-bg q-mt-lg"
v-if=
'queryObj.pageCount == queryObj.pageIndex && !loading'
>
<span
class=
"text-small"
style=
"background: #f3f6fb;padding: 0 10px;color:#a3a3a3"
>
已加载完成所有数据
</span>
</el-divider>
<div
v-if=
'queryObj.pageCount == queryObj.pageIndex && !loading'
class=
"text-center q-pt-lg"
><img
:src=
"noDataImg(2)"
width=
"118"
/></div>
<div
style=
"height:40px;"
class=
"q-mt-md no-bg"
background=
"transparent"
v-loading=
"loading"
element-loading-text=
"正在加载中"
></div>
</div>
</div>
...
...
@@ -339,6 +337,8 @@ import { Delete,View } from '@element-plus/icons-vue';
import
{
VIEWPORT_SIZE
,
VIEWPORT_VER_SIZE
}
from
'@/configs/canvas'
import
foote
from
'@/components/footer/index.vue'
;
import
{
noDataImg
}
from
"@/utils/common"
;
const
{
userInfo
}
=
storeToRefs
(
useUserStore
())
...
...
src/views/TemplateCenter/Layout.vue
View file @
b918ca45
...
...
@@ -37,14 +37,13 @@ import { useRouter } from "vue-router";
const
router
=
useRouter
()
const
useMenu
=
useMenuStore
();
const
menus
=
ref
(
useMenu
.
get
User
Menu
);
const
menus
=
ref
(
useMenu
.
get
Template
Menu
);
const
activeIndex
=
ref
(
0
)
const
forwardSpace
=
()
=>
router
.
push
(
'/space'
)
watch
(()
=>
router
.
currentRoute
.
value
.
path
,
(
toPath
)
=>
{
menus
.
value
=
useMenu
.
getUserMenu
console
.
log
(
menus
.
value
,
'===='
)
if
(
!
menus
.
value
)
return
activeIndex
.
value
=
menus
.
value
.
findIndex
(
x
=>
x
.
url
==
router
.
currentRoute
.
value
.
path
)
},{
immediate
:
true
,
deep
:
true
})
...
...
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