研发图纸文件管理系统-前端项目
chenghx
2018-07-25 5014a92bd2867cd6e362c90d83975121169dbf51
新增布局PageLayout,优化代码结构
1 文件已重命名
3个文件已修改
42 ■■■■ 已修改文件
src/components/layout/PageLayout.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/result/Error.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/result/Success.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/layout/PageLayout.vue
File was renamed from src/components/form/Form.vue
@@ -12,7 +12,7 @@
<script>
import PageHeader from '../page/PageHeader'
export default {
  name: 'Form',
  name: 'PageLayout',
  components: {PageHeader},
  data () {
    return {
src/components/result/Error.vue
@@ -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,20 +34,8 @@
  components: {AButton, AIcon, PageHeader, ACard, Result},
  data () {
    return {
      breadcrumb: [],
      title: '提交失败',
      description: '请核对并修改以下信息后,再重新提交。'
    }
  },
  mounted () {
    this.getPageHeaderInfo()
  },
  beforeUpdate () {
    this.getPageHeaderInfo()
  },
  methods: {
    getPageHeaderInfo () {
      this.breadcrumb = this.$route.matched
    }
  }
}
src/components/result/Success.vue
@@ -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,23 +75,11 @@
  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
    }
  }
}
src/router/index.js
@@ -5,7 +5,7 @@
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 @@
    {
      path: '/form',
      name: '表单页',
      component: Form,
      component: PageLayout,
      icon: 'form',
      children: [
        {
@@ -51,7 +51,7 @@
    {
      path: '/list',
      name: '列表页',
      component: Exception,
      component: PageLayout,
      icon: 'table',
      children: [
        {
@@ -84,7 +84,7 @@
      path: '/detail',
      name: '详情页',
      icon: 'profile',
      component: Exception,
      component: PageLayout,
      children: [
        {
          path: '/detail/basic',
@@ -104,7 +104,7 @@
      path: '/result',
      name: '结果页',
      icon: 'check-circle-o',
      component: Exception,
      component: PageLayout,
      children: [
        {
          path: '/result/success',