新增布局PageLayout,优化代码结构

master
chenghx 6 years ago
parent 45a2c86b37
commit 5014a92bd2
  1. 2
      src/components/layout/PageLayout.vue
  2. 15
      src/components/result/Error.vue
  3. 15
      src/components/result/Success.vue
  4. 10
      src/router/index.js

@ -12,7 +12,7 @@
<script>
import PageHeader from '../page/PageHeader'
export default {
name: 'Form',
name: 'PageLayout',
components: {PageHeader},
data () {
return {

@ -1,6 +1,4 @@
<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">
@ -23,7 +21,6 @@
</div>
</result>
</a-card>
</div>
</template>
<script>
@ -37,21 +34,9 @@ export default {
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>

@ -1,6 +1,4 @@
<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">
@ -59,7 +57,6 @@
</div>
</result>
</a-card>
</div>
</template>
<script>
@ -78,24 +75,12 @@ export default {
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>

@ -5,7 +5,7 @@ import Exception from '@/components/exception/Exception'
import NotFound from '@/components/exception/404'
import NotPermit from '@/components/exception/403'
import ServerError from '@/components/exception/500'
import Form from '@/components/form/Form'
import PageLayout from '@/components/layout/PageLayout'
import BasicForm from '@/components/form/BasicForm'
import StepForm from '@/components/form/stepForm/StepForm'
import AdvancedForm from '@/components/form/advancedForm/AdvancedForm'
@ -25,7 +25,7 @@ export default new Router({
{
path: '/form',
name: '表单页',
component: Form,
component: PageLayout,
icon: 'form',
children: [
{
@ -51,7 +51,7 @@ export default new Router({
{
path: '/list',
name: '列表页',
component: Exception,
component: PageLayout,
icon: 'table',
children: [
{
@ -84,7 +84,7 @@ export default new Router({
path: '/detail',
name: '详情页',
icon: 'profile',
component: Exception,
component: PageLayout,
children: [
{
path: '/detail/basic',
@ -104,7 +104,7 @@ export default new Router({
path: '/result',
name: '结果页',
icon: 'check-circle-o',
component: Exception,
component: PageLayout,
children: [
{
path: '/result/success',

Loading…
Cancel
Save