Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
najiu-frontend
najiu-admin-template
Commits
21a225c2
Commit
21a225c2
authored
Nov 03, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: abnormal page adjustment
parent
0c28ffa8
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
48 additions
and
78 deletions
+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
No files found.
CHANGELOG.zh_CN.md
View file @
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
View file @
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
View file @
0c28ffa8
14.6 KB
src/assets/images/exception/500.png
deleted
100644 → 0
View file @
0c28ffa8
15.3 KB
src/components/Form/src/FormItem.tsx
View file @
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
View file @
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
View file @
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
View file @
21a225c2
...
@@ -5,6 +5,10 @@ const menu: MenuModule = {
...
@@ -5,6 +5,10 @@ const menu: MenuModule = {
name
:
'
异常页
'
,
name
:
'
异常页
'
,
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
View file @
21a225c2
...
@@ -18,6 +18,18 @@ export default {
...
@@ -18,6 +18,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
'
,
...
@@ -54,18 +66,6 @@ export default {
...
@@ -54,18 +66,6 @@ export default {
afterCloseLoading
:
true
,
afterCloseLoading
:
true
,
},
},
},
},
{
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
'
,
...
...
src/settings/projectSetting.ts
View file @
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
View file @
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
View file @
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
View file @
21a225c2
export
{
default
as
Exception
}
from
'
./Exception
'
;
export
{
default
as
Exception
}
from
'
./Exception
'
;
export
{
default
as
LoadTimeOut
}
from
'
./LoadTimeOut.vue
'
;
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