提交 21e0548e 作者: vben

feat: add result page demo

上级 746d4a74
...@@ -88,6 +88,16 @@ const menu: MenuModule = { ...@@ -88,6 +88,16 @@ const menu: MenuModule = {
}, },
], ],
}, },
{
path: '/form',
name: '验证组件',
children: [
{
path: '/base',
name: '拖拽校验',
},
],
},
], ],
}, },
}; };
......
import type { MenuModule } from '/@/router/types.d'; import type { MenuModule } from '/@/router/types.d';
const menu: MenuModule = { const menu: MenuModule = {
orderNo: 10, orderNo: 19,
menu: { menu: {
name: '页面功能', name: '功能',
path: '/feat', path: '/feat',
children: [ children: [
{ {
......
import type { MenuModule } from '/@/router/types.d'; import type { MenuModule } from '/@/router/types.d';
const menu: MenuModule = { const menu: MenuModule = {
orderNo: 500, orderNo: 20,
menu: { menu: {
name: '页面',
path: '/page-demo',
tag: {
dot: true,
},
children: [
{
path: 'result',
name: '结果页',
tag: {
content: 'new',
},
children: [
{
path: 'success',
name: '成功页',
},
{
path: 'fail',
name: '失败页',
},
],
},
{
path: 'exception',
name: '异常页', name: '异常页',
path: '/exception',
children: [ children: [
{ {
path: '403', path: '403',
...@@ -22,14 +46,12 @@ const menu: MenuModule = { ...@@ -22,14 +46,12 @@ const menu: MenuModule = {
name: '网络错误', name: '网络错误',
}, },
{ {
path: 'page-time-out',
name: '页面超时',
},
{
path: 'not-data', path: 'not-data',
name: '无数据', name: '无数据',
}, },
], ],
}, },
],
},
}; };
export default menu; export default menu;
import type { MenuModule } from '/@/router/types.d'; import type { MenuModule } from '/@/router/types.d';
const menu: MenuModule = { const menu: MenuModule = {
orderNo: 20, orderNo: 15,
menu: { menu: {
name: '权限管理', name: '权限管理',
path: '/permission', path: '/permission',
......
...@@ -6,20 +6,55 @@ import { ExceptionEnum } from '/@/enums/exceptionEnum'; ...@@ -6,20 +6,55 @@ import { ExceptionEnum } from '/@/enums/exceptionEnum';
const ExceptionPage = () => import('/@/views/sys/exception/Exception'); const ExceptionPage = () => import('/@/views/sys/exception/Exception');
export default { export default {
layout: { path: '/page-demo',
path: '/exception', name: 'PageDemo',
name: 'ExceptionPage',
component: PAGE_LAYOUT_COMPONENT, component: PAGE_LAYOUT_COMPONENT,
redirect: '/exception/404', redirect: '/page-demo/exception',
meta: { meta: {
icon: 'ant-design:exception-outlined', icon: 'mdi:page-next-outline',
title: '异常页', title: '页面',
},
children: [
// =============================result start=============================
{
path: '/result',
name: 'ResultPage',
redirect: '/page-demo/result/success',
meta: {
title: '结果页',
}, },
children: [
{
path: 'success',
name: 'ResultSuccessPage',
component: () => import('/@/views/demo/page/result/success/index.vue'),
meta: {
title: '成功页',
},
},
{
path: 'fail',
name: 'ResultFailPage',
component: () => import('/@/views/demo/page/result/fail/index.vue'),
meta: {
title: '失败页',
}, },
},
],
},
// =============================result end=============================
routes: [ // =============================exception start=============================
{ {
path: '/403', path: '/exception',
name: 'ExceptionPage',
redirect: '/page-demo/exception/404',
meta: {
title: '异常页',
},
children: [
{
path: '403',
name: 'PageNotAccess', name: 'PageNotAccess',
component: ExceptionPage, component: ExceptionPage,
props: { props: {
...@@ -31,7 +66,7 @@ export default { ...@@ -31,7 +66,7 @@ export default {
}, },
}, },
{ {
path: '/404', path: '404',
name: 'PageNotFound', name: 'PageNotFound',
component: ExceptionPage, component: ExceptionPage,
props: { props: {
...@@ -43,7 +78,7 @@ export default { ...@@ -43,7 +78,7 @@ export default {
}, },
}, },
{ {
path: '/500', path: '500',
name: 'ServiceError', name: 'ServiceError',
component: ExceptionPage, component: ExceptionPage,
props: { props: {
...@@ -55,7 +90,7 @@ export default { ...@@ -55,7 +90,7 @@ export default {
}, },
}, },
{ {
path: '/net-work-error', path: 'net-work-error',
name: 'NetWorkError', name: 'NetWorkError',
component: ExceptionPage, component: ExceptionPage,
props: { props: {
...@@ -67,7 +102,7 @@ export default { ...@@ -67,7 +102,7 @@ export default {
}, },
}, },
{ {
path: '/not-data', path: 'not-data',
name: 'NotData', name: 'NotData',
component: ExceptionPage, component: ExceptionPage,
props: { props: {
...@@ -79,4 +114,7 @@ export default { ...@@ -79,4 +114,7 @@ export default {
}, },
}, },
], ],
},
// =============================exception end=============================
],
} as AppRouteModule; } as AppRouteModule;
<template>
<div class="m-5 result-error">
<Result status="error" title="提交失败" sub-title="请核对并修改以下信息后,再重新提交。">
<template #extra>
<a-button key="console" type="primary"> 返回修改 </a-button>
</template>
</Result>
<div class="result-error__content">
<div class="result-error__content-title">您提交的内容有如下错误:</div>
<div class="mb-4">
<CloseCircleOutlined class="mr-2 result-error__content-icon" />
您的账户已被冻结
<a class="ml-4">立即解冻 ></a>
</div>
<div class="mb-4">
<CloseCircleOutlined class="mr-2 result-error__content-icon" />
您的账户还不具备申请资格
<a class="ml-4">立即解冻 ></a>
</div>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { Result } from 'ant-design-vue';
import { CloseCircleOutlined } from '@ant-design/icons-vue';
export default defineComponent({
components: {
Result,
CloseCircleOutlined,
},
});
</script>
<style lang="less" scoped>
.result-error {
padding: 48px 32px;
background: #fff;
&__content {
padding: 24px 40px;
background: #fafafa;
&-title {
margin-bottom: 16px;
font-size: 16px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
}
&-icon {
color: #ff4d4f;
}
}
}
</style>
<template>
<div class="m-5 result-success">
<Result
status="success"
title="提交成功"
sub-title="提交结果页用于反馈一系列操作任务的处理结果, 如果仅是简单操作,使用 Message 全局提示反馈即可。 本文字区域可以展示简单的补充说明,如果有类似展示 “单据”的需求,下面这个灰色区域可以呈现比较复杂的内容。"
>
<template #extra>
<a-button key="console" type="primary"> 返回列表 </a-button>
<a-button key="buy"> 查看项目 </a-button>
<a-button key="buy"> 打印 </a-button>
</template>
</Result>
<div class="result-success__content">
<Descriptions title="项目名称">
<DescriptionItem label="项目 ID"> 111222 </DescriptionItem>
<DescriptionItem label="负责人"> Vben </DescriptionItem>
<DescriptionItem label="生效时间"> 2016-12-12 ~ 2017-12-12 </DescriptionItem>
</Descriptions>
<Steps :current="1" progress-dot size="small">
<Step title="创建项目">
<template #description> <div>Vben</div> <p>2016-12-12 12:32</p> </template>
</Step>
<Step title="部门初审">
<template #description> <p>Chad</p> </template>
</Step>
<Step title="财务复核" />
<Step title="完成" />
</Steps>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { Result, Steps, Descriptions } from 'ant-design-vue';
export default defineComponent({
components: {
Result,
Steps,
Step: Steps.Step,
Descriptions,
DescriptionItem: Descriptions.Item,
},
});
</script>
<style lang="less" scoped>
.result-success {
padding: 48px 32px;
background: #fff;
&__content {
padding: 24px 40px;
background: #fafafa;
}
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论