vue2-client 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -65
- package/babel.config.js +1 -0
- package/docs/notice.md +24 -0
- package/index.js +28 -28
- package/package.json +1 -1
- package/src/App.vue +93 -93
- package/src/base-client/all.js +57 -57
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1159 -1159
- package/src/base-client/components/common/CreateQuery/index.md +42 -42
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +540 -540
- package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
- package/src/base-client/components/common/CustomColumnsDrawer/index.md +46 -46
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +150 -150
- package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
- package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
- package/src/base-client/components/common/XAddForm/XAddForm.vue +323 -323
- package/src/base-client/components/common/XAddForm/index.md +60 -60
- package/src/base-client/components/common/XBadge/index.md +39 -39
- package/src/base-client/components/common/XCard/index.md +43 -43
- package/src/base-client/components/common/XForm/XForm.vue +275 -275
- package/src/base-client/components/common/XForm/XFormItem.vue +217 -217
- package/src/base-client/components/common/XForm/index.md +196 -196
- package/src/base-client/components/common/XFormCol/index.md +35 -35
- package/src/base-client/components/common/XFormTable/XFormTable.vue +405 -405
- package/src/base-client/components/common/XFormTable/index.md +89 -89
- package/src/base-client/components/common/XTable/XTable.vue +262 -262
- package/src/base-client/components/common/XTable/index.md +255 -255
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +105 -105
- package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +226 -226
- package/src/base-client/components/iot/CustomerDetailsView/index.md +41 -41
- package/src/base-client/components/iot/DataAnalysisUser/DataAnalysisUser.vue +127 -127
- package/src/base-client/components/iot/DataAnalysisViewGD/DataAnalysisViewGD.vue +548 -548
- package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +453 -453
- package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +231 -231
- package/src/base-client/components/iot/DeviceDetailsView/index.md +43 -43
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -330
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstruct.vue +122 -122
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +122 -122
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +225 -225
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +135 -135
- package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +277 -277
- package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +472 -472
- package/src/base-client/components/iot/InstructDetailsView/index.md +45 -45
- package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +380 -380
- package/src/base-client/components/iot/LogDetailsView/index.md +43 -43
- package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +360 -360
- package/src/base-client/components/iot/MeterDetailsView/index.md +43 -43
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +335 -335
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +185 -185
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +292 -292
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +237 -237
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +257 -257
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +190 -190
- package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +723 -723
- package/src/base-client/components/iot/WebmeterAnalysisView/index.md +48 -48
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
- package/src/base-client/components/system/DictionaryDetailsView/index.md +41 -41
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +248 -248
- package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +406 -406
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +486 -486
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +184 -184
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +303 -303
- package/src/base-client/plugins/AppData.js +69 -69
- package/src/base-client/plugins/GetLoginInfoService.js +221 -221
- package/src/base-client/plugins/index.js +21 -21
- package/src/bootstrap.js +27 -27
- package/src/components/Ellipsis/Ellipsis.vue +64 -64
- package/src/components/Ellipsis/index.md +38 -38
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/STable/README.md +341 -341
- package/src/components/Trend/index.md +45 -45
- package/src/components/cache/AKeepAlive.js +172 -172
- package/src/components/checkbox/index.js +7 -7
- package/src/components/index.js +36 -36
- package/src/components/menu/menu.js +273 -273
- package/src/components/setting/Setting.vue +237 -237
- package/src/components/table/advance/AdvanceTable.vue +275 -275
- package/src/components/transition/PageToggleTransition.vue +97 -97
- package/src/layouts/CommonLayout.vue +42 -42
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +74 -74
- package/src/layouts/header/AdminHeader.vue +109 -109
- package/src/layouts/header/HeaderAvatar.vue +60 -60
- package/src/layouts/header/HeaderNotice.vue +97 -97
- package/src/layouts/tabs/TabsHead.vue +190 -190
- package/src/layouts/tabs/TabsView.vue +355 -355
- package/src/main.js +20 -20
- package/src/mock/goods/index.js +108 -108
- package/src/mock/index.js +12 -12
- package/src/mock/project/index.js +17 -17
- package/src/mock/user/current.js +13 -13
- package/src/mock/user/login.js +39 -39
- package/src/mock/workplace/index.js +15 -15
- package/src/pages/exception/403.vue +25 -25
- package/src/pages/exception/404.vue +25 -25
- package/src/pages/exception/500.vue +25 -25
- package/src/pages/login/Login.vue +194 -194
- package/src/pages/report/ReportTableHome.vue +28 -28
- package/src/pages/resourceManage/resourceManageMain.vue +55 -55
- package/src/pages/system/applyInstallView/Core.vue +570 -570
- package/src/pages/system/applyInstallView/index.vue +34 -34
- package/src/pages/system/dictionary/index.vue +41 -41
- package/src/pages/system/queryParams/index.vue +41 -41
- package/src/router/async/config.async.js +25 -25
- package/src/router/async/router.map.js +59 -59
- package/src/router/guards.js +104 -104
- package/src/router/index.js +27 -27
- package/src/services/api/common.js +39 -39
- package/src/services/api/restTools.js +23 -23
- package/src/services/dataSource.js +12 -12
- package/src/services/user.js +34 -34
- package/src/store/modules/setting.js +114 -114
- package/src/utils/i18n.js +80 -80
- package/src/utils/indexedDB.js +146 -146
- package/src/utils/request.js +197 -197
- package/src/utils/routerUtil.js +15 -2
- package/tests/unit/ReportTable.spec.js +15 -15
- package/vue.config.js +153 -153
- package/webpack.config.js +12 -12
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<transition
|
|
3
|
-
v-if="!disabled"
|
|
4
|
-
:enter-active-class="`animated ${enterAnimate} page-toggle-enter-active`"
|
|
5
|
-
:leave-active-class="`animated ${leaveAnimate} page-toggle-leave-active`"
|
|
6
|
-
>
|
|
7
|
-
<slot></slot>
|
|
8
|
-
</transition>
|
|
9
|
-
<div v-else><slot></slot></div>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
import { preset as animates } from '@vue2-client/config/default/animate.config'
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
name: 'PageToggleTransition',
|
|
17
|
-
props: {
|
|
18
|
-
disabled: {
|
|
19
|
-
type: Boolean,
|
|
20
|
-
default: false
|
|
21
|
-
},
|
|
22
|
-
animate: {
|
|
23
|
-
type: String,
|
|
24
|
-
validator (value) {
|
|
25
|
-
return animates.findIndex(item => item.name == value) != -1
|
|
26
|
-
},
|
|
27
|
-
default: 'bounce'
|
|
28
|
-
},
|
|
29
|
-
// eslint-disable-next-line vue/require-default-prop
|
|
30
|
-
direction: {
|
|
31
|
-
type: String,
|
|
32
|
-
validator (value) {
|
|
33
|
-
return ['x', 'y', 'left', 'right', 'up', 'down', 'downLeft', 'upRight', 'downRight', 'upLeft', 'downBig',
|
|
34
|
-
'upBig', 'downLeft', 'downRight', 'topRight', 'bottomLeft', 'topLeft', 'bottomRight', 'default'].indexOf(value) > -1
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
reverse: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: true
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
computed: {
|
|
43
|
-
enterAnimate () {
|
|
44
|
-
return this.activeClass(false)
|
|
45
|
-
},
|
|
46
|
-
leaveAnimate () {
|
|
47
|
-
return this.activeClass(true)
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
methods: {
|
|
51
|
-
activeClass (isLeave) {
|
|
52
|
-
const animate = animates.find(item => this.animate == item.name)
|
|
53
|
-
if (animate == undefined) {
|
|
54
|
-
return ''
|
|
55
|
-
}
|
|
56
|
-
let direction = ''
|
|
57
|
-
if (this.direction == undefined) {
|
|
58
|
-
direction = animate.directions[0]
|
|
59
|
-
} else {
|
|
60
|
-
direction = animate.directions.find(item => item == this.direction)
|
|
61
|
-
}
|
|
62
|
-
direction = (direction == undefined || direction === 'default') ? '' : direction
|
|
63
|
-
if (direction != '') {
|
|
64
|
-
direction = isLeave && this.reverse ? this.reversePosition(direction, animate.directions) : direction
|
|
65
|
-
direction = direction[0].toUpperCase() + direction.substring(1)
|
|
66
|
-
}
|
|
67
|
-
const t = isLeave ? 'Out' : 'In'
|
|
68
|
-
return animate.name + t + direction
|
|
69
|
-
},
|
|
70
|
-
reversePosition (direction, directions) {
|
|
71
|
-
if (direction.length == 0 || direction == 'x' || direction == 'y') {
|
|
72
|
-
return direction
|
|
73
|
-
}
|
|
74
|
-
let index = directions.indexOf(direction)
|
|
75
|
-
index = (index % 2 == 1) ? index - 1 : index + 1
|
|
76
|
-
return directions[index]
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
</script>
|
|
81
|
-
|
|
82
|
-
<style lang="less">
|
|
83
|
-
.page-toggle-enter-active{
|
|
84
|
-
position: absolute !important;
|
|
85
|
-
animation-duration: 0.8s !important;
|
|
86
|
-
width: calc(100%) !important;
|
|
87
|
-
}
|
|
88
|
-
.page-toggle-leave-active{
|
|
89
|
-
position: absolute !important;
|
|
90
|
-
animation-duration: 0.8s !important;
|
|
91
|
-
width: calc(100%) !important;
|
|
92
|
-
}
|
|
93
|
-
.page-toggle-enter{
|
|
94
|
-
}
|
|
95
|
-
.page-toggle-leave-to{
|
|
96
|
-
}
|
|
97
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<transition
|
|
3
|
+
v-if="!disabled"
|
|
4
|
+
:enter-active-class="`animated ${enterAnimate} page-toggle-enter-active`"
|
|
5
|
+
:leave-active-class="`animated ${leaveAnimate} page-toggle-leave-active`"
|
|
6
|
+
>
|
|
7
|
+
<slot></slot>
|
|
8
|
+
</transition>
|
|
9
|
+
<div v-else><slot></slot></div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import { preset as animates } from '@vue2-client/config/default/animate.config'
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: 'PageToggleTransition',
|
|
17
|
+
props: {
|
|
18
|
+
disabled: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
},
|
|
22
|
+
animate: {
|
|
23
|
+
type: String,
|
|
24
|
+
validator (value) {
|
|
25
|
+
return animates.findIndex(item => item.name == value) != -1
|
|
26
|
+
},
|
|
27
|
+
default: 'bounce'
|
|
28
|
+
},
|
|
29
|
+
// eslint-disable-next-line vue/require-default-prop
|
|
30
|
+
direction: {
|
|
31
|
+
type: String,
|
|
32
|
+
validator (value) {
|
|
33
|
+
return ['x', 'y', 'left', 'right', 'up', 'down', 'downLeft', 'upRight', 'downRight', 'upLeft', 'downBig',
|
|
34
|
+
'upBig', 'downLeft', 'downRight', 'topRight', 'bottomLeft', 'topLeft', 'bottomRight', 'default'].indexOf(value) > -1
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
reverse: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
computed: {
|
|
43
|
+
enterAnimate () {
|
|
44
|
+
return this.activeClass(false)
|
|
45
|
+
},
|
|
46
|
+
leaveAnimate () {
|
|
47
|
+
return this.activeClass(true)
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
methods: {
|
|
51
|
+
activeClass (isLeave) {
|
|
52
|
+
const animate = animates.find(item => this.animate == item.name)
|
|
53
|
+
if (animate == undefined) {
|
|
54
|
+
return ''
|
|
55
|
+
}
|
|
56
|
+
let direction = ''
|
|
57
|
+
if (this.direction == undefined) {
|
|
58
|
+
direction = animate.directions[0]
|
|
59
|
+
} else {
|
|
60
|
+
direction = animate.directions.find(item => item == this.direction)
|
|
61
|
+
}
|
|
62
|
+
direction = (direction == undefined || direction === 'default') ? '' : direction
|
|
63
|
+
if (direction != '') {
|
|
64
|
+
direction = isLeave && this.reverse ? this.reversePosition(direction, animate.directions) : direction
|
|
65
|
+
direction = direction[0].toUpperCase() + direction.substring(1)
|
|
66
|
+
}
|
|
67
|
+
const t = isLeave ? 'Out' : 'In'
|
|
68
|
+
return animate.name + t + direction
|
|
69
|
+
},
|
|
70
|
+
reversePosition (direction, directions) {
|
|
71
|
+
if (direction.length == 0 || direction == 'x' || direction == 'y') {
|
|
72
|
+
return direction
|
|
73
|
+
}
|
|
74
|
+
let index = directions.indexOf(direction)
|
|
75
|
+
index = (index % 2 == 1) ? index - 1 : index + 1
|
|
76
|
+
return directions[index]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style lang="less">
|
|
83
|
+
.page-toggle-enter-active{
|
|
84
|
+
position: absolute !important;
|
|
85
|
+
animation-duration: 0.8s !important;
|
|
86
|
+
width: calc(100%) !important;
|
|
87
|
+
}
|
|
88
|
+
.page-toggle-leave-active{
|
|
89
|
+
position: absolute !important;
|
|
90
|
+
animation-duration: 0.8s !important;
|
|
91
|
+
width: calc(100%) !important;
|
|
92
|
+
}
|
|
93
|
+
.page-toggle-enter{
|
|
94
|
+
}
|
|
95
|
+
.page-toggle-leave-to{
|
|
96
|
+
}
|
|
97
|
+
</style>
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="common-layout">
|
|
3
|
-
<div class="content"><slot></slot></div>
|
|
4
|
-
<page-footer :link-list="footerLinks" :copyright="copyright"></page-footer>
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script>
|
|
9
|
-
import PageFooter from '@vue2-client/layouts/footer/PageFooter'
|
|
10
|
-
import { mapState } from 'vuex'
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
name: 'CommonLayout',
|
|
14
|
-
components: { PageFooter },
|
|
15
|
-
computed: {
|
|
16
|
-
...mapState('setting', ['footerLinks', 'copyright'])
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<style scoped lang="less">
|
|
22
|
-
.common-layout{
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
height: 100vh;
|
|
26
|
-
overflow: auto;
|
|
27
|
-
background-color: @layout-body-background;
|
|
28
|
-
background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg');
|
|
29
|
-
background-repeat: no-repeat;
|
|
30
|
-
background-position-x: center;
|
|
31
|
-
background-position-y: 110px;
|
|
32
|
-
background-size: 100%;
|
|
33
|
-
.content{
|
|
34
|
-
padding: 32px 0;
|
|
35
|
-
flex: 1;
|
|
36
|
-
@media (min-width: 768px){
|
|
37
|
-
|
|
38
|
-
padding: 112px 0 24px;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="common-layout">
|
|
3
|
+
<div class="content"><slot></slot></div>
|
|
4
|
+
<page-footer :link-list="footerLinks" :copyright="copyright"></page-footer>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import PageFooter from '@vue2-client/layouts/footer/PageFooter'
|
|
10
|
+
import { mapState } from 'vuex'
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: 'CommonLayout',
|
|
14
|
+
components: { PageFooter },
|
|
15
|
+
computed: {
|
|
16
|
+
...mapState('setting', ['footerLinks', 'copyright'])
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<style scoped lang="less">
|
|
22
|
+
.common-layout{
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
height: 100vh;
|
|
26
|
+
overflow: auto;
|
|
27
|
+
background-color: @layout-body-background;
|
|
28
|
+
background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg');
|
|
29
|
+
background-repeat: no-repeat;
|
|
30
|
+
background-position-x: center;
|
|
31
|
+
background-position-y: 110px;
|
|
32
|
+
background-size: 100%;
|
|
33
|
+
.content{
|
|
34
|
+
padding: 32px 0;
|
|
35
|
+
flex: 1;
|
|
36
|
+
@media (min-width: 768px){
|
|
37
|
+
|
|
38
|
+
padding: 112px 0 24px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="page-layout">
|
|
3
|
-
<page-header
|
|
4
|
-
ref="pageHeader"
|
|
5
|
-
:style="`margin-top: ${multiPage ? 0 : -24}px`"
|
|
6
|
-
:breadcrumb="breadcrumb"
|
|
7
|
-
:title="pageTitle"
|
|
8
|
-
:logo="logo"
|
|
9
|
-
:avatar="avatar">
|
|
10
|
-
<slot name="action" slot="action"></slot>
|
|
11
|
-
<slot slot="content" name="headerContent"></slot>
|
|
12
|
-
<div slot="content" v-if="!this.$slots.headerContent && desc">
|
|
13
|
-
<p>{{ desc }}</p>
|
|
14
|
-
<div v-if="this.linkList" class="link">
|
|
15
|
-
<template v-for="(link, index) in linkList">
|
|
16
|
-
<a :key="index" :href="link.href"><a-icon :type="link.icon" />{{ link.title }}</a>
|
|
17
|
-
</template>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
<slot v-if="this.$slots.extra" slot="extra" name="extra"></slot>
|
|
21
|
-
</page-header>
|
|
22
|
-
<div ref="page" :class="['page-content', layout, pageWidth]" >
|
|
23
|
-
<slot></slot>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script>
|
|
29
|
-
import PageHeader from '@vue2-client/components/page/header/PageHeader'
|
|
30
|
-
import { mapState, mapMutations } from 'vuex'
|
|
31
|
-
import { getI18nKey } from '@vue2-client/utils/routerUtil'
|
|
32
|
-
|
|
33
|
-
export default {
|
|
34
|
-
name: 'PageLayout',
|
|
35
|
-
components: { PageHeader },
|
|
36
|
-
// eslint-disable-next-line vue/require-prop-types
|
|
37
|
-
props: ['desc', 'logo', 'title', 'avatar', 'linkList', 'extraImage'],
|
|
38
|
-
data () {
|
|
39
|
-
return {
|
|
40
|
-
page: {},
|
|
41
|
-
pageHeaderHeight: 0
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
watch: {
|
|
45
|
-
$route () {
|
|
46
|
-
this.page = this.$route.meta.page
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
updated () {
|
|
50
|
-
if (!this._inactive) {
|
|
51
|
-
this.updatePageHeight()
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
activated () {
|
|
55
|
-
this.updatePageHeight()
|
|
56
|
-
},
|
|
57
|
-
deactivated () {
|
|
58
|
-
this.updatePageHeight(0)
|
|
59
|
-
},
|
|
60
|
-
mounted () {
|
|
61
|
-
this.updatePageHeight()
|
|
62
|
-
},
|
|
63
|
-
created () {
|
|
64
|
-
this.page = this.$route.meta.page
|
|
65
|
-
},
|
|
66
|
-
beforeDestroy () {
|
|
67
|
-
this.updatePageHeight(0)
|
|
68
|
-
},
|
|
69
|
-
computed: {
|
|
70
|
-
...mapState('setting', ['layout', 'multiPage', 'pageMinHeight', 'pageWidth', 'customTitles']),
|
|
71
|
-
pageTitle () {
|
|
72
|
-
const pageTitle = this.page && this.page.title
|
|
73
|
-
return this.customTitle || (pageTitle && this.$t(pageTitle)) || this.title || this.routeName
|
|
74
|
-
},
|
|
75
|
-
routeName () {
|
|
76
|
-
const route = this.$route
|
|
77
|
-
return this.$t(getI18nKey(route.matched[route.matched.length - 1].path))
|
|
78
|
-
},
|
|
79
|
-
breadcrumb () {
|
|
80
|
-
const page = this.page
|
|
81
|
-
const breadcrumb = page && page.breadcrumb
|
|
82
|
-
if (breadcrumb) {
|
|
83
|
-
const i18nBreadcrumb = []
|
|
84
|
-
breadcrumb.forEach(item => {
|
|
85
|
-
i18nBreadcrumb.push(this.$t(item))
|
|
86
|
-
})
|
|
87
|
-
return i18nBreadcrumb
|
|
88
|
-
} else {
|
|
89
|
-
return this.getRouteBreadcrumb()
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
marginCorrect () {
|
|
93
|
-
return this.multiPage ? 24 : 0
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
methods: {
|
|
97
|
-
...mapMutations('setting', ['correctPageMinHeight']),
|
|
98
|
-
getRouteBreadcrumb () {
|
|
99
|
-
const routes = this.$route.matched
|
|
100
|
-
const path = this.$route.path
|
|
101
|
-
const breadcrumb = []
|
|
102
|
-
routes.filter(item => path.includes(item.path))
|
|
103
|
-
.forEach(route => {
|
|
104
|
-
const path = route.path.length === 0 ? '/home' : route.path
|
|
105
|
-
breadcrumb.push(this.$t(getI18nKey(path)))
|
|
106
|
-
})
|
|
107
|
-
const pageTitle = this.page && this.page.title
|
|
108
|
-
if (this.customTitle || pageTitle) {
|
|
109
|
-
breadcrumb[breadcrumb.length - 1] = this.customTitle || pageTitle
|
|
110
|
-
}
|
|
111
|
-
return breadcrumb
|
|
112
|
-
},
|
|
113
|
-
/**
|
|
114
|
-
* 用于计算页面内容最小高度
|
|
115
|
-
* @param newHeight
|
|
116
|
-
*/
|
|
117
|
-
updatePageHeight (newHeight = this.$refs.pageHeader.$el.offsetHeight + this.marginCorrect) {
|
|
118
|
-
this.correctPageMinHeight(this.pageHeaderHeight - newHeight)
|
|
119
|
-
this.pageHeaderHeight = newHeight
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
</script>
|
|
124
|
-
|
|
125
|
-
<style lang="less">
|
|
126
|
-
.page-header{
|
|
127
|
-
margin: 0 -24px 0;
|
|
128
|
-
}
|
|
129
|
-
.link{
|
|
130
|
-
/*margin-top: 16px;*/
|
|
131
|
-
line-height: 24px;
|
|
132
|
-
a{
|
|
133
|
-
font-size: 14px;
|
|
134
|
-
margin-right: 32px;
|
|
135
|
-
i{
|
|
136
|
-
font-size: 22px;
|
|
137
|
-
margin-right: 8px;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
.page-content{
|
|
142
|
-
position: relative;
|
|
143
|
-
padding: 24px 0 0;
|
|
144
|
-
&.side{
|
|
145
|
-
}
|
|
146
|
-
&.head.fixed{
|
|
147
|
-
margin: 0 auto;
|
|
148
|
-
max-width: 1400px;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="page-layout">
|
|
3
|
+
<page-header
|
|
4
|
+
ref="pageHeader"
|
|
5
|
+
:style="`margin-top: ${multiPage ? 0 : -24}px`"
|
|
6
|
+
:breadcrumb="breadcrumb"
|
|
7
|
+
:title="pageTitle"
|
|
8
|
+
:logo="logo"
|
|
9
|
+
:avatar="avatar">
|
|
10
|
+
<slot name="action" slot="action"></slot>
|
|
11
|
+
<slot slot="content" name="headerContent"></slot>
|
|
12
|
+
<div slot="content" v-if="!this.$slots.headerContent && desc">
|
|
13
|
+
<p>{{ desc }}</p>
|
|
14
|
+
<div v-if="this.linkList" class="link">
|
|
15
|
+
<template v-for="(link, index) in linkList">
|
|
16
|
+
<a :key="index" :href="link.href"><a-icon :type="link.icon" />{{ link.title }}</a>
|
|
17
|
+
</template>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<slot v-if="this.$slots.extra" slot="extra" name="extra"></slot>
|
|
21
|
+
</page-header>
|
|
22
|
+
<div ref="page" :class="['page-content', layout, pageWidth]" >
|
|
23
|
+
<slot></slot>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import PageHeader from '@vue2-client/components/page/header/PageHeader'
|
|
30
|
+
import { mapState, mapMutations } from 'vuex'
|
|
31
|
+
import { getI18nKey } from '@vue2-client/utils/routerUtil'
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
name: 'PageLayout',
|
|
35
|
+
components: { PageHeader },
|
|
36
|
+
// eslint-disable-next-line vue/require-prop-types
|
|
37
|
+
props: ['desc', 'logo', 'title', 'avatar', 'linkList', 'extraImage'],
|
|
38
|
+
data () {
|
|
39
|
+
return {
|
|
40
|
+
page: {},
|
|
41
|
+
pageHeaderHeight: 0
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
watch: {
|
|
45
|
+
$route () {
|
|
46
|
+
this.page = this.$route.meta.page
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
updated () {
|
|
50
|
+
if (!this._inactive) {
|
|
51
|
+
this.updatePageHeight()
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
activated () {
|
|
55
|
+
this.updatePageHeight()
|
|
56
|
+
},
|
|
57
|
+
deactivated () {
|
|
58
|
+
this.updatePageHeight(0)
|
|
59
|
+
},
|
|
60
|
+
mounted () {
|
|
61
|
+
this.updatePageHeight()
|
|
62
|
+
},
|
|
63
|
+
created () {
|
|
64
|
+
this.page = this.$route.meta.page
|
|
65
|
+
},
|
|
66
|
+
beforeDestroy () {
|
|
67
|
+
this.updatePageHeight(0)
|
|
68
|
+
},
|
|
69
|
+
computed: {
|
|
70
|
+
...mapState('setting', ['layout', 'multiPage', 'pageMinHeight', 'pageWidth', 'customTitles']),
|
|
71
|
+
pageTitle () {
|
|
72
|
+
const pageTitle = this.page && this.page.title
|
|
73
|
+
return this.customTitle || (pageTitle && this.$t(pageTitle)) || this.title || this.routeName
|
|
74
|
+
},
|
|
75
|
+
routeName () {
|
|
76
|
+
const route = this.$route
|
|
77
|
+
return this.$t(getI18nKey(route.matched[route.matched.length - 1].path))
|
|
78
|
+
},
|
|
79
|
+
breadcrumb () {
|
|
80
|
+
const page = this.page
|
|
81
|
+
const breadcrumb = page && page.breadcrumb
|
|
82
|
+
if (breadcrumb) {
|
|
83
|
+
const i18nBreadcrumb = []
|
|
84
|
+
breadcrumb.forEach(item => {
|
|
85
|
+
i18nBreadcrumb.push(this.$t(item))
|
|
86
|
+
})
|
|
87
|
+
return i18nBreadcrumb
|
|
88
|
+
} else {
|
|
89
|
+
return this.getRouteBreadcrumb()
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
marginCorrect () {
|
|
93
|
+
return this.multiPage ? 24 : 0
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
methods: {
|
|
97
|
+
...mapMutations('setting', ['correctPageMinHeight']),
|
|
98
|
+
getRouteBreadcrumb () {
|
|
99
|
+
const routes = this.$route.matched
|
|
100
|
+
const path = this.$route.path
|
|
101
|
+
const breadcrumb = []
|
|
102
|
+
routes.filter(item => path.includes(item.path))
|
|
103
|
+
.forEach(route => {
|
|
104
|
+
const path = route.path.length === 0 ? '/home' : route.path
|
|
105
|
+
breadcrumb.push(this.$t(getI18nKey(path)))
|
|
106
|
+
})
|
|
107
|
+
const pageTitle = this.page && this.page.title
|
|
108
|
+
if (this.customTitle || pageTitle) {
|
|
109
|
+
breadcrumb[breadcrumb.length - 1] = this.customTitle || pageTitle
|
|
110
|
+
}
|
|
111
|
+
return breadcrumb
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* 用于计算页面内容最小高度
|
|
115
|
+
* @param newHeight
|
|
116
|
+
*/
|
|
117
|
+
updatePageHeight (newHeight = this.$refs.pageHeader.$el.offsetHeight + this.marginCorrect) {
|
|
118
|
+
this.correctPageMinHeight(this.pageHeaderHeight - newHeight)
|
|
119
|
+
this.pageHeaderHeight = newHeight
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
<style lang="less">
|
|
126
|
+
.page-header{
|
|
127
|
+
margin: 0 -24px 0;
|
|
128
|
+
}
|
|
129
|
+
.link{
|
|
130
|
+
/*margin-top: 16px;*/
|
|
131
|
+
line-height: 24px;
|
|
132
|
+
a{
|
|
133
|
+
font-size: 14px;
|
|
134
|
+
margin-right: 32px;
|
|
135
|
+
i{
|
|
136
|
+
font-size: 22px;
|
|
137
|
+
margin-right: 8px;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
.page-content{
|
|
142
|
+
position: relative;
|
|
143
|
+
padding: 24px 0 0;
|
|
144
|
+
&.side{
|
|
145
|
+
}
|
|
146
|
+
&.head.fixed{
|
|
147
|
+
margin: 0 auto;
|
|
148
|
+
max-width: 1400px;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
</style>
|