@meethive/components 0.0.3 → 0.0.4
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/es/AutoComplete/AutoComplete.js +71 -80
- package/es/BadgeStatus/Badge.js +38 -47
- package/es/CardSelect/CardSelect.js +115 -137
- package/es/CheckButton/CheckButton.js +102 -118
- package/es/ConfigProvider/ConfigProvider.js +44 -68
- package/es/DragModal/DragModal.js +191 -212
- package/es/EditTable/Body.js +158 -189
- package/es/EditTable/CellRender.js +10 -12
- package/es/EditTable/EditTable.js +385 -434
- package/es/EditTable/FormItem.js +140 -169
- package/es/EditTable/Group.js +171 -204
- package/es/EditTable/Header.js +57 -63
- package/es/EditTable/HeaderRender.js +10 -12
- package/es/EditTable/components/ContextMenu/Menu.js +78 -86
- package/es/EditTable/components/Search/Search.js +151 -163
- package/es/EditTable/components/Search/Sort.js +104 -119
- package/es/Ellipsis/Ellipsis.js +144 -148
- package/es/Empty/Empty.js +51 -57
- package/es/FullPage/FullPage.js +20 -19
- package/es/Icon/Icon.js +42 -49
- package/es/LocaleProvider/LocaleProvider.js +32 -38
- package/es/Markdown/Markdown.js +101 -118
- package/es/PermissionButton/PermissionButton.js +118 -118
- package/es/ProLayout/Basic/BasicLayout.js +301 -418
- package/es/ProLayout/Basic/Header.js +91 -111
- package/es/ProLayout/PageContainer/index.js +267 -344
- package/es/ProLayout/SiderMenu/BaseMenu.js +186 -240
- package/es/ProTable/Alert.js +39 -40
- package/es/ProTable/Content.js +84 -97
- package/es/ProTable/Header.js +32 -33
- package/es/ProTable/Pagination.js +56 -55
- package/es/ProTable/ProTable.js +256 -276
- package/es/RadioButton/RadioButton.js +48 -53
- package/es/Scrollbar/Bar.js +65 -76
- package/es/Scrollbar/Scrollbar.js +129 -161
- package/es/Scrollbar/Thumb.js +101 -150
- package/es/Search/Item.js +208 -236
- package/es/Search/Search.js +90 -90
- package/es/Skeleton/Skeleton.js +26 -27
- package/es/Skeleton/components/DashBoardCard.js +26 -27
- package/es/Skeleton/components/DashBoardChart.js +26 -27
- package/es/Skeleton/components/Detail.js +26 -27
- package/es/Skeleton/components/Drawer.js +26 -27
- package/es/Skeleton/components/Item.js +55 -54
- package/es/Skeleton/components/List.js +29 -27
- package/es/Skeleton/components/ListCard.js +28 -28
- package/es/Skeleton/components/ListCardItem.js +20 -20
- package/es/Skeleton/components/ListTable.js +26 -27
- package/es/Skeleton/components/Page.js +27 -26
- package/es/Skeleton/components/Search.js +16 -16
- package/es/Skeleton/components/Tree.js +26 -27
- package/es/TimeFormat/TimeFormat.js +32 -36
- package/es/Title/Title.js +23 -26
- package/es/ValueItem/ValueItem.js +100 -113
- package/es/VirtualTable/VirtualTable.js +235 -271
- package/lib/AutoComplete/AutoComplete.js +71 -80
- package/lib/BadgeStatus/Badge.js +38 -47
- package/lib/CardSelect/CardSelect.js +115 -137
- package/lib/CheckButton/CheckButton.js +102 -118
- package/lib/ConfigProvider/ConfigProvider.js +44 -68
- package/lib/DragModal/DragModal.js +191 -212
- package/lib/EditTable/Body.js +158 -189
- package/lib/EditTable/CellRender.js +10 -12
- package/lib/EditTable/EditTable.js +385 -434
- package/lib/EditTable/FormItem.js +140 -169
- package/lib/EditTable/Group.js +171 -204
- package/lib/EditTable/Header.js +57 -63
- package/lib/EditTable/HeaderRender.js +10 -12
- package/lib/EditTable/components/ContextMenu/Menu.js +78 -86
- package/lib/EditTable/components/Search/Search.js +151 -163
- package/lib/EditTable/components/Search/Sort.js +104 -119
- package/lib/Ellipsis/Ellipsis.js +144 -148
- package/lib/Empty/Empty.js +51 -57
- package/lib/FullPage/FullPage.js +20 -19
- package/lib/Icon/Icon.js +42 -49
- package/lib/LocaleProvider/LocaleProvider.js +32 -38
- package/lib/Markdown/Markdown.js +101 -118
- package/lib/PermissionButton/PermissionButton.js +118 -118
- package/lib/ProLayout/Basic/BasicLayout.js +301 -418
- package/lib/ProLayout/Basic/Header.js +91 -111
- package/lib/ProLayout/PageContainer/index.js +267 -344
- package/lib/ProLayout/SiderMenu/BaseMenu.js +186 -240
- package/lib/ProTable/Alert.js +39 -40
- package/lib/ProTable/Content.js +84 -97
- package/lib/ProTable/Header.js +32 -33
- package/lib/ProTable/Pagination.js +56 -55
- package/lib/ProTable/ProTable.js +256 -276
- package/lib/RadioButton/RadioButton.js +48 -53
- package/lib/Scrollbar/Bar.js +65 -76
- package/lib/Scrollbar/Scrollbar.js +129 -161
- package/lib/Scrollbar/Thumb.js +101 -150
- package/lib/Search/Item.js +208 -236
- package/lib/Search/Search.js +90 -90
- package/lib/Skeleton/Skeleton.js +26 -27
- package/lib/Skeleton/components/DashBoardCard.js +26 -27
- package/lib/Skeleton/components/DashBoardChart.js +26 -27
- package/lib/Skeleton/components/Detail.js +26 -27
- package/lib/Skeleton/components/Drawer.js +26 -27
- package/lib/Skeleton/components/Item.js +55 -54
- package/lib/Skeleton/components/List.js +29 -27
- package/lib/Skeleton/components/ListCard.js +28 -28
- package/lib/Skeleton/components/ListCardItem.js +20 -20
- package/lib/Skeleton/components/ListTable.js +26 -27
- package/lib/Skeleton/components/Page.js +27 -26
- package/lib/Skeleton/components/Search.js +16 -16
- package/lib/Skeleton/components/Tree.js +26 -27
- package/lib/TimeFormat/TimeFormat.js +32 -36
- package/lib/Title/Title.js +23 -26
- package/lib/ValueItem/ValueItem.js +100 -113
- package/lib/VirtualTable/VirtualTable.js +235 -271
- package/package.json +1 -1
|
@@ -1,354 +1,277 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export const pageHeaderTabConfig = {
|
|
1
|
+
import { defineComponent, computed, toRefs, unref } from 'vue';
|
|
2
|
+
import { withInstall } from 'ant-design-vue/es/_util/type';
|
|
3
|
+
import { Affix, Spin, PageHeader, Tabs, Button } from 'ant-design-vue';
|
|
4
|
+
import { pageHeaderProps } from 'ant-design-vue/es/page-header';
|
|
5
|
+
import { useRouteContext } from '../RouteContext';
|
|
6
|
+
import { getSlotVNode } from '../util';
|
|
7
|
+
import { LayoutType } from '../defaultSettings';
|
|
8
|
+
import { useLocaleReceiver } from '../../LocaleReciver';
|
|
9
|
+
import useProLayoutStyle from '../style';
|
|
10
|
+
export const pageHeaderTabConfig = {
|
|
13
11
|
/**
|
|
14
12
|
* @name tabs 的列表
|
|
15
|
-
*/
|
|
16
|
-
tabList: {
|
|
17
|
-
type: [Object, Function, Array],
|
|
18
|
-
default: () => undefined
|
|
19
|
-
},
|
|
13
|
+
*/
|
|
14
|
+
tabList: {
|
|
15
|
+
type: [Object, Function, Array],
|
|
16
|
+
default: () => undefined
|
|
17
|
+
},
|
|
20
18
|
/**
|
|
21
19
|
* @name 当前选中 tab 的 key
|
|
22
|
-
*/
|
|
23
|
-
tabActiveKey: String,
|
|
20
|
+
*/
|
|
21
|
+
tabActiveKey: String,
|
|
24
22
|
/**
|
|
25
23
|
* @name tab 上多余的区域
|
|
26
|
-
*/
|
|
27
|
-
tabBarExtraContent: {
|
|
28
|
-
type: [Object, Function],
|
|
29
|
-
default: () => undefined
|
|
30
|
-
},
|
|
24
|
+
*/
|
|
25
|
+
tabBarExtraContent: {
|
|
26
|
+
type: [Object, Function],
|
|
27
|
+
default: () => undefined
|
|
28
|
+
},
|
|
31
29
|
/**
|
|
32
30
|
* @name tabs 的其他配置
|
|
33
|
-
*/
|
|
34
|
-
tabProps: {
|
|
35
|
-
type: Object,
|
|
36
|
-
default: () => undefined
|
|
37
|
-
},
|
|
31
|
+
*/
|
|
32
|
+
tabProps: {
|
|
33
|
+
type: Object,
|
|
34
|
+
default: () => undefined
|
|
35
|
+
},
|
|
38
36
|
/**
|
|
39
37
|
* @name 固定 PageHeader 到页面顶部
|
|
40
|
-
*/
|
|
41
|
-
fixedHeader: Boolean,
|
|
42
|
-
// events
|
|
43
|
-
onTabChange: Function,
|
|
44
|
-
pure: Boolean
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
...
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
title
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
[hashId.value]: true,
|
|
281
|
-
[prefixedClassName.value]: true,
|
|
282
|
-
[`${prefixCls}-page-container-ghost`]: ghost.value
|
|
283
|
-
}))
|
|
284
|
-
|
|
285
|
-
const headerDom = computed(() => {
|
|
286
|
-
// const tags = getSlotVNode<DefaultPropRender>(slots, props, 'tags');
|
|
287
|
-
const headerContent = getSlotVNode(slots, props, 'content')
|
|
288
|
-
const extra = getSlotVNode(slots, props, 'extra')
|
|
289
|
-
const extraContent = getSlotVNode(slots, props, 'extraContent')
|
|
290
|
-
const subTitle = getSlotVNode(slots, props, 'subTitle')
|
|
291
|
-
const title = getSlotVNode(slots, props, 'title')
|
|
292
|
-
// @ts-ignore
|
|
293
|
-
return (
|
|
294
|
-
React.createElement(ProPageHeader, {
|
|
295
|
-
...props,
|
|
296
|
-
prefixCls: undefined,
|
|
297
|
-
prefixedClassName: prefixedClassName.value,
|
|
298
|
-
ghost: ghost.value,
|
|
299
|
-
title: title,
|
|
300
|
-
subTitle: subTitle,
|
|
301
|
-
content: headerContent,
|
|
302
|
-
extra: extra,
|
|
303
|
-
extraContent: extraContent,}
|
|
304
|
-
)
|
|
305
|
-
)
|
|
306
|
-
})
|
|
307
|
-
|
|
308
|
-
return () => {
|
|
309
|
-
const { fixedHeader, pure } = props
|
|
310
|
-
|
|
311
|
-
return (
|
|
312
|
-
React.createElement(React.Fragment, null
|
|
313
|
-
, pure ? (
|
|
314
|
-
React.createElement('div', { class: classNames.value,}
|
|
315
|
-
, _optionalChain([slots, 'access', _4 => _4.default, 'optionalCall', _5 => _5()])
|
|
316
|
-
)
|
|
317
|
-
) : (
|
|
318
|
-
React.createElement('div', { class: classNames.value, style: { ...(attrs.style || {}) },}
|
|
319
|
-
, fixedHeader && headerDom.value ? (
|
|
320
|
-
React.createElement(Affix, {
|
|
321
|
-
...affixProps.value,
|
|
322
|
-
offsetTop: (value ).hasHeader && (value ).fixedHeader ? (value ).headerHeight : 0,}
|
|
323
|
-
|
|
324
|
-
, headerDom.value
|
|
325
|
-
)
|
|
326
|
-
) : (
|
|
327
|
-
headerDom.value
|
|
328
|
-
)
|
|
329
|
-
, React.createElement('div', { class: `${prefixedClassName.value}-grid-content`,}
|
|
330
|
-
, loading.value ? (
|
|
331
|
-
React.createElement(Spin, null )
|
|
332
|
-
) : slots.default ? (
|
|
333
|
-
React.createElement('div', null
|
|
334
|
-
, React.createElement('div', {
|
|
335
|
-
class: `${prefixedClassName.value}-children-content ${childrenFullHeight.value ? 'children-full-height' : ''} ${hashId.value}`,
|
|
336
|
-
style: { ...(props.contentStyle || {}) },}
|
|
337
|
-
|
|
338
|
-
, slots.default()
|
|
339
|
-
)
|
|
340
|
-
, (value ).hasFooterToolbar && (
|
|
341
|
-
React.createElement('div', { style: { height: 48, marginTop: 24 },} )
|
|
342
|
-
)
|
|
343
|
-
)
|
|
344
|
-
) : null
|
|
345
|
-
)
|
|
346
|
-
)
|
|
347
|
-
)
|
|
348
|
-
)
|
|
349
|
-
)
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
})
|
|
353
|
-
|
|
354
|
-
export default withInstall(PageContainer)
|
|
38
|
+
*/
|
|
39
|
+
fixedHeader: Boolean,
|
|
40
|
+
// events
|
|
41
|
+
onTabChange: Function,
|
|
42
|
+
pure: Boolean
|
|
43
|
+
};
|
|
44
|
+
export const pageContainerProps = {
|
|
45
|
+
...pageHeaderTabConfig,
|
|
46
|
+
...pageHeaderProps,
|
|
47
|
+
prefixCls: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: 'ant-pro'
|
|
50
|
+
},
|
|
51
|
+
title: {
|
|
52
|
+
type: [Object, String, Boolean, Function],
|
|
53
|
+
default: () => null
|
|
54
|
+
},
|
|
55
|
+
subTitle: {
|
|
56
|
+
type: [Object, String, Boolean, Function],
|
|
57
|
+
default: () => null
|
|
58
|
+
},
|
|
59
|
+
content: {
|
|
60
|
+
type: [Object, String, Boolean, Function],
|
|
61
|
+
default: () => null
|
|
62
|
+
},
|
|
63
|
+
extra: {
|
|
64
|
+
type: [Object, String, Boolean, Function],
|
|
65
|
+
default: () => null
|
|
66
|
+
},
|
|
67
|
+
extraContent: {
|
|
68
|
+
type: [Object, String, Boolean, Function],
|
|
69
|
+
default: () => null
|
|
70
|
+
},
|
|
71
|
+
header: {
|
|
72
|
+
type: [Object, String, Boolean, Function],
|
|
73
|
+
default: () => null
|
|
74
|
+
},
|
|
75
|
+
pageHeaderRender: {
|
|
76
|
+
type: [Object, Function, Boolean],
|
|
77
|
+
default: () => undefined
|
|
78
|
+
},
|
|
79
|
+
affixProps: {
|
|
80
|
+
type: [Object, Function]
|
|
81
|
+
},
|
|
82
|
+
ghost: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: () => false
|
|
85
|
+
},
|
|
86
|
+
loading: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: () => undefined
|
|
89
|
+
},
|
|
90
|
+
childrenFullHeight: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: () => true
|
|
93
|
+
},
|
|
94
|
+
pure: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false
|
|
97
|
+
},
|
|
98
|
+
showBack: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: false
|
|
101
|
+
},
|
|
102
|
+
contentStyle: {
|
|
103
|
+
type: Object,
|
|
104
|
+
default: () => ({})
|
|
105
|
+
},
|
|
106
|
+
onBack: {
|
|
107
|
+
type: Function
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const renderFooter = props => {
|
|
111
|
+
const {
|
|
112
|
+
tabList,
|
|
113
|
+
tabActiveKey,
|
|
114
|
+
onTabChange,
|
|
115
|
+
tabBarExtraContent,
|
|
116
|
+
tabProps
|
|
117
|
+
} = props;
|
|
118
|
+
const tabPane = item => {
|
|
119
|
+
return <span class={item.class || `tab-pane-${item.key}`}>{item.tab}</span>;
|
|
120
|
+
};
|
|
121
|
+
if (tabList && tabList.length) {
|
|
122
|
+
return <Tabs class="page-container-tabs" activeKey={tabActiveKey} onChange={key => {
|
|
123
|
+
if (onTabChange) {
|
|
124
|
+
onTabChange(key);
|
|
125
|
+
}
|
|
126
|
+
}} tabBarExtraContent={tabBarExtraContent} {...tabProps}>
|
|
127
|
+
{tabList.map(item => <Tabs.TabPane {...item} tab={tabPane(item)} key={item.key} />)}
|
|
128
|
+
</Tabs>;
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
};
|
|
132
|
+
const renderPageHeader = (content, extraContent, prefixedClassName) => {
|
|
133
|
+
if (!content && !extraContent) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
return <div class={`${prefixedClassName}-detail`}>
|
|
137
|
+
<div class={`${prefixedClassName}-main`}>
|
|
138
|
+
<div class={`${prefixedClassName}-row`}>
|
|
139
|
+
{content && <div class={`${prefixedClassName}-content`}>
|
|
140
|
+
{typeof content === 'function' && content() || content}
|
|
141
|
+
</div>}
|
|
142
|
+
{extraContent && <div class={`${prefixedClassName}-extraContent`}>
|
|
143
|
+
{typeof extraContent === 'function' && extraContent() || extraContent}
|
|
144
|
+
</div>}
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</div>;
|
|
148
|
+
};
|
|
149
|
+
const ProPageHeader = props => {
|
|
150
|
+
const {
|
|
151
|
+
title,
|
|
152
|
+
tabList,
|
|
153
|
+
tabActiveKey,
|
|
154
|
+
content,
|
|
155
|
+
pageHeaderRender,
|
|
156
|
+
header,
|
|
157
|
+
extraContent,
|
|
158
|
+
prefixedClassName,
|
|
159
|
+
prefixCls,
|
|
160
|
+
fixedHeader: _,
|
|
161
|
+
showBack,
|
|
162
|
+
onBack,
|
|
163
|
+
...restProps
|
|
164
|
+
} = props;
|
|
165
|
+
const value = useRouteContext();
|
|
166
|
+
const [contextLocale] = useLocaleReceiver('ProLayout');
|
|
167
|
+
if (pageHeaderRender === false) {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
if (pageHeaderRender) {
|
|
171
|
+
return pageHeaderRender({
|
|
172
|
+
...props
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
let pageHeaderTitle = title;
|
|
176
|
+
if (!title && title !== false) {
|
|
177
|
+
pageHeaderTitle = value.title;
|
|
178
|
+
}
|
|
179
|
+
const unrefBreadcrumb = unref(value.breadcrumb || {});
|
|
180
|
+
const breadcrumb = props.breadcrumb || {
|
|
181
|
+
...unrefBreadcrumb,
|
|
182
|
+
routes: unrefBreadcrumb.routes,
|
|
183
|
+
itemRender: unrefBreadcrumb.itemRender
|
|
184
|
+
};
|
|
185
|
+
const backProps = {};
|
|
186
|
+
if (showBack) {
|
|
187
|
+
// @ts-ignore
|
|
188
|
+
backProps.backIcon = <Button>{contextLocale.value.pageContainer.back}</Button>;
|
|
189
|
+
backProps.onBack = () => {
|
|
190
|
+
if (props.onBack) {
|
|
191
|
+
props.onBack();
|
|
192
|
+
} else {
|
|
193
|
+
value.back?.();
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
const styles = value.layoutType === LayoutType.CARD ? {
|
|
198
|
+
padding: props.extra || props.subTitle || pageHeaderTitle || tabList || props.extraContent || props.showBack || props.title ? '16px 24px' : '0px'
|
|
199
|
+
} : {};
|
|
200
|
+
return <div class={`${prefixedClassName}-wrap`}>
|
|
201
|
+
<PageHeader style={styles} {...backProps} {...restProps} title={pageHeaderTitle} breadcrumb={value.layoutType === LayoutType.LIST ? breadcrumb : null} footer={renderFooter({
|
|
202
|
+
...restProps,
|
|
203
|
+
tabList,
|
|
204
|
+
tabActiveKey
|
|
205
|
+
})} prefixCls={prefixCls}>
|
|
206
|
+
{header || renderPageHeader(content, extraContent, prefixedClassName)}
|
|
207
|
+
</PageHeader>
|
|
208
|
+
</div>;
|
|
209
|
+
};
|
|
210
|
+
const PageContainer = defineComponent({
|
|
211
|
+
name: 'JPageContainer',
|
|
212
|
+
inheritAttrs: false,
|
|
213
|
+
props: pageContainerProps,
|
|
214
|
+
setup(props, {
|
|
215
|
+
slots,
|
|
216
|
+
attrs
|
|
217
|
+
}) {
|
|
218
|
+
const {
|
|
219
|
+
loading,
|
|
220
|
+
affixProps,
|
|
221
|
+
ghost,
|
|
222
|
+
childrenFullHeight
|
|
223
|
+
} = toRefs(props);
|
|
224
|
+
const value = useRouteContext();
|
|
225
|
+
const getPrefixCls = value.getPrefixCls;
|
|
226
|
+
const prefixCls = props.prefixCls || getPrefixCls();
|
|
227
|
+
const stylePrefixCls = computed(() => 'pro-layout');
|
|
228
|
+
const [wrapSSR, hashId] = useProLayoutStyle(stylePrefixCls);
|
|
229
|
+
const prefixedClassName = computed(() => `${prefixCls}-page-container`);
|
|
230
|
+
const classNames = computed(() => ({
|
|
231
|
+
[hashId.value]: true,
|
|
232
|
+
[prefixedClassName.value]: true,
|
|
233
|
+
[`${prefixCls}-page-container-ghost`]: ghost.value
|
|
234
|
+
}));
|
|
235
|
+
const headerDom = computed(() => {
|
|
236
|
+
// const tags = getSlotVNode<DefaultPropRender>(slots, props, 'tags');
|
|
237
|
+
const headerContent = getSlotVNode(slots, props, 'content');
|
|
238
|
+
const extra = getSlotVNode(slots, props, 'extra');
|
|
239
|
+
const extraContent = getSlotVNode(slots, props, 'extraContent');
|
|
240
|
+
const subTitle = getSlotVNode(slots, props, 'subTitle');
|
|
241
|
+
const title = getSlotVNode(slots, props, 'title');
|
|
242
|
+
// @ts-ignore
|
|
243
|
+
return <ProPageHeader {...props} prefixCls={undefined} prefixedClassName={prefixedClassName.value} ghost={ghost.value} title={title} subTitle={subTitle} content={headerContent} extra={extra} extraContent={extraContent} />;
|
|
244
|
+
});
|
|
245
|
+
return () => {
|
|
246
|
+
const {
|
|
247
|
+
fixedHeader,
|
|
248
|
+
pure
|
|
249
|
+
} = props;
|
|
250
|
+
return <>
|
|
251
|
+
{pure ? <div class={classNames.value}>
|
|
252
|
+
{slots.default?.()}
|
|
253
|
+
</div> : <div class={classNames.value} style={{
|
|
254
|
+
...(attrs.style || {})
|
|
255
|
+
}}>
|
|
256
|
+
{fixedHeader && headerDom.value ? <Affix {...affixProps.value} offsetTop={value.hasHeader && value.fixedHeader ? value.headerHeight : 0}>
|
|
257
|
+
{headerDom.value}
|
|
258
|
+
</Affix> : headerDom.value}
|
|
259
|
+
<div class={`${prefixedClassName.value}-grid-content`}>
|
|
260
|
+
{loading.value ? <Spin /> : slots.default ? <div>
|
|
261
|
+
<div class={`${prefixedClassName.value}-children-content ${childrenFullHeight.value ? 'children-full-height' : ''} ${hashId.value}`} style={{
|
|
262
|
+
...(props.contentStyle || {})
|
|
263
|
+
}}>
|
|
264
|
+
{slots.default()}
|
|
265
|
+
</div>
|
|
266
|
+
{value.hasFooterToolbar && <div style={{
|
|
267
|
+
height: 48,
|
|
268
|
+
marginTop: 24
|
|
269
|
+
}} />}
|
|
270
|
+
</div> : null}
|
|
271
|
+
</div>
|
|
272
|
+
</div>}
|
|
273
|
+
</>;
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
export default withInstall(PageContainer);
|