优化Result组件,完善结果页(error、success)

master
iczer 6 years ago
parent 1ce46133c5
commit cb96f91b4d
  1. 2
      src/components/menu/menu.js
  2. 2
      src/components/page/PageHeader.vue
  3. 61
      src/components/result/Error.vue
  4. 28
      src/components/result/Result.vue
  5. 105
      src/components/result/Success.vue
  6. 10
      src/router/index.js

@ -47,7 +47,7 @@ export default {
data () {
return {
rootSubmenuKeys: ['/form', '/list', '/detail', '/exception', '/result'],
openKeys: ['/form']
openKeys: []
}
},
methods: {

@ -23,7 +23,7 @@ export default {
props: {
title: {
type: String,
required: true
required: false
},
breadcrumb: {
type: Array,

@ -0,0 +1,61 @@
<template>
<div>
<page-header :breadcrumb="breadcrumb" style="margin: -24px -24px 24px -24px"/>
<a-card :bordered="false">
<result style="margin-bottom: 16px; margin-top: 48px" :is-success="false" :title="title" :description="description">
<template slot="action">
<a-button type="primary" >返回修改</a-button>
</template>
<div>
<div style="fontSize: 16px; color: rgba(0, 0, 0, 0.85); fontWeight: 500; marginBottom: 16px">
您提交的内容有如下错误
</div>
<div style="margin-bottom: 16px">
<a-icon type="close-circle-o" style="color: #f5222d; margin-right: 8px"/>
您的账户已被冻结
<a style="margin-left: 16px">立即解冻 <a-icon type="right" /></a>
</div>
<div>
<a-icon type="close-circle-o" style="color: #f5222d; margin-right: 8px"/>
您的账户还不具备申请资格
<a style="margin-left: 16px">立即升级 <a-icon type="right" /></a>
</div>
</div>
</result>
</a-card>
</div>
</template>
<script>
import Result from './Result'
import ACard from 'vue-antd-ui/es/card/Card'
import PageHeader from '../page/PageHeader'
import AIcon from 'vue-antd-ui/es/icon/icon'
import AButton from "vue-antd-ui/es/button/button";
export default {
name: 'Error',
components: {AButton, AIcon, PageHeader, ACard, Result},
data () {
return {
breadcrumb: [],
title: '提交失败',
description: '请核对并修改以下信息后,再重新提交。'
}
},
mounted () {
this.getPageHeaderInfo()
},
beforeUpdate () {
this.getPageHeaderInfo()
},
methods: {
getPageHeaderInfo () {
this.breadcrumb = this.$route.matched
}
}
}
</script>
<style scoped>
</style>

@ -3,9 +3,13 @@
<div >
<a-icon :class="[isSuccess ? 'success' : 'error' ,'icon']" :type="isSuccess ? 'check-circle' : 'close-circle'" />
</div>
<div class="title">{{title}}</div>
<div>
<slot name="content"></slot>
<div class="title" v-if="title">{{title}}</div>
<div class="desc" v-if="description">{{description}}</div>
<div class="content">
<slot></slot>
</div>
<div class="action">
<slot name="action"></slot>
</div>
</div>
</template>
@ -15,13 +19,12 @@ import AIcon from 'vue-antd-ui/es/icon/icon'
export default {
name: 'Result',
components: {AIcon},
props: ['isSuccess', 'title']
props: ['isSuccess', 'title', 'description']
}
</script>
<style lang="less" scoped>
.result{
text-align: center;
text-align: center;
width: 72%;
margin: 0 auto;
@ -43,6 +46,21 @@ export default {
line-height: 32px;
margin-bottom: 16px;
}
.desc{
font-size: 14px;
line-height: 22px;
color: rgba(0, 0, 0, 0.45);
margin-bottom: 24px;
}
.content{
background: #fafafa;
padding: 24px 40px;
border-radius: 2px;
text-align: left;
}
.action{
margin-top: 32px;
}
}
</style>

@ -0,0 +1,105 @@
<template>
<div>
<page-header :breadcrumb="breadcrumb" style="margin: -24px -24px 24px -24px"/>
<a-card :bordered="false">
<result :is-success="true" :description="description" :title="title">
<template slot="action">
<a-button type="primary">返回列表</a-button>
<a-button style="margin-left: 8px">查看项目</a-button>
<a-button style="margin-left: 8px">打印</a-button>
</template>
<div>
<div style="font-size: 16px; color: rgba(0, 0, 0, 0.85); font-weight: 500; margin-bottom: 20px;">项目名称</div>
<a-row style="margin-bottom: 16px">
<a-col :xs="24" :sm="12" :md="12" :lg="12" :xl="6">
<span style="color: rgba(0, 0, 0, 0.85)">项目 ID</span>
20180724089
</a-col>
<a-col :xs="24" :sm="12" :md="12" :lg="12" :xl="6">
<span style="color: rgba(0, 0, 0, 0.85)">负责人</span>
曲丽丽是谁
</a-col>
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
<span style="color: rgba(0, 0, 0, 0.85)">生效时间</span>
2016-12-12 ~ 2017-12-12
</a-col>
</a-row>
<a-steps :current="1" progressDot>
<a-step >
<span style="font-size: 14px" slot="title">创建项目</span>
<template slot="description">
<div style="fontSize: 12px; color: rgba(0, 0, 0, 0.45); position: relative; left: 42px;" slot="description" >
<div style="margin: 8px 0 4px">
曲丽丽
<a-icon style="margin-left: 8px" type="dingding-o" />
</div>
<div>2016-12-12 12:32</div>
</div>
</template>
</a-step>
<a-step title="部门初审">
<span style="font-size: 14px" slot="title">部门初审</span>
<template slot="description">
<div style="fontSize: 12px; color: rgba(0, 0, 0, 0.45); position: relative; left: 42px;" slot="description" >
<div style="margin: 8px 0 4px">
周毛毛
<a-icon style="margin-left: 8px; color: #00A0E9" type="dingding-o" />
</div>
<div><a href="">催一下</a></div>
</div>
</template>
</a-step>
<a-step title="财务复核">
<span style="font-size: 14px" slot="title">财务复核</span>
</a-step>
<a-step title="完成" >
<span style="font-size: 14px" slot="title">完成</span>
</a-step>
</a-steps>
</div>
</result>
</a-card>
</div>
</template>
<script>
import Result from './Result'
import ACard from 'vue-antd-ui/es/card/Card'
import PageHeader from '../page/PageHeader'
import AButton from 'vue-antd-ui/es/button/button'
import ACol from 'vue-antd-ui/es/grid/Col'
import ARow from 'vue-antd-ui/es/grid/Row'
import ASteps from 'vue-antd-ui/es/steps/index'
import AIcon from 'vue-antd-ui/es/icon/icon'
const AStep = ASteps.Step
export default {
name: 'Success',
components: {AIcon, AStep, ASteps, ARow, ACol, AButton, PageHeader, ACard, Result},
data () {
return {
breadcrumb: [],
title: '提交成功',
description: '提交结果页用于反馈一系列操作任务的处理结果,\n' +
' 如果仅是简单操作,使用 Message 全局提示反馈即可。\n' +
' 本文字区域可以展示简单的补充说明,如果有类似展示\n' +
' “单据”的需求,下面这个灰色区域可以呈现比较复杂的内容。'
}
},
mounted () {
this.getPageHeaderInfo()
},
beforeUpdate () {
this.getPageHeaderInfo()
},
methods: {
getPageHeaderInfo () {
this.breadcrumb = this.$route.matched
}
}
}
</script>
<style scoped>
</style>

@ -9,6 +9,8 @@ import Form from '@/components/form/Form'
import BasicForm from '@/components/form/BasicForm'
import StepForm from '@/components/form/stepForm/StepForm'
import AdvancedForm from '@/components/form/advancedForm/AdvancedForm'
import Success from '@/components/result/Success'
import Error from '@/components/result/Error'
Vue.use(Router)
@ -100,7 +102,7 @@ export default new Router({
},
{
path: '/result',
name: '详情页',
name: '结果页',
icon: 'check-circle-o',
component: Exception,
children: [
@ -108,13 +110,13 @@ export default new Router({
path: '/result/success',
name: '成功',
icon: 'none',
component: NotFound
component: Success
},
{
path: '/result/failure',
path: '/result/error',
name: '失败',
icon: 'none',
component: NotFound
component: Error
}
]
},

Loading…
Cancel
Save