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', {
...
@@ -49,16 +49,26 @@ export const useMenuStore = defineStore('menu', {
if
(
userInfo
.
iv
){
if
(
userInfo
.
iv
){
userPermissions
.
push
(
'V'
)
userPermissions
.
push
(
'V'
)
}
}
if
(
userInfo
.
im
){
const
findFreeMenu
=
menus
.
filter
(
x
=>
userPermissions
.
includes
(
x
.
owner
))
userPermissions
.
push
(
'M'
)
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
))
const
findFreeMenu
=
menus
.
filter
(
x
=>
userPermissions
.
includes
(
x
.
owner
))
if
(
findFreeMenu
){
if
(
findFreeMenu
){
state
.
userMenu
=
findFreeMenu
.
map
(
x
=>
x
.
menu
)
state
.
userMenu
=
findFreeMenu
.
map
(
x
=>
x
.
menu
)
}
}
}
}
return
state
.
userMenu
return
state
.
userMenu
}
}
,
},
},
// actions:{
// actions:{
// setUserMenu()
// setUserMenu()
...
...
src/store/user.ts
View file @
b918ca45
...
@@ -39,7 +39,7 @@ export const useUserStore = defineStore('user', {
...
@@ -39,7 +39,7 @@ export const useUserStore = defineStore('user', {
let
rate
:
CustomerRate
=
'FREE'
let
rate
:
CustomerRate
=
'FREE'
if
(
state
.
userInfo
.
it
)
rate
=
'EN'
if
(
state
.
userInfo
.
it
)
rate
=
'EN'
else
if
(
state
.
userInfo
.
iv
)
rate
=
'VIP'
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
)
const
theme
=
CustomerThemeConfig
.
find
(
x
=>
x
.
name
==
rate
)
return
theme
return
theme
},
},
...
@@ -58,7 +58,6 @@ export const useUserStore = defineStore('user', {
...
@@ -58,7 +58,6 @@ export const useUserStore = defineStore('user', {
d
.
isTemplate
=
d
.
IsEditTripTemplate
d
.
isTemplate
=
d
.
IsEditTripTemplate
d
.
ia
=
0
d
.
ia
=
0
d
.
it
=
true
d
.
it
=
true
d
.
im
=
true
this
.
userInfo
=
d
this
.
userInfo
=
d
return
true
return
true
...
...
src/utils/common.ts
View file @
b918ca45
...
@@ -122,4 +122,10 @@ export const formatDateTimeToRead = (dateStr:string,prefix:string='') =>{
...
@@ -122,4 +122,10 @@ export const formatDateTimeToRead = (dateStr:string,prefix:string='') =>{
}
else
}
else
result
=
"刚刚"
;
result
=
"刚刚"
;
return
prefix
+
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 @@
...
@@ -206,11 +206,9 @@
</div>
</div>
<div
v-else-if=
"dataList.length == 0 && !loading"
class=
"q-mt-lg bg-white rounded"
<div
v-else-if=
"dataList.length == 0 && !loading"
class=
"q-mt-lg bg-white rounded"
style=
"padding: 30px 10px 30px 10px;"
>
style=
"padding: 30px 10px 30px 10px;"
>
<el-empty
description=
"暂无数据"
/>
<el-empty
description=
"暂无数据"
:image=
"noDataImg(1)"
/>
</div>
</div>
<el-divider
class=
"no-bg q-mt-lg"
v-if=
'queryObj.pageCount == queryObj.pageIndex && !loading'
>
<div
v-if=
'queryObj.pageCount == queryObj.pageIndex && !loading'
class=
"text-center q-pt-lg"
><img
:src=
"noDataImg(2)"
width=
"118"
/></div>
<span
class=
"text-small"
style=
"background: #f3f6fb;padding: 0 10px;color:#a3a3a3"
>
已加载完成所有数据
</span>
</el-divider>
<div
style=
"height:40px;"
class=
"q-mt-md no-bg"
background=
"transparent"
v-loading=
"loading"
element-loading-text=
"正在加载中"
></div>
<div
style=
"height:40px;"
class=
"q-mt-md no-bg"
background=
"transparent"
v-loading=
"loading"
element-loading-text=
"正在加载中"
></div>
</div>
</div>
</div>
</div>
...
@@ -339,6 +337,8 @@ import { Delete,View } from '@element-plus/icons-vue';
...
@@ -339,6 +337,8 @@ import { Delete,View } from '@element-plus/icons-vue';
import
{
VIEWPORT_SIZE
,
VIEWPORT_VER_SIZE
}
from
'@/configs/canvas'
import
{
VIEWPORT_SIZE
,
VIEWPORT_VER_SIZE
}
from
'@/configs/canvas'
import
foote
from
'@/components/footer/index.vue'
;
import
foote
from
'@/components/footer/index.vue'
;
import
{
noDataImg
}
from
"@/utils/common"
;
const
{
const
{
userInfo
userInfo
}
=
storeToRefs
(
useUserStore
())
}
=
storeToRefs
(
useUserStore
())
...
...
src/views/TemplateCenter/Layout.vue
View file @
b918ca45
...
@@ -37,14 +37,13 @@ import { useRouter } from "vue-router";
...
@@ -37,14 +37,13 @@ import { useRouter } from "vue-router";
const
router
=
useRouter
()
const
router
=
useRouter
()
const
useMenu
=
useMenuStore
();
const
useMenu
=
useMenuStore
();
const
menus
=
ref
(
useMenu
.
get
User
Menu
);
const
menus
=
ref
(
useMenu
.
get
Template
Menu
);
const
activeIndex
=
ref
(
0
)
const
activeIndex
=
ref
(
0
)
const
forwardSpace
=
()
=>
router
.
push
(
'/space'
)
const
forwardSpace
=
()
=>
router
.
push
(
'/space'
)
watch
(()
=>
router
.
currentRoute
.
value
.
path
,
(
toPath
)
=>
{
watch
(()
=>
router
.
currentRoute
.
value
.
path
,
(
toPath
)
=>
{
menus
.
value
=
useMenu
.
getUserMenu
menus
.
value
=
useMenu
.
getUserMenu
console
.
log
(
menus
.
value
,
'===='
)
if
(
!
menus
.
value
)
return
if
(
!
menus
.
value
)
return
activeIndex
.
value
=
menus
.
value
.
findIndex
(
x
=>
x
.
url
==
router
.
currentRoute
.
value
.
path
)
activeIndex
.
value
=
menus
.
value
.
findIndex
(
x
=>
x
.
url
==
router
.
currentRoute
.
value
.
path
)
},{
immediate
:
true
,
deep
:
true
})
},{
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