@king-one/antdv 1.1.9 → 1.1.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/CHANGELOG.md +12 -0
- package/dist/es/components/collapse-transtion/hooks/use-collapse-transtion.mjs +108 -41
- package/dist/es/components/collapse-transtion/index.mjs +7 -7
- package/dist/es/components/collapse-transtion/src/collapse-transtion.vue.mjs +2 -2
- package/dist/es/components/collapse-transtion/src/collapse-transtion.vue2.mjs +24 -19
- package/dist/es/components/collapse-transtion/src/types.mjs +3 -3
- package/dist/es/components/cover-scroll-bar/hooks/use-has-scroll.mjs +25 -12
- package/dist/es/components/cover-scroll-bar/index.mjs +7 -7
- package/dist/es/components/cover-scroll-bar/src/cover-scroll-bar.mjs +198 -123
- package/dist/es/components/cover-scroll-bar/src/types.mjs +2 -2
- package/dist/es/components/form/component/form-item.vue.mjs +2 -2
- package/dist/es/components/form/component/form-item.vue2.mjs +58 -51
- package/dist/es/components/form/component/form.mjs +5 -4
- package/dist/es/components/form/component/form.vue.mjs +2 -2
- package/dist/es/components/form/component/form.vue2.mjs +21 -18
- package/dist/es/components/form/content/form-content.mjs +9 -9
- package/dist/es/components/form/index.mjs +11 -10
- package/dist/es/components/icon/index.mjs +5 -5
- package/dist/es/components/icon/src/icon.vue.mjs +2 -2
- package/dist/es/components/icon/src/icon.vue2.mjs +31 -21
- package/dist/es/components/icon/src/types.mjs +3 -3
- package/dist/es/components/index.mjs +35 -35
- package/dist/es/components/plus-upload/apis/plus-upload.api.mjs +8 -8
- package/dist/es/components/plus-upload/hook/useExtractPlusUpload.mjs +37 -28
- package/dist/es/components/plus-upload/hook/usePlusUpload.mjs +29 -18
- package/dist/es/components/plus-upload/images/pdf-icon.png.mjs +2 -2
- package/dist/es/components/plus-upload/images/word-icon.png.mjs +2 -2
- package/dist/es/components/plus-upload/images/xls-icon.png.mjs +2 -2
- package/dist/es/components/plus-upload/index.mjs +5 -5
- package/dist/es/components/plus-upload/src/plus-upload.vue.mjs +2 -2
- package/dist/es/components/plus-upload/src/plus-upload.vue2.mjs +180 -139
- package/dist/es/components/plus-upload/src/types.mjs +22 -10
- package/dist/es/components/pro-area/apis/pro-area.api.mjs +3 -3
- package/dist/es/components/pro-area/hooks/use-pro-area.mjs +9 -8
- package/dist/es/components/pro-area/index.mjs +9 -9
- package/dist/es/components/pro-area/src/ProArea.vue.mjs +2 -2
- package/dist/es/components/pro-area/src/ProArea.vue2.mjs +116 -82
- package/dist/es/components/pro-area/src/types.mjs +4 -3
- package/dist/es/components/pro-contract-view/apis/pro-contract-view.api.mjs +7 -7
- package/dist/es/components/pro-contract-view/hooks/use-contract-view.mjs +28 -22
- package/dist/es/components/pro-contract-view/index.mjs +7 -7
- package/dist/es/components/pro-contract-view/src/pro-contract-view.vue.mjs +2 -2
- package/dist/es/components/pro-contract-view/src/pro-contract-view.vue2.mjs +127 -103
- package/dist/es/components/pro-contract-view/src/types.mjs +6 -6
- package/dist/es/components/pro-loading/index.mjs +2 -2
- package/dist/es/components/pro-loading/src/pro-loading.mjs +48 -32
- package/dist/es/components/pro-modal/hooks/useProModal.mjs +38 -25
- package/dist/es/components/pro-modal/index.mjs +8 -8
- package/dist/es/components/pro-modal/src/ProModal.vue.mjs +2 -2
- package/dist/es/components/pro-modal/src/ProModal.vue2.mjs +111 -79
- package/dist/es/components/pro-modal/src/types.mjs +4 -4
- package/dist/es/components/pro-overlay/index.mjs +5 -5
- package/dist/es/components/pro-overlay/src/pro-overlay.vue.mjs +2 -2
- package/dist/es/components/pro-overlay/src/pro-overlay.vue2.mjs +36 -29
- package/dist/es/components/pro-picker/apis/pro-picker.api.mjs +6 -6
- package/dist/es/components/pro-picker/index.mjs +8 -8
- package/dist/es/components/pro-picker/src/ProPicker.vue.mjs +2 -2
- package/dist/es/components/pro-picker/src/ProPicker.vue2.mjs +90 -74
- package/dist/es/components/pro-picker/src/types.mjs +10 -4
- package/dist/es/components/pro-signature/index.mjs +7 -7
- package/dist/es/components/pro-signature/src/ProSignature.vue.mjs +2 -2
- package/dist/es/components/pro-signature/src/ProSignature.vue2.mjs +216 -103
- package/dist/es/components/pro-signature/src/types.mjs +4 -4
- package/dist/es/components/pro-table/hooks/use-pro-table.mjs +9 -8
- package/dist/es/components/pro-table/index.mjs +7 -7
- package/dist/es/components/pro-table/src/constants.mjs +8 -6
- package/dist/es/components/pro-table/src/field/field-date-range/field-date-range.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/field/field-date-range/field-date-range.vue2.mjs +22 -17
- package/dist/es/components/pro-table/src/field/field-input/field-input.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/field/field-input/field-input.vue2.mjs +22 -17
- package/dist/es/components/pro-table/src/field/field-radio/field-radio.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/field/field-radio/field-radio.vue2.mjs +50 -43
- package/dist/es/components/pro-table/src/field/field-select/field-select.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/field/field-select/field-select.vue2.mjs +50 -43
- package/dist/es/components/pro-table/src/field/field.css +3 -1
- package/dist/es/components/pro-table/src/field/field.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/field/field.vue2.mjs +127 -102
- package/dist/es/components/pro-table/src/form-render.css +3 -1
- package/dist/es/components/pro-table/src/form-render.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/form-render.vue2.mjs +148 -127
- package/dist/es/components/pro-table/src/hooks/use-form.mjs +20 -17
- package/dist/es/components/pro-table/src/hooks/use-table.mjs +47 -29
- package/dist/es/components/pro-table/src/pro-table.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/pro-table.vue2.mjs +170 -155
- package/dist/es/components/pro-table/utils.mjs +10 -10
- package/dist/es/components/pro-tag/index.mjs +7 -7
- package/dist/es/components/pro-tag/src/ProTag.vue.mjs +2 -2
- package/dist/es/components/pro-tag/src/ProTag.vue2.mjs +28 -19
- package/dist/es/components/pro-tag/src/types.mjs +4 -3
- package/dist/es/components/pro-title/index.mjs +7 -7
- package/dist/es/components/pro-title/src/ProTitle.vue.mjs +2 -2
- package/dist/es/components/pro-title/src/ProTitle.vue2.mjs +47 -36
- package/dist/es/components/pro-title/src/types.mjs +4 -4
- package/dist/es/components/pro-upload/index.mjs +7 -7
- package/dist/es/components/pro-upload/src/assets/images/audio-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/materials-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/pdf-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/ppt-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/video-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/word-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/xls-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/zip-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/data.mjs +18 -18
- package/dist/es/components/pro-upload/src/file-list.mjs +70 -55
- package/dist/es/components/pro-upload/src/gd-upload.mjs +163 -132
- package/dist/es/components/pro-upload/src/hooks/index.mjs +4 -4
- package/dist/es/components/pro-upload/src/hooks/useHttp.mjs +8 -8
- package/dist/es/components/pro-upload/src/hooks/useUpload.mjs +66 -36
- package/dist/es/components/pro-upload/src/props.mjs +6 -6
- package/dist/es/components/pro-upload/src/utils/index.mjs +38 -25
- package/dist/es/components/scale-virtual-list/component/scale-virtual-list.vue.mjs +2 -2
- package/dist/es/components/scale-virtual-list/component/scale-virtual-list.vue2.mjs +83 -69
- package/dist/es/components/scale-virtual-list/hooks/useVirtualList.mjs +176 -125
- package/dist/es/components/scale-virtual-list/index.mjs +5 -5
- package/dist/es/components/scroll-bar/index.mjs +7 -7
- package/dist/es/components/scroll-bar/src/scroll-bar.mjs +390 -240
- package/dist/es/components/scroll-bar/src/types.mjs +2 -2
- package/dist/es/components/utils/install.mjs +16 -14
- package/dist/es/hooks/index.mjs +3 -3
- package/dist/es/hooks/use-namespace/index.mjs +72 -41
- package/dist/es/hooks/useProForm.mjs +42 -27
- package/dist/es/index.mjs +73 -73
- package/dist/es/installer.mjs +8 -8
- package/dist/lib/components/base/style/index.js +2 -1
- package/dist/lib/components/collapse-transtion/hooks/use-collapse-transtion.js +134 -1
- package/dist/lib/components/collapse-transtion/index.js +11 -1
- package/dist/lib/components/collapse-transtion/src/collapse-transtion.vue.js +4 -1
- package/dist/lib/components/collapse-transtion/src/collapse-transtion.vue2.js +29 -1
- package/dist/lib/components/collapse-transtion/src/types.js +9 -1
- package/dist/lib/components/collapse-transtion/style/index.js +3 -1
- package/dist/lib/components/cover-scroll-bar/hooks/use-has-scroll.js +30 -1
- package/dist/lib/components/cover-scroll-bar/index.js +10 -1
- package/dist/lib/components/cover-scroll-bar/src/cover-scroll-bar.js +221 -1
- package/dist/lib/components/cover-scroll-bar/src/types.js +17 -1
- package/dist/lib/components/cover-scroll-bar/style/index.js +3 -1
- package/dist/lib/components/form/component/form-item.vue.js +4 -1
- package/dist/lib/components/form/component/form-item.vue2.js +63 -1
- package/dist/lib/components/form/component/form.js +14 -1
- package/dist/lib/components/form/component/form.vue.js +4 -1
- package/dist/lib/components/form/component/form.vue2.js +26 -1
- package/dist/lib/components/form/content/form-content.js +13 -1
- package/dist/lib/components/form/index.js +15 -1
- package/dist/lib/components/icon/index.js +9 -1
- package/dist/lib/components/icon/src/icon.vue.js +4 -1
- package/dist/lib/components/icon/src/icon.vue2.js +36 -1
- package/dist/lib/components/icon/src/types.js +17 -1
- package/dist/lib/components/icon/style/index.js +3 -1
- package/dist/lib/components/index.js +38 -1
- package/dist/lib/components/plus-upload/apis/plus-upload.api.js +21 -1
- package/dist/lib/components/plus-upload/hook/useExtractPlusUpload.js +64 -1
- package/dist/lib/components/plus-upload/hook/usePlusUpload.js +34 -1
- package/dist/lib/components/plus-upload/images/pdf-icon.png.js +4 -1
- package/dist/lib/components/plus-upload/images/word-icon.png.js +4 -1
- package/dist/lib/components/plus-upload/images/xls-icon.png.js +4 -1
- package/dist/lib/components/plus-upload/index.js +9 -1
- package/dist/lib/components/plus-upload/src/plus-upload.vue.js +4 -1
- package/dist/lib/components/plus-upload/src/plus-upload.vue2.js +199 -1
- package/dist/lib/components/plus-upload/src/types.js +37 -1
- package/dist/lib/components/plus-upload/style/index.js +3 -1
- package/dist/lib/components/pro-area/apis/pro-area.api.js +6 -1
- package/dist/lib/components/pro-area/hooks/use-pro-area.js +12 -1
- package/dist/lib/components/pro-area/index.js +13 -1
- package/dist/lib/components/pro-area/src/ProArea.vue.js +4 -1
- package/dist/lib/components/pro-area/src/ProArea.vue2.js +135 -1
- package/dist/lib/components/pro-area/src/types.js +22 -1
- package/dist/lib/components/pro-area/style/index.js +3 -1
- package/dist/lib/components/pro-contract-view/apis/pro-contract-view.api.js +10 -1
- package/dist/lib/components/pro-contract-view/hooks/use-contract-view.js +45 -1
- package/dist/lib/components/pro-contract-view/index.js +11 -1
- package/dist/lib/components/pro-contract-view/src/pro-contract-view.vue.js +4 -1
- package/dist/lib/components/pro-contract-view/src/pro-contract-view.vue2.js +152 -1
- package/dist/lib/components/pro-contract-view/src/types.js +24 -1
- package/dist/lib/components/pro-contract-view/style/index.js +3 -1
- package/dist/lib/components/pro-loading/index.js +5 -1
- package/dist/lib/components/pro-loading/src/pro-loading.js +75 -1
- package/dist/lib/components/pro-modal/hooks/useProModal.js +47 -1
- package/dist/lib/components/pro-modal/index.js +12 -1
- package/dist/lib/components/pro-modal/src/ProModal.vue.js +4 -1
- package/dist/lib/components/pro-modal/src/ProModal.vue2.js +122 -1
- package/dist/lib/components/pro-modal/src/types.js +16 -1
- package/dist/lib/components/pro-modal/style/index.js +3 -1
- package/dist/lib/components/pro-overlay/index.js +9 -1
- package/dist/lib/components/pro-overlay/src/pro-overlay.vue.js +4 -1
- package/dist/lib/components/pro-overlay/src/pro-overlay.vue2.js +41 -1
- package/dist/lib/components/pro-overlay/style/index.js +3 -1
- package/dist/lib/components/pro-picker/apis/pro-picker.api.js +9 -1
- package/dist/lib/components/pro-picker/index.js +11 -1
- package/dist/lib/components/pro-picker/src/ProPicker.vue.js +4 -1
- package/dist/lib/components/pro-picker/src/ProPicker.vue2.js +106 -1
- package/dist/lib/components/pro-picker/src/types.js +28 -1
- package/dist/lib/components/pro-signature/index.js +10 -1
- package/dist/lib/components/pro-signature/src/ProSignature.vue.js +4 -1
- package/dist/lib/components/pro-signature/src/ProSignature.vue2.js +258 -1
- package/dist/lib/components/pro-signature/src/types.js +40 -1
- package/dist/lib/components/pro-table/hooks/use-pro-table.js +12 -1
- package/dist/lib/components/pro-table/index.js +12 -1
- package/dist/lib/components/pro-table/src/constants.js +25 -1
- package/dist/lib/components/pro-table/src/field/field-date-range/field-date-range.vue.js +4 -1
- package/dist/lib/components/pro-table/src/field/field-date-range/field-date-range.vue2.js +31 -1
- package/dist/lib/components/pro-table/src/field/field-input/field-input.vue.js +4 -1
- package/dist/lib/components/pro-table/src/field/field-input/field-input.vue2.js +31 -1
- package/dist/lib/components/pro-table/src/field/field-radio/field-radio.vue.js +4 -1
- package/dist/lib/components/pro-table/src/field/field-radio/field-radio.vue2.js +59 -1
- package/dist/lib/components/pro-table/src/field/field-select/field-select.vue.js +4 -1
- package/dist/lib/components/pro-table/src/field/field-select/field-select.vue2.js +59 -1
- package/dist/lib/components/pro-table/src/field/field.css +3 -1
- package/dist/lib/components/pro-table/src/field/field.vue.js +5 -1
- package/dist/lib/components/pro-table/src/field/field.vue2.js +149 -1
- package/dist/lib/components/pro-table/src/form-render.css +3 -1
- package/dist/lib/components/pro-table/src/form-render.vue.js +5 -1
- package/dist/lib/components/pro-table/src/form-render.vue2.js +166 -1
- package/dist/lib/components/pro-table/src/hooks/use-form.js +25 -1
- package/dist/lib/components/pro-table/src/hooks/use-table.js +57 -1
- package/dist/lib/components/pro-table/src/pro-table.vue.js +4 -1
- package/dist/lib/components/pro-table/src/pro-table.vue2.js +203 -1
- package/dist/lib/components/pro-table/style/index.js +3 -1
- package/dist/lib/components/pro-table/utils.js +15 -1
- package/dist/lib/components/pro-tag/index.js +10 -1
- package/dist/lib/components/pro-tag/src/ProTag.vue.js +4 -1
- package/dist/lib/components/pro-tag/src/ProTag.vue2.js +46 -1
- package/dist/lib/components/pro-tag/src/types.js +10 -1
- package/dist/lib/components/pro-title/index.js +11 -1
- package/dist/lib/components/pro-title/src/ProTitle.vue.js +4 -1
- package/dist/lib/components/pro-title/src/ProTitle.vue2.js +52 -1
- package/dist/lib/components/pro-title/src/types.js +21 -1
- package/dist/lib/components/pro-title/style/index.js +3 -1
- package/dist/lib/components/pro-upload/index.js +11 -1
- package/dist/lib/components/pro-upload/src/assets/images/audio-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/materials-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/pdf-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/ppt-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/video-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/word-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/xls-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/zip-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/data.js +49 -1
- package/dist/lib/components/pro-upload/src/file-list.js +160 -1
- package/dist/lib/components/pro-upload/src/gd-upload.js +211 -1
- package/dist/lib/components/pro-upload/src/hooks/index.js +6 -1
- package/dist/lib/components/pro-upload/src/hooks/useHttp.js +23 -1
- package/dist/lib/components/pro-upload/src/hooks/useUpload.js +85 -1
- package/dist/lib/components/pro-upload/src/props.js +50 -1
- package/dist/lib/components/pro-upload/src/utils/index.js +46 -1
- package/dist/lib/components/pro-upload/style/index.js +3 -1
- package/dist/lib/components/scale-virtual-list/component/scale-virtual-list.vue.js +4 -1
- package/dist/lib/components/scale-virtual-list/component/scale-virtual-list.vue2.js +93 -1
- package/dist/lib/components/scale-virtual-list/hooks/useVirtualList.js +220 -1
- package/dist/lib/components/scale-virtual-list/index.js +10 -1
- package/dist/lib/components/scale-virtual-list/style/index.js +3 -1
- package/dist/lib/components/scroll-bar/index.js +10 -1
- package/dist/lib/components/scroll-bar/src/scroll-bar.js +424 -1
- package/dist/lib/components/scroll-bar/src/types.js +13 -1
- package/dist/lib/components/scroll-bar/style/index.js +3 -1
- package/dist/lib/components/utils/install.js +23 -1
- package/dist/lib/hooks/index.js +5 -1
- package/dist/lib/hooks/use-namespace/index.js +80 -1
- package/dist/lib/hooks/useProForm.js +50 -1
- package/dist/lib/index.js +77 -1
- package/dist/lib/installer.js +13 -1
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/package.json +9 -9
|
@@ -1,90 +1,106 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { debounce
|
|
3
|
-
import { Select
|
|
4
|
-
import { proPickerApi
|
|
5
|
-
import { PickerApiEnum
|
|
6
|
-
const
|
|
7
|
-
|
|
1
|
+
import { defineComponent, useModel, reactive, watch, createBlock, openBlock, unref, createSlots, withCtx, createVNode, mergeModels } from "vue";
|
|
2
|
+
import { debounce } from "lodash-es";
|
|
3
|
+
import { Select, Spin } from "ant-design-vue";
|
|
4
|
+
import { proPickerApi } from "../apis/pro-picker.api.mjs";
|
|
5
|
+
import { PickerApiEnum, ProPickerProps } from "./types.mjs";
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
...{
|
|
8
|
+
name: "ProPicker"
|
|
9
|
+
},
|
|
8
10
|
__name: "ProPicker",
|
|
9
|
-
props: /* @__PURE__ */
|
|
10
|
-
value: {},
|
|
11
|
-
valueModifiers: {}
|
|
11
|
+
props: /* @__PURE__ */ mergeModels(ProPickerProps, {
|
|
12
|
+
"value": {},
|
|
13
|
+
"valueModifiers": {}
|
|
12
14
|
}),
|
|
13
|
-
emits: /* @__PURE__ */
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
15
|
+
emits: /* @__PURE__ */ mergeModels(["change"], ["update:value"]),
|
|
16
|
+
setup(__props, { emit: __emit }) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
const emit = __emit;
|
|
19
|
+
const value = useModel(__props, "value");
|
|
20
|
+
const state = reactive({
|
|
16
21
|
data: [],
|
|
17
|
-
fetching:
|
|
22
|
+
fetching: false
|
|
18
23
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
(
|
|
22
|
-
if (!
|
|
24
|
+
watch(
|
|
25
|
+
value,
|
|
26
|
+
(value2) => {
|
|
27
|
+
if (!value2)
|
|
23
28
|
return;
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
value:
|
|
32
|
-
}))
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
const type = state.data.some((item) => item.value === value2);
|
|
30
|
+
if (type)
|
|
31
|
+
return;
|
|
32
|
+
const url = PickerApiEnum[props.type];
|
|
33
|
+
if (typeof value2 === "string" || typeof value2 === "number") {
|
|
34
|
+
proPickerApi.getOps({
|
|
35
|
+
url,
|
|
36
|
+
params: { value: value2 }
|
|
37
|
+
}).then((res) => {
|
|
38
|
+
state.data = res.data.options.map((item) => ({
|
|
39
|
+
label: item.label,
|
|
40
|
+
value: item.value
|
|
41
|
+
}));
|
|
42
|
+
});
|
|
43
|
+
} else if (Array.isArray(value2)) {
|
|
44
|
+
proPickerApi.getOps({
|
|
45
|
+
url,
|
|
46
|
+
params: { value: value2.join(",") }
|
|
47
|
+
}).then((res) => {
|
|
48
|
+
state.data = res.data.options.map((item) => ({
|
|
49
|
+
label: item.label,
|
|
50
|
+
value: item.value
|
|
51
|
+
}));
|
|
52
|
+
state.fetching = false;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
42
55
|
},
|
|
43
56
|
{
|
|
44
|
-
immediate:
|
|
57
|
+
immediate: true
|
|
45
58
|
}
|
|
46
59
|
);
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
label:
|
|
54
|
-
value:
|
|
55
|
-
}))
|
|
60
|
+
const handleSearch = debounce((value2) => {
|
|
61
|
+
if (value2) {
|
|
62
|
+
state.fetching = true;
|
|
63
|
+
const url = PickerApiEnum[props.type];
|
|
64
|
+
proPickerApi.getOps({ url, params: { label: value2 } }).then((res) => {
|
|
65
|
+
state.data = res.data.options.map((item) => ({
|
|
66
|
+
label: item.label,
|
|
67
|
+
value: item.value
|
|
68
|
+
}));
|
|
69
|
+
state.fetching = false;
|
|
56
70
|
});
|
|
57
71
|
}
|
|
58
|
-
},
|
|
59
|
-
function
|
|
60
|
-
|
|
72
|
+
}, props.delay);
|
|
73
|
+
function handleChange(_value, options) {
|
|
74
|
+
emit("change", options);
|
|
61
75
|
}
|
|
62
|
-
return (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
return (_ctx, _cache) => {
|
|
77
|
+
return openBlock(), createBlock(unref(Select), {
|
|
78
|
+
value: value.value,
|
|
79
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
80
|
+
mode: _ctx.mode,
|
|
81
|
+
"show-search": "",
|
|
82
|
+
placeholder: _ctx.placeholder,
|
|
83
|
+
style: { "width": "100%" },
|
|
84
|
+
"filter-option": false,
|
|
85
|
+
"not-found-content": state.fetching ? void 0 : null,
|
|
86
|
+
options: state.data,
|
|
87
|
+
onChange: handleChange,
|
|
88
|
+
onSearch: unref(handleSearch)
|
|
89
|
+
}, createSlots({
|
|
90
|
+
_: 2
|
|
91
|
+
/* DYNAMIC */
|
|
92
|
+
}, [
|
|
93
|
+
state.fetching ? {
|
|
94
|
+
name: "notFoundContent",
|
|
95
|
+
fn: withCtx(() => [
|
|
96
|
+
createVNode(unref(Spin), { size: "small" })
|
|
97
|
+
]),
|
|
98
|
+
key: "0"
|
|
99
|
+
} : void 0
|
|
100
|
+
]), 1032, ["value", "mode", "placeholder", "not-found-content", "options", "onSearch"]);
|
|
101
|
+
};
|
|
86
102
|
}
|
|
87
103
|
});
|
|
88
104
|
export {
|
|
89
|
-
|
|
105
|
+
_sfc_main as default
|
|
90
106
|
};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
1
|
+
var PickerApiEnum = /* @__PURE__ */ ((PickerApiEnum2) => {
|
|
2
|
+
PickerApiEnum2["company"] = "/security/company/options";
|
|
3
|
+
PickerApiEnum2["user"] = "/security/user/options";
|
|
4
|
+
PickerApiEnum2["department"] = "/security/department/options";
|
|
5
|
+
PickerApiEnum2["flowApplication"] = "/flow/application/options";
|
|
6
|
+
return PickerApiEnum2;
|
|
7
|
+
})(PickerApiEnum || {});
|
|
8
|
+
const ProPickerProps = {
|
|
3
9
|
type: {
|
|
4
10
|
type: String,
|
|
5
11
|
default: "company"
|
|
@@ -17,6 +23,6 @@ const o = {
|
|
|
17
23
|
}
|
|
18
24
|
};
|
|
19
25
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
PickerApiEnum,
|
|
27
|
+
ProPickerProps
|
|
22
28
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { withInstall
|
|
1
|
+
import { withInstall } from "../utils/install.mjs";
|
|
2
2
|
import "./src/ProSignature.vue.mjs";
|
|
3
|
-
import { ProSignatureProps
|
|
4
|
-
import
|
|
5
|
-
const
|
|
3
|
+
import { ProSignatureProps } from "./src/types.mjs";
|
|
4
|
+
import _sfc_main from "./src/ProSignature.vue2.mjs";
|
|
5
|
+
const KProSignature = withInstall(_sfc_main);
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
KProSignature,
|
|
8
|
+
ProSignatureProps,
|
|
9
|
+
KProSignature as default
|
|
10
10
|
};
|
|
@@ -1,145 +1,258 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { ProSignatureProps
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent, ref, computed, watch, onMounted, onBeforeUnmount, reactive, createElementBlock, openBlock, withModifiers, normalizeStyle } from "vue";
|
|
2
|
+
import { ProSignatureProps } from "./types.mjs";
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
4
|
__name: "ProSignature",
|
|
5
|
-
props:
|
|
5
|
+
props: ProSignatureProps,
|
|
6
6
|
emits: ["update:bgColor"],
|
|
7
|
-
setup(
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
8
|
+
const props = __props;
|
|
9
|
+
const emit = __emit;
|
|
10
|
+
const canvas = ref(null);
|
|
11
|
+
const canvasTxt = ref(null);
|
|
12
|
+
const hasDrew = ref(false);
|
|
13
|
+
const resultImg = ref("");
|
|
14
|
+
const points = ref([]);
|
|
15
|
+
const startX = ref(0);
|
|
16
|
+
const startY = ref(0);
|
|
17
|
+
const isDrawing = ref(false);
|
|
18
|
+
const sratio = ref(1);
|
|
19
|
+
const ratio = computed(() => props.height / props.width);
|
|
20
|
+
const myBg = computed(() => props.bgColor ? props.bgColor : "rgba(255, 255, 255, 0)");
|
|
21
|
+
function resizeHandler() {
|
|
22
|
+
if (!canvas.value || !canvasTxt.value)
|
|
11
23
|
return;
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
24
|
+
const dpr = window.devicePixelRatio || 1;
|
|
25
|
+
canvas.value.style.width = `${props.width}px`;
|
|
26
|
+
const realw = Number.parseFloat(window.getComputedStyle(canvas.value).width);
|
|
27
|
+
canvas.value.style.height = `${ratio.value * realw}px`;
|
|
28
|
+
canvas.value.width = realw * dpr;
|
|
29
|
+
canvas.value.height = ratio.value * realw * dpr;
|
|
30
|
+
canvasTxt.value.scale(dpr, dpr);
|
|
31
|
+
sratio.value = realw / props.width;
|
|
16
32
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
33
|
+
function drawStart(obj) {
|
|
34
|
+
if (!canvasTxt.value)
|
|
35
|
+
return;
|
|
36
|
+
startX.value = obj.x;
|
|
37
|
+
startY.value = obj.y;
|
|
38
|
+
canvasTxt.value.beginPath();
|
|
39
|
+
canvasTxt.value.moveTo(startX.value, startY.value);
|
|
40
|
+
canvasTxt.value.lineTo(obj.x, obj.y);
|
|
41
|
+
canvasTxt.value.lineCap = "round";
|
|
42
|
+
canvasTxt.value.lineJoin = "round";
|
|
43
|
+
canvasTxt.value.lineWidth = props.lineWidth * sratio.value;
|
|
44
|
+
canvasTxt.value.stroke();
|
|
45
|
+
canvasTxt.value.closePath();
|
|
46
|
+
points.value.push(obj);
|
|
19
47
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
48
|
+
function drawMove(obj) {
|
|
49
|
+
if (!canvasTxt.value)
|
|
50
|
+
return;
|
|
51
|
+
canvasTxt.value.beginPath();
|
|
52
|
+
canvasTxt.value.moveTo(startX.value, startY.value);
|
|
53
|
+
canvasTxt.value.lineTo(obj.x, obj.y);
|
|
54
|
+
canvasTxt.value.strokeStyle = props.lineColor;
|
|
55
|
+
canvasTxt.value.lineWidth = props.lineWidth * sratio.value;
|
|
56
|
+
canvasTxt.value.lineCap = "round";
|
|
57
|
+
canvasTxt.value.lineJoin = "round";
|
|
58
|
+
canvasTxt.value.stroke();
|
|
59
|
+
canvasTxt.value.closePath();
|
|
60
|
+
startY.value = obj.y;
|
|
61
|
+
startX.value = obj.x;
|
|
62
|
+
points.value.push(obj);
|
|
22
63
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
64
|
+
function drawEnd(obj) {
|
|
65
|
+
if (!canvasTxt.value)
|
|
66
|
+
return;
|
|
67
|
+
canvasTxt.value.beginPath();
|
|
68
|
+
canvasTxt.value.moveTo(startX.value, startY.value);
|
|
69
|
+
canvasTxt.value.lineTo(obj.x, obj.y);
|
|
70
|
+
canvasTxt.value.lineCap = "round";
|
|
71
|
+
canvasTxt.value.lineJoin = "round";
|
|
72
|
+
canvasTxt.value.stroke();
|
|
73
|
+
canvasTxt.value.closePath();
|
|
74
|
+
points.value.push(obj);
|
|
75
|
+
points.value.push({ x: -1, y: -1 });
|
|
25
76
|
}
|
|
26
|
-
function
|
|
27
|
-
e.preventDefault()
|
|
77
|
+
function mouseDown(e) {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
isDrawing.value = true;
|
|
80
|
+
hasDrew.value = true;
|
|
81
|
+
drawStart({
|
|
28
82
|
x: e.offsetX,
|
|
29
83
|
y: e.offsetY
|
|
30
84
|
});
|
|
31
85
|
}
|
|
32
|
-
function
|
|
33
|
-
e.preventDefault()
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
86
|
+
function mouseMove(e) {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
if (isDrawing.value) {
|
|
89
|
+
drawMove({
|
|
90
|
+
x: e.offsetX,
|
|
91
|
+
y: e.offsetY
|
|
92
|
+
});
|
|
93
|
+
}
|
|
37
94
|
}
|
|
38
|
-
function
|
|
39
|
-
e.preventDefault()
|
|
95
|
+
function mouseUp(e) {
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
drawEnd({
|
|
40
98
|
x: e.offsetX,
|
|
41
99
|
y: e.offsetY
|
|
42
|
-
})
|
|
100
|
+
});
|
|
101
|
+
isDrawing.value = false;
|
|
43
102
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
103
|
+
function touchStart(e) {
|
|
104
|
+
hasDrew.value = true;
|
|
105
|
+
if (e.touches.length === 1 && canvas.value) {
|
|
106
|
+
const rect = canvas.value.getBoundingClientRect();
|
|
107
|
+
drawStart({
|
|
108
|
+
x: e.targetTouches[0].clientX - rect.left,
|
|
109
|
+
y: e.targetTouches[0].clientY - rect.top
|
|
50
110
|
});
|
|
51
111
|
}
|
|
52
112
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
113
|
+
function touchMove(e) {
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
if (e.touches.length === 1 && canvas.value) {
|
|
116
|
+
const rect = canvas.value.getBoundingClientRect();
|
|
117
|
+
drawMove({
|
|
118
|
+
x: e.targetTouches[0].clientX - rect.left,
|
|
119
|
+
y: e.targetTouches[0].clientY - rect.top
|
|
59
120
|
});
|
|
60
121
|
}
|
|
61
122
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
123
|
+
function touchEnd(e) {
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
if (e.touches.length === 1 && canvas.value) {
|
|
126
|
+
const rect = canvas.value.getBoundingClientRect();
|
|
127
|
+
drawEnd({
|
|
128
|
+
x: e.targetTouches[0].clientX - rect.left,
|
|
129
|
+
y: e.targetTouches[0].clientY - rect.top
|
|
68
130
|
});
|
|
69
131
|
}
|
|
70
132
|
}
|
|
71
|
-
function
|
|
72
|
-
if (!
|
|
133
|
+
function getCropArea(imgData) {
|
|
134
|
+
if (!canvas.value)
|
|
73
135
|
return [0, 0, 0, 0];
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
136
|
+
let topX = canvas.value.width;
|
|
137
|
+
let btmX = 0;
|
|
138
|
+
let topY = canvas.value.height;
|
|
139
|
+
let btnY = 0;
|
|
140
|
+
for (let i = 0; i < canvas.value.width; i++) {
|
|
141
|
+
for (let j = 0; j < canvas.value.height; j++) {
|
|
142
|
+
const pos = (i + canvas.value.width * j) * 4;
|
|
143
|
+
if (imgData[pos] > 0 || imgData[pos + 1] > 0 || imgData[pos + 2] || imgData[pos + 3] > 0) {
|
|
144
|
+
btnY = Math.max(j, btnY);
|
|
145
|
+
btmX = Math.max(i, btmX);
|
|
146
|
+
topY = Math.min(j, topY);
|
|
147
|
+
topX = Math.min(i, topX);
|
|
148
|
+
}
|
|
79
149
|
}
|
|
80
|
-
|
|
150
|
+
}
|
|
151
|
+
return [topX + 1, topY + 1, btmX + 1, btnY + 1];
|
|
81
152
|
}
|
|
82
|
-
function
|
|
83
|
-
return new Promise((
|
|
84
|
-
if (!
|
|
85
|
-
|
|
153
|
+
function generate(options) {
|
|
154
|
+
return new Promise((resolve, reject) => {
|
|
155
|
+
if (!hasDrew.value || !canvas.value || !canvasTxt.value) {
|
|
156
|
+
reject("Warning: Not Signned!");
|
|
86
157
|
return;
|
|
87
158
|
}
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
159
|
+
const imgFormat = (options == null ? void 0 : options.format) || props.format;
|
|
160
|
+
const imgQuality = (options == null ? void 0 : options.quality) || props.quality;
|
|
161
|
+
const resImgData = canvasTxt.value.getImageData(0, 0, canvas.value.width, canvas.value.height);
|
|
162
|
+
canvasTxt.value.globalCompositeOperation = "destination-over";
|
|
163
|
+
canvasTxt.value.fillStyle = myBg.value;
|
|
164
|
+
canvasTxt.value.fillRect(0, 0, canvas.value.width, canvas.value.height);
|
|
165
|
+
resultImg.value = canvas.value.toDataURL(imgFormat, imgQuality);
|
|
166
|
+
let finalImg = resultImg.value;
|
|
167
|
+
canvasTxt.value.clearRect(0, 0, canvas.value.width, canvas.value.height);
|
|
168
|
+
canvasTxt.value.putImageData(resImgData, 0, 0);
|
|
169
|
+
canvasTxt.value.globalCompositeOperation = "source-over";
|
|
170
|
+
if (props.isCrop) {
|
|
171
|
+
const cropArea = getCropArea(resImgData.data);
|
|
172
|
+
const cropCanvas = document.createElement("canvas");
|
|
173
|
+
const cropCtx = cropCanvas.getContext("2d");
|
|
174
|
+
if (cropCtx) {
|
|
175
|
+
cropCanvas.width = cropArea[2] - cropArea[0];
|
|
176
|
+
cropCanvas.height = cropArea[3] - cropArea[1];
|
|
177
|
+
const cropImgData = canvasTxt.value.getImageData(cropArea[0], cropArea[1], cropArea[2] - cropArea[0], cropArea[3] - cropArea[1]);
|
|
178
|
+
cropCtx.globalCompositeOperation = "destination-over";
|
|
179
|
+
cropCtx.putImageData(cropImgData, 0, 0);
|
|
180
|
+
cropCtx.fillStyle = myBg.value;
|
|
181
|
+
cropCtx.fillRect(0, 0, cropCanvas.width, cropCanvas.height);
|
|
182
|
+
finalImg = cropCanvas.toDataURL(imgFormat, imgQuality);
|
|
97
183
|
}
|
|
98
184
|
}
|
|
99
|
-
|
|
185
|
+
resolve(finalImg);
|
|
100
186
|
});
|
|
101
187
|
}
|
|
102
|
-
function
|
|
103
|
-
|
|
188
|
+
function reset() {
|
|
189
|
+
if (!canvas.value || !canvasTxt.value)
|
|
190
|
+
return;
|
|
191
|
+
canvasTxt.value.clearRect(0, 0, canvas.value.width, canvas.value.height);
|
|
192
|
+
if (props.isClearBgColor) {
|
|
193
|
+
emit("update:bgColor", "");
|
|
194
|
+
canvas.value.style.background = "rgba(255, 255, 255, 0)";
|
|
195
|
+
}
|
|
196
|
+
points.value = [];
|
|
197
|
+
hasDrew.value = false;
|
|
198
|
+
resultImg.value = "";
|
|
104
199
|
}
|
|
105
|
-
|
|
106
|
-
() => [
|
|
107
|
-
([
|
|
108
|
-
!
|
|
200
|
+
watch(
|
|
201
|
+
() => [props.width, props.height],
|
|
202
|
+
([newWidth, newHeight]) => {
|
|
203
|
+
if (!canvas.value || !canvasTxt.value)
|
|
204
|
+
return;
|
|
205
|
+
canvas.value.width = newWidth;
|
|
206
|
+
canvas.value.height = newHeight;
|
|
207
|
+
canvas.value.style.background = myBg.value;
|
|
208
|
+
resizeHandler();
|
|
109
209
|
}
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
210
|
+
);
|
|
211
|
+
onMounted(() => {
|
|
212
|
+
if (!canvas.value)
|
|
213
|
+
return;
|
|
214
|
+
canvas.value.height = props.height;
|
|
215
|
+
canvas.value.width = props.width;
|
|
216
|
+
canvas.value.style.background = myBg.value;
|
|
217
|
+
canvasTxt.value = canvas.value.getContext("2d");
|
|
218
|
+
resizeHandler();
|
|
219
|
+
window.addEventListener("resize", resizeHandler);
|
|
220
|
+
document.addEventListener("mouseup", () => {
|
|
221
|
+
isDrawing.value = false;
|
|
222
|
+
});
|
|
116
223
|
});
|
|
117
|
-
|
|
118
|
-
|
|
224
|
+
onBeforeUnmount(() => {
|
|
225
|
+
window.removeEventListener("resize", resizeHandler);
|
|
226
|
+
});
|
|
227
|
+
const canvasSty = reactive({
|
|
228
|
+
width: `100%`,
|
|
119
229
|
height: "100%"
|
|
120
230
|
});
|
|
121
|
-
|
|
122
|
-
generate
|
|
123
|
-
reset
|
|
124
|
-
})
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
231
|
+
__expose({
|
|
232
|
+
generate,
|
|
233
|
+
reset
|
|
234
|
+
});
|
|
235
|
+
return (_ctx, _cache) => {
|
|
236
|
+
return openBlock(), createElementBlock(
|
|
237
|
+
"canvas",
|
|
238
|
+
{
|
|
239
|
+
ref_key: "canvas",
|
|
240
|
+
ref: canvas,
|
|
241
|
+
style: normalizeStyle(canvasSty),
|
|
242
|
+
onMousedown: mouseDown,
|
|
243
|
+
onMousemove: mouseMove,
|
|
244
|
+
onMouseup: mouseUp,
|
|
245
|
+
onTouchstartPassive: touchStart,
|
|
246
|
+
onTouchmovePassive: touchMove,
|
|
247
|
+
onTouchend: withModifiers(touchEnd, ["prevent"])
|
|
248
|
+
},
|
|
249
|
+
null,
|
|
250
|
+
36
|
|
251
|
+
/* STYLE, NEED_HYDRATION */
|
|
252
|
+
);
|
|
253
|
+
};
|
|
141
254
|
}
|
|
142
255
|
});
|
|
143
256
|
export {
|
|
144
|
-
|
|
257
|
+
_sfc_main as default
|
|
145
258
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { definePropType
|
|
2
|
-
const
|
|
1
|
+
import { definePropType } from "../../utils/install.mjs";
|
|
2
|
+
const ProSignatureProps = {
|
|
3
3
|
width: {
|
|
4
|
-
type:
|
|
4
|
+
type: definePropType(Number),
|
|
5
5
|
default: 800
|
|
6
6
|
},
|
|
7
7
|
height: {
|
|
@@ -36,5 +36,5 @@ const r = {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
export {
|
|
39
|
-
|
|
39
|
+
ProSignatureProps
|
|
40
40
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { ref
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
(
|
|
7
|
-
}
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
function useProTable() {
|
|
3
|
+
const proTableRef = ref();
|
|
4
|
+
const onRefresh = () => {
|
|
5
|
+
var _a;
|
|
6
|
+
(_a = proTableRef.value) == null ? void 0 : _a.onRefresh();
|
|
7
|
+
};
|
|
8
|
+
return { proTableRef, onRefresh };
|
|
8
9
|
}
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
useProTable
|
|
11
12
|
};
|