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.
Files changed (112) hide show
  1. package/README.md +376 -0
  2. package/dist/jianghu-ui.css +2318 -0
  3. package/dist/jianghu-ui.js +2 -0
  4. package/dist/jianghu-ui.js.LICENSE.txt +1 -0
  5. package/package.json +56 -0
  6. package/src/Design.stories.mdx +195 -0
  7. package/src/Introduction.stories.mdx +148 -0
  8. package/src/components/JhAddressSelect/JhAddressSelect.md +250 -0
  9. package/src/components/JhAddressSelect/JhAddressSelect.stories.js +282 -0
  10. package/src/components/JhAddressSelect/JhAddressSelect.vue +261 -0
  11. package/src/components/JhCard/JhCard.md +246 -0
  12. package/src/components/JhCard/JhCard.stories.js +688 -0
  13. package/src/components/JhCard/JhCard.vue +604 -0
  14. package/src/components/JhCheckCard/JhCheckCard.md +245 -0
  15. package/src/components/JhCheckCard/JhCheckCard.stories.js +750 -0
  16. package/src/components/JhCheckCard/JhCheckCard.vue +476 -0
  17. package/src/components/JhConfirmDialog/JhConfirmDialog.md +70 -0
  18. package/src/components/JhConfirmDialog/JhConfirmDialog.stories.js +550 -0
  19. package/src/components/JhConfirmDialog/JhConfirmDialog.vue +181 -0
  20. package/src/components/JhDateRangePicker/JhDateRangePicker.md +56 -0
  21. package/src/components/JhDateRangePicker/JhDateRangePicker.stories.js +320 -0
  22. package/src/components/JhDateRangePicker/JhDateRangePicker.vue +307 -0
  23. package/src/components/JhDescriptions/JhDescriptions.md +724 -0
  24. package/src/components/JhDescriptions/JhDescriptions.stories.js +858 -0
  25. package/src/components/JhDescriptions/JhDescriptions.vue +933 -0
  26. package/src/components/JhDraggable/JhDraggable.md +66 -0
  27. package/src/components/JhDraggable/JhDraggable.stories.js +161 -0
  28. package/src/components/JhDraggable/JhDraggable.vue +254 -0
  29. package/src/components/JhDrawer/JhDrawer.md +68 -0
  30. package/src/components/JhDrawer/JhDrawer.stories.js +478 -0
  31. package/src/components/JhDrawer/JhDrawer.vue +281 -0
  32. package/src/components/JhDrawerForm/JhDrawerForm.md +69 -0
  33. package/src/components/JhDrawerForm/JhDrawerForm.stories.js +492 -0
  34. package/src/components/JhDrawerForm/JhDrawerForm.vue +297 -0
  35. package/src/components/JhEditableTable/JhEditableTable.md +507 -0
  36. package/src/components/JhEditableTable/JhEditableTable.stories.js +615 -0
  37. package/src/components/JhEditableTable/JhEditableTable.vue +685 -0
  38. package/src/components/JhFileInput/JhFileInput.md +56 -0
  39. package/src/components/JhFileInput/JhFileInput.stories.js +103 -0
  40. package/src/components/JhFileInput/JhFileInput.vue +253 -0
  41. package/src/components/JhForm/JhForm.md +676 -0
  42. package/src/components/JhForm/JhForm.stories.js +1375 -0
  43. package/src/components/JhForm/JhForm.vue +657 -0
  44. package/src/components/JhFormField/JhFormField.stories.js +217 -0
  45. package/src/components/JhFormField/JhFormField.vue +439 -0
  46. package/src/components/JhFormFields/JhFormFields.md +647 -0
  47. package/src/components/JhFormFields/JhFormFields.stories.js +922 -0
  48. package/src/components/JhFormFields/JhFormFields.vue +998 -0
  49. package/src/components/JhFormList/JhFormList.md +303 -0
  50. package/src/components/JhFormList/JhFormList.stories.js +661 -0
  51. package/src/components/JhFormList/JhFormList.vue +1127 -0
  52. package/src/components/JhJsonEditor/JhJsonEditor.md +54 -0
  53. package/src/components/JhJsonEditor/JhJsonEditor.stories.js +157 -0
  54. package/src/components/JhJsonEditor/JhJsonEditor.vue +178 -0
  55. package/src/components/JhLayout/JhLayout.md +580 -0
  56. package/src/components/JhLayout/JhLayout.stories.js +414 -0
  57. package/src/components/JhLayout/JhLayout.vue +387 -0
  58. package/src/components/JhList/JhList.md +441 -0
  59. package/src/components/JhList/JhList.stories.js +524 -0
  60. package/src/components/JhList/JhList.vue +571 -0
  61. package/src/components/JhMarkdownEditor/JhMarkdownEditor.md +56 -0
  62. package/src/components/JhMarkdownEditor/JhMarkdownEditor.stories.js +191 -0
  63. package/src/components/JhMarkdownEditor/JhMarkdownEditor.vue +188 -0
  64. package/src/components/JhMask/JhMask.md +62 -0
  65. package/src/components/JhMask/JhMask.stories.js +270 -0
  66. package/src/components/JhMask/JhMask.vue +123 -0
  67. package/src/components/JhMenu/JhMenu.md +85 -0
  68. package/src/components/JhMenu/JhMenu.stories.js +384 -0
  69. package/src/components/JhMenu/JhMenu.vue +545 -0
  70. package/src/components/JhModal/JhModal.md +68 -0
  71. package/src/components/JhModal/JhModal.stories.js +562 -0
  72. package/src/components/JhModal/JhModal.vue +235 -0
  73. package/src/components/JhModalForm/JhModalForm.md +69 -0
  74. package/src/components/JhModalForm/JhModalForm.stories.js +592 -0
  75. package/src/components/JhModalForm/JhModalForm.vue +298 -0
  76. package/src/components/JhPageContainer/JhPageContainer.md +409 -0
  77. package/src/components/JhPageContainer/JhPageContainer.stories.js +209 -0
  78. package/src/components/JhPageContainer/JhPageContainer.vue +72 -0
  79. package/src/components/JhQueryFilter/JhQueryFilter.md +77 -0
  80. package/src/components/JhQueryFilter/JhQueryFilter.stories.js +684 -0
  81. package/src/components/JhQueryFilter/JhQueryFilter.vue +429 -0
  82. package/src/components/JhScene/JhScene.md +64 -0
  83. package/src/components/JhScene/JhScene.stories.js +317 -0
  84. package/src/components/JhScene/JhScene.vue +376 -0
  85. package/src/components/JhStatisticCard/JhStatisticCard.md +363 -0
  86. package/src/components/JhStatisticCard/JhStatisticCard.stories.js +847 -0
  87. package/src/components/JhStatisticCard/JhStatisticCard.vue +459 -0
  88. package/src/components/JhStepsForm/JhStepsForm.md +666 -0
  89. package/src/components/JhStepsForm/JhStepsForm.stories.js +1224 -0
  90. package/src/components/JhStepsForm/JhStepsForm.vue +749 -0
  91. package/src/components/JhTable/JhTable.md +730 -0
  92. package/src/components/JhTable/JhTable.stories.js +1444 -0
  93. package/src/components/JhTable/JhTable.vue +2298 -0
  94. package/src/components/JhTableAttachment/JhTableAttachment.md +70 -0
  95. package/src/components/JhTableAttachment/JhTableAttachment.stories.js +198 -0
  96. package/src/components/JhTableAttachment/JhTableAttachment.vue +264 -0
  97. package/src/components/JhToast/JhToast.md +67 -0
  98. package/src/components/JhToast/JhToast.stories.js +386 -0
  99. package/src/components/JhToast/JhToast.vue +239 -0
  100. package/src/components/JhTreeSelect/JhTreeSelect.md +82 -0
  101. package/src/components/JhTreeSelect/JhTreeSelect.stories.js +391 -0
  102. package/src/components/JhTreeSelect/JhTreeSelect.vue +727 -0
  103. package/src/components/JhWaterMark/JhWaterMark.md +190 -0
  104. package/src/components/JhWaterMark/JhWaterMark.stories.js +675 -0
  105. package/src/components/JhWaterMark/JhWaterMark.vue +351 -0
  106. package/src/components/README.md +52 -0
  107. package/src/index.js +135 -0
  108. package/src/style/globalCSSJHV4.css +348 -0
  109. package/src/style/globalCSSVuetifyV4.css +637 -0
  110. package/src/style/storybook.css +4 -0
  111. package/src/tailwind.css +3 -0
  112. package/src/utils/vuetify.js +31 -0
