mrxy-yk 0.0.1-beta.11
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/LICENSE +21 -0
- package/README.md +34 -0
- package/dist/@type/components/a-map-canvas/index.d.ts +1 -0
- package/dist/@type/components/adaptive-box/AdaptiveBox.d.ts +42 -0
- package/dist/@type/components/coordinate-pickup/CoordinatePickup.d.ts +29 -0
- package/dist/@type/components/drag-drop-box/DragDropBox.d.ts +33 -0
- package/dist/@type/components/drag-drop-container/DragDropContainer.d.ts +39 -0
- package/dist/@type/components/drag-drop-container/type.d.ts +3 -0
- package/dist/@type/components/echarts-canvas/EChartsCanvas.d.ts +21 -0
- package/dist/@type/components/in-body/InBody.d.ts +22 -0
- package/dist/@type/components/index.d.ts +12 -0
- package/dist/@type/components/position-anchor/PositionAnchor.d.ts +23 -0
- package/dist/@type/components/progress-bar/ProgressBar.d.ts +35 -0
- package/dist/@type/components/progress-bar/type.d.ts +5 -0
- package/dist/@type/components/progress-ring/ProgressRing.d.ts +22 -0
- package/dist/@type/components/scroll-container/ScrollContainer.d.ts +35 -0
- package/dist/@type/components/show-log/ShowLog.d.ts +25 -0
- package/dist/@type/components/ys-video/@type/index.d.ts +151 -0
- package/dist/@type/components/ys-video/YsVideo.d.ts +18 -0
- package/dist/@type/components/ys-video/components/BtnLineRec.d.ts +7 -0
- package/dist/@type/components/ys-video/type.d.ts +9 -0
- package/dist/@type/config/index.d.ts +23 -0
- package/dist/@type/directive/index.d.ts +1 -0
- package/dist/@type/directive/ref-height/index.d.ts +3 -0
- package/dist/@type/directive/ref-height/type.d.ts +11 -0
- package/dist/@type/directive/table-scroll-carousel/index.d.ts +3 -0
- package/dist/@type/element-plus/components/attrs.d.ts +2 -0
- package/dist/@type/element-plus/components/date-picker/DatePicker.d.ts +16 -0
- package/dist/@type/element-plus/components/date-picker/index.d.ts +22 -0
- package/dist/@type/element-plus/components/date-picker/type.d.ts +17 -0
- package/dist/@type/element-plus/components/empty/Empty.d.ts +31 -0
- package/dist/@type/element-plus/components/empty/config.d.ts +24 -0
- package/dist/@type/element-plus/components/empty/hooks/index.d.ts +2 -0
- package/dist/@type/element-plus/components/empty/hooks/type.d.ts +12 -0
- package/dist/@type/element-plus/components/empty/type.d.ts +9 -0
- package/dist/@type/element-plus/components/form-dialog/FormDialog.d.ts +400 -0
- package/dist/@type/element-plus/components/form-dialog/type.d.ts +4 -0
- package/dist/@type/element-plus/components/images/Images.d.ts +16 -0
- package/dist/@type/element-plus/components/images/index.d.ts +9 -0
- package/dist/@type/element-plus/components/index.d.ts +9 -0
- package/dist/@type/element-plus/components/pagination/Pagination.d.ts +18 -0
- package/dist/@type/element-plus/components/table-column/TableColumn.d.ts +27 -0
- package/dist/@type/element-plus/components/upload/accept/index.d.ts +1 -0
- package/dist/@type/element-plus/components/upload/index.d.ts +42 -0
- package/dist/@type/element-plus/components/upload/select-file/SelectFile.d.ts +822 -0
- package/dist/@type/element-plus/components/upload/upload-files/UploadFiles.d.ts +844 -0
- package/dist/@type/element-plus/components/upload/upload-images/UploadImages.d.ts +842 -0
- package/dist/@type/element-plus/hooks/dialog/index.d.ts +2 -0
- package/dist/@type/element-plus/hooks/dialog/type.d.ts +20 -0
- package/dist/@type/element-plus/hooks/form/index.d.ts +2 -0
- package/dist/@type/element-plus/hooks/form/type.d.ts +45 -0
- package/dist/@type/element-plus/hooks/form-dialog/index.d.ts +2 -0
- package/dist/@type/element-plus/hooks/form-dialog/type.d.ts +70 -0
- package/dist/@type/element-plus/hooks/index.d.ts +5 -0
- package/dist/@type/element-plus/hooks/table-sort/index.d.ts +20 -0
- package/dist/@type/element-plus/hooks/table-sort/type.d.ts +21 -0
- package/dist/@type/element-plus/index.d.ts +2 -0
- package/dist/@type/element-plus/type.d.ts +15 -0
- package/dist/@type/element-plus/utils/form-rule/index.d.ts +4 -0
- package/dist/@type/element-plus/utils/form-rule/rule.d.ts +22 -0
- package/dist/@type/element-plus/utils/form-rule/type.d.ts +14 -0
- package/dist/@type/element-plus/utils/index.d.ts +2 -0
- package/dist/@type/element-plus/utils/table-util/index.d.ts +25 -0
- package/dist/@type/entity/BigFloat.d.ts +48 -0
- package/dist/@type/entity/Pages.d.ts +9 -0
- package/dist/@type/entity/RejectError.d.ts +24 -0
- package/dist/@type/entity/index.d.ts +3 -0
- package/dist/@type/hooks/index.d.ts +1 -0
- package/dist/@type/hooks/table-search/index.d.ts +3 -0
- package/dist/@type/hooks/table-search/type.d.ts +54 -0
- package/dist/@type/icons/index.d.ts +2 -0
- package/dist/@type/index.d.ts +13 -0
- package/dist/@type/resolver/index.d.ts +3 -0
- package/dist/@type/type.d.ts +11 -0
- package/dist/@type/typings.d.ts +20 -0
- package/dist/@type/utils/amap/@type/AMap.d.ts +24 -0
- package/dist/@type/utils/amap/@type/Bounds.d.ts +18 -0
- package/dist/@type/utils/amap/@type/Control.d.ts +19 -0
- package/dist/@type/utils/amap/@type/Event.d.ts +11 -0
- package/dist/@type/utils/amap/@type/Icon.d.ts +12 -0
- package/dist/@type/utils/amap/@type/InfoWindow.d.ts +40 -0
- package/dist/@type/utils/amap/@type/LngLat.d.ts +34 -0
- package/dist/@type/utils/amap/@type/Map.d.ts +218 -0
- package/dist/@type/utils/amap/@type/Marker.d.ts +137 -0
- package/dist/@type/utils/amap/@type/MarkerCluster.d.ts +65 -0
- package/dist/@type/utils/amap/@type/MoveAnimation.d.ts +33 -0
- package/dist/@type/utils/amap/@type/Pixel.d.ts +11 -0
- package/dist/@type/utils/amap/@type/Polyline.d.ts +80 -0
- package/dist/@type/utils/amap/@type/Size.d.ts +9 -0
- package/dist/@type/utils/amap/@type/index.d.ts +23 -0
- package/dist/@type/utils/amap/@type/other.d.ts +11 -0
- package/dist/@type/utils/amap/index.d.ts +3 -0
- package/dist/@type/utils/amap/type.d.ts +21 -0
- package/dist/@type/utils/amap/utils/coordinates.d.ts +24 -0
- package/dist/@type/utils/amap/utils/index.d.ts +12 -0
- package/dist/@type/utils/amap/utils/type.d.ts +4 -0
- package/dist/@type/utils/echarts/hooks/index.d.ts +76 -0
- package/dist/@type/utils/echarts/index.d.ts +3 -0
- package/dist/@type/utils/echarts/modules/coordinate/basic.d.ts +27 -0
- package/dist/@type/utils/echarts/modules/coordinate/cartesian.d.ts +25 -0
- package/dist/@type/utils/echarts/modules/coordinate/polar.d.ts +14 -0
- package/dist/@type/utils/echarts/modules/index.d.ts +5 -0
- package/dist/@type/utils/echarts/modules/series/bar.d.ts +16 -0
- package/dist/@type/utils/echarts/modules/series/line.d.ts +16 -0
- package/dist/@type/utils/echarts/modules/series/pie.d.ts +28 -0
- package/dist/@type/utils/echarts/modules/type.d.ts +83 -0
- package/dist/@type/utils/echarts/type.d.ts +8 -0
- package/dist/@type/utils/echarts/utils/assignOption.d.ts +7 -0
- package/dist/@type/utils/echarts/utils/index.d.ts +27 -0
- package/dist/@type/utils/fn-periodically/FnBatchPeriodically.d.ts +32 -0
- package/dist/@type/utils/fn-periodically/FnPeriodically.d.ts +37 -0
- package/dist/@type/utils/fn-periodically/index.d.ts +2 -0
- package/dist/@type/utils/fn-periodically/type.d.ts +30 -0
- package/dist/@type/utils/index.d.ts +6 -0
- package/dist/@type/utils/match-unit/dataset.d.ts +8 -0
- package/dist/@type/utils/match-unit/index.d.ts +10 -0
- package/dist/@type/utils/match-unit/type.d.ts +39 -0
- package/dist/@type/utils/mitt/hooks/inject-events/index.d.ts +7 -0
- package/dist/@type/utils/mitt/hooks/inject-events/type.d.ts +9 -0
- package/dist/@type/utils/prototype/index.d.ts +5 -0
- package/dist/@type/utils/prototype/lib/ArrayUtil.d.ts +87 -0
- package/dist/@type/utils/prototype/lib/ComponentUtil.d.ts +18 -0
- package/dist/@type/utils/prototype/lib/FileUtil.d.ts +19 -0
- package/dist/@type/utils/prototype/lib/NumberUtil.d.ts +9 -0
- package/dist/@type/utils/prototype/lib/ObjectUtil.d.ts +152 -0
- package/dist/@type/utils/prototype/lib/PromiseUtil.d.ts +7 -0
- package/dist/@type/utils/prototype/type.d.ts +28 -0
- package/dist/@type/utils/sandbox/Sandbox.d.ts +25 -0
- package/dist/@type/utils/transition-fade/index.d.ts +32 -0
- package/dist/@type/utils/transition-fade/type.d.ts +6 -0
- package/dist/_virtual/_plugin-vue_export-helper.es.js +10 -0
- package/dist/components/adaptive-box/AdaptiveBox.vue.es.js +7 -0
- package/dist/components/adaptive-box/AdaptiveBox.vue.es2.js +170 -0
- package/dist/components/coordinate-pickup/CoordinatePickup.vue.es.js +10 -0
- package/dist/components/coordinate-pickup/CoordinatePickup.vue.es2.js +302 -0
- package/dist/components/drag-drop-box/DragDropBox.vue.es.js +7 -0
- package/dist/components/drag-drop-box/DragDropBox.vue.es2.js +59 -0
- package/dist/components/drag-drop-container/DragDropContainer.vue.es.js +7 -0
- package/dist/components/drag-drop-container/DragDropContainer.vue.es2.js +113 -0
- package/dist/components/echarts-canvas/EChartsCanvas.vue.es.js +7 -0
- package/dist/components/echarts-canvas/EChartsCanvas.vue.es2.js +73 -0
- package/dist/components/in-body/InBody.vue.es.js +24 -0
- package/dist/components/in-body/InBody.vue.es2.js +4 -0
- package/dist/components/index.es.js +26 -0
- package/dist/components/position-anchor/PositionAnchor.vue.es.js +7 -0
- package/dist/components/position-anchor/PositionAnchor.vue.es2.js +22 -0
- package/dist/components/progress-bar/ProgressBar.vue.es.js +7 -0
- package/dist/components/progress-bar/ProgressBar.vue.es2.js +126 -0
- package/dist/components/progress-ring/ProgressRing.vue.es.js +7 -0
- package/dist/components/progress-ring/ProgressRing.vue.es2.js +87 -0
- package/dist/components/scroll-container/ScrollContainer.vue.es.js +7 -0
- package/dist/components/scroll-container/ScrollContainer.vue.es2.js +89 -0
- package/dist/components/show-log/ShowLog.vue.es.js +7 -0
- package/dist/components/show-log/ShowLog.vue.es2.js +61 -0
- package/dist/components/ys-video/YsVideo.vue.es.js +7 -0
- package/dist/components/ys-video/YsVideo.vue.es2.js +122 -0
- package/dist/components/ys-video/components/BtnLineRec.vue.es.js +7 -0
- package/dist/components/ys-video/components/BtnLineRec.vue.es2.js +57 -0
- package/dist/components/ys-video/images/btn-play.png.es.js +4 -0
- package/dist/config/index.es.js +16 -0
- package/dist/directive/index.es.js +4 -0
- package/dist/directive/ref-height/index.es.js +49 -0
- package/dist/element-plus/components/date-picker/DatePicker.vue.es.js +107 -0
- package/dist/element-plus/components/date-picker/DatePicker.vue.es2.js +4 -0
- package/dist/element-plus/components/date-picker/index.es.js +213 -0
- package/dist/element-plus/components/empty/Empty.vue.es.js +92 -0
- package/dist/element-plus/components/empty/Empty.vue.es3.js +5 -0
- package/dist/element-plus/components/empty/config.es.js +10 -0
- package/dist/element-plus/components/empty/hooks/index.es.js +24 -0
- package/dist/element-plus/components/form-dialog/FormDialog.vue.es.js +135 -0
- package/dist/element-plus/components/form-dialog/FormDialog.vue.es2.js +4 -0
- package/dist/element-plus/components/images/Images.vue.es.js +7 -0
- package/dist/element-plus/components/images/Images.vue.es2.js +93 -0
- package/dist/element-plus/components/images/index.es.js +10 -0
- package/dist/element-plus/components/index.es.js +21 -0
- package/dist/element-plus/components/pagination/Pagination.vue.es.js +7 -0
- package/dist/element-plus/components/pagination/Pagination.vue.es2.js +66 -0
- package/dist/element-plus/components/table-column/TableColumn.vue.es.js +34 -0
- package/dist/element-plus/components/table-column/TableColumn.vue.es2.js +4 -0
- package/dist/element-plus/components/upload/accept/index.es.js +12 -0
- package/dist/element-plus/components/upload/index.es.js +35 -0
- package/dist/element-plus/components/upload/select-file/SelectFile.vue.es.js +7 -0
- package/dist/element-plus/components/upload/select-file/SelectFile.vue.es2.js +66 -0
- package/dist/element-plus/components/upload/upload-files/UploadFiles.vue.es.js +7 -0
- package/dist/element-plus/components/upload/upload-files/UploadFiles.vue.es2.js +204 -0
- package/dist/element-plus/components/upload/upload-images/UploadImages.vue.es.js +7 -0
- package/dist/element-plus/components/upload/upload-images/UploadImages.vue.es2.js +212 -0
- package/dist/element-plus/hooks/dialog/index.es.js +44 -0
- package/dist/element-plus/hooks/form/index.es.js +45 -0
- package/dist/element-plus/hooks/form-dialog/index.es.js +53 -0
- package/dist/element-plus/hooks/table-sort/index.es.js +30 -0
- package/dist/element-plus/index.es.js +51 -0
- package/dist/element-plus/utils/form-rule/rule.es.js +107 -0
- package/dist/element-plus/utils/table-util/index.es.js +56 -0
- package/dist/entity/BigFloat.es.js +102 -0
- package/dist/entity/Pages.es.js +11 -0
- package/dist/entity/RejectError.es.js +35 -0
- package/dist/entity/index.es.js +8 -0
- package/dist/hooks/index.es.js +4 -0
- package/dist/hooks/table-search/index.es.js +72 -0
- package/dist/icons/images/Image.svg.es.js +4 -0
- package/dist/icons/images/ImageError.svg.es.js +4 -0
- package/dist/icons/index.es.js +12 -0
- package/dist/index.es.js +111 -0
- package/dist/mrxy-yk.css +1 -0
- package/dist/resolver/index.es.js +24 -0
- package/dist/styles/plugins/colors/index.scss +52 -0
- package/dist/styles/plugins/colors/var.scss +77 -0
- package/dist/styles/plugins/template.scss +37 -0
- package/dist/utils/amap/index.es.js +21 -0
- package/dist/utils/amap/utils/coordinates.es.js +61 -0
- package/dist/utils/amap/utils/index.es.js +39 -0
- package/dist/utils/echarts/hooks/index.es.js +32 -0
- package/dist/utils/echarts/modules/coordinate/basic.es.js +103 -0
- package/dist/utils/echarts/modules/coordinate/cartesian.es.js +79 -0
- package/dist/utils/echarts/modules/series/bar.es.js +43 -0
- package/dist/utils/echarts/modules/series/line.es.js +47 -0
- package/dist/utils/echarts/modules/series/pie.es.js +126 -0
- package/dist/utils/echarts/utils/assignOption.es.js +40 -0
- package/dist/utils/echarts/utils/index.es.js +99 -0
- package/dist/utils/fn-periodically/FnBatchPeriodically.es.js +70 -0
- package/dist/utils/fn-periodically/FnPeriodically.es.js +85 -0
- package/dist/utils/index.es.js +49 -0
- package/dist/utils/match-unit/dataset.es.js +143 -0
- package/dist/utils/match-unit/index.es.js +56 -0
- package/dist/utils/mitt/hooks/inject-events/index.es.js +27 -0
- package/dist/utils/prototype/lib/ArrayUtil.es.js +115 -0
- package/dist/utils/prototype/lib/ComponentUtil.es.js +45 -0
- package/dist/utils/prototype/lib/NumberUtil.es.js +17 -0
- package/dist/utils/prototype/lib/ObjectUtil.es.js +277 -0
- package/dist/utils/prototype/lib/PromiseUtil.es.js +18 -0
- package/dist/utils/transition-fade/index.es.js +79 -0
- package/global.d.ts +55 -0
- package/package.json +134 -0
- package/web-types-mr.json +923 -0
- package/web-types-yk.json +923 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
type UseDialogHooksOptions<SP extends any[], CP extends any[]> = {
|
|
3
|
+
// 对话框打开之前钩子
|
|
4
|
+
beforeShow?(...args: SP): boolean | Promise<boolean> | undefined | void
|
|
5
|
+
// 对话框打开之后钩子
|
|
6
|
+
show?(...args: SP): void
|
|
7
|
+
// 对话框关闭之前钩子
|
|
8
|
+
beforeClose?(...args: CP): boolean | Promise<boolean> | undefined | void
|
|
9
|
+
// 对话框关闭之后钩子
|
|
10
|
+
close?(...args: CP): void
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type UseDialogHooksExample<SP extends any[], CP extends any[]> = {
|
|
14
|
+
// 展示对话框,返回是否打开成功
|
|
15
|
+
show(...args: SP): Promise<boolean>
|
|
16
|
+
// 关闭对话框,返回是否关闭成功
|
|
17
|
+
close(...args: CP): Promise<boolean>
|
|
18
|
+
// 当前展示状态,提供双向绑定
|
|
19
|
+
model: Ref<boolean>
|
|
20
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { FormInstance, FormRules } from 'element-plus';
|
|
2
|
+
import { ShallowRef, Ref } from 'vue';
|
|
3
|
+
type UseFormHooksOptions<
|
|
4
|
+
M = Record<string, any>,
|
|
5
|
+
S extends any[]
|
|
6
|
+
> = {
|
|
7
|
+
// 表单ref名称
|
|
8
|
+
ref?: string | ShallowRef<FormInstance>
|
|
9
|
+
// 表单对象
|
|
10
|
+
form?: M | Ref<M>
|
|
11
|
+
// 表单验证规则
|
|
12
|
+
rules?: FormRules<string>
|
|
13
|
+
// 提交实现方法
|
|
14
|
+
submit?(...args: S): Promise<unknown> | void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type UseFormHooksExample<
|
|
18
|
+
M = Record<string, any>,
|
|
19
|
+
S extends any[]
|
|
20
|
+
> = {
|
|
21
|
+
// 表单实例
|
|
22
|
+
ref: ShallowRef<FormInstance>
|
|
23
|
+
// 响应式表单对象
|
|
24
|
+
form: Ref<M>
|
|
25
|
+
// 表单验证规则
|
|
26
|
+
rules: FormRules<string>
|
|
27
|
+
// 提交
|
|
28
|
+
submit(...args: S): void
|
|
29
|
+
// 重置表单
|
|
30
|
+
resetFields(): void
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type _UseFormHooksOptions<
|
|
34
|
+
M = Record<string, any>,
|
|
35
|
+
S extends any[]
|
|
36
|
+
> = UseFormHooksOptions<M, S> & {
|
|
37
|
+
beforeSubmit?(): Promise<void>
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type _UseFormHooksExample<
|
|
41
|
+
M = Record<string, any>,
|
|
42
|
+
S extends any[]
|
|
43
|
+
> = UseFormHooksExample<M, S> & {
|
|
44
|
+
_option: _UseFormHooksOptions<M, S>
|
|
45
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { UseFormDialogHooksExample, UseFormDialogHooksOptions } from './type';
|
|
2
|
+
export declare function useElFormDialogHooks<M = Record<string, any>, S extends any[] = [], SP extends any[] = [], CP extends any[] = []>(options: UseFormDialogHooksOptions<M, S, SP, CP>): UseFormDialogHooksExample<M, S, SP, CP>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ShallowRef, Ref } from 'vue';
|
|
2
|
+
import { FormInstance, FormRules } from 'element-plus';
|
|
3
|
+
import { _UseFormHooksExample } from '../form/type';
|
|
4
|
+
export type UseFormDialogHooksOptions<
|
|
5
|
+
M = Record<string, any>,
|
|
6
|
+
S extends any[],
|
|
7
|
+
SP extends any[],
|
|
8
|
+
CP extends any[]
|
|
9
|
+
> = {
|
|
10
|
+
// 表单ref名称
|
|
11
|
+
ref?: string | ShallowRef<FormInstance>
|
|
12
|
+
// 表单对象
|
|
13
|
+
form?: M | Ref<M>
|
|
14
|
+
// 表单验证规则
|
|
15
|
+
rules?: FormRules
|
|
16
|
+
// 提交实现方法 如果`submit`返回的是`Promise`,`submitAutoClose`缺省值为`true`
|
|
17
|
+
submit?(...args: S): Promise<unknown> | void
|
|
18
|
+
// 对话框打开之前钩子
|
|
19
|
+
beforeShow?(...args: SP): boolean | Promise<boolean> | undefined | void
|
|
20
|
+
// 对话框打开之后钩子
|
|
21
|
+
show?(...args: SP): void
|
|
22
|
+
// 对话框关闭之前钩子
|
|
23
|
+
beforeClose?(...args: CP): boolean | Promise<boolean> | undefined | void
|
|
24
|
+
// 对话框关闭之后钩子
|
|
25
|
+
close?(...args: CP): void
|
|
26
|
+
// 对话框标题,根据form自动补充为添加XX或编辑XX,如"添加用户"
|
|
27
|
+
title?: string
|
|
28
|
+
// 关闭自动清空表单
|
|
29
|
+
closeResetFields?: boolean
|
|
30
|
+
// 提交后自动关闭,如果`submit`返回的是`Promise`,`submitAutoClose`缺省值为`true`
|
|
31
|
+
submitAutoClose?: boolean
|
|
32
|
+
// 提交后自动上传文件 仅配合使用ElFormDialog组件时生效
|
|
33
|
+
submitAutoUploadFile?: boolean
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type UseFormDialogHooksExample<
|
|
37
|
+
M = Record<string, any>,
|
|
38
|
+
S extends any[],
|
|
39
|
+
SP extends any[],
|
|
40
|
+
CP extends any[]
|
|
41
|
+
> = {
|
|
42
|
+
// 表单实例
|
|
43
|
+
ref: ShallowRef<FormInstance>
|
|
44
|
+
// 响应式表单对象
|
|
45
|
+
form: Ref<M>
|
|
46
|
+
// 表单验证规则
|
|
47
|
+
rules: FormRules
|
|
48
|
+
// 提交
|
|
49
|
+
submit(...args: S): void | Promise<unknown>
|
|
50
|
+
// 重置表单
|
|
51
|
+
resetFields(): void
|
|
52
|
+
// 展示对话框,返回是否打开成功
|
|
53
|
+
show(...args: SP): Promise<boolean>
|
|
54
|
+
// 关闭对话框,返回是否关闭成功
|
|
55
|
+
close(...args: CP): Promise<boolean>
|
|
56
|
+
// 当前展示状态,提供双向绑定
|
|
57
|
+
model: Ref<boolean>
|
|
58
|
+
// 对话框标题
|
|
59
|
+
title: Ref<string>
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type _UseFormDialogHooksExample<
|
|
63
|
+
M = Record<string, any>,
|
|
64
|
+
S extends any[],
|
|
65
|
+
SP extends any[],
|
|
66
|
+
CP extends any[]
|
|
67
|
+
> = UseFormDialogHooksExample<M, S, SP, CP> & {
|
|
68
|
+
_formHook: _UseFormHooksExample<M, []>,
|
|
69
|
+
_options: UseFormDialogHooksOptions<M, [], [], []>
|
|
70
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UseTableSortHooksExample, UseTableSortHooksOptions } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* 此Hook用于给`ElTable`或一些列表进行排序,属于纯前端排序,所以需要获取到所有数据。
|
|
4
|
+
* 使用方式
|
|
5
|
+
* 初始化
|
|
6
|
+
* ``` typescript
|
|
7
|
+
* const tableData = ref([])
|
|
8
|
+
* const hook = useElTableSortHooks({ data: tableData })
|
|
9
|
+
* ```
|
|
10
|
+
* 在循环中使用`ElInputNumber`,使用`sortValue`绑定数据,使用`sort`触发排序
|
|
11
|
+
* ``` html
|
|
12
|
+
* <el-input-number
|
|
13
|
+
* v-model="hook.sortValue.value[index]"
|
|
14
|
+
* @keyup.enter="hook.sort(index)"
|
|
15
|
+
* @blur="hook.sort(index)"
|
|
16
|
+
* />
|
|
17
|
+
* ```
|
|
18
|
+
* @param options
|
|
19
|
+
*/
|
|
20
|
+
export declare function useElTableSortHooks(options: UseTableSortHooksOptions): UseTableSortHooksExample;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export type UseTableSortHooksOptions = {
|
|
3
|
+
// 列表数据
|
|
4
|
+
data: Ref<any[]>
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type UseTableSortHooksExample = {
|
|
8
|
+
// 当前排序功能开启状态
|
|
9
|
+
isEnable: Ref<boolean>
|
|
10
|
+
// 启用排序功能
|
|
11
|
+
enable(): void
|
|
12
|
+
// 禁用排序功能
|
|
13
|
+
disable(): void
|
|
14
|
+
/**
|
|
15
|
+
* 触发排序
|
|
16
|
+
* @param index 修改项的序号
|
|
17
|
+
*/
|
|
18
|
+
sort(index: number): void
|
|
19
|
+
// 排序序号
|
|
20
|
+
sortValue: Ref<number[]>
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TableColumnCtx } from 'element-plus';
|
|
2
|
+
export namespace TableSlot {
|
|
3
|
+
export type Default<T> = {
|
|
4
|
+
row: T,
|
|
5
|
+
column: TableColumnCtx<T>,
|
|
6
|
+
$index: number
|
|
7
|
+
}
|
|
8
|
+
export type D<T> = TableSlot.Default<T>
|
|
9
|
+
|
|
10
|
+
export type Header<T> = {
|
|
11
|
+
column: TableColumnCtx<T>,
|
|
12
|
+
$index: number
|
|
13
|
+
}
|
|
14
|
+
export type H<T> = TableSlot.Header<T>
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ElFormRuleRequired, ElFormRuleValidator } from './type';
|
|
2
|
+
import { FormItemRule } from 'element-plus';
|
|
3
|
+
export declare const required: ElFormRuleRequired;
|
|
4
|
+
export declare const validator: ElFormRuleValidator;
|
|
5
|
+
export declare function phoneTag(value: string): Error;
|
|
6
|
+
export declare const phoneRule: FormItemRule;
|
|
7
|
+
export declare function usernameTag(value: string): Error;
|
|
8
|
+
export declare const usernameRule: FormItemRule;
|
|
9
|
+
export declare function passwordTag(value: string): Error;
|
|
10
|
+
export declare const passwordRule: FormItemRule;
|
|
11
|
+
export declare function positionTag(value: string): Error;
|
|
12
|
+
export declare const positionRule: FormItemRule;
|
|
13
|
+
export declare function ipTag(value: string): Error;
|
|
14
|
+
export declare const ipRule: FormItemRule;
|
|
15
|
+
export declare function numberTag(value: number | string): Error;
|
|
16
|
+
export declare const numberRule: FormItemRule;
|
|
17
|
+
export declare function positiveNumberTag(value: number | string): Error;
|
|
18
|
+
export declare const positiveNumberRule: FormItemRule;
|
|
19
|
+
export declare function integerTag(value: number | string): Error;
|
|
20
|
+
export declare const integerRule: FormItemRule;
|
|
21
|
+
export declare function positiveIntegerTag(value: number | string): Error;
|
|
22
|
+
export declare const positiveIntegerRule: FormItemRule;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormItemRule } from 'element-plus';
|
|
2
|
+
export type ElFormRuleRequired = {
|
|
3
|
+
(message?: string, trigger?: string): FormItemRule,
|
|
4
|
+
blur(message?: string): FormItemRule,
|
|
5
|
+
change(message?: string): FormItemRule
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type ElValidator = FormItemRule['validator']
|
|
9
|
+
|
|
10
|
+
export type ElFormRuleValidator = {
|
|
11
|
+
(fn: ElValidator, ops?: FormItemRule): FormItemRule,
|
|
12
|
+
blur(fn: ElValidator, ops?: FormItemRule): FormItemRule,
|
|
13
|
+
change(fn: ElValidator, ops?: FormItemRule): FormItemRule
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TableInstance } from 'element-plus';
|
|
2
|
+
import { Pages } from '../../../entity/Pages';
|
|
3
|
+
/**
|
|
4
|
+
* 表格工具包
|
|
5
|
+
*/
|
|
6
|
+
export declare const TableUtil: {
|
|
7
|
+
/**
|
|
8
|
+
* 计算表格序号
|
|
9
|
+
* @param pages
|
|
10
|
+
*/
|
|
11
|
+
indexMethod(pages: Pages): (index: number) => number;
|
|
12
|
+
/**
|
|
13
|
+
* 前端分页
|
|
14
|
+
* @param tableData
|
|
15
|
+
* @param pages
|
|
16
|
+
*/
|
|
17
|
+
paging<T>(tableData: T[], pages: Pages): T[];
|
|
18
|
+
/**
|
|
19
|
+
* 高亮某一行
|
|
20
|
+
* @param ref
|
|
21
|
+
* @param index
|
|
22
|
+
* @param timeout
|
|
23
|
+
*/
|
|
24
|
+
highlightRow(ref: TableInstance, index: number, timeout?: number): void;
|
|
25
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare class BigFloat {
|
|
2
|
+
private precision;
|
|
3
|
+
private currentValue;
|
|
4
|
+
constructor(value: number | string, _precision?: number);
|
|
5
|
+
/**
|
|
6
|
+
* 转为BigFloat
|
|
7
|
+
* @param value
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
10
|
+
private toBigFloat;
|
|
11
|
+
/**
|
|
12
|
+
* 获取对其小数位后的值
|
|
13
|
+
* @param bigFloat
|
|
14
|
+
* @param precision
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
private getComputeBigInt;
|
|
18
|
+
/**
|
|
19
|
+
* 获取倍数
|
|
20
|
+
* @param precision
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
23
|
+
private decimalsAgainst;
|
|
24
|
+
/**
|
|
25
|
+
* 加法
|
|
26
|
+
* @param value
|
|
27
|
+
*/
|
|
28
|
+
add(value: number | string | BigFloat): this;
|
|
29
|
+
/**
|
|
30
|
+
* 减法
|
|
31
|
+
* @param value
|
|
32
|
+
*/
|
|
33
|
+
subtract(value: number | string | BigFloat): this;
|
|
34
|
+
/**
|
|
35
|
+
* 乘法
|
|
36
|
+
* @param value
|
|
37
|
+
*/
|
|
38
|
+
multiply(value: number | string | BigFloat): this;
|
|
39
|
+
/**
|
|
40
|
+
* 除法
|
|
41
|
+
* @param value
|
|
42
|
+
*/
|
|
43
|
+
divide(value: number | string | BigFloat): this;
|
|
44
|
+
/**
|
|
45
|
+
* 获取结果
|
|
46
|
+
*/
|
|
47
|
+
get value(): string;
|
|
48
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Promise 异常类
|
|
3
|
+
* @author 木人心
|
|
4
|
+
* @version 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* 以Promise的reject被try时可以携带数据到catch中为思路,创建RejectError异常类可以throw出带有数据的类
|
|
8
|
+
*/
|
|
9
|
+
export declare class RejectError extends Error {
|
|
10
|
+
readonly name: 'RejectError';
|
|
11
|
+
readonly code: number;
|
|
12
|
+
readonly message: '';
|
|
13
|
+
readonly data: any;
|
|
14
|
+
constructor(message: string);
|
|
15
|
+
constructor(code: number, message: string);
|
|
16
|
+
constructor(code: number, data: {
|
|
17
|
+
[p: string]: any;
|
|
18
|
+
});
|
|
19
|
+
constructor(args: {
|
|
20
|
+
code: number;
|
|
21
|
+
message?: string;
|
|
22
|
+
data: any;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './table-search';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ShallowRef, Ref } from 'vue';
|
|
2
|
+
import { UseTableSearchHooksExample, UseTableSearchHooksOptions } from './type';
|
|
3
|
+
export declare function useTableSearchHooks<TD, SP extends Record<string, any>, SHP extends any[], TDP extends any[], TDT extends (Ref<TD[]> | ShallowRef<TD[]>), TDR = void>(options: UseTableSearchHooksOptions<TD, SP, SHP, TDP, TDT, TDR>): UseTableSearchHooksExample<TD, SP, SHP, TDP, TDT, TDR>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Pages } from '../../entity/Pages';
|
|
2
|
+
import { ShallowRef, Ref } from 'vue';
|
|
3
|
+
import { TableInstance } from 'element-plus';
|
|
4
|
+
type UseTableSearchHooksOptions<
|
|
5
|
+
TD,
|
|
6
|
+
SP extends Record<string, any>,
|
|
7
|
+
SHP extends any[],
|
|
8
|
+
TDP extends any[],
|
|
9
|
+
TDT extends (Ref<TD[]> | ShallowRef<TD[]>),
|
|
10
|
+
TDR
|
|
11
|
+
> = {
|
|
12
|
+
// 搜索参数,缺省值ref({})
|
|
13
|
+
searchParams?: SP | Ref<SP>,
|
|
14
|
+
// 搜索方法,缺省值:基础搜索功能
|
|
15
|
+
searchHandle?(...args: SHP): void
|
|
16
|
+
// 表格数据,缺省值:shallowRef([])
|
|
17
|
+
tableData?: TDT
|
|
18
|
+
// 表格实例
|
|
19
|
+
tableRef?: string | ShallowRef<TableInstance>
|
|
20
|
+
// 获取表格数据
|
|
21
|
+
getTableData(...args: TDP): TDR
|
|
22
|
+
// 删除表格项目
|
|
23
|
+
delTableItem?(id: string): void
|
|
24
|
+
// 删除确认框提示内容
|
|
25
|
+
deleteConfirmMessage?: string
|
|
26
|
+
// 删除确认框提示标题
|
|
27
|
+
deleteConfirmTitle?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
type UseTableSearchHooksExample<
|
|
31
|
+
TD,
|
|
32
|
+
SP extends Record<string, any>,
|
|
33
|
+
SHP extends any[],
|
|
34
|
+
TDP extends any[],
|
|
35
|
+
TDT extends (Ref<TD[]> | ShallowRef<TD[]>),
|
|
36
|
+
TDR
|
|
37
|
+
> = {
|
|
38
|
+
// 搜索参数,缺省值ref({})
|
|
39
|
+
searchParams: Ref<SP>
|
|
40
|
+
searchHandle(...args: SHP)
|
|
41
|
+
searchPages: Ref<Pages>
|
|
42
|
+
getPagesParams(): {
|
|
43
|
+
param: SP,
|
|
44
|
+
pageNum: number
|
|
45
|
+
pageSize: number
|
|
46
|
+
}
|
|
47
|
+
tableRef?: ShallowRef<TableInstance>
|
|
48
|
+
tableData: TDT
|
|
49
|
+
getTableData(...args: TDP): TDR
|
|
50
|
+
delTableItem(id: string): void
|
|
51
|
+
setTotal(total: number): void
|
|
52
|
+
setTableData(tableData: TD[]): void
|
|
53
|
+
searchedParams: ShallowRef<SP>
|
|
54
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
export type * from './type.d.ts';
|
|
3
|
+
export type * from './typings.d.ts';
|
|
4
|
+
export * from './directive';
|
|
5
|
+
export * from './element-plus';
|
|
6
|
+
export * from './hooks';
|
|
7
|
+
export * from './utils';
|
|
8
|
+
export * from './entity';
|
|
9
|
+
export * from './icons';
|
|
10
|
+
declare const _default: {
|
|
11
|
+
install(app: App): void;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as YkComponents from './components'
|
|
2
|
+
import type * as YkElComponents from './element-plus/components'
|
|
3
|
+
|
|
4
|
+
export type YkAdaptiveBoxInstance = InstanceType<typeof YkComponents.YkAdaptiveBox>
|
|
5
|
+
export type YkDragDropContainerInstance = InstanceType<typeof YkComponents.YkDragDropContainer>
|
|
6
|
+
export type YkPositionAnchorInstance = InstanceType<typeof YkComponents.YkPositionAnchor>
|
|
7
|
+
export type YkYsVideoInstance = InstanceType<typeof YkComponents.YkYsVideo>
|
|
8
|
+
export type YkEChartsCanvasInstance = InstanceType<typeof YkComponents.YkEChartsCanvas>
|
|
9
|
+
|
|
10
|
+
export type YkElUploadFilesInstance = InstanceType<typeof YkElComponents.YkElUploadFiles>
|
|
11
|
+
export type YkElUploadImagesInstance = InstanceType<typeof YkElComponents.YkElUploadImages>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// 【类型推导】 获取数组的类型
|
|
2
|
+
export type ArrayType<T extends Array<any>> = T extends Array<infer P> ? P : never
|
|
3
|
+
|
|
4
|
+
// 【类型推导】 获取Promise的类型
|
|
5
|
+
export type PromiseType<T extends Promise<any>> = T extends Promise<infer P> ? P : never
|
|
6
|
+
|
|
7
|
+
// 【类型生成】 强制替换并生成类型 *递归类型合并,可能会占用过多性能,少用
|
|
8
|
+
export type ReplaceType<T, U> = {
|
|
9
|
+
[K in keyof T | keyof U]?: K extends keyof U
|
|
10
|
+
? K extends keyof T
|
|
11
|
+
? U[K] extends object
|
|
12
|
+
? T[K] extends object
|
|
13
|
+
? ReplaceType<T[K], U[K]>
|
|
14
|
+
: U[K]
|
|
15
|
+
: U[K]
|
|
16
|
+
: U[K]
|
|
17
|
+
: K extends keyof T
|
|
18
|
+
? T[K]
|
|
19
|
+
: never
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Map as _Map } from './Map';
|
|
2
|
+
import { LngLat as _LngLat } from './LngLat';
|
|
3
|
+
import { Bounds as _Bounds } from './Bounds';
|
|
4
|
+
import { Size as _Size } from './Size';
|
|
5
|
+
import { Pixel as _Pixel } from './Pixel';
|
|
6
|
+
import { Control as _Control } from './Control';
|
|
7
|
+
import { Marker as _Marker } from './Marker';
|
|
8
|
+
import { InfoWindow as _InfoWindow } from './InfoWindow';
|
|
9
|
+
import { Icon as _Icon } from './Icon';
|
|
10
|
+
import { MarkerCluster as _MarkerCluster } from './MarkerCluster';
|
|
11
|
+
import { Polyline as _Polyline } from './Polyline';
|
|
12
|
+
export namespace AMap {
|
|
13
|
+
export class Map extends _Map {}
|
|
14
|
+
export class LngLat extends _LngLat {}
|
|
15
|
+
export class Bounds extends _Bounds {}
|
|
16
|
+
export class Size extends _Size {}
|
|
17
|
+
export class Pixel extends _Pixel {}
|
|
18
|
+
export class Control extends _Control {}
|
|
19
|
+
export class Marker extends _Marker {}
|
|
20
|
+
export class InfoWindow extends _InfoWindow {}
|
|
21
|
+
export class Icon extends _Icon {}
|
|
22
|
+
export class MarkerCluster extends _MarkerCluster {}
|
|
23
|
+
export class Polyline extends _Polyline {}
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AMap } from './AMap';
|
|
2
|
+
export class Bounds {
|
|
3
|
+
constructor(southWest: AMap.LngLat, northEast: LngLat)
|
|
4
|
+
|
|
5
|
+
getSouthWest(): AMap.LngLat
|
|
6
|
+
|
|
7
|
+
getNorthEast(): AMap.LngLat
|
|
8
|
+
|
|
9
|
+
getNorthWest(): AMap.LngLat
|
|
10
|
+
|
|
11
|
+
getSouthEast(): AMap.LngLat
|
|
12
|
+
|
|
13
|
+
contains(obj: AMap.LngLat): boolean
|
|
14
|
+
|
|
15
|
+
getCenter(): AMap.LngLat
|
|
16
|
+
|
|
17
|
+
toString(): string
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class Control {
|
|
2
|
+
constructor(opts: ControlConfig, offset: number[])
|
|
3
|
+
|
|
4
|
+
addTo(map: AMap.Map): void
|
|
5
|
+
|
|
6
|
+
removeFrom(): void
|
|
7
|
+
|
|
8
|
+
show(): void
|
|
9
|
+
|
|
10
|
+
hide(): void
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface ControlConfig {
|
|
14
|
+
position: string | {
|
|
15
|
+
top?: number, left?: number, right?: number, bottom?: number
|
|
16
|
+
} | {
|
|
17
|
+
LT: number, RT: number, LB: number, RB: number
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class Event<D extends Record<string, any>> {
|
|
2
|
+
on<K extends keyof D>(type: K, fn: { (data: D[K]): void }, context?: any, once?: boolean)
|
|
3
|
+
|
|
4
|
+
off<K extends keyof D>(type: K, fn: { (data: D[K]): void }, context?: any)
|
|
5
|
+
|
|
6
|
+
hasEvents<K extends keyof D>(type: K, fn: { (data: D[K]): void }, context?: any)
|
|
7
|
+
|
|
8
|
+
clearEvents<K extends keyof D>(type: K)
|
|
9
|
+
|
|
10
|
+
emit<K extends keyof D>(type: K, data: any)
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AMap } from './AMap';
|
|
2
|
+
import { Vector2 } from './index';
|
|
3
|
+
export class Icon {
|
|
4
|
+
constructor(opts?: IconOpts)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface IconOpts {
|
|
8
|
+
size?: AMap.Size | Vector2
|
|
9
|
+
imageOffset?: AMap.Pixel | Vector2
|
|
10
|
+
image?: string
|
|
11
|
+
imageSize?: AMap.Size | Vector2
|
|
12
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Event } from './Event';
|
|
2
|
+
import { AMap } from './AMap';
|
|
3
|
+
import { MouseEvent } from './Map';
|
|
4
|
+
import { Vector2, Anchor } from './index';
|
|
5
|
+
export class InfoWindow extends Event<InfoWindowEvent> {
|
|
6
|
+
constructor(opts: InfoOptions)
|
|
7
|
+
|
|
8
|
+
open(map: AMap.Map, position: Vector2, height?: number): void
|
|
9
|
+
|
|
10
|
+
close(): void
|
|
11
|
+
|
|
12
|
+
getIsOpen(): boolean
|
|
13
|
+
|
|
14
|
+
setSize(size: AMap.Size | Vector2): void
|
|
15
|
+
|
|
16
|
+
setContent(content: string | HTMLElement): void
|
|
17
|
+
|
|
18
|
+
setAnchor(anchor: Anchor): void
|
|
19
|
+
|
|
20
|
+
getExtData(): any
|
|
21
|
+
|
|
22
|
+
setExtData(extData: any)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface InfoOptions {
|
|
26
|
+
isCustom?: boolean,
|
|
27
|
+
autoMove?: boolean,
|
|
28
|
+
avoid?: number[],
|
|
29
|
+
closeWhenClickMap?: boolean,
|
|
30
|
+
content?: string | HTMLElement,
|
|
31
|
+
size?: AMap.Size,
|
|
32
|
+
anchor?: Anchor,
|
|
33
|
+
offset?: Vector2 | AMap.Pixel,
|
|
34
|
+
position?: Vector2 | AMap.Pixel
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// region Event
|
|
38
|
+
type InfoWindowEventType = 'open' | 'close';
|
|
39
|
+
type InfoWindowEvent = Record<InfoWindowEventType, MouseEvent>
|
|
40
|
+
// endregion
|