Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
21a225c2
提交
21a225c2
authored
11月 03, 2020
作者:
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: abnormal page adjustment
上级
0c28ffa8
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
48 行增加
和
78 行删除
+48
-78
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
lessModifyVars.ts
build/config/lessModifyVars.ts
+2
-2
404.png
src/assets/images/exception/404.png
+0
-0
500.png
src/assets/images/exception/500.png
+0
-0
FormItem.tsx
src/components/Form/src/FormItem.tsx
+0
-12
exceptionEnum.ts
src/enums/exceptionEnum.ts
+4
-10
Logo.vue
src/layouts/Logo.vue
+1
-1
exception.ts
src/router/menus/modules/demo/exception.ts
+4
-0
exception.ts
src/router/routes/modules/demo/exception.ts
+12
-12
projectSetting.ts
src/settings/projectSetting.ts
+1
-1
Exception.tsx
src/views/sys/exception/Exception.tsx
+23
-22
LoadTimeOut.vue
src/views/sys/exception/LoadTimeOut.vue
+0
-17
index.ts
src/views/sys/exception/index.ts
+0
-1
没有找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
21a225c2
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
-
删除菜单背景图
-
删除菜单背景图
-
更新
`ant-design-vue`
版本为
`beta13`
-
更新
`ant-design-vue`
版本为
`beta13`
-
更新
`vite`
版本为
`rc.9`
-
更新
`vite`
版本为
`rc.9`
-
异常页调整
### 🐛 Bug Fixes
### 🐛 Bug Fixes
...
...
build/config/lessModifyVars.ts
浏览文件 @
21a225c2
...
@@ -17,8 +17,8 @@ const modifyVars = {
...
@@ -17,8 +17,8 @@ const modifyVars = {
'background-color-base'
:
'#F0F2F5'
,
// background color
'background-color-base'
:
'#F0F2F5'
,
// background color
'font-size-base'
:
'14px'
,
// Main font size
'font-size-base'
:
'14px'
,
// Main font size
'box-shadow-base'
:
'0 2px 8px rgba(0, 0, 0, 0.15)'
,
// Floating shadow
'box-shadow-base'
:
'0 2px 8px rgba(0, 0, 0, 0.15)'
,
// Floating shadow
'border-color-base'
:
'#
cececd
'
,
// Border color,
'border-color-base'
:
'#
F0F0F0
'
,
// Border color,
'border-color-split'
:
'#
cececd
'
,
// Border color,
'border-color-split'
:
'#
F0F0F0
'
,
// Border color,
'border-radius-base'
:
'2px'
,
// Component/float fillet
'border-radius-base'
:
'2px'
,
// Component/float fillet
};
};
//}
//}
...
...
src/assets/images/exception/404.png
deleted
100644 → 0
浏览文件 @
0c28ffa8
14.6 KB
src/assets/images/exception/500.png
deleted
100644 → 0
浏览文件 @
0c28ffa8
15.3 KB
src/components/Form/src/FormItem.tsx
浏览文件 @
21a225c2
...
@@ -193,18 +193,6 @@ export default defineComponent({
...
@@ -193,18 +193,6 @@ export default defineComponent({
const
bindValue
=
{
const
bindValue
=
{
[
isCheck
?
'checked'
:
'value'
]:
(
props
.
formModel
as
any
)[
field
],
[
isCheck
?
'checked'
:
'value'
]:
(
props
.
formModel
as
any
)[
field
],
};
};
// TODO先兼容antd的警告,后面官方修复后删除
if
(
component
===
'Select'
)
{
if
(
Reflect
.
has
(
propsData
,
'options'
))
{
propsData
.
options
=
propsData
.
options
.
map
((
item
:
any
)
=>
{
return
{
key
:
item
.
value
,
...
item
,
};
});
}
}
if
(
!
renderComponentContent
)
{
if
(
!
renderComponentContent
)
{
return
<
Comp
{
...
propsData
}
{
...
on
}
{
...
bindValue
}
/>;
return
<
Comp
{
...
propsData
}
{
...
on
}
{
...
bindValue
}
/>;
}
}
...
...
src/enums/exceptionEnum.ts
浏览文件 @
21a225c2
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
* @description: Exception related enumeration
* @description: Exception related enumeration
*/
*/
export
enum
ExceptionEnum
{
export
enum
ExceptionEnum
{
// page not access
PAGE_NOT_ACCESS
=
403
,
// page not found
// page not found
PAGE_NOT_FOUND
=
404
,
PAGE_NOT_FOUND
=
404
,
...
@@ -11,17 +14,8 @@ export enum ExceptionEnum {
...
@@ -11,17 +14,8 @@ export enum ExceptionEnum {
// net work error
// net work error
NET_WORK_ERROR
=
10000
,
NET_WORK_ERROR
=
10000
,
// net work timeout
NET_WORK_TIMEOUT
=
10100
,
// not data
NOT_DATA
=
10200
,
// The page loads too long and timeout
PAGE_TIMEOUT
=
10300
,
// No data on the page. In fact, it is not an exception page
// No data on the page. In fact, it is not an exception page
PAGE_NOT_DATA
=
10
4
00
,
PAGE_NOT_DATA
=
10
1
00
,
}
}
export
enum
ErrorTypeEnum
{
export
enum
ErrorTypeEnum
{
...
...
src/layouts/Logo.vue
浏览文件 @
21a225c2
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
.logo-title
{
.logo-title
{
font-size
:
18px
;
font-size
:
18px
;
font-weight
:
4
00
;
font-weight
:
7
00
;
opacity
:
0
;
opacity
:
0
;
transition
:
all
0.5s
;
transition
:
all
0.5s
;
.respond-to(medium,{
.respond-to(medium,{
...
...
src/router/menus/modules/demo/exception.ts
浏览文件 @
21a225c2
...
@@ -6,6 +6,10 @@ const menu: MenuModule = {
...
@@ -6,6 +6,10 @@ const menu: MenuModule = {
path
:
'/exception'
,
path
:
'/exception'
,
children
:
[
children
:
[
{
{
path
:
'403'
,
name
:
'403'
,
},
{
path
:
'404'
,
path
:
'404'
,
name
:
'404'
,
name
:
'404'
,
},
},
...
...
src/router/routes/modules/demo/exception.ts
浏览文件 @
21a225c2
...
@@ -19,6 +19,18 @@ export default {
...
@@ -19,6 +19,18 @@ export default {
routes
:
[
routes
:
[
{
{
path
:
'/403'
,
name
:
'PageNotAccess'
,
component
:
ExceptionPage
,
props
:
{
status
:
ExceptionEnum
.
PAGE_NOT_ACCESS
,
},
meta
:
{
title
:
'403'
,
afterCloseLoading
:
true
,
},
},
{
path
:
'/404'
,
path
:
'/404'
,
name
:
'PageNotFound'
,
name
:
'PageNotFound'
,
component
:
ExceptionPage
,
component
:
ExceptionPage
,
...
@@ -55,18 +67,6 @@ export default {
...
@@ -55,18 +67,6 @@ export default {
},
},
},
},
{
{
path
:
'/page-time-out'
,
name
:
'PageTimeOut'
,
component
:
ExceptionPage
,
props
:
{
status
:
ExceptionEnum
.
PAGE_TIMEOUT
,
},
meta
:
{
title
:
'页面超时'
,
afterCloseLoading
:
true
,
},
},
{
path
:
'/not-data'
,
path
:
'/not-data'
,
name
:
'NotData'
,
name
:
'NotData'
,
component
:
ExceptionPage
,
component
:
ExceptionPage
,
...
...
src/settings/projectSetting.ts
浏览文件 @
21a225c2
...
@@ -4,7 +4,7 @@ import { MenuTypeEnum, MenuThemeEnum, MenuModeEnum } from '/@/enums/menuEnum';
...
@@ -4,7 +4,7 @@ import { MenuTypeEnum, MenuThemeEnum, MenuModeEnum } from '/@/enums/menuEnum';
import
{
ContentEnum
,
PermissionModeEnum
,
RouterTransitionEnum
}
from
'/@/enums/appEnum'
;
import
{
ContentEnum
,
PermissionModeEnum
,
RouterTransitionEnum
}
from
'/@/enums/appEnum'
;
import
{
primaryColor
}
from
'../../build/config/lessModifyVars'
;
import
{
primaryColor
}
from
'../../build/config/lessModifyVars'
;
import
{
isProdMode
}
from
'/@/utils/env'
;
import
{
isProdMode
}
from
'/@/utils/env'
;
// !
改动后需要清空浏览器缓存
// !
You need to clear the browser cache after the change
const
setting
:
ProjectConfig
=
{
const
setting
:
ProjectConfig
=
{
// Whether to show the configuration button
// Whether to show the configuration button
showSettingButton
:
true
,
showSettingButton
:
true
,
...
...
src/views/sys/exception/Exception.tsx
浏览文件 @
21a225c2
...
@@ -6,8 +6,6 @@ import { defineComponent, ref, computed, unref } from 'vue';
...
@@ -6,8 +6,6 @@ import { defineComponent, ref, computed, unref } from 'vue';
import
{
ExceptionEnum
}
from
'/@/enums/exceptionEnum'
;
import
{
ExceptionEnum
}
from
'/@/enums/exceptionEnum'
;
import
netWorkImg
from
'/@/assets/images/exception/net-work.png'
;
import
netWorkImg
from
'/@/assets/images/exception/net-work.png'
;
import
error404
from
'/@/assets/images/exception/404.png'
;
import
error500
from
'/@/assets/images/exception/500.png'
;
import
notDataImg
from
'/@/assets/images/no-data.png'
;
import
notDataImg
from
'/@/assets/images/no-data.png'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
useRoute
}
from
'vue-router'
;
...
@@ -22,6 +20,7 @@ interface MapValue {
...
@@ -22,6 +20,7 @@ interface MapValue {
btnText
?:
string
;
btnText
?:
string
;
icon
?:
string
;
icon
?:
string
;
handler
?:
Fn
;
handler
?:
Fn
;
status
?:
string
;
}
}
export
default
defineComponent
({
export
default
defineComponent
({
...
@@ -63,50 +62,52 @@ export default defineComponent({
...
@@ -63,50 +62,52 @@ export default defineComponent({
}
}
);
);
unref
(
statusMapRef
).
set
(
ExceptionEnum
.
PAGE_NOT_ACCESS
,
{
title
:
'403'
,
status
:
`
${
ExceptionEnum
.
PAGE_NOT_ACCESS
}
`
,
subTitle
:
`Sorry, you don't have access to this page.!`
,
btnText
:
props
.
full
?
'Back Login'
:
'Back Home'
,
handler
:
()
=>
(
props
.
full
?
go
(
PageEnum
.
BASE_LOGIN
)
:
go
()),
});
unref
(
statusMapRef
).
set
(
ExceptionEnum
.
PAGE_NOT_FOUND
,
{
unref
(
statusMapRef
).
set
(
ExceptionEnum
.
PAGE_NOT_FOUND
,
{
title
:
'404'
,
title
:
'404'
,
subTitle
:
'抱歉,您访问的页面不存在!'
,
status
:
`
${
ExceptionEnum
.
PAGE_NOT_FOUND
}
`
,
btnText
:
props
.
full
?
'返回登录'
:
'返回首页'
,
subTitle
:
`Sorry, the page you visited does not exist.`
,
btnText
:
props
.
full
?
'Back Login'
:
'Back Home'
,
handler
:
()
=>
(
props
.
full
?
go
(
PageEnum
.
BASE_LOGIN
)
:
go
()),
handler
:
()
=>
(
props
.
full
?
go
(
PageEnum
.
BASE_LOGIN
)
:
go
()),
icon
:
error404
,
});
});
unref
(
statusMapRef
).
set
(
ExceptionEnum
.
ERROR
,
{
unref
(
statusMapRef
).
set
(
ExceptionEnum
.
ERROR
,
{
title
:
'500'
,
title
:
'500'
,
subTitle
:
'抱歉,服务器出现异常!'
,
status
:
`
${
ExceptionEnum
.
ERROR
}
`
,
btnText
:
'返回首页'
,
subTitle
:
`Sorry, the server is reporting an error.`
,
btnText
:
'Back Home'
,
handler
:
()
=>
go
(),
handler
:
()
=>
go
(),
icon
:
error500
,
});
});
unref
(
statusMapRef
).
set
(
ExceptionEnum
.
PAGE_NOT_DATA
,
{
unref
(
statusMapRef
).
set
(
ExceptionEnum
.
PAGE_NOT_DATA
,
{
title
:
'
当前页面无数据
'
,
title
:
'
No data on the current page
'
,
subTitle
:
''
,
subTitle
:
''
,
btnText
:
'
刷新
'
,
btnText
:
'
Refresh
'
,
handler
:
()
=>
redo
(),
handler
:
()
=>
redo
(),
icon
:
notDataImg
,
icon
:
notDataImg
,
});
});
unref
(
statusMapRef
).
set
(
ExceptionEnum
.
NET_WORK_ERROR
,
{
unref
(
statusMapRef
).
set
(
ExceptionEnum
.
NET_WORK_ERROR
,
{
title
:
'
网络错误
'
,
title
:
'
Network Error
'
,
subTitle
:
'
抱歉,您的网络连接已断开,请检查您的网络
!'
,
subTitle
:
'
Sorry,Your network connection has been disconnected, please check your network
!'
,
btnText
:
'
刷新
'
,
btnText
:
'
Refresh
'
,
handler
:
()
=>
redo
(),
handler
:
()
=>
redo
(),
icon
:
netWorkImg
,
icon
:
netWorkImg
,
});
});
unref
(
statusMapRef
).
set
(
ExceptionEnum
.
PAGE_TIMEOUT
,
{
title
:
'页面加载失败'
,
subTitle
:
'抱歉,您的页面加载出错或者过久未响应,请检查您的网络!'
,
btnText
:
'刷新'
,
handler
:
()
=>
redo
(),
icon
:
netWorkImg
,
});
return
()
=>
{
return
()
=>
{
const
{
title
,
subTitle
,
btnText
,
icon
,
handler
}
=
unref
(
getMapValue
)
||
{};
const
{
title
,
subTitle
,
btnText
,
icon
,
handler
,
status
}
=
unref
(
getMapValue
)
||
{};
return
(
return
(
<
Result
<
Result
class=
"exception "
class=
"exception "
status=
{
status
as
any
}
title=
{
props
.
title
||
title
}
title=
{
props
.
title
||
title
}
sub
-
title=
{
props
.
subTitle
||
subTitle
}
sub
-
title=
{
props
.
subTitle
||
subTitle
}
>
>
...
@@ -117,7 +118,7 @@ export default defineComponent({
...
@@ -117,7 +118,7 @@ export default defineComponent({
{
()
=>
btnText
}
{
()
=>
btnText
}
</
Button
>
</
Button
>
),
),
icon
:
()
=>
icon
&&
<
img
src=
{
icon
}
/>
,
icon
:
()
=>
(
icon
?
<
img
src=
{
icon
}
/>
:
null
)
,
}
}
}
}
</
Result
>
</
Result
>
);
);
...
...
src/views/sys/exception/LoadTimeOut.vue
deleted
100644 → 0
浏览文件 @
0c28ffa8
<
template
>
<Exception
:status=
"ExceptionEnum.PAGE_TIMEOUT"
/>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'vue'
;
import
{
Exception
}
from
'/@/views/sys/exception'
;
import
{
ExceptionEnum
}
from
'/@/enums/exceptionEnum'
;
export
default
defineComponent
({
name
:
'LoadTimeout'
,
components
:
{
Exception
},
setup
()
{
return
{
ExceptionEnum
};
},
});
</
script
>
src/views/sys/exception/index.ts
浏览文件 @
21a225c2
export
{
default
as
Exception
}
from
'./Exception'
;
export
{
default
as
Exception
}
from
'./Exception'
;
export
{
default
as
LoadTimeOut
}
from
'./LoadTimeOut.vue'
;
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论