Blame view

ant-design-vue-jeecg/src/components/page/PageLayout.vue 2.91 KB
肖超群 authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<template>
  <div :style="!$route.meta.pageHeader ? 'margin: -10px -24px 0;' : null">
    <!-- pageHeader , route meta hideHeader:true on hide -->
    <page-header v-if="!$route.meta.pageHeader" :title="title" :logo="logo" :avatar="avatar">
      <slot slot="action" name="action"></slot>
      <slot slot="content" name="headerContent"></slot>
      <div slot="content" v-if="!this.$slots.headerContent && desc">
        <p style="font-size: 14px;color: rgba(0,0,0,.65)">{{ desc }}</p>
        <div class="link">
          <template v-for="(link, index) in linkList">
            <a :key="index" :href="link.href">
              <a-icon :type="link.icon"/>
              <span>{{ link.title }}</span>
            </a>
          </template>
        </div>
      </div>
      <slot slot="extra" name="extra"></slot>
      <div slot="pageMenu">
        <div class="page-menu-search" v-if="search">
肖超群 authored
21
          <a-input-search style="width: 80%; max-width: 522px;" placeholder="请输入..." size="large" enterButton="搜索"/>
肖超群 authored
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
        </div>
        <div class="page-menu-tabs" v-if="tabs && tabs.items">
          <!-- @change="callback" :activeKey="activeKey" -->
          <a-tabs :tabBarStyle="{margin: 0}" @change="tabs.callback" :activeKey="tabs.active()">
            <a-tab-pane v-for="item in tabs.items" :tab="item.title" :key="item.key"></a-tab-pane>
          </a-tabs>
        </div>
      </div>
    </page-header>
    <div class="content">
      <div :class="['page-header-index-wide']">
        <slot></slot>
      </div>
    </div>
  </div>
</template>

<script>
肖超群 authored
40
import PageHeader from './PageHeader'
肖超群 authored
41
肖超群 authored
42
43
44
45
46
47
48
49
50
51
export default {
  name: "LayoutContent",
  components: {
    PageHeader
  },
  // ['desc', 'logo', 'title', 'avatar', 'linkList', 'extraImage']
  props: {
    desc: {
      type: String,
      default: null
肖超群 authored
52
    },
肖超群 authored
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
    logo: {
      type: String,
      default: null
    },
    title: {
      type: String,
      default: null
    },
    avatar: {
      type: String,
      default: null
    },
    linkList: {
      type: Array,
      default: null
    },
    extraImage: {
      type: String,
      default: null
肖超群 authored
72
    },
肖超群 authored
73
74
75
76
77
78
79
80
    search: {
      type: Boolean,
      default: false
    },
    tabs: {
      type: Object,
      default: () => {
      }
肖超群 authored
81
    }
肖超群 authored
82
83
84
  },
  methods: {}
}
肖超群 authored
85
86
87
</script>

<style lang="less" scoped>
肖超群 authored
88
89
.content {
  margin: 24px 24px 0;
肖超群 authored
90
肖超群 authored
91
92
93
94
95
96
  .link {
    margin-top: 16px;

    &:not(:empty) {
      margin-bottom: 16px;
    }
肖超群 authored
97
肖超群 authored
98
99
100
101
102
103
104
105
106
107
    a {
      margin-right: 32px;
      height: 24px;
      line-height: 24px;
      display: inline-block;

      i {
        font-size: 24px;
        margin-right: 8px;
        vertical-align: middle;
肖超群 authored
108
      }
肖超群 authored
109
110

      span {
肖超群 authored
111
112
113
        height: 24px;
        line-height: 24px;
        display: inline-block;
肖超群 authored
114
        vertical-align: middle;
肖超群 authored
115
116
117
      }
    }
  }
肖超群 authored
118
119
120
121
122
123
124
125
126
127
128
129
130
131
}

.page-menu-search {
  text-align: center;
  margin-bottom: 16px;
}

.page-menu-tabs {
  margin-top: 48px;
}

.page-header[data-v-6740ec88] {
  margin: 0px 24px 0;
}
肖超群 authored
132
</style>