@@ -0,0 +1,562 @@
1
+ import JhModal from './JhModal.vue';
2
+
3
+ export default {
4
+ title: '基础组件/JhModal - 弹窗',
5
+ component: JhModal,
6
+ parameters: {
7
+ docs: {
8
+ description: {
9
+ component: `
10
+ # JhModal 通用弹窗组件
11
+
12
+ 基于 Vuetify 的通用弹窗组件,提供一致的弹窗框架,支持完全自定义内容。
13
+
14
+ ## 特性
15
+
16
+ - 🎨 **自定义内容**: 通过默认插槽完全自定义弹窗内容
17
+ - 🎛️ **灵活配置**: 支持宽度、全屏、持久化等配置
18
+ - 🔧 **操作按钮**: 支持自定义操作按钮或使用默认按钮
19
+ - 📱 **响应式**: 适配移动端和桌面端
20
+ - 🎯 **事件丰富**: 提供 open、close、confirm、cancel 等事件
21
+ - ⌨️ **键盘支持**: 支持 ESC 键关闭
22
+
23
+ ## 基础用法
24
+
25
+ \`\`\`vue
26
+ <jh-modal v-model="showModal" title="自定义弹窗">
27
+ <div>这里是自定义内容</div>
28
+ </jh-modal>
29
+ \`\`\`
30
+
31
+ ## Props
32
+
33
+ | 参数 | 说明 | 类型 | 默认值 |
34
+ |------|------|------|--------|
35
+ | value | 弹窗显示状态 (v-model) | Boolean | false |
36
+ | title | 弹窗标题 | String | '弹窗' |
37
+ | width | 弹窗宽度 | Number/String | 600 |
38
+ | fullscreen | 是否全屏显示 | Boolean | false |
39
+ | persistent | 是否持久化(点击外部不关闭) | Boolean | true |
40
+ | closable | 是否显示关闭按钮 | Boolean | true |
41
+ | showActions | 是否显示底部操作区域 | Boolean | true |
42
+ | showConfirmButton | 是否显示确认按钮 | Boolean | true |
43
+ | showCancelButton | 是否显示取消按钮 | Boolean | true |
44
+ | confirmText | 确认按钮文本 | String | '确认' |
45
+ | cancelText | 取消按钮文本 | String | '取消' |
46
+
47
+ ## Events
48
+
49
+ | 事件名 | 说明 | 参数 |
50
+ |--------|------|------|
51
+ | open | 弹窗打开时触发 | - |
52
+ | close | 弹窗关闭时触发 | - |
53
+ | confirm | 点击确认按钮时触发 | - |
54
+ | cancel | 点击取消按钮时触发 | - |
55
+
56
+ ## Slots
57
+
58
+ | 插槽名 | 说明 |
59
+ |--------|------|
60
+ | default | 弹窗内容 |
61
+ | actions | 自定义操作按钮 |
62
+
63
+ ## 方法
64
+
65
+ | 方法名 | 说明 | 参数 |
66
+ |--------|------|------|
67
+ | open | 打开弹窗 | - |
68
+ | close | 关闭弹窗 | - |
69
+ `
70
+ }
71
+ }
72
+ },
73
+ argTypes: {
74
+ value: {
75
+ control: { type: 'boolean' },
76
+ description: '弹窗显示状态'
77
+ },
78
+ title: {
79
+ control: { type: 'text' },
80
+ description: '弹窗标题'
81
+ },
82
+ width: {
83
+ control: { type: 'text' },
84
+ description: '弹窗宽度'
85
+ },
86
+ fullscreen: {
87
+ control: { type: 'boolean' },
88
+ description: '是否全屏显示'
89
+ },
90
+ persistent: {
91
+ control: { type: 'boolean' },
92
+ description: '是否持久化'
93
+ },
94
+ closable: {
95
+ control: { type: 'boolean' },
96
+ description: '是否显示关闭按钮'
97
+ },
98
+ showActions: {
99
+ control: { type: 'boolean' },
100
+ description: '是否显示底部操作区域'
101
+ },
102
+ showConfirmButton: {
103
+ control: { type: 'boolean' },
104
+ description: '是否显示确认按钮'
105
+ },
106
+ showCancelButton: {
107
+ control: { type: 'boolean' },
108
+ description: '是否显示取消按钮'
109
+ },
110
+ confirmText: {
111
+ control: { type: 'text' },
112
+ description: '确认按钮文本'
113
+ },
114
+ cancelText: {
115
+ control: { type: 'text' },
116
+ description: '取消按钮文本'
117
+ }
118
+ }
119
+ };
120
+
121
+ // 基础用法
122
+ export const Basic = {
123
+ render: (args) => ({
124
+ components: { JhModal },
125
+ data() {
126
+ return {
127
+ showModal: false,
128
+ ...args
129
+ };
130
+ },
131
+ template: `
132
+ <div>
133
+ <v-btn color="primary" @click="showModal = true">打开弹窗</v-btn>
134
+ <jh-modal
135
+ v-model="showModal"
136
+ :title="title"
137
+ :width="width"
138
+ :fullscreen="fullscreen"
139
+ :persistent="persistent"
140
+ :closable="closable"
141
+ :show-actions="showActions"
142
+ :show-confirm-button="showConfirmButton"
143
+ :show-cancel-button="showCancelButton"
144
+ :confirm-text="confirmText"
145
+ :cancel-text="cancelText"
146
+ @confirm="handleConfirm"
147
+ @cancel="handleCancel"
148
+ @open="handleOpen"
149
+ @close="handleClose"
150
+ >
151
+ <div>
152
+ <h3>自定义内容</h3>
153
+ <p>这里可以放置任何自定义内容,比如表单、列表、图表等。</p>
154
+ <v-alert type="info" class="mt-4">
155
+ 这是一个信息提示框
156
+ </v-alert>
157
+ <v-text-field
158
+ label="输入框示例"
159
+ outlined
160
+ class="mt-4"
161
+ ></v-text-field>
162
+ </div>
163
+ </jh-modal>
164
+ </div>
165
+ `,
166
+ methods: {
167
+ handleConfirm() {
168
+ console.log('确认操作');
169
+ this.showModal = false;
170
+ },
171
+ handleCancel() {
172
+ console.log('取消操作');
173
+ },
174
+ handleOpen() {
175
+ console.log('弹窗已打开');
176
+ },
177
+ handleClose() {
178
+ console.log('弹窗已关闭');
179
+ }
180
+ }
181
+ }),
182
+ args: {
183
+ title: '基础弹窗',
184
+ width: 600,
185
+ fullscreen: false,
186
+ persistent: true,
187
+ closable: true,
188
+ showActions: true,
189
+ showConfirmButton: true,
190
+ showCancelButton: true,
191
+ confirmText: '确认',
192
+ cancelText: '取消'
193
+ }
194
+ };
195
+
196
+ // 全屏弹窗
197
+ export const Fullscreen = {
198
+ render: (args) => ({
199
+ components: { JhModal },
200
+ data() {
201
+ return {
202
+ showModal: false,
203
+ ...args
204
+ };
205
+ },
206
+ template: `
207
+ <div>
208
+ <v-btn color="primary" @click="showModal = true">打开全屏弹窗</v-btn>
209
+ <jh-modal
210
+ v-model="showModal"
211
+ :title="title"
212
+ :fullscreen="fullscreen"
213
+ @confirm="showModal = false"
214
+ >
215
+ <div>
216
+ <h2>全屏弹窗内容</h2>
217
+ <p>这是一个全屏显示的弹窗,适合展示大量内容或复杂的界面。</p>
218
+
219
+ <v-row class="mt-6">
220
+ <v-col cols="12" md="6">
221
+ <v-card>
222
+ <v-card-title>卡片1</v-card-title>
223
+ <v-card-text>
224
+ 这里是一些内容...
225
+ </v-card-text>
226
+ </v-card>
227
+ </v-col>
228
+ <v-col cols="12" md="6">
229
+ <v-card>
230
+ <v-card-title>卡片2</v-card-title>
231
+ <v-card-text>
232
+ 这里是一些内容...
233
+ </v-card-text>
234
+ </v-card>
235
+ </v-col>
236
+ </v-row>
237
+
238
+ <v-data-table
239
+ :headers="[
240
+ { text: '姓名', value: 'name' },
241
+ { text: '年龄', value: 'age' },
242
+ { text: '城市', value: 'city' }
243
+ ]"
244
+ :items="[
245
+ { name: '张三', age: 25, city: '北京' },
246
+ { name: '李四', age: 30, city: '上海' },
247
+ { name: '王五', age: 28, city: '广州' }
248
+ ]"
249
+ class="mt-6"
250
+ ></v-data-table>
251
+ </div>
252
+ </jh-modal>
253
+ </div>
254
+ `
255
+ }),
256
+ args: {
257
+ title: '全屏弹窗',
258
+ fullscreen: true
259
+ }
260
+ };
261
+
262
+ // 自定义操作按钮
263
+ export const CustomActions = {
264
+ render: (args) => ({
265
+ components: { JhModal },
266
+ data() {
267
+ return {
268
+ showModal: false,
269
+ ...args
270
+ };
271
+ },
272
+ template: `
273
+ <div>
274
+ <v-btn color="primary" @click="showModal = true">自定义操作按钮</v-btn>
275
+ <jh-modal
276
+ v-model="showModal"
277
+ :title="title"
278
+ @confirm="showModal = false"
279
+ >
280
+ <template #actions>
281
+ <v-btn
282
+ text
283
+ color="grey"
284
+ @click="handleReset"
285
+ >
286
+ 重置
287
+ </v-btn>
288
+ <v-spacer />
289
+ <v-btn
290
+ text
291
+ @click="showModal = false"
292
+ >
293
+ 取消
294
+ </v-btn>
295
+ <v-btn
296
+ color="warning"
297
+ class="ml-2"
298
+ @click="handleSave"
299
+ >
300
+ 保存草稿
301
+ </v-btn>
302
+ <v-btn
303
+ color="success"
304
+ class="ml-2"
305
+ @click="handleSubmit"
306
+ >
307
+ 发布
308
+ </v-btn>
309
+ </template>
310
+
311
+ <div>
312
+ <h3>自定义操作按钮</h3>
313
+ <p>这个弹窗使用了自定义的操作按钮。</p>
314
+ <v-form>
315
+ <v-text-field
316
+ label="标题"
317
+ outlined
318
+ class="mb-4"
319
+ ></v-text-field>
320
+ <v-textarea
321
+ label="内容"
322
+ outlined
323
+ rows="4"
324
+ class="mb-4"
325
+ ></v-textarea>
326
+ <v-select
327
+ label="分类"
328
+ :items="['技术', '生活', '工作', '学习']"
329
+ outlined
330
+ ></v-select>
331
+ </v-form>
332
+ </div>
333
+ </jh-modal>
334
+ </div>
335
+ `,
336
+ methods: {
337
+ handleReset() {
338
+ console.log('重置表单');
339
+ },
340
+ handleSave() {
341
+ console.log('保存草稿');
342
+ },
343
+ handleSubmit() {
344
+ console.log('发布内容');
345
+ this.showModal = false;
346
+ }
347
+ }
348
+ }),
349
+ args: {
350
+ title: '发布文章'
351
+ }
352
+ };
353
+
354
+ // 无操作区域
355
+ export const NoActions = {
356
+ render: (args) => ({
357
+ components: { JhModal },
358
+ data() {
359
+ return {
360
+ showModal: false,
361
+ ...args
362
+ };
363
+ },
364
+ template: `
365
+ <div>
366
+ <v-btn color="primary" @click="showModal = true">无操作区域弹窗</v-btn>
367
+ <jh-modal
368
+ v-model="showModal"
369
+ :title="title"
370
+ :show-actions="showActions"
371
+ >
372
+ <div>
373
+ <h3>纯展示内容</h3>
374
+ <p>这个弹窗没有底部操作区域,适合纯展示内容。</p>
375
+
376
+ <v-alert type="success" class="mt-4">
377
+ 操作成功!数据已保存。
378
+ </v-alert>
379
+
380
+ <v-card class="mt-4">
381
+ <v-card-title>详细信息</v-card-title>
382
+ <v-card-text>
383
+ <v-simple-table>
384
+ <tbody>
385
+ <tr>
386
+ <td><strong>用户名</strong></td>
387
+ <td>admin</td>
388
+ </tr>
389
+ <tr>
390
+ <td><strong>创建时间</strong></td>
391
+ <td>2023-12-01 10:30:00</td>
392
+ </tr>
393
+ <tr>
394
+ <td><strong>状态</strong></td>
395
+ <td><v-chip color="success" small>已激活</v-chip></td>
396
+ </tr>
397
+ </tbody>
398
+ </v-simple-table>
399
+ </v-card-text>
400
+ </v-card>
401
+
402
+ <div class="text-center mt-6">
403
+ <v-btn color="primary" @click="showModal = false">
404
+ 我知道了
405
+ </v-btn>
406
+ </div>
407
+ </div>
408
+ </jh-modal>
409
+ </div>
410
+ `
411
+ }),
412
+ args: {
413
+ title: '信息展示',
414
+ showActions: false
415
+ }
416
+ };
417
+
418
+ // 不同尺寸
419
+ export const DifferentSizes = {
420
+ render: (args) => ({
421
+ components: { JhModal },
422
+ data() {
423
+ return {
424
+ showModal1: false,
425
+ showModal2: false,
426
+ showModal3: false,
427
+ showModal4: false,
428
+ ...args
429
+ };
430
+ },
431
+ template: `
432
+ <div>
433
+ <v-btn color="primary" class="mr-2" @click="showModal1 = true">
434
+ 小弹窗 (400px)
435
+ </v-btn>
436
+ <v-btn color="primary" class="mr-2" @click="showModal2 = true">
437
+ 中弹窗 (600px)
438
+ </v-btn>
439
+ <v-btn color="primary" class="mr-2" @click="showModal3 = true">
440
+ 大弹窗 (800px)
441
+ </v-btn>
442
+ <v-btn color="primary" @click="showModal4 = true">
443
+ 超大弹窗 (1200px)
444
+ </v-btn>
445
+
446
+ <jh-modal
447
+ v-model="showModal1"
448
+ title="小弹窗"
449
+ :width="400"
450
+ @confirm="showModal1 = false"
451
+ >
452
+ <div>
453
+ <p>这是一个小尺寸的弹窗 (400px)</p>
454
+ <v-text-field label="输入框" outlined></v-text-field>
455
+ </div>
456
+ </jh-modal>
457
+
458
+ <jh-modal
459
+ v-model="showModal2"
460
+ title="中弹窗"
461
+ :width="600"
462
+ @confirm="showModal2 = false"
463
+ >
464
+ <div>
465
+ <p>这是一个中等尺寸的弹窗 (600px)</p>
466
+ <v-row>
467
+ <v-col cols="6">
468
+ <v-text-field label="姓名" outlined></v-text-field>
469
+ </v-col>
470
+ <v-col cols="6">
471
+ <v-text-field label="邮箱" outlined></v-text-field>
472
+ </v-col>
473
+ </v-row>
474
+ </div>
475
+ </jh-modal>
476
+
477
+ <jh-modal
478
+ v-model="showModal3"
479
+ title="大弹窗"
480
+ :width="800"
481
+ @confirm="showModal3 = false"
482
+ >
483
+ <div>
484
+ <p>这是一个大尺寸的弹窗 (800px)</p>
485
+ <v-row>
486
+ <v-col cols="4" v-for="i in 3" :key="i">
487
+ <v-card>
488
+ <v-card-title>卡片 {{ i }}</v-card-title>
489
+ <v-card-text>内容 {{ i }}</v-card-text>
490
+ </v-card>
491
+ </v-col>
492
+ </v-row>
493
+ </div>
494
+ </jh-modal>
495
+
496
+ <jh-modal
497
+ v-model="showModal4"
498
+ title="超大弹窗"
499
+ :width="1200"
500
+ @confirm="showModal4 = false"
501
+ >
502
+ <div>
503
+ <p>这是一个超大尺寸的弹窗 (1200px)</p>
504
+ <v-data-table
505
+ :headers="[
506
+ { text: 'ID', value: 'id' },
507
+ { text: '姓名', value: 'name' },
508
+ { text: '邮箱', value: 'email' },
509
+ { text: '部门', value: 'department' },
510
+ { text: '职位', value: 'position' },
511
+ { text: '状态', value: 'status' }
512
+ ]"
513
+ :items="[
514
+ { id: 1, name: '张三', email: 'zhangsan@example.com', department: '技术部', position: '工程师', status: '在职' },
515
+ { id: 2, name: '李四', email: 'lisi@example.com', department: '产品部', position: '产品经理', status: '在职' },
516
+ { id: 3, name: '王五', email: 'wangwu@example.com', department: '设计部', position: '设计师', status: '离职' }
517
+ ]"
518
+ ></v-data-table>
519
+ </div>
520
+ </jh-modal>
521
+ </div>
522
+ `
523
+ }),
524
+ args: {}
525
+ };
526
+
527
+ // 非持久化弹窗
528
+ export const NonPersistent = {
529
+ render: (args) => ({
530
+ components: { JhModal },
531
+ data() {
532
+ return {
533
+ showModal: false,
534
+ ...args
535
+ };
536
+ },
537
+ template: `
538
+ <div>
539
+ <v-btn color="primary" @click="showModal = true">非持久化弹窗</v-btn>
540
+ <p class="mt-2 text-caption">点击弹窗外部区域可以关闭弹窗</p>
541
+ <jh-modal
542
+ v-model="showModal"
543
+ :title="title"
544
+ :persistent="persistent"
545
+ @confirm="showModal = false"
546
+ >
547
+ <div>
548
+ <h3>非持久化弹窗</h3>
549
+ <p>这个弹窗允许点击外部区域关闭,也可以按 ESC 键关闭。</p>
550
+ <v-alert type="warning" class="mt-4">
551
+ 注意:点击弹窗外部区域会关闭弹窗
552
+ </v-alert>
553
+ </div>
554
+ </jh-modal>
555
+ </div>
556
+ `
557
+ }),
558
+ args: {
559
+ title: '非持久化弹窗',
560
+ persistent: false
561
+ }
562
+ };