auto-vue-manual 0.0.24 → 0.0.26

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 (30) hide show
  1. package/README.md +297 -14
  2. package/dist/auto-vue-manual.es.js +1329 -683
  3. package/dist/auto-vue-manual.umd.js +3 -3
  4. package/dist/index.css +1 -1
  5. package/dist/types/components/index.d.ts +7 -0
  6. package/dist/types/components/modal/basicDialog.vue.d.ts +85 -0
  7. package/dist/types/components/modal/basicDrawer.vue.d.ts +74 -0
  8. package/dist/types/components/modal/formDialog.vue.d.ts +133 -0
  9. package/dist/types/components/modal/tableDialog.vue.d.ts +100 -0
  10. package/dist/types/components/table/components/Pagination.vue.d.ts +1 -1
  11. package/dist/types/components/table/components/TableColumn.vue.d.ts +1 -1
  12. package/dist/types/components/table/components/TableColumnV2.d.ts +1 -1
  13. package/dist/types/components/table/hook/useAutoHeight.d.ts +1 -1
  14. package/dist/types/components/table/hook/useTable.d.ts +1 -1
  15. package/dist/types/components/table/index.vue.d.ts +2 -1
  16. package/dist/types/components/table/list.vue.d.ts +9 -5
  17. package/dist/types/components/table/summary.vue.d.ts +1 -1
  18. package/dist/types/components/table/utils/table.d.ts +1 -1
  19. package/dist/types/components/upload/uploadAvatar.d.ts +66 -0
  20. package/dist/types/components/upload/uploadImage.d.ts +66 -0
  21. package/dist/types/components/upload/uploadImages.d.ts +80 -0
  22. package/dist/types/index.d.ts +1 -1
  23. package/dist/types/types/index.d.ts +2 -1
  24. package/dist/types/types/install.d.ts +2 -1
  25. package/dist/types/{components/table/interface/index.d.ts → types/table.d.ts} +1 -1
  26. package/dist/types/types/upload.d.ts +16 -0
  27. package/dist/types/utils/index.d.ts +1 -0
  28. package/dist/types/utils/mittBus.d.ts +9 -5
  29. package/dist/version.js +1 -1
  30. package/package.json +2 -2
package/README.md CHANGED
@@ -1,8 +1,56 @@
1
1
  # 自用组件库
2
2
 
3
- ## ProTable / ProTableSummary 属性说明
3
+ ## 安装
4
4
 
