jianghu-ui 1.0.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 +376 -0
- package/dist/jianghu-ui.css +2318 -0
- package/dist/jianghu-ui.js +2 -0
- package/dist/jianghu-ui.js.LICENSE.txt +1 -0
- package/package.json +56 -0
- package/src/Design.stories.mdx +195 -0
- package/src/Introduction.stories.mdx +148 -0
- package/src/components/JhAddressSelect/JhAddressSelect.md +250 -0
- package/src/components/JhAddressSelect/JhAddressSelect.stories.js +282 -0
- package/src/components/JhAddressSelect/JhAddressSelect.vue +261 -0
- package/src/components/JhCard/JhCard.md +246 -0
- package/src/components/JhCard/JhCard.stories.js +688 -0
- package/src/components/JhCard/JhCard.vue +604 -0
- package/src/components/JhCheckCard/JhCheckCard.md +245 -0
- package/src/components/JhCheckCard/JhCheckCard.stories.js +750 -0
- package/src/components/JhCheckCard/JhCheckCard.vue +476 -0
- package/src/components/JhConfirmDialog/JhConfirmDialog.md +70 -0
- package/src/components/JhConfirmDialog/JhConfirmDialog.stories.js +550 -0
- package/src/components/JhConfirmDialog/JhConfirmDialog.vue +181 -0
- package/src/components/JhDateRangePicker/JhDateRangePicker.md +56 -0
- package/src/components/JhDateRangePicker/JhDateRangePicker.stories.js +320 -0
- package/src/components/JhDateRangePicker/JhDateRangePicker.vue +307 -0
- package/src/components/JhDescriptions/JhDescriptions.md +724 -0
- package/src/components/JhDescriptions/JhDescriptions.stories.js +858 -0
- package/src/components/JhDescriptions/JhDescriptions.vue +933 -0
- package/src/components/JhDraggable/JhDraggable.md +66 -0
- package/src/components/JhDraggable/JhDraggable.stories.js +161 -0
- package/src/components/JhDraggable/JhDraggable.vue +254 -0
- package/src/components/JhDrawer/JhDrawer.md +68 -0
- package/src/components/JhDrawer/JhDrawer.stories.js +478 -0
- package/src/components/JhDrawer/JhDrawer.vue +281 -0
- package/src/components/JhDrawerForm/JhDrawerForm.md +69 -0
- package/src/components/JhDrawerForm/JhDrawerForm.stories.js +492 -0
- package/src/components/JhDrawerForm/JhDrawerForm.vue +297 -0
- package/src/components/JhEditableTable/JhEditableTable.md +507 -0
- package/src/components/JhEditableTable/JhEditableTable.stories.js +615 -0
- package/src/components/JhEditableTable/JhEditableTable.vue +685 -0
- package/src/components/JhFileInput/JhFileInput.md +56 -0
- package/src/components/JhFileInput/JhFileInput.stories.js +103 -0
- package/src/components/JhFileInput/JhFileInput.vue +253 -0
- package/src/components/JhForm/JhForm.md +676 -0
- package/src/components/JhForm/JhForm.stories.js +1375 -0
- package/src/components/JhForm/JhForm.vue +657 -0
- package/src/components/JhFormField/JhFormField.stories.js +217 -0
- package/src/components/JhFormField/JhFormField.vue +439 -0
- package/src/components/JhFormFields/JhFormFields.md +647 -0
- package/src/components/JhFormFields/JhFormFields.stories.js +922 -0
- package/src/components/JhFormFields/JhFormFields.vue +998 -0
- package/src/components/JhFormList/JhFormList.md +303 -0
- package/src/components/JhFormList/JhFormList.stories.js +661 -0
- package/src/components/JhFormList/JhFormList.vue +1127 -0
- package/src/components/JhJsonEditor/JhJsonEditor.md +54 -0
- package/src/components/JhJsonEditor/JhJsonEditor.stories.js +157 -0
- package/src/components/JhJsonEditor/JhJsonEditor.vue +178 -0
- package/src/components/JhLayout/JhLayout.md +580 -0
- package/src/components/JhLayout/JhLayout.stories.js +414 -0
- package/src/components/JhLayout/JhLayout.vue +387 -0
- package/src/components/JhList/JhList.md +441 -0
- package/src/components/JhList/JhList.stories.js +524 -0
- package/src/components/JhList/JhList.vue +571 -0
- package/src/components/JhMarkdownEditor/JhMarkdownEditor.md +56 -0
- package/src/components/JhMarkdownEditor/JhMarkdownEditor.stories.js +191 -0
- package/src/components/JhMarkdownEditor/JhMarkdownEditor.vue +188 -0
- package/src/components/JhMask/JhMask.md +62 -0
- package/src/components/JhMask/JhMask.stories.js +270 -0
- package/src/components/JhMask/JhMask.vue +123 -0
- package/src/components/JhMenu/JhMenu.md +85 -0
- package/src/components/JhMenu/JhMenu.stories.js +384 -0
- package/src/components/JhMenu/JhMenu.vue +545 -0
- package/src/components/JhModal/JhModal.md +68 -0
- package/src/components/JhModal/JhModal.stories.js +562 -0
- package/src/components/JhModal/JhModal.vue +235 -0
- package/src/components/JhModalForm/JhModalForm.md +69 -0
- package/src/components/JhModalForm/JhModalForm.stories.js +592 -0
- package/src/components/JhModalForm/JhModalForm.vue +298 -0
- package/src/components/JhPageContainer/JhPageContainer.md +409 -0
- package/src/components/JhPageContainer/JhPageContainer.stories.js +209 -0
- package/src/components/JhPageContainer/JhPageContainer.vue +72 -0
- package/src/components/JhQueryFilter/JhQueryFilter.md +77 -0
- package/src/components/JhQueryFilter/JhQueryFilter.stories.js +684 -0
- package/src/components/JhQueryFilter/JhQueryFilter.vue +429 -0
- package/src/components/JhScene/JhScene.md +64 -0
- package/src/components/JhScene/JhScene.stories.js +317 -0
- package/src/components/JhScene/JhScene.vue +376 -0
- package/src/components/JhStatisticCard/JhStatisticCard.md +363 -0
- package/src/components/JhStatisticCard/JhStatisticCard.stories.js +847 -0
- package/src/components/JhStatisticCard/JhStatisticCard.vue +459 -0
- package/src/components/JhStepsForm/JhStepsForm.md +666 -0
- package/src/components/JhStepsForm/JhStepsForm.stories.js +1224 -0
- package/src/components/JhStepsForm/JhStepsForm.vue +749 -0
- package/src/components/JhTable/JhTable.md +730 -0
- package/src/components/JhTable/JhTable.stories.js +1444 -0
- package/src/components/JhTable/JhTable.vue +2298 -0
- package/src/components/JhTableAttachment/JhTableAttachment.md +70 -0
- package/src/components/JhTableAttachment/JhTableAttachment.stories.js +198 -0
- package/src/components/JhTableAttachment/JhTableAttachment.vue +264 -0
- package/src/components/JhToast/JhToast.md +67 -0
- package/src/components/JhToast/JhToast.stories.js +386 -0
- package/src/components/JhToast/JhToast.vue +239 -0
- package/src/components/JhTreeSelect/JhTreeSelect.md +82 -0
- package/src/components/JhTreeSelect/JhTreeSelect.stories.js +391 -0
- package/src/components/JhTreeSelect/JhTreeSelect.vue +727 -0
- package/src/components/JhWaterMark/JhWaterMark.md +190 -0
- package/src/components/JhWaterMark/JhWaterMark.stories.js +675 -0
- package/src/components/JhWaterMark/JhWaterMark.vue +351 -0
- package/src/components/README.md +52 -0
- package/src/index.js +135 -0
- package/src/style/globalCSSJHV4.css +348 -0
- package/src/style/globalCSSVuetifyV4.css +637 -0
- package/src/style/storybook.css +4 -0
- package/src/tailwind.css +3 -0
- package/src/utils/vuetify.js +31 -0
|
@@ -0,0 +1,688 @@
|
|
|
1
|
+
import JhCard from './JhCard.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: '布局/JhCard - 高级卡片',
|
|
5
|
+
component: JhCard,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: '高级卡片组件,参考 Ant Design ProCard 设计规范。支持标题、提示、操作项、分栏布局、栅格布局、标签页等多种功能。',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
title: {
|
|
16
|
+
control: 'text',
|
|
17
|
+
description: '卡片标题',
|
|
18
|
+
table: {
|
|
19
|
+
type: { summary: 'string' },
|
|
20
|
+
defaultValue: { summary: '' },
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
tooltip: {
|
|
24
|
+
control: 'text',
|
|
25
|
+
description: '标题旁边的提示信息',
|
|
26
|
+
table: {
|
|
27
|
+
type: { summary: 'string' },
|
|
28
|
+
defaultValue: { summary: '' },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
extra: {
|
|
32
|
+
control: 'text',
|
|
33
|
+
description: '右上角额外内容',
|
|
34
|
+
table: {
|
|
35
|
+
type: { summary: 'string' },
|
|
36
|
+
defaultValue: { summary: '' },
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
bordered: {
|
|
40
|
+
control: 'boolean',
|
|
41
|
+
description: '是否有边框',
|
|
42
|
+
table: {
|
|
43
|
+
type: { summary: 'boolean' },
|
|
44
|
+
defaultValue: { summary: 'true' },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
headerBordered: {
|
|
48
|
+
control: 'boolean',
|
|
49
|
+
description: '标题和内容之间是否有分割线',
|
|
50
|
+
table: {
|
|
51
|
+
type: { summary: 'boolean' },
|
|
52
|
+
defaultValue: { summary: 'false' },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
ghost: {
|
|
56
|
+
control: 'boolean',
|
|
57
|
+
description: '幽灵模式,即是否取消卡片内容区域的 padding 和卡片的背景颜色',
|
|
58
|
+
table: {
|
|
59
|
+
type: { summary: 'boolean' },
|
|
60
|
+
defaultValue: { summary: 'false' },
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
collapsible: {
|
|
64
|
+
control: 'boolean',
|
|
65
|
+
description: '是否可折叠',
|
|
66
|
+
table: {
|
|
67
|
+
type: { summary: 'boolean' },
|
|
68
|
+
defaultValue: { summary: 'false' },
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
size: {
|
|
72
|
+
control: { type: 'select' },
|
|
73
|
+
options: ['default', 'small'],
|
|
74
|
+
description: '卡片尺寸',
|
|
75
|
+
table: {
|
|
76
|
+
type: { summary: 'string' },
|
|
77
|
+
defaultValue: { summary: 'default' },
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
loading: {
|
|
81
|
+
control: 'boolean',
|
|
82
|
+
description: '加载状态',
|
|
83
|
+
table: {
|
|
84
|
+
type: { summary: 'boolean' },
|
|
85
|
+
defaultValue: { summary: 'false' },
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
layout: {
|
|
89
|
+
control: { type: 'select' },
|
|
90
|
+
options: ['default', 'center'],
|
|
91
|
+
description: '布局方式',
|
|
92
|
+
table: {
|
|
93
|
+
type: { summary: 'string' },
|
|
94
|
+
defaultValue: { summary: 'default' },
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
direction: {
|
|
98
|
+
control: { type: 'select' },
|
|
99
|
+
options: ['row', 'column'],
|
|
100
|
+
description: 'Flex 方向',
|
|
101
|
+
table: {
|
|
102
|
+
type: { summary: 'string' },
|
|
103
|
+
defaultValue: { summary: 'column' },
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
split: {
|
|
107
|
+
control: { type: 'select' },
|
|
108
|
+
options: ['', 'vertical', 'horizontal'],
|
|
109
|
+
description: '分栏模式',
|
|
110
|
+
table: {
|
|
111
|
+
type: { summary: 'string' },
|
|
112
|
+
defaultValue: { summary: '' },
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
hoverable: {
|
|
116
|
+
control: 'boolean',
|
|
117
|
+
description: '鼠标悬浮时是否有阴影效果',
|
|
118
|
+
table: {
|
|
119
|
+
type: { summary: 'boolean' },
|
|
120
|
+
defaultValue: { summary: 'false' },
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// 基础用法
|
|
127
|
+
export const Basic = {
|
|
128
|
+
render: (args) => ({
|
|
129
|
+
components: { JhCard },
|
|
130
|
+
setup() {
|
|
131
|
+
return { args };
|
|
132
|
+
},
|
|
133
|
+
template: `
|
|
134
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
135
|
+
<jh-card
|
|
136
|
+
v-bind="args"
|
|
137
|
+
title="默认尺寸"
|
|
138
|
+
tooltip="这是提示"
|
|
139
|
+
extra="extra"
|
|
140
|
+
style="max-width: 400px;"
|
|
141
|
+
>
|
|
142
|
+
<div>Card content</div>
|
|
143
|
+
<div>Card content</div>
|
|
144
|
+
<div>Card content</div>
|
|
145
|
+
</jh-card>
|
|
146
|
+
</div>
|
|
147
|
+
`,
|
|
148
|
+
}),
|
|
149
|
+
parameters: {
|
|
150
|
+
docs: {
|
|
151
|
+
description: {
|
|
152
|
+
story: '基础卡片,包含标题、提示信息和额外内容。',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// 小尺寸卡片
|
|
159
|
+
export const SmallSize = {
|
|
160
|
+
render: () => ({
|
|
161
|
+
components: { JhCard },
|
|
162
|
+
template: `
|
|
163
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
164
|
+
<jh-card
|
|
165
|
+
title="小尺寸卡片"
|
|
166
|
+
tooltip="这是提示"
|
|
167
|
+
extra="extra"
|
|
168
|
+
size="small"
|
|
169
|
+
style="max-width: 400px;"
|
|
170
|
+
>
|
|
171
|
+
<div>Card content</div>
|
|
172
|
+
<div>Card content</div>
|
|
173
|
+
<div>Card content</div>
|
|
174
|
+
</jh-card>
|
|
175
|
+
</div>
|
|
176
|
+
`,
|
|
177
|
+
}),
|
|
178
|
+
parameters: {
|
|
179
|
+
docs: {
|
|
180
|
+
description: {
|
|
181
|
+
story: '小尺寸卡片,适合紧凑布局。',
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// 带分割线的标题
|
|
188
|
+
export const HeaderBordered = {
|
|
189
|
+
render: () => ({
|
|
190
|
+
components: { JhCard },
|
|
191
|
+
template: `
|
|
192
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
193
|
+
<jh-card
|
|
194
|
+
title="带分割线的标题"
|
|
195
|
+
extra="2024年11月9日"
|
|
196
|
+
header-bordered
|
|
197
|
+
style="max-width: 400px;"
|
|
198
|
+
>
|
|
199
|
+
<div>Card content</div>
|
|
200
|
+
<div>Card content</div>
|
|
201
|
+
<div>Card content</div>
|
|
202
|
+
</jh-card>
|
|
203
|
+
</div>
|
|
204
|
+
`,
|
|
205
|
+
}),
|
|
206
|
+
parameters: {
|
|
207
|
+
docs: {
|
|
208
|
+
description: {
|
|
209
|
+
story: '标题和内容之间有分割线。',
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
// 可折叠卡片
|
|
216
|
+
export const Collapsible = {
|
|
217
|
+
render: () => ({
|
|
218
|
+
components: { JhCard },
|
|
219
|
+
template: `
|
|
220
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
221
|
+
<jh-card
|
|
222
|
+
title="可折叠卡片"
|
|
223
|
+
collapsible
|
|
224
|
+
style="max-width: 400px;"
|
|
225
|
+
>
|
|
226
|
+
<div>Card content</div>
|
|
227
|
+
<div>Card content</div>
|
|
228
|
+
<div>Card content</div>
|
|
229
|
+
</jh-card>
|
|
230
|
+
</div>
|
|
231
|
+
`,
|
|
232
|
+
}),
|
|
233
|
+
parameters: {
|
|
234
|
+
docs: {
|
|
235
|
+
description: {
|
|
236
|
+
story: '可以折叠的卡片,点击右上角按钮展开/收起。',
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// 加载状态
|
|
243
|
+
export const Loading = {
|
|
244
|
+
render: () => ({
|
|
245
|
+
components: { JhCard },
|
|
246
|
+
template: `
|
|
247
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
248
|
+
<jh-card
|
|
249
|
+
title="加载中"
|
|
250
|
+
loading
|
|
251
|
+
style="max-width: 400px; min-height: 200px;"
|
|
252
|
+
>
|
|
253
|
+
<div>Card content</div>
|
|
254
|
+
</jh-card>
|
|
255
|
+
</div>
|
|
256
|
+
`,
|
|
257
|
+
}),
|
|
258
|
+
parameters: {
|
|
259
|
+
docs: {
|
|
260
|
+
description: {
|
|
261
|
+
story: '显示加载状态的卡片。',
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
// 操作项
|
|
268
|
+
export const WithActions = {
|
|
269
|
+
render: () => ({
|
|
270
|
+
components: { JhCard },
|
|
271
|
+
data() {
|
|
272
|
+
return {
|
|
273
|
+
actions: [
|
|
274
|
+
{ icon: 'mdi-cog', text: '设置', onClick: () => alert('设置') },
|
|
275
|
+
{ icon: 'mdi-pencil', text: '编辑', onClick: () => alert('编辑') },
|
|
276
|
+
{ icon: 'mdi-dots-horizontal', text: '更多', onClick: () => alert('更多') },
|
|
277
|
+
],
|
|
278
|
+
};
|
|
279
|
+
},
|
|
280
|
+
template: `
|
|
281
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
282
|
+
<jh-card
|
|
283
|
+
title="Actions 操作项"
|
|
284
|
+
:actions="actions"
|
|
285
|
+
style="max-width: 400px;"
|
|
286
|
+
>
|
|
287
|
+
<div>Card content</div>
|
|
288
|
+
<div>Card content</div>
|
|
289
|
+
<div>Card content</div>
|
|
290
|
+
</jh-card>
|
|
291
|
+
</div>
|
|
292
|
+
`,
|
|
293
|
+
}),
|
|
294
|
+
parameters: {
|
|
295
|
+
docs: {
|
|
296
|
+
description: {
|
|
297
|
+
story: '底部带操作项的卡片,操作项之间自动有分割线。',
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
// 无边框
|
|
304
|
+
export const NoBorder = {
|
|
305
|
+
render: () => ({
|
|
306
|
+
components: { JhCard },
|
|
307
|
+
template: `
|
|
308
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
309
|
+
<jh-card
|
|
310
|
+
title="无边框卡片"
|
|
311
|
+
:bordered="false"
|
|
312
|
+
style="max-width: 400px;"
|
|
313
|
+
>
|
|
314
|
+
<div>Card content</div>
|
|
315
|
+
<div>Card content</div>
|
|
316
|
+
<div>Card content</div>
|
|
317
|
+
</jh-card>
|
|
318
|
+
</div>
|
|
319
|
+
`,
|
|
320
|
+
}),
|
|
321
|
+
parameters: {
|
|
322
|
+
docs: {
|
|
323
|
+
description: {
|
|
324
|
+
story: '没有边框的卡片。',
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
// 幽灵模式
|
|
331
|
+
export const Ghost = {
|
|
332
|
+
render: () => ({
|
|
333
|
+
components: { JhCard },
|
|
334
|
+
template: `
|
|
335
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
336
|
+
<jh-card
|
|
337
|
+
title="幽灵模式卡片"
|
|
338
|
+
ghost
|
|
339
|
+
style="max-width: 400px;"
|
|
340
|
+
>
|
|
341
|
+
<div>Card content</div>
|
|
342
|
+
<div>Card content</div>
|
|
343
|
+
<div>Card content</div>
|
|
344
|
+
</jh-card>
|
|
345
|
+
</div>
|
|
346
|
+
`,
|
|
347
|
+
}),
|
|
348
|
+
parameters: {
|
|
349
|
+
docs: {
|
|
350
|
+
description: {
|
|
351
|
+
story: '幽灵模式,取消背景色和 padding,适合页面布局。',
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
// 悬浮效果
|
|
358
|
+
export const Hoverable = {
|
|
359
|
+
render: () => ({
|
|
360
|
+
components: { JhCard },
|
|
361
|
+
template: `
|
|
362
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
363
|
+
<jh-card
|
|
364
|
+
title="悬浮效果"
|
|
365
|
+
hoverable
|
|
366
|
+
style="max-width: 400px;"
|
|
367
|
+
>
|
|
368
|
+
<div>鼠标悬浮时会有阴影效果</div>
|
|
369
|
+
<div>Card content</div>
|
|
370
|
+
<div>Card content</div>
|
|
371
|
+
</jh-card>
|
|
372
|
+
</div>
|
|
373
|
+
`,
|
|
374
|
+
}),
|
|
375
|
+
parameters: {
|
|
376
|
+
docs: {
|
|
377
|
+
description: {
|
|
378
|
+
story: '鼠标悬浮时显示阴影效果。',
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
// 内容居中
|
|
385
|
+
export const CenterLayout = {
|
|
386
|
+
render: () => ({
|
|
387
|
+
components: { JhCard },
|
|
388
|
+
template: `
|
|
389
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
390
|
+
<jh-card
|
|
391
|
+
layout="center"
|
|
392
|
+
bordered
|
|
393
|
+
style="max-width: 400px; min-height: 200px;"
|
|
394
|
+
>
|
|
395
|
+
<div>内容居中显示</div>
|
|
396
|
+
</jh-card>
|
|
397
|
+
</div>
|
|
398
|
+
`,
|
|
399
|
+
}),
|
|
400
|
+
parameters: {
|
|
401
|
+
docs: {
|
|
402
|
+
description: {
|
|
403
|
+
story: '内容上下左右居中显示。',
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
// 栅格布局
|
|
410
|
+
export const GridLayout = {
|
|
411
|
+
render: () => ({
|
|
412
|
+
components: { JhCard },
|
|
413
|
+
template: `
|
|
414
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
415
|
+
<jh-card direction="column" ghost :gutter="[0, 8]">
|
|
416
|
+
<jh-card layout="center" bordered>
|
|
417
|
+
colSpan - 24
|
|
418
|
+
</jh-card>
|
|
419
|
+
<jh-card :col-span="12" layout="center" bordered>
|
|
420
|
+
colSpan - 12
|
|
421
|
+
</jh-card>
|
|
422
|
+
<jh-card :col-span="8" layout="center" bordered>
|
|
423
|
+
colSpan - 8
|
|
424
|
+
</jh-card>
|
|
425
|
+
</jh-card>
|
|
426
|
+
|
|
427
|
+
<jh-card :gutter="8" title="24栅格" style="margin-top: 16px;">
|
|
428
|
+
<jh-card :col-span="12" layout="center" bordered>
|
|
429
|
+
colSpan - 12
|
|
430
|
+
</jh-card>
|
|
431
|
+
<jh-card :col-span="6" layout="center" bordered>
|
|
432
|
+
colSpan - 6
|
|
433
|
+
</jh-card>
|
|
434
|
+
<jh-card :col-span="6" layout="center" bordered>
|
|
435
|
+
colSpan - 6
|
|
436
|
+
</jh-card>
|
|
437
|
+
</jh-card>
|
|
438
|
+
|
|
439
|
+
<jh-card style="margin-top: 16px;" :gutter="8" ghost>
|
|
440
|
+
<jh-card col-span="200px" layout="center" bordered>
|
|
441
|
+
colSpan - 200px
|
|
442
|
+
</jh-card>
|
|
443
|
+
<jh-card layout="center" bordered>
|
|
444
|
+
Auto
|
|
445
|
+
</jh-card>
|
|
446
|
+
</jh-card>
|
|
447
|
+
|
|
448
|
+
<jh-card style="margin-top: 16px;" :gutter="8" ghost>
|
|
449
|
+
<jh-card bordered layout="center">
|
|
450
|
+
Auto
|
|
451
|
+
</jh-card>
|
|
452
|
+
<jh-card col-span="30%" bordered layout="center">
|
|
453
|
+
colSpan - 30%
|
|
454
|
+
</jh-card>
|
|
455
|
+
</jh-card>
|
|
456
|
+
</div>
|
|
457
|
+
`,
|
|
458
|
+
}),
|
|
459
|
+
parameters: {
|
|
460
|
+
docs: {
|
|
461
|
+
description: {
|
|
462
|
+
story: '栅格布局,支持数字、像素值、百分比等多种 colSpan 设置。',
|
|
463
|
+
},
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
// 左右分栏
|
|
469
|
+
export const VerticalSplit = {
|
|
470
|
+
render: () => ({
|
|
471
|
+
components: { JhCard },
|
|
472
|
+
template: `
|
|
473
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
474
|
+
<jh-card
|
|
475
|
+
title="左右分栏带标题"
|
|
476
|
+
extra="2024年11月9日"
|
|
477
|
+
split="vertical"
|
|
478
|
+
bordered
|
|
479
|
+
header-bordered
|
|
480
|
+
>
|
|
481
|
+
<jh-card title="左侧详情" col-span="30%">
|
|
482
|
+
<div style="height: 100px;">左侧内容</div>
|
|
483
|
+
</jh-card>
|
|
484
|
+
<jh-card title="流量占用情况">
|
|
485
|
+
<div style="height: 100px;">右侧内容</div>
|
|
486
|
+
</jh-card>
|
|
487
|
+
</jh-card>
|
|
488
|
+
</div>
|
|
489
|
+
`,
|
|
490
|
+
}),
|
|
491
|
+
parameters: {
|
|
492
|
+
docs: {
|
|
493
|
+
description: {
|
|
494
|
+
story: '左右分栏布局,使用垂直分割线分隔。',
|
|
495
|
+
},
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
// 上下分栏
|
|
501
|
+
export const HorizontalSplit = {
|
|
502
|
+
render: () => ({
|
|
503
|
+
components: { JhCard },
|
|
504
|
+
template: `
|
|
505
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
506
|
+
<jh-card
|
|
507
|
+
title="上下分栏带标题"
|
|
508
|
+
extra="2024年11月9日"
|
|
509
|
+
split="horizontal"
|
|
510
|
+
bordered
|
|
511
|
+
header-bordered
|
|
512
|
+
>
|
|
513
|
+
<jh-card title="上部详情" col-span="50%">
|
|
514
|
+
<div style="height: 100px;">上部内容</div>
|
|
515
|
+
</jh-card>
|
|
516
|
+
<jh-card title="下部详情">
|
|
517
|
+
<div style="height: 100px;">下部内容</div>
|
|
518
|
+
</jh-card>
|
|
519
|
+
</jh-card>
|
|
520
|
+
</div>
|
|
521
|
+
`,
|
|
522
|
+
}),
|
|
523
|
+
parameters: {
|
|
524
|
+
docs: {
|
|
525
|
+
description: {
|
|
526
|
+
story: '上下分栏布局,使用水平分割线分隔。',
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
},
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
// 复杂布局
|
|
533
|
+
export const ComplexLayout = {
|
|
534
|
+
render: () => ({
|
|
535
|
+
components: { JhCard },
|
|
536
|
+
template: `
|
|
537
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
538
|
+
<jh-card split="vertical" bordered>
|
|
539
|
+
<jh-card title="左侧菜单" col-span="200px" header-bordered>
|
|
540
|
+
<div style="height: 300px;">
|
|
541
|
+
<div style="padding: 8px;">菜单项 1</div>
|
|
542
|
+
<div style="padding: 8px;">菜单项 2</div>
|
|
543
|
+
<div style="padding: 8px;">菜单项 3</div>
|
|
544
|
+
</div>
|
|
545
|
+
</jh-card>
|
|
546
|
+
<jh-card split="horizontal">
|
|
547
|
+
<jh-card title="顶部信息" header-bordered>
|
|
548
|
+
<div style="height: 100px;">顶部内容区域</div>
|
|
549
|
+
</jh-card>
|
|
550
|
+
<jh-card title="主要内容" header-bordered>
|
|
551
|
+
<div style="height: 200px;">主要内容区域</div>
|
|
552
|
+
</jh-card>
|
|
553
|
+
</jh-card>
|
|
554
|
+
</jh-card>
|
|
555
|
+
</div>
|
|
556
|
+
`,
|
|
557
|
+
}),
|
|
558
|
+
parameters: {
|
|
559
|
+
docs: {
|
|
560
|
+
description: {
|
|
561
|
+
story: '复杂的嵌套分栏布局,左侧固定宽度,右侧上下分栏。',
|
|
562
|
+
},
|
|
563
|
+
},
|
|
564
|
+
},
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
// 统计卡片示例
|
|
568
|
+
export const StatisticCards = {
|
|
569
|
+
render: () => ({
|
|
570
|
+
components: { JhCard },
|
|
571
|
+
template: `
|
|
572
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
573
|
+
<jh-card title="核心指标" direction="row" :gutter="16">
|
|
574
|
+
<jh-card layout="center" bordered style="min-height: 120px;">
|
|
575
|
+
<div style="text-align: center;">
|
|
576
|
+
<div style="font-size: 24px; font-weight: bold; color: #1890ff;">79.0</div>
|
|
577
|
+
<div style="color: rgba(0,0,0,0.45); margin-top: 8px;">今日UV</div>
|
|
578
|
+
</div>
|
|
579
|
+
</jh-card>
|
|
580
|
+
<jh-card layout="center" bordered style="min-height: 120px;">
|
|
581
|
+
<div style="text-align: center;">
|
|
582
|
+
<div style="font-size: 24px; font-weight: bold; color: #52c41a;">112,893</div>
|
|
583
|
+
<div style="color: rgba(0,0,0,0.45); margin-top: 8px;">冻结金额</div>
|
|
584
|
+
</div>
|
|
585
|
+
</jh-card>
|
|
586
|
+
<jh-card layout="center" bordered style="min-height: 120px;">
|
|
587
|
+
<div style="text-align: center;">
|
|
588
|
+
<div style="font-size: 24px; font-weight: bold; color: #faad14;">93 / 100</div>
|
|
589
|
+
<div style="color: rgba(0,0,0,0.45); margin-top: 8px;">信息完整度</div>
|
|
590
|
+
</div>
|
|
591
|
+
</jh-card>
|
|
592
|
+
<jh-card layout="center" bordered style="min-height: 120px;">
|
|
593
|
+
<div style="text-align: center;">
|
|
594
|
+
<div style="font-size: 24px; font-weight: bold; color: #f5222d;">8</div>
|
|
595
|
+
<div style="color: rgba(0,0,0,0.45); margin-top: 8px;">待处理</div>
|
|
596
|
+
</div>
|
|
597
|
+
</jh-card>
|
|
598
|
+
</jh-card>
|
|
599
|
+
</div>
|
|
600
|
+
`,
|
|
601
|
+
}),
|
|
602
|
+
parameters: {
|
|
603
|
+
docs: {
|
|
604
|
+
description: {
|
|
605
|
+
story: '统计卡片示例,展示多个指标数据。',
|
|
606
|
+
},
|
|
607
|
+
},
|
|
608
|
+
},
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
// 响应式布局
|
|
612
|
+
export const ResponsiveLayout = {
|
|
613
|
+
render: () => ({
|
|
614
|
+
components: { JhCard },
|
|
615
|
+
template: `
|
|
616
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
617
|
+
<jh-card title="响应式卡片组" :gutter="[16, 16]" ghost>
|
|
618
|
+
<jh-card :col-span="8" bordered>
|
|
619
|
+
<div style="padding: 20px; text-align: center;">卡片 1</div>
|
|
620
|
+
</jh-card>
|
|
621
|
+
<jh-card :col-span="8" bordered>
|
|
622
|
+
<div style="padding: 20px; text-align: center;">卡片 2</div>
|
|
623
|
+
</jh-card>
|
|
624
|
+
<jh-card :col-span="8" bordered>
|
|
625
|
+
<div style="padding: 20px; text-align: center;">卡片 3</div>
|
|
626
|
+
</jh-card>
|
|
627
|
+
</jh-card>
|
|
628
|
+
</div>
|
|
629
|
+
`,
|
|
630
|
+
}),
|
|
631
|
+
parameters: {
|
|
632
|
+
docs: {
|
|
633
|
+
description: {
|
|
634
|
+
story: '响应式布局示例,使用 gutter 设置间距。',
|
|
635
|
+
},
|
|
636
|
+
},
|
|
637
|
+
},
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
// 所有功能组合
|
|
641
|
+
export const AllFeatures = {
|
|
642
|
+
render: () => ({
|
|
643
|
+
components: { JhCard },
|
|
644
|
+
data() {
|
|
645
|
+
return {
|
|
646
|
+
actions: [
|
|
647
|
+
{ icon: 'mdi-cog', onClick: () => alert('设置') },
|
|
648
|
+
{ icon: 'mdi-pencil', onClick: () => alert('编辑') },
|
|
649
|
+
{ icon: 'mdi-delete', onClick: () => alert('删除') },
|
|
650
|
+
],
|
|
651
|
+
};
|
|
652
|
+
},
|
|
653
|
+
template: `
|
|
654
|
+
<div style="background: rgb(240, 242, 245); padding: 20px;">
|
|
655
|
+
<jh-card
|
|
656
|
+
title="功能完整的卡片"
|
|
657
|
+
tooltip="这是一个包含所有功能的卡片示例"
|
|
658
|
+
extra="额外信息"
|
|
659
|
+
bordered
|
|
660
|
+
header-bordered
|
|
661
|
+
hoverable
|
|
662
|
+
collapsible
|
|
663
|
+
:actions="actions"
|
|
664
|
+
style="max-width: 600px;"
|
|
665
|
+
>
|
|
666
|
+
<div style="padding: 20px;">
|
|
667
|
+
<p>这是一个展示所有功能的卡片:</p>
|
|
668
|
+
<ul>
|
|
669
|
+
<li>标题和提示信息</li>
|
|
670
|
+
<li>右上角额外内容</li>
|
|
671
|
+
<li>标题分割线</li>
|
|
672
|
+
<li>可折叠功能</li>
|
|
673
|
+
<li>悬浮效果</li>
|
|
674
|
+
<li>底部操作项</li>
|
|
675
|
+
</ul>
|
|
676
|
+
</div>
|
|
677
|
+
</jh-card>
|
|
678
|
+
</div>
|
|
679
|
+
`,
|
|
680
|
+
}),
|
|
681
|
+
parameters: {
|
|
682
|
+
docs: {
|
|
683
|
+
description: {
|
|
684
|
+
story: '包含所有功能的完整示例。',
|
|
685
|
+
},
|
|
686
|
+
},
|
|
687
|
+
},
|
|
688
|
+
};
|