Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
project-online-fi
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
project-online-fi
Commits
f3c1a52c
提交
f3c1a52c
authored
11月 18, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
a0eaad9f
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
72 行增加
和
31 行删除
+72
-31
App.vue
src/App.vue
+4
-6
Header.vue
src/components/layout/Header.vue
+29
-14
Index.vue
src/components/layout/Index.vue
+8
-7
Nav.vue
src/components/layout/Nav.vue
+1
-1
TreeItem.vue
src/components/layout/TreeItem.vue
+1
-1
useDevice.ts
src/composables/useDevice.ts
+23
-0
index.ts
src/modules/home/index.ts
+1
-0
index.ts
src/router/index.ts
+5
-2
没有找到文件。
src/App.vue
浏览文件 @
f3c1a52c
<
script
lang=
"ts"
setup
>
<
script
setup
lang=
"ts"
>
// import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
import
{
useDevice
}
from
'@/composables/useDevice'
// const breakpoints = useBreakpoints(breakpointsTailwind)
const
{
mobile
}
=
useDevice
()
// const isMobile = breakpoints.smaller('md')
const
isMobile
=
false
</
script
>
</
script
>
<
template
>
<
template
>
<router-view
:class=
"
{ 'is-h5':
isMobile, 'is-pc': !isM
obile }" />
<router-view
:class=
"
{ 'is-h5':
mobile, 'is-pc': !m
obile }" />
</
template
>
</
template
>
src/components/layout/Header.vue
浏览文件 @
f3c1a52c
...
@@ -5,6 +5,11 @@ import { useUserStore } from '@/stores/user'
...
@@ -5,6 +5,11 @@ import { useUserStore } from '@/stores/user'
import
{
useRoute
}
from
'vue-router'
import
{
useRoute
}
from
'vue-router'
import
AppNav
from
'./Nav.vue'
import
AppNav
from
'./Nav.vue'
interface
Props
{
fixed
?:
boolean
}
const
props
=
defineProps
<
Props
>
()
const
route
=
useRoute
()
const
route
=
useRoute
()
const
user
=
useUserStore
()
const
user
=
useUserStore
()
const
LOGIN_URL
=
`
${
import
.
meta
.
env
.
VITE_LOGIN_URL
}
?rd=
${
encodeURIComponent
(
location
.
href
)}
`
const
LOGIN_URL
=
`
${
import
.
meta
.
env
.
VITE_LOGIN_URL
}
?rd=
${
encodeURIComponent
(
location
.
href
)}
`
...
@@ -22,6 +27,7 @@ watch(route, () => {
...
@@ -22,6 +27,7 @@ watch(route, () => {
const
classNames
=
computed
(()
=>
{
const
classNames
=
computed
(()
=>
{
return
{
return
{
'has-menu'
:
menuVisible
.
value
,
'has-menu'
:
menuVisible
.
value
,
'is-fixed'
:
props
.
fixed
,
'is-scrolled'
:
isScrolled
.
value
'is-scrolled'
:
isScrolled
.
value
}
}
})
})
...
@@ -45,7 +51,7 @@ const isScrolled = computed(() => {
...
@@ -45,7 +51,7 @@ const isScrolled = computed(() => {
<div
class=
"app-header-left"
>
<div
class=
"app-header-left"
>
<div
class=
"logo"
>
<div
class=
"logo"
>
<router-link
to=
"/"
>
<router-link
to=
"/"
>
<img
src=
"@/assets/images/logo.png"
v-if=
"isScrolled"
/>
<img
src=
"@/assets/images/logo.png"
v-if=
"isScrolled
|| !fixed
"
/>
<img
src=
"@/assets/images/logo_white.png"
v-else
/>
<img
src=
"@/assets/images/logo_white.png"
v-else
/>
</router-link>
</router-link>
</div>
</div>
...
@@ -58,8 +64,8 @@ const isScrolled = computed(() => {
...
@@ -58,8 +64,8 @@ const isScrolled = computed(() => {
<template
v-if=
"user.isLogin"
>
<template
v-if=
"user.isLogin"
>
你好,
{{
user
.
userName
}}
你好,
{{
user
.
userName
}}
<div
class=
"app-header-logout"
@
click=
"handleLogout"
>
<div
class=
"app-header-logout"
@
click=
"handleLogout"
>
<img
v-if=
"isScrolled"
src=
"https://webapp-pub.ezijing.com/project/saas/logout.png
"
/>
<img
src=
"https://webapp-pub.ezijing.com/project/saas/logout.png"
v-if=
"isScrolled || !fixed
"
/>
<img
v-else
src=
"https://webapp-pub.ezijing.com/project_online/fi/logout_white.png"
/>
<img
src=
"https://webapp-pub.ezijing.com/project_online/fi/logout_white.png"
v-else
/>
退出
退出
</div>
</div>
</
template
>
</
template
>
...
@@ -74,22 +80,25 @@ const isScrolled = computed(() => {
...
@@ -74,22 +80,25 @@ const isScrolled = computed(() => {
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
.app-header
{
.app-header
{
position
:
fixed
;
position
:
sticky
;
top
:
0
;
left
:
0
;
left
:
0
;
right
:
0
;
right
:
0
;
color
:
#aa1941
;
background
:
linear-gradient
(
0deg
,
rgba
(
0
,
0
,
0
,
0
)
0%
,
rgba
(
0
,
0
,
0
,
0
.5
)
100%
);
z-index
:
1000
;
z-index
:
1000
;
.cell
{
&
.is-fixed
{
color
:
#fff
!
important
;
position
:
fixed
;
left
:
0
;
right
:
0
;
color
:
#fff
;
background
:
linear-gradient
(
0deg
,
rgba
(
0
,
0
,
0
,
0
)
0%
,
rgba
(
0
,
0
,
0
,
0
.5
)
100%
);
.button-default
{
color
:
#fff
;
}
}
}
&
.is-scrolled
{
&
.is-scrolled
{
color
:
#
fff
;
color
:
#
333
;
background
:
#fff
;
background
:
#fff
;
box-shadow
:
0px
0px
12px
rgba
(
0
,
0
,
0
,
0
.1
);
box-shadow
:
0px
0px
12px
rgba
(
0
,
0
,
0
,
0
.1
);
.cell
{
color
:
#333
!
important
;
}
.button-default
{
.button-default
{
color
:
#333
;
color
:
#333
;
}
}
...
@@ -114,8 +123,14 @@ const isScrolled = computed(() => {
...
@@ -114,8 +123,14 @@ const isScrolled = computed(() => {
}
}
}
}
.app-header-right
{
.app-header-right
{
.study
{
font-size
:
18px
;
line-height
:
50px
;
margin-right
:
30px
;
font-weight
:
400
;
cursor
:
pointer
;
}
display
:
flex
;
display
:
flex
;
color
:
#333
;
.app-header-logout
{
.app-header-logout
{
// background: url('https://webapp-pub.ezijing.com/project/saas/logout.png') no-repeat left center;
// background: url('https://webapp-pub.ezijing.com/project/saas/logout.png') no-repeat left center;
...
@@ -134,7 +149,7 @@ const isScrolled = computed(() => {
...
@@ -134,7 +149,7 @@ const isScrolled = computed(() => {
padding
:
0
10px
;
padding
:
0
10px
;
font-size
:
14px
;
font-size
:
14px
;
line-height
:
24px
;
line-height
:
24px
;
color
:
#
fff
;
color
:
#
333
;
text-align
:
center
;
text-align
:
center
;
border
:
1px
solid
#eaeaea
;
border
:
1px
solid
#eaeaea
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
...
...
src/components/layout/Index.vue
浏览文件 @
f3c1a52c
<
script
setup
lang=
"ts"
>
import
AppHeader
from
'./Header.vue'
import
AppFooter
from
'./Footer.vue'
const
attrs
=
useAttrs
()
</
script
>
<
template
>
<
template
>
<div
class=
"app-layout"
>
<div
class=
"app-layout"
>
<AppHeader></AppHeader>
<AppHeader
v-bind=
"attrs"
></AppHeader>
<section
class=
"app-layout-container"
>
<section
class=
"app-layout-container"
>
<router-view></router-view>
<router-view
:key=
"$route.fullPath"
></router-view>
</section>
</section>
<AppFooter></AppFooter>
<AppFooter></AppFooter>
</div>
</div>
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
import
AppHeader
from
'./Header.vue'
import
AppFooter
from
'./Footer.vue'
</
script
>
src/components/layout/Nav.vue
浏览文件 @
f3c1a52c
...
@@ -32,7 +32,7 @@ const navList = [
...
@@ -32,7 +32,7 @@ const navList = [
>
.cell
{
>
.cell
{
font-size
:
18px
;
font-size
:
18px
;
line-height
:
50px
;
line-height
:
50px
;
color
:
#333
;
//
color: #333;
}
}
>
.tree-item-group
{
>
.tree-item-group
{
margin-top
:
-4px
;
margin-top
:
-4px
;
...
...
src/components/layout/TreeItem.vue
浏览文件 @
f3c1a52c
...
@@ -30,7 +30,7 @@ function toggleVisible(event: Event) {
...
@@ -30,7 +30,7 @@ function toggleVisible(event: Event) {
<li
class=
"tree-item"
:class=
"
{ 'is-active': isActive }">
<li
class=
"tree-item"
:class=
"
{ 'is-active': isActive }">
<div
class=
"cell"
:class=
"
{ bold: isFolder }" @click.capture="toggleVisible">
<div
class=
"cell"
:class=
"
{ bold: isFolder }" @click.capture="toggleVisible">
<div
class=
"cell-title"
>
<div
class=
"cell-title"
>
<
a
:href=
"item.path"
>
{{
item
.
name
}}
</a
>
<
router-link
:to=
"item.path"
>
{{
item
.
name
}}
</router-link
>
</div>
</div>
<div
class=
"cell-icon"
v-if=
"isFolder"
>
<div
class=
"cell-icon"
v-if=
"isFolder"
>
<i
class=
"el-icon-arrow-up"
v-if=
"isOpen"
></i>
<i
class=
"el-icon-arrow-up"
v-if=
"isOpen"
></i>
...
...
src/composables/useDevice.ts
0 → 100644
浏览文件 @
f3c1a52c
export
function
useDevice
()
{
const
navigator
=
window
.
navigator
const
userAgent
=
ref
(
navigator
.
userAgent
)
const
mobile
=
computed
(()
=>
{
return
/iphone/i
.
test
(
userAgent
.
value
)
||
(
/android/i
.
test
(
userAgent
.
value
)
&&
/mobile/i
.
test
(
userAgent
.
value
))
})
const
wechat
=
computed
(()
=>
{
return
/micromessenger/i
.
test
(
userAgent
.
value
)
})
const
alipay
=
computed
(()
=>
{
return
/alipayclient/i
.
test
(
userAgent
.
value
)
})
addEventListener
(
'resize'
,
()
=>
{
if
(
navigator
)
userAgent
.
value
=
navigator
.
userAgent
})
return
{
userAgent
,
mobile
,
wechat
,
alipay
}
}
src/modules/home/index.ts
浏览文件 @
f3c1a52c
...
@@ -5,6 +5,7 @@ export const routes: Array<RouteRecordRaw> = [
...
@@ -5,6 +5,7 @@ export const routes: Array<RouteRecordRaw> = [
{
{
path
:
'/'
,
path
:
'/'
,
component
:
AppLayout
,
component
:
AppLayout
,
props
:
{
fixed
:
true
},
children
:
[{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
}]
children
:
[{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
}]
}
}
]
]
src/router/index.ts
浏览文件 @
f3c1a52c
...
@@ -2,12 +2,15 @@ import { createRouter, createWebHistory } from 'vue-router'
...
@@ -2,12 +2,15 @@ import { createRouter, createWebHistory } from 'vue-router'
// import { useUserStore } from '@/stores/user'
// import { useUserStore } from '@/stores/user'
const
router
=
createRouter
({
const
router
=
createRouter
({
scrollBehavior
()
{
scrollBehavior
(
to
)
{
if
(
to
.
hash
)
{
return
{
el
:
to
.
hash
,
top
:
94
}
}
// 始终滚动到顶部
// 始终滚动到顶部
return
{
top
:
0
}
return
{
top
:
0
}
},
},
history
:
createWebHistory
(),
history
:
createWebHistory
(),
routes
:
[{
path
:
'/:pathMatch(.*)*'
,
redirect
:
'/'
}]
routes
:
[{
path
:
'/:pathMatch(.*)*'
,
redirect
:
'/
home
'
}]
})
})
// router.beforeEach((to, from, next) => {
// router.beforeEach((to, from, next) => {
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论