Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Simoje丶
vue-vben-admin
提交
70fba7ec
V
vue-vben-admin
项目概览
Simoje丶
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
70fba7ec
编写于
10月 15, 2020
作者:
V
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf: performance optimization
上级
8f4d51a7
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
126 addition
and
74 deletion
+126
-74
README.en-US.md
README.en-US.md
+11
-0
README.md
README.md
+11
-0
src/App.vue
src/App.vue
+9
-1
src/components/Drawer/src/BasicDrawer.tsx
src/components/Drawer/src/BasicDrawer.tsx
+52
-46
src/components/Loading/FullLoading.vue
src/components/Loading/FullLoading.vue
+1
-1
src/components/Menu/src/index.less
src/components/Menu/src/index.less
+14
-5
src/design/transition/fade.less
src/design/transition/fade.less
+7
-8
src/design/transition/zoom.less
src/design/transition/zoom.less
+1
-1
src/hooks/event/useEvent.ts
src/hooks/event/useEvent.ts
+0
-2
src/hooks/event/useWindowSize.ts
src/hooks/event/useWindowSize.ts
+1
-0
src/hooks/web/useECharts.ts
src/hooks/web/useECharts.ts
+6
-1
src/hooks/web/useFullScreen.ts
src/hooks/web/useFullScreen.ts
+1
-5
src/hooks/web/useLockPage.ts
src/hooks/web/useLockPage.ts
+1
-0
src/layouts/default/multitabs/index.less
src/layouts/default/multitabs/index.less
+6
-0
src/main.ts
src/main.ts
+5
-4
未找到文件。
README.en-US.md
浏览文件 @
70fba7ec
...
...
@@ -30,6 +30,7 @@
-
[
Code contribution
](
#code-contribution
)
-
[
Finished features
](
#finished-features
)
-
[
Developing features
](
#developing-features
)
-
[
Browser support
](
#browser-support
)
## Introduction
...
...
@@ -238,3 +239,13 @@ yarn clean:lib # Delete node_modules, supported window
-
[ ] System performance optimization
If you have more components/functions/suggestions/bugs/, welcome to submit pr or issue.
## Browser support
It is recommended to use the
`Chrome`
browser for local development. Development in the Firefox browser is relatively slow.
Support modern browsers, Not currently supported ie11,Follow-up consideration support ie11
|
[
<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />
](
http://godban.github.io/browsers-support-badges/
)
</br>
IE / Edge |
[
<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />
](
http://godban.github.io/browsers-support-badges/
)
</br>
Firefox |
[
<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />
](
http://godban.github.io/browsers-support-badges/
)
</br>
Chrome |
[
<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />
](
http://godban.github.io/browsers-support-badges/
)
</br>
Safari |
| :-: | :-: | :-: | :-: |
| Not currently supported | last 2 versions | last 2 versions | last 2 versions |
README.md
浏览文件 @
70fba7ec
...
...
@@ -30,6 +30,7 @@
-
[
代码贡献
](
#代码贡献
)
-
[
已完成功能
](
#已完成功能
)
-
[
正在开发的功能
](
#正在开发的功能
)
-
[
浏览器支持
](
#浏览器支持
)
-
[
加入我们
](
#加入我们
)
## 介绍
...
...
@@ -241,6 +242,16 @@ yarn clean:lib # 删除node_modules,兼容window系统
更多组件/功能/建议/bug/欢迎提交 pr 或者 issue
## 浏览器支持
本地开发推荐使用
`Chrome`
浏览器,在火狐浏览器进行开发相对卡顿。
支持现代浏览器, IE 暂不支持,后续考虑支持 ie11
|
[
<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />
](
http://godban.github.io/browsers-support-badges/
)
</br>
IE / Edge |
[
<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />
](
http://godban.github.io/browsers-support-badges/
)
</br>
Firefox |
[
<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />
](
http://godban.github.io/browsers-support-badges/
)
</br>
Chrome |
[
<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />
](
http://godban.github.io/browsers-support-badges/
)
</br>
Safari |
| :-: | :-: | :-: | :-: |
| not support | last 2 versions | last 2 versions | last 2 versions |
## 加入我们
`Vue-Vben-Aadmin`
是完全开源免费的项目,在帮助开发者更方便地进行中大型管理系统开发,同时也提供 QQ 交流群(项目刚起步,人数较少,有兴趣的可以加群一起讨论),使用问题欢迎在群内提问。
...
...
src/App.vue
浏览文件 @
70fba7ec
...
...
@@ -15,6 +15,8 @@
import
{
useConfigProvider
,
useInitAppConfigStore
,
useListenerNetWork
}
from
'
./useApp
'
;
import
{
useLockPage
}
from
'
/@/hooks/web/useLockPage
'
;
import
{
useSetting
}
from
'
/@/hooks/core/useSetting
'
;
moment
.
locale
(
'
zh-cn
'
);
export
default
defineComponent
({
name
:
'
App
'
,
...
...
@@ -23,8 +25,14 @@
useInitAppConfigStore
();
useListenerNetWork
();
createBreakpointListen
();
const
{
projectSetting
}
=
useSetting
();
const
{
transformCellText
}
=
useConfigProvider
();
const
{
on
:
lockOn
}
=
useLockPage
();
let
lockOn
=
{};
if
(
projectSetting
.
lockTime
)
{
const
{
on
}
=
useLockPage
();
lockOn
=
on
;
}
return
{
transformCellText
,
zhCN
,
...
...
src/components/Drawer/src/BasicDrawer.tsx
浏览文件 @
70fba7ec
...
...
@@ -6,12 +6,12 @@ import {
watchEffect
,
watch
,
unref
,
getCurrentInstance
,
//
getCurrentInstance,
nextTick
,
toRaw
,
}
from
'
vue
'
;
import
{
BasicTitle
}
from
'
/@/components/Basic
'
;
import
{
ScrollContainer
,
ScrollContainerOptions
}
from
'
/@/components/Container/index
'
;
//
import { ScrollContainer, ScrollContainerOptions } from '/@/components/Container/index';
import
{
FullLoading
}
from
'
/@/components/Loading/index
'
;
import
{
getSlot
}
from
'
/@/utils/helper/tsxHelper
'
;
...
...
@@ -35,16 +35,16 @@ export default defineComponent({
setup
(
props
,
{
slots
,
emit
,
attrs
})
{
// const { currentRoute } = useRouter();
const
scrollRef
=
ref
<
any
>
(
null
);
/**
* @description: 获取配置ScrollContainer
*/
const
getScrollOptions
=
computed
(
():
ScrollContainerOptions
=>
{
return
{
...(
props
.
scrollOptions
as
any
),
};
}
);
/
/ /
**
//
* @description: 获取配置ScrollContainer
//
*/
//
const getScrollOptions = computed(
//
(): ScrollContainerOptions => {
//
return {
//
...(props.scrollOptions as any),
//
};
//
}
//
);
const
visibleRef
=
ref
(
false
);
const
propsRef
=
ref
<
Partial
<
DrawerProps
>
|
null
>
(
null
);
...
...
@@ -95,33 +95,27 @@ export default defineComponent({
}
);
// watch(
// () => currentRoute.value.path,
// () => {
// if (unref(visibleRef)) {
// visibleRef.value = false;
// }
// function scrollBottom() {
// const scroll = unref(scrollRef);
// if (scroll) {
// scroll.scrollBottom();
// }
// );
function
scrollBottom
()
{
const
scroll
=
unref
(
scrollRef
);
if
(
scroll
)
{
scroll
.
scrollBottom
();
}
}
function
scrollTo
(
to
:
number
)
{
const
scroll
=
unref
(
scrollRef
);
if
(
scroll
)
{
scroll
.
scrollTo
(
to
);
}
}
function
getScrollWrap
()
{
const
scroll
=
unref
(
scrollRef
);
if
(
scroll
)
{
return
scroll
.
getScrollWrap
();
}
return
null
;
}
// }
// function scrollTo(to: number) {
// const scroll = unref(scrollRef);
// if (scroll) {
// scroll.scrollTo(to);
// }
// }
// function getScrollWrap() {
// const scroll = unref(scrollRef);
// if (scroll) {
// return scroll.getScrollWrap();
// }
// return null;
// }
// 取消事件
async
function
onClose
(
e
:
any
)
{
const
{
closeFunc
}
=
unref
(
getProps
);
...
...
@@ -225,12 +219,12 @@ export default defineComponent({
);
}
const
currentInstance
=
getCurrentInstance
()
as
any
;
if
(
getCurrentInstance
())
{
currentInstance
.
scrollBottom
=
scrollBottom
;
currentInstance
.
scrollTo
=
scrollTo
;
currentInstance
.
getScrollWrap
=
getScrollWrap
;
}
//
const currentInstance = getCurrentInstance() as any;
//
if (getCurrentInstance()) {
//
currentInstance.scrollBottom = scrollBottom;
//
currentInstance.scrollTo = scrollTo;
//
currentInstance.getScrollWrap = getScrollWrap;
//
}
const
drawerInstance
:
DrawerInstance
=
{
setDrawerProps
:
setDrawerProps
,
};
...
...
@@ -259,7 +253,7 @@ export default defineComponent({
class
=
{
[
!
unref
(
getProps
).
loading
?
'
hidden
'
:
''
]
}
tip
=
"加载中..."
/>
<
ScrollContainer
{
/*
<ScrollContainer
ref={scrollRef}
{...{ ...attrs, ...unref(getScrollOptions) }}
style={{
...
...
@@ -267,7 +261,19 @@ export default defineComponent({
}}
>
{() => getSlot(slots, 'default')}
</
ScrollContainer
>
</ScrollContainer> */
}
<
div
ref
=
{
scrollRef
}
{
...
attrs
}
style
=
{
{
height
:
`calc(100% -
${
footerHeight
}
px)`
,
overflow
:
'
auto
'
,
padding
:
'
16px
'
,
paddingBottom
:
'
30px
'
,
}
}
>
{
getSlot
(
slots
,
'
default
'
)
}
</
div
>
{
renderFooter
()
}
</>
),
...
...
src/components/Loading/FullLoading.vue
浏览文件 @
70fba7ec
...
...
@@ -42,7 +42,7 @@
width: 100%;
height: 100%;
// background: rgba(255, 255, 255, 0.3);
background: rgba(241, 241, 246, 0.
8
);
background: rgba(241, 241, 246, 0.
7
);
justify-content: center;
align-items: center;
}
...
...
src/components/Menu/src/index.less
浏览文件 @
70fba7ec
...
...
@@ -162,9 +162,9 @@
// 层级样式
&.ant-menu-dark {
.ant-menu-item {
transition: unset;
}
//
.ant-menu-item {
//
transition: unset;
//
}
.ant-menu-item.ant-menu-item-selected.basic-menu-menu-item__level1,
.ant-menu-submenu-selected.basic-menu-menu-item__level1 {
...
...
@@ -206,9 +206,18 @@
}
.ant-menu-submenu-title {
height: @app-menu-item-height;
// margin: 0;
line-height: @app-menu-item-height;
// line-height: @app-menu-item-height;
display: flex;
height: @app-menu-item-height;
align-items: center;
}
&.ant-menu-inline-collapsed {
.ant-menu-item-selected {
background: unset !important;
box-shadow: none;
}
}
}
...
...
src/design/transition/fade.less
浏览文件 @
70fba7ec
...
...
@@ -8,21 +8,20 @@
opacity: 0;
}
/
/ side-fade
.slide-fade-
enter
-active,
.slide-fade-
leave
-active {
transition:
opacity 0.3s, transform 0.35
s;
/
* fade-transform */
.slide-fade-
leave
-active,
.slide-fade-
enter
-active {
transition:
all 0.3
s;
}
.slide-enter-from,
.slide-fade-enter {
.slide-fade-enter-from {
opacity: 0;
transform: translateX(-30
%
);
transform: translateX(-30
px
);
}
.slide-fade-leave-to {
opacity: 0;
transform: translateX(30
%
);
transform: translateX(30
px
);
}
// ///////////////////////////////////////////////
...
...
src/design/transition/zoom.less
浏览文件 @
70fba7ec
...
...
@@ -13,7 +13,7 @@
// zoom-fade
.zoom-fade-enter-active,
.zoom-fade-leave-active {
transition: transform 0.1
s, opacity 0.15
s ease-out;
transition: transform 0.1
5s, opacity 0.2
s ease-out;
}
.zoom-fade-enter-from {
...
...
src/hooks/event/useEvent.ts
浏览文件 @
70fba7ec
...
...
@@ -45,8 +45,6 @@ export function useEvent({
if
(
v
)
{
!
unref
(
isAddRef
)
&&
addEventListener
(
v
);
cleanUp
(()
=>
{
// @ts-ignore
window
.
a
=
v
;
autoRemove
&&
removeEventListener
(
v
);
});
}
...
...
src/hooks/event/useWindowSize.ts
浏览文件 @
70fba7ec
...
...
@@ -21,6 +21,7 @@ export function useWindowSizeFn<T>(fn: Fn<T>, wait = 150, options?: WindowSizeOp
tryOnMounted
(()
=>
{
window
.
addEventListener
(
'
resize
'
,
handler
);
});
tryOnUnmounted
(()
=>
{
window
.
removeEventListener
(
'
resize
'
,
handler
);
cancel
();
...
...
src/hooks/web/useECharts.ts
浏览文件 @
70fba7ec
...
...
@@ -14,6 +14,7 @@ export function useECharts(
)
{
const
chartInstanceRef
=
ref
<
Nullable
<
ECharts
>>
(
null
);
let
resizeFn
:
Fn
=
resize
;
let
removeResizeFn
:
Fn
=
()
=>
{};
const
[
debounceResize
]
=
useDebounce
(
resize
,
200
);
resizeFn
=
debounceResize
;
...
...
@@ -25,11 +26,12 @@ export function useECharts(
return
;
}
chartInstanceRef
.
value
=
echarts
.
init
(
el
,
theme
);
useEvent
({
const
{
removeEvent
}
=
useEvent
({
el
:
window
,
name
:
'
resize
'
,
listener
:
resizeFn
,
});
removeResizeFn
=
removeEvent
;
const
{
widthRef
,
screenEnum
}
=
useBreakpoint
();
if
(
unref
(
widthRef
)
<=
screenEnum
.
MD
)
{
useTimeout
(()
=>
{
...
...
@@ -37,6 +39,9 @@ export function useECharts(
},
30
);
}
}
tryOnUnmounted
(()
=>
{
removeResizeFn
();
});
function
setOptions
(
options
:
any
,
clear
=
true
)
{
nextTick
(()
=>
{
...
...
src/hooks/web/useFullScreen.ts
浏览文件 @
70fba7ec
...
...
@@ -15,11 +15,7 @@ type FSEPropName =
|
'
msFullscreenElement
'
|
'
mozFullScreenElement
'
|
'
fullscreenElement
'
;
type
ONFSCPropName
=
|
'
onfullscreenchange
'
|
'
onwebkitfullscreenchange
'
|
'
onmozfullscreenchange
'
|
'
MSFullscreenChange
'
;
type
ONFSCPropName
=
'
onfullscreenchange
'
|
'
onwebkitfullscreenchange
'
|
'
MSFullscreenChange
'
;
export
function
useFullscreen
(
target
:
Ref
<
Nullable
<
HTMLElement
>>
=
ref
(
document
.
documentElement
),
...
...
src/hooks/web/useLockPage.ts
浏览文件 @
70fba7ec
...
...
@@ -3,6 +3,7 @@ import { useThrottle } from '/@/hooks/core/useThrottle';
import
{
appStore
}
from
'
/@/store/modules/app
'
;
import
{
userStore
}
from
'
/@/store/modules/user
'
;
export
function
useLockPage
()
{
let
timeId
:
ReturnType
<
typeof
setTimeout
>
;
...
...
src/layouts/default/multitabs/index.less
浏览文件 @
70fba7ec
...
...
@@ -34,6 +34,12 @@
color: inherit;
}
> div {
display: flex;
justify-content: center;
align-items: center;
}
svg {
fill: @text-color-base;
}
...
...
src/main.ts
浏览文件 @
70fba7ec
import
{
createApp
}
from
'
vue
'
;
import
{
setupAntd
}
from
'
/@/setup/ant-design-vue
'
;
import
router
,
{
setupRouter
}
from
'
/@/router
'
;
import
{
setupStore
}
from
'
/@/store
'
;
import
App
from
'
./App.vue
'
;
import
{
registerGlobComp
}
from
'
/@/components/registerGlobComp
'
;
import
{
setupAntd
}
from
'
/@/setup/ant-design-vue
'
;
import
{
setupDirectives
}
from
'
/@/setup/directives/index
'
;
import
{
registerGlobComp
}
from
'
/@/components/registerGlobComp
'
;
import
{
isDevMode
,
isProdMode
,
isUseMock
}
from
'
/@/utils/env
'
;
import
{
setupProdMockServer
}
from
'
../mock/_createProductionServer
'
;
import
App
from
'
./App.vue
'
;
import
'
/@/design/index.less
'
;
const
app
=
createApp
(
App
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录