5
- ### ColumnProps 列配置说明
5
+ ```bash
6
+ npm install auto-vue-manual
7
+ ```
8
+
9
+ ## 使用
10
+
11
+ ```js
12
+ import AutoVueManual from "auto-vue-manual";
13
+ import type { InstallOptions } from 'auto-vue-manual';
14
+ import 'auto-vue-manual/dist/index.css';
15
+
16
+ import request from "@/global/request";
17
+ import { Translate } from "@/languages/index";
18
+
19
+ const options: InstallOptions = {
20
+ request,
21
+ translate: Translate
22
+ }
23
+
24
+ const app = createApp(App);
25
+ app.use(AutoVueManual, options);
26
+ app.mount('#app');
27
+ ```
28
+
29
+ ## 目录
30
+
31
+ #### Table
32
+ [ProTable/ProTableSummary](#protable--protablesummary)
33
+ [ProTableList](#protablelist)
34
+
35
+ #### Modal
36
+ [BasicDialog](#basicdialog)
37
+ [BasicDrawer](#basicdrawer)
38
+ [FormDialog](#formdialog)
39
+ [TableDialog](#tabledialog)
40
+
41
+ #### Upload
42
+ [UploadAvatar](#uploadavatar)
43
+ [UploadImage](#uploadimage)
44
+ [UploadImages](#uploadimages)
45
+
46
+
47
+ # Document
48
+
49
+ ## Table
50
+
51
+ ### ProTable / ProTableSummary
52
+
53
+ #### ColumnProps
6
54
 
7
55
  | 属性名 | 类型 | 说明 | 默认值 |
8
56
  | ------ | ---- | ---- | ------ |
@@ -17,11 +65,11 @@
17
65
  | **render** | `(scope: RenderScope<T>) => VNode string` | 自定义单元格内容渲染(tsx语法),Basic和list的scope略有不同,请注意 | - |
18
66
  | **props** | `{ api?: string, activeValue?: any, inactiveValue?: any, refresh?: boolean }` | type = switch 时,props 配置 (TODO 更新其他type) | - |
19
67
 
20
- ### Props 参数说明
68
+ #### Props 参数说明
21
69
 
22
70
  | 属性名 | 类型 | 说明 | 默认值 |
23
71
  | ------ | ---- | ---- | ------ |
24
- | **columns** | `ColumnProps[]` | 必填,列配置项 | - |
72
+ | **columns** | [`ColumnProps[]`](#columnprops) | 必填,列配置项 | - |
25
73
  | **data** | `any[]` | 静态 table data 数据,若存在则不会使用 request url 返回的 data | - |
26
74
  | **url** | `string` | 实际请求接口 | - |
27
75
  | **auto-search** | `boolean` | 是否自动执行请求 api | true |
@@ -40,7 +88,7 @@
40
88
  | **sum-text** | `string` | 汇总文本,仅 ProTableSummary 有效 | Total |
41
89
  | **sum-text-format** | `string` | 汇总文本格式,仅 ProTableSummary 有效 | * |
42
90
 
43
- ### Event 事件说明
91
+ #### Event 事件说明
44
92
 
45
93
  | 事件名 | 说明 | 参数 |
46
94
  | ------ | ---- | ---- |
@@ -48,7 +96,7 @@
48
96
  | **@row-dblclick** | 行双击事件,已排除 status / operation 列 | `(row: any, column: any) => void` |
49
97
  | **@switch-change** | 开关切换事件 | `(value, scope, column) => void` |
50
98
 
51
- ### Expose 暴露方法说明
99
+ #### Expose 暴露方法说明
52
100
 
53
101
  | 方法名 | 说明 | 参数 |
54
102
  | ------ | ---- | ---- |
@@ -56,7 +104,7 @@
56
104
  | **@reset** | 重置事件 | `() => void` |
57
105
  | **@getTableList** | 获取表格数据,不更新搜索参数及分页参数 | `() => void` |
58
106
 
59
- ### 示例代码
107
+ #### 示例代码
60
108
 
61
109
  ```vue
62
110
  <template>
@@ -121,22 +169,26 @@ const onRowDblclick = (row: any, column: any, event: any) => {
121
169
  </script>
122
170
  ```
123
171
 
124
- ## ProTableList 属性说明
172
+ ## ProTableList
125
173
 
126
- ### Props 参数说明
127
- ProTable 相同,但多了 `row-key` 属性,用于指定行数据的唯一标识。
174
+ #### Props 参数说明
175
+ | 属性名 | 类型 | 说明 | 默认值 |
176
+ | ------ | ---- | ---- | ------ |
177
+ | **row-key** | `string` | 行数据的 Key,用来优化 Table 的渲染,当表格数据多选时,所指定的 id ) | id |
178
+
179
+ 其余同 [ProTable](#protable--protablesummary)
128
180
 
129
- ### Event 事件说明
181
+ #### Event 事件说明
130
182
 
131
183
  | 事件名 | 说明 | 参数 |
132
184
  | ------ | ---- | ---- |
133
185
  | **@row-click** | 行点击事件,未排除 status / operation 列,需添加 e.stopPropagation() 阻止事件冒泡 | `({ row: any, column: any }) => void` |
134
186
  | **@row-dblclick** | 行双击事件,未排除 status / operation 列,需添加 e.stopPropagation() 阻止事件冒泡 | `({ row: any, column: any }) => void` |
135
187
 
136
- ### Expose 暴露方法说明
188
+ #### Expose 暴露方法说明
137
189
  与 ProTable 相同。
138
190
 
139
- ### 示例代码
191
+ #### 示例代码
140
192
 
141
193
  ```vue
142
194
  <template>
@@ -196,4 +248,235 @@ const onRowDblclick = (row: RowEventHandlerParams) => {
196
248
  console.log("onRowDblclick", row);
197
249
  };
198
250
  </script>
199
- ```
251
+ ```
252
+
253
+ ## Modal
254
+
255
+ ### BasicDialog
256
+
257
+ #### Props 参数说明
258
+
259
+ | 属性名 | 类型 | 说明 | 默认值 |
260
+ | ------ | ---- | ---- | ------ |
261
+ | **visible** | `boolean` | 是否显示 | false |
262
+ | **show-close** | `boolean` | 是否显示关闭按钮 | true |
263
+ | **title** | `string` | 标题 | Title |
264
+ | **width** | `string` | 宽度 | 520px |
265
+ | **top** | `string` | 顶部距离 | 15vh |
266
+ | **dialog-props** | `object` | 对话框属性 | {} |
267
+
268
+ #### Event 事件说明
269
+
270
+ | 事件名 | 说明 | 参数 |
271
+ | ------ | ---- | ---- |
272
+ | **@closed** | 关闭事件 | - |
273
+ | **@submit** | 确定事件 | - |
274
+
275
+ #### 示例代码
276
+
277
+ ```vue
278
+ <template>
279
+ <BasicDialog ref="basicDialogRef" :visible="visible" title="user.name" width="520px" @closed="onClosed" @submit="onSubmit" />
280
+ </template>
281
+ <script setup lang="ts">
282
+ import { ref } from "vue";
283
+ import BasicDialog from "auto-vue-manual";
284
+
285
+ const basicDialogRef = ref<InstanceType<typeof BasicDialog>>();
286
+ const visible = ref(false);
287
+
288
+ const onClosed = () => {
289
+ console.log("onClosed");
290
+ };
291
+ const onSubmit = () => {
292
+ console.log("onSubmit");
293
+ };
294
+ </script>
295
+ ```
296
+
297
+ ## BasicDrawer
298
+
299
+ #### Props 参数说明
300
+
301
+ | 属性名 | 类型 | 说明 | 默认值 |
302
+ | ------ | ---- | ---- | ------ |
303
+ | **visible** | `boolean` | 是否显示 | false |
304
+ | **show-close** | `boolean` | 是否显示关闭按钮 | true |
305
+ | **title** | `string` | 标题 | Title |
306
+ | **width** | `string` | 宽度 | 520px |
307
+ | **dialog-props** | `object` | 对话框属性 | {} |
308
+
309
+ #### Event 事件说明
310
+
311
+ | 事件名 | 说明 | 参数 |
312
+ | ------ | ---- | ---- |
313
+ | **@closed** | 关闭事件 | - |
314
+
315
+ #### 示例代码
316
+
317
+ ```vue
318
+ <template>
319
+ <BasicDrawer ref="basicDrawerRef" :visible="visible" title="user.name" width="520px" @closed="onClosed" />
320
+ </template>
321
+ <script setup lang="ts">
322
+ import { ref } from "vue";
323
+ import BasicDrawer from "auto-vue-manual";
324
+
325
+ const basicDrawerRef = ref<InstanceType<typeof BasicDrawer>>();
326
+ const visible = ref(false);
327
+
328
+ const onClosed = () => {
329
+ console.log("onClosed");
330
+ };
331
+ </script>
332
+ ```
333
+
334
+ ## FormDialog
335
+
336
+ #### Props 参数说明
337
+
338
+ | 属性名 | 类型 | 说明 | 默认值 |
339
+ | ------ | ---- | ---- | ------ |
340
+ | **executing** | `boolean` | 是否执行中 | false |
341
+ | **footer** | `boolean` | 是否显示底部 | true |
342
+ | **btn-size** | `string` | 按钮大小 | default |
343
+ | **ok-text** | `string` | 确定按钮文本 | base.submit |
344
+ | **cancel-text** | `string` | 取消按钮文本 | base.cancel |
345
+
346
+ 其余同 [BasicDialog](#basicdialog)
347
+
348
+ #### Event 事件说明
349
+
350
+ | 事件名 | 说明 | 参数 |
351
+ | ------ | ---- | ---- |
352
+ | **@closed** | 关闭事件 | - |
353
+ | **@submit** | 确定事件 | - |
354
+ | **@before-close** | 关闭前事件 | - |
355
+
356
+ #### 示例代码
357
+
358
+ ```vue
359
+ <template>
360
+ <FormDialog ref="formDialogRef" :visible="visible" title="user.name" width="520px" @closed="onClosed" @submit="onSubmit" @before-close="onBeforeClose" />
361
+ </template>
362
+ <script setup lang="ts">
363
+ import { ref } from "vue";
364
+ import FormDialog from "auto-vue-manual";
365
+
366
+ const formDialogRef = ref<InstanceType<typeof FormDialog>>();
367
+ const visible = ref(false);
368
+
369
+ const onClosed = () => {
370
+ console.log("onClosed");
371
+ };
372
+ const onSubmit = () => {
373
+ console.log("onSubmit");
374
+ };
375
+ const onBeforeClose = () => {
376
+ console.log("onBeforeClose");
377
+ };
378
+ </script>
379
+ ```
380
+
381
+ ## TableDialog
382
+
383
+ #### Props 参数说明
384
+
385
+ | 属性名 | 类型 | 说明 | 默认值 |
386
+ | ------ | ---- | ---- | ------ |
387
+ | **requesting** | `boolean` | 是否请求中 | false |
388
+
389
+ 其余同 [BasicDialog](#basicdialog)
390
+
391
+ #### Event 事件说明
392
+
393
+ | 事件名 | 说明 | 参数 |
394
+ | ------ | ---- | ---- |
395
+ | **@closed** | 关闭事件 | - |
396
+
397
+ #### 示例代码
398
+
399
+ ```vue
400
+ <template>
401
+ <TableDialog ref="tableDialogRef" :visible="visible" title="user.name" width="520px" @closed="onClosed" />
402
+ </template>
403
+ <script setup lang="ts">
404
+ import { ref } from "vue";
405
+ import TableDialog from "auto-vue-manual";
406
+
407
+ const tableDialogRef = ref<InstanceType<typeof TableDialog>>();
408
+ const visible = ref(false);
409
+
410
+ const onClosed = () => {
411
+ console.log("onClosed");
412
+ };
413
+ </script>
414
+ ```
415
+
416
+ ## Upload
417
+
418
+ ### UploadAvatar
419
+
420
+ #### Props 参数说明
421
+
422
+ | 属性名 | 类型 | 说明 | 默认值 |
423
+ | ------ | ---- | ---- | ------ |
424
+ | **url** | `string` | 上传地址 | - |
425
+ | **avatar** | `string` | 头像地址 | - |
426
+ | **text** | `string` | 上传提示 | - |
427
+ | **path** | `string` | 保存路径 | - |
428
+ | **preview** | `boolean` | 是否显示预览 | false |
429
+ | **disabled** | `boolean` | 是否禁用 | false |
430
+ | **size** | `number` | 大小(KB) | 5120 |
431
+
432
+ ### UploadImage
433
+
434
+ #### Props 参数说明
435
+
436
+ | 属性名 | 类型 | 说明 | 默认值 |
437
+ | ------ | ---- | ---- | ------ |
438
+ | **image** | `string` | 图片地址 | - |
439
+
440
+ 其余同 [UploadAvatar](#uploadavatar)
441
+
442
+ #### 示例代码
443
+
444
+ ```vue
445
+ <template>
446
+ <UploadAvatar ref="uploadAvatarRef" url="/upload/image" :avatar="avatar" text="上传头像" path="/avatar" preview :size="1024" />
447
+ </template>
448
+ <script setup lang="ts">
449
+ import { ref } from "vue";
450
+ import UploadAvatar from "auto-vue-manual";
451
+
452
+ const uploadAvatarRef = ref<InstanceType<typeof UploadAvatar>>();
453
+ const avatar = ref("");
454
+ </script>
455
+ ```
456
+
457
+ ### UploadImages
458
+
459
+ #### Props 参数说明
460
+
461
+ | 属性名 | 类型 | 说明 | 默认值 |
462
+ | ------ | ---- | ---- | ------ |
463
+ | **images** | `FileList[]` | 图片地址 | - |
464
+ | **limit** | `number` | 限制数量 | 10 |
465
+
466
+ 其余同 [UploadAvatar](#uploadavatar)
467
+
468
+ #### 示例代码
469
+
470
+ ```vue
471
+ <template>
472
+ <UploadImages ref="uploadImagesRef" url="/upload/image" :images="images" text="上传图片" path="/image" preview :size="1024" />
473
+ </template>
474
+ <script setup lang="ts">
475
+ import type { FileList } from "auto-vue-manual";
476
+
477
+ import { ref } from "vue";
478
+ import UploadImages from "auto-vue-manual";
479
+
480
+ const uploadImagesRef = ref<InstanceType<typeof UploadImages>>();
481
+ const images = ref<FileList[]>([]);
482
+ </script>