@vunk/form 2.18.2 → 2.19.0
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/components/_plugin-vue_export-helper.cjs +1 -11
- package/components/api-tables-select/index.cjs +1 -467
- package/components/api-tables-select/index.mjs +56 -413
- package/components/api-tables-select/src/ctx.d.ts +152 -172
- package/components/api-tables-select/src/index.vue.d.ts +394 -983
- package/components/button/index.cjs +1 -112
- package/components/button/index.mjs +57 -85
- package/components/button/src/ctx.d.ts +28 -113
- package/components/button/src/index.vue.d.ts +317 -625
- package/components/card-input-collection/index.cjs +1 -370
- package/components/card-input-collection/index.mjs +175 -277
- package/components/card-input-collection/src/core.vue.d.ts +54 -951
- package/components/card-input-collection/src/ctx.d.ts +19 -49
- package/components/card-input-collection/src/index.vue.d.ts +46 -110
- package/components/cascader/index.cjs +1 -150
- package/components/cascader/index.mjs +88 -116
- package/components/cascader/src/ctx.d.ts +140 -207
- package/components/cascader/src/index.vue.d.ts +315 -522
- package/components/cascader/src/use.d.ts +1 -1
- package/components/checkbox/index.cjs +1 -152
- package/components/checkbox/index.mjs +75 -119
- package/components/checkbox/src/ctx.d.ts +46 -69
- package/components/checkbox/src/index.vue.d.ts +448 -1016
- package/components/cloneDeep.cjs +1 -2106
- package/components/color-picker/index.cjs +1 -80
- package/components/color-picker/index.mjs +46 -69
- package/components/color-picker/src/ctx.d.ts +130 -107
- package/components/color-picker/src/index.vue.d.ts +285 -255
- package/components/date-picker/index.cjs +1 -119
- package/components/date-picker/index.mjs +63 -97
- package/components/date-picker/src/ctx.d.ts +123 -206
- package/components/date-picker/src/index.vue.d.ts +269 -1358
- package/components/date-picker/src/types.d.ts +7 -7
- package/components/date-picker-range/index.cjs +1 -177
- package/components/date-picker-range/index.mjs +62 -113
- package/components/date-picker-range/src/ctx.d.ts +130 -206
- package/components/date-picker-range/src/index.vue.d.ts +861 -448
- package/components/debounce.cjs +1 -0
- package/components/dialog/index.cjs +1 -126
- package/components/dialog/index.mjs +65 -99
- package/components/dialog/src/ctx.d.ts +17 -108
- package/components/dialog/src/index.vue.d.ts +77 -1072
- package/components/dialog-input-collection/index.cjs +1 -624
- package/components/dialog-input-collection/index.mjs +276 -498
- package/components/dialog-input-collection/src/ctx.d.ts +21 -52
- package/components/dialog-input-collection/src/dialog-form.vue.d.ts +29 -6371
- package/components/dialog-input-collection/src/index.vue.d.ts +65 -7630
- package/components/dialog-input-collection/src/layout.vue.d.ts +13 -73
- package/components/download-plus/index.cjs +1 -456
- package/components/download-plus/index.mjs +215 -358
- package/components/download-plus/src/api.d.ts +1 -1
- package/components/download-plus/src/ctx.d.ts +21 -52
- package/components/download-plus/src/index.vue.d.ts +437 -1177
- package/components/editable-text/index.cjs +1 -295
- package/components/editable-text/index.mjs +113 -239
- package/components/editable-text/src/ctx.d.ts +24 -50
- package/components/editable-text/src/index.vue.d.ts +59 -3258
- package/components/el-slider/index.cjs +1 -0
- package/components/el-slider/index.d.ts +5 -0
- package/components/el-slider/index.mjs +475 -0
- package/components/el-slider/src/button.d.ts +36 -0
- package/components/el-slider/src/button.vue.d.ts +41 -0
- package/components/el-slider/src/composables/index.cjs +1 -0
- package/components/el-slider/src/composables/index.d.ts +6 -0
- package/components/el-slider/src/composables/index.mjs +9 -0
- package/components/el-slider/src/composables/use-lifecycle.d.ts +4 -0
- package/components/el-slider/src/composables/use-marks.d.ts +7 -0
- package/components/el-slider/src/composables/use-slide.d.ts +23 -0
- package/components/el-slider/src/composables/use-slider-button.d.ts +18 -0
- package/components/el-slider/src/composables/use-stops.d.ts +8 -0
- package/components/el-slider/src/composables/use-watch.d.ts +4 -0
- package/components/el-slider/src/constants.d.ts +14 -0
- package/components/el-slider/src/marker.d.ts +37 -0
- package/components/el-slider/src/slider-core.vue.d.ts +218 -0
- package/components/el-slider/src/slider.d.ts +174 -0
- package/components/esri-input-geojson/index.cjs +2 -1604
- package/components/esri-input-geojson/index.mjs +682 -1290
- package/components/esri-input-geojson/src/append.vue.d.ts +239 -1099
- package/components/esri-input-geojson/src/const.d.ts +1 -1
- package/components/esri-input-geojson/src/ctx.d.ts +66 -161
- package/components/esri-input-geojson/src/default-view.vue.d.ts +8 -132
- package/components/esri-input-geojson/src/index.vue.d.ts +982 -708
- package/components/esri-input-geojson/src/types.d.ts +1 -0
- package/components/esri-input-geojson/src/viewer.vue.d.ts +53 -282
- package/components/fieldset/index.cjs +1 -110
- package/components/fieldset/index.mjs +63 -76
- package/components/fieldset/src/ctx.d.ts +4 -4
- package/components/fieldset/src/index.vue.d.ts +7 -7
- package/components/form/index.cjs +1 -248
- package/components/form/index.mjs +107 -161
- package/components/form/src/ctx.d.ts +15 -64
- package/components/form/src/index.vue.d.ts +374 -2431
- package/components/form-item/index.cjs +1 -294
- package/components/form-item/index.mjs +140 -229
- package/components/form-item/src/core.vue.d.ts +32 -1854
- package/components/form-item/src/ctx.d.ts +19 -51
- package/components/form-item/src/index.vue.d.ts +38 -101
- package/components/form-item-renderer/index.cjs +1 -193
- package/components/form-item-renderer/index.mjs +103 -162
- package/components/form-item-renderer/src/core.vue.d.ts +9 -9
- package/components/form-item-renderer/src/ctx.d.ts +3 -3
- package/components/form-item-renderer/src/index.vue.d.ts +24 -74
- package/components/form-item-renderer-template/index.cjs +1 -47
- package/components/form-item-renderer-template/index.mjs +20 -33
- package/components/form-item-renderer-template/src/index.vue.d.ts +1 -1
- package/components/forms-provider/index.cjs +1 -99
- package/components/forms-provider/index.mjs +44 -73
- package/components/forms-provider/src/core.d.ts +3 -2
- package/components/forms-provider/src/segment.vue.d.ts +8 -8
- package/components/forms-provider/src/view.vue.d.ts +14 -4
- package/components/index.cjs +1 -399
- package/components/index2.cjs +1 -17
- package/components/information/index.cjs +1 -65
- package/components/information/index.mjs +28 -38
- package/components/information/src/ctx.d.ts +2 -2
- package/components/information/src/index.vue.d.ts +4 -4
- package/components/information-collection/index.cjs +1 -81
- package/components/information-collection/index.mjs +44 -48
- package/components/information-collection/src/ctx.d.ts +29 -65
- package/components/information-collection/src/index.vue.d.ts +64 -136
- package/components/information-renderer/index.cjs +1 -16
- package/components/information-renderer/index.d.ts +9 -9
- package/components/information-renderer/index.mjs +9 -10
- package/components/information-tag/index.cjs +1 -101
- package/components/information-tag/index.mjs +44 -54
- package/components/information-tag/src/ctx.d.ts +6 -21
- package/components/information-tag/src/index.vue.d.ts +23 -51
- package/components/information-templates-default/index.cjs +1 -101
- package/components/information-templates-default/index.mjs +63 -73
- package/components/information-templates-default/src/index.vue.d.ts +1 -1
- package/components/input/index.cjs +1 -115
- package/components/input/index.mjs +60 -83
- package/components/input/src/ctx.d.ts +51 -152
- package/components/input/src/index.vue.d.ts +392 -951
- package/components/input-array/index.cjs +1 -310
- package/components/input-array/index.mjs +114 -244
- package/components/input-array/src/ctx.d.ts +19 -49
- package/components/input-array/src/form-template.vue.d.ts +1 -901
- package/components/input-array/src/index.vue.d.ts +43 -730
- package/components/input-collection/index.cjs +1 -452
- package/components/input-collection/index.mjs +195 -355
- package/components/input-collection/src/core.vue.d.ts +64 -1026
- package/components/input-collection/src/ctx.d.ts +21 -51
- package/components/input-collection/src/index.vue.d.ts +50 -114
- package/components/input-file/index.cjs +1 -142
- package/components/input-file/index.mjs +68 -100
- package/components/input-file/src/ctx.d.ts +8 -29
- package/components/input-file/src/index.vue.d.ts +444 -74
- package/components/input-file/src/template.vue.d.ts +1 -124
- package/components/input-link/index.cjs +1 -167
- package/components/input-link/index.mjs +60 -83
- package/components/input-link/src/ctx.d.ts +52 -137
- package/components/input-link/src/index.vue.d.ts +833 -311
- package/components/input-number/index.cjs +1 -119
- package/components/input-number/index.mjs +73 -87
- package/components/input-number/src/ctx.d.ts +38 -131
- package/components/input-number/src/index.vue.d.ts +321 -683
- package/components/input-tag/index.cjs +1 -100
- package/components/input-tag/index.mjs +51 -78
- package/components/input-tag/src/ctx.d.ts +43 -145
- package/components/input-tag/src/index.vue.d.ts +324 -778
- package/components/isObject.cjs +1 -165
- package/components/monaco-editor/index.cjs +1 -83
- package/components/monaco-editor/index.mjs +40 -59
- package/components/monaco-editor/src/ctx.d.ts +19 -44
- package/components/monaco-editor/src/index.vue.d.ts +209 -109
- package/components/radio/index.cjs +1 -267
- package/components/radio/index.mjs +110 -209
- package/components/radio/src/ctx.d.ts +27 -91
- package/components/radio/src/index.vue.d.ts +298 -1279
- package/components/radio/src/option.vue.d.ts +29 -881
- package/components/radio/src/wraper.vue.d.ts +64 -196
- package/components/renderer-data/index.cjs +1 -41
- package/components/renderer-data/index.mjs +19 -26
- package/components/renderer-data/src/ctx.d.ts +1 -1
- package/components/renderer-data/src/index.vue.d.ts +2 -2
- package/components/select/index.cjs +1 -311
- package/components/select/index.mjs +156 -214
- package/components/select/src/core.vue.d.ts +638 -1080
- package/components/select/src/ctx.d.ts +140 -223
- package/components/select/src/index.vue.d.ts +334 -610
- package/components/select/src/options.vue.d.ts +1 -1
- package/components/slider/index.cjs +1 -88
- package/components/slider/index.mjs +41 -70
- package/components/slider/src/ctx.d.ts +63 -174
- package/components/slider/src/index.vue.d.ts +151 -420
- package/components/style.css +1 -0
- package/components/switch/index.cjs +1 -88
- package/components/switch/index.mjs +37 -69
- package/components/switch/src/ctx.d.ts +34 -113
- package/components/switch/src/index.vue.d.ts +88 -699
- package/components/switch/src/types.d.ts +2 -2
- package/components/tables-select/index.cjs +1 -263
- package/components/tables-select/index.mjs +102 -172
- package/components/tables-select/src/ctx.d.ts +76 -91
- package/components/tables-select/src/index.vue.d.ts +228 -4969
- package/components/template-instances-provider/index.cjs +1 -31
- package/components/template-instances-provider/index.mjs +18 -22
- package/components/template-instances-provider/src/index.vue.d.ts +2 -2
- package/components/templates-default/index.cjs +1 -235
- package/components/templates-default/index.mjs +152 -211
- package/components/templates-default/src/ctx.d.ts +5 -3
- package/components/templates-default/src/index.vue.d.ts +7298 -157
- package/components/templates-element-plus/index.cjs +1 -112
- package/components/templates-element-plus/index.mjs +49 -91
- package/components/templates-element-plus/src/ctx.d.ts +1 -1
- package/components/templates-element-plus/src/index.vue.d.ts +65 -258
- package/components/templates-esri/index.cjs +1 -65
- package/components/templates-esri/index.mjs +29 -39
- package/components/templates-esri/src/ctx.d.ts +1 -1
- package/components/templates-esri/src/index.vue.d.ts +1776 -24
- package/components/templates-layout/index.cjs +1 -137
- package/components/templates-layout/index.mjs +78 -116
- package/components/templates-layout/src/ctx.d.ts +1 -1
- package/components/templates-layout/src/index.vue.d.ts +79 -411
- package/components/templates-variant/index.cjs +1 -70
- package/components/templates-variant/index.mjs +33 -43
- package/components/templates-variant/src/ctx.d.ts +1 -1
- package/components/templates-variant/src/index.vue.d.ts +1238 -24
- package/components/time-picker/index.cjs +1 -104
- package/components/time-picker/index.mjs +57 -87
- package/components/time-picker/src/ctx.d.ts +121 -211
- package/components/time-picker/src/index.vue.d.ts +263 -1368
- package/components/upload/index.cjs +1 -663
- package/components/upload/index.mjs +343 -537
- package/components/upload/src/ctx.d.ts +108 -195
- package/components/upload/src/file.vue.d.ts +197 -776
- package/components/upload/src/index.vue.d.ts +689 -1931
- package/components/upload/src/types.d.ts +1 -1
- package/components/upload/src/wraper.vue.d.ts +232 -407
- package/components/upload-plus/index.cjs +21 -18673
- package/components/upload-plus/index.mjs +4598 -18372
- package/components/upload-plus/src/api.d.ts +2 -2
- package/components/upload-plus/src/ctx.d.ts +24 -51
- package/components/upload-plus/src/index.vue.d.ts +51 -1656
- package/components/use-watch.cjs +1 -0
- package/components/van-cascader/index.cjs +1 -125
- package/components/van-cascader/index.mjs +51 -96
- package/components/van-cascader/src/ctx.d.ts +135 -203
- package/components/van-cascader/src/index.vue.d.ts +312 -985
- package/components/var-datetime-picker/index.cjs +1 -333
- package/components/var-datetime-picker/index.mjs +175 -254
- package/components/var-datetime-picker/src/ctx.d.ts +19 -50
- package/components/var-datetime-picker/src/index.vue.d.ts +688 -1115
- package/components/vditor/index.cjs +1 -86
- package/components/vditor/index.mjs +40 -66
- package/components/vditor/src/ctx.d.ts +16 -45
- package/components/vditor/src/index.vue.d.ts +195 -120
- package/composables/element-plus/index.cjs +1 -23
- package/composables/element-plus/index.mjs +14 -18
- package/composables/index.cjs +1 -161
- package/composables/index.d.ts +1 -0
- package/composables/index.mjs +102 -135
- package/composables/useForm.d.ts +2 -2
- package/composables/useRtl.d.ts +18 -0
- package/composables/useSourceManager.d.ts +2 -2
- package/composables/useTemplateInstances.d.ts +3 -3
- package/index.css +1 -562
- package/index.d.ts +0 -3
- package/index.esm.js +23 -48
- package/locale/index.cjs +1 -102
- package/locale/index.mjs +34 -34
- package/locale/lang/index.cjs +1 -2
- package/locale/lang/index.d.ts +1 -0
- package/package.json +14 -85
- package/shared/const/index.cjs +1 -59
- package/shared/const/index.d.ts +1 -1
- package/shared/const/index.mjs +18 -20
- package/shared/element-plus/ctx.d.ts +40 -37
- package/shared/element-plus/index.cjs +1 -211
- package/shared/element-plus/index.mjs +93 -161
- package/shared/element-plus/instances.d.ts +207 -321
- package/shared/form/index.cjs +1 -33
- package/shared/form/index.mjs +23 -25
- package/shared/helper/index.cjs +1 -11
- package/shared/helper/index.mjs +7 -8
- package/shared/index.cjs +1 -8
- package/shared/index.mjs +5 -1
- package/shared/infer-prop/index.cjs +1 -36
- package/shared/infer-prop/index.mjs +22 -28
- package/shared/progress-it/index.cjs +1 -42
- package/shared/progress-it/index.mjs +15 -31
- package/shared/rules/index.cjs +1 -56
- package/shared/rules/index.mjs +19 -18
- package/shared/types/form/index.cjs +1 -2
- package/shared/types/index.cjs +1 -2
- package/shared/types/source/index.cjs +1 -2
- package/shared/types/source-manager/index.cjs +1 -2
- package/shared/upload/index.cjs +1 -774
- package/shared/upload/index.mjs +180 -764
- package/component.d.ts +0 -3
- package/components/_plugin-vue_export-helper.mjs +0 -9
- package/components/card-input-collection/index.css +0 -21
- package/components/cascader/index.css +0 -9
- package/components/checkbox/index.css +0 -30
- package/components/cloneDeep.mjs +0 -2104
- package/components/date-picker-range/index.css +0 -18
- package/components/dialog-input-collection/index.css +0 -21
- package/components/download-plus/index.css +0 -68
- package/components/editable-text/index.css +0 -9
- package/components/esri-input-geojson/index.css +0 -32
- package/components/fieldset/index.css +0 -5
- package/components/form-item/index.css +0 -35
- package/components/index.mjs +0 -378
- package/components/index2.mjs +0 -14
- package/components/information-tag/index.css +0 -6
- package/components/information-templates-default/index.css +0 -16
- package/components/input-array/index.css +0 -14
- package/components/input-collection/index.css +0 -20
- package/components/input-link/index.css +0 -4
- package/components/input-number/index.css +0 -13
- package/components/isObject.mjs +0 -158
- package/components/monaco-editor/index.css +0 -4
- package/components/radio/index.css +0 -40
- package/components/select/index.css +0 -15
- package/components/switch/index.css +0 -10
- package/components/tables-select/index.css +0 -3
- package/components/templates-layout/index.css +0 -3
- package/components/upload/index.css +0 -34
- package/components/upload-plus/index.css +0 -84
- package/components/van-cascader/index.css +0 -6
- package/components/var-datetime-picker/index.css +0 -17
- package/defaults.d.ts +0 -5
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, Fragment
|
|
2
|
-
import { _VkfFormItemCtx, VkfFormItem } from
|
|
3
|
-
import { bindPropsFactory, onEmitsFactory, vOn } from
|
|
4
|
-
import { uploadProps, ElProgress, ElIcon, ElButton, useNamespace, ElUpload, ElLink, ElMessageBox, genFileId } from
|
|
5
|
-
import { pickObject } from
|
|
6
|
-
import { createUploadBindProps } from
|
|
7
|
-
import {
|
|
8
|
-
import { RestFetch } from
|
|
9
|
-
import { NOOP } from
|
|
10
|
-
import { isCallable } from
|
|
11
|
-
import { useLocale } from
|
|
12
|
-
import { _ as
|
|
13
|
-
import { useComputedReadonly } from
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
...
|
|
18
|
-
...uploadProps,
|
|
1
|
+
import { defineComponent as T, computed as F, resolveComponent as m, openBlock as p, createElementBlock as g, Fragment as S, normalizeClass as n, createBlock as C, createCommentVNode as b, createElementVNode as I, withModifiers as R, createVNode as s, withCtx as u, toDisplayString as P, createTextVNode as D, normalizeStyle as M, shallowRef as Z, normalizeProps as G, guardReactiveProps as q, mergeProps as A, createSlots as H, renderSlot as J, h as K } from "vue";
|
|
2
|
+
import { _VkfFormItemCtx as O, VkfFormItem as Q } from "@vunk/form/components/form-item";
|
|
3
|
+
import { bindPropsFactory as W, onEmitsFactory as X, vOn as Y } from "@vunk/core/shared/utils-vue";
|
|
4
|
+
import { uploadProps as _, ElProgress as x, ElIcon as ee, ElButton as oe, useNamespace as V, ElUpload as le, ElLink as ne, ElMessageBox as se, genFileId as te } from "element-plus";
|
|
5
|
+
import { pickObject as ae } from "@vunk/core/shared/utils-object";
|
|
6
|
+
import { createUploadBindProps as ie } from "@vunk/form/shared/element-plus";
|
|
7
|
+
import { g as de, z as re, d as ue, h as pe, i as me, j as ce, b as fe } from "../index.cjs";
|
|
8
|
+
import { RestFetch as ve } from "@vunk/core/shared/utils-fetch";
|
|
9
|
+
import { NOOP as ye } from "@vunk/core/shared/utils-function";
|
|
10
|
+
import { isCallable as be } from "@vunk/shared/function";
|
|
11
|
+
import { useLocale as j } from "@vunk/form/composables/element-plus";
|
|
12
|
+
import { _ as z } from "../_plugin-vue_export-helper.cjs";
|
|
13
|
+
import { useComputedReadonly as we } from "@vunk/form/composables";
|
|
14
|
+
import ke from "@vunk/form/shared/progress-it";
|
|
15
|
+
const L = {
|
|
16
|
+
...O.props,
|
|
17
|
+
..._,
|
|
19
18
|
tip: {
|
|
20
19
|
type: String,
|
|
21
20
|
default: ""
|
|
@@ -42,50 +41,42 @@ const props = {
|
|
|
42
41
|
*/
|
|
43
42
|
exceedable: {
|
|
44
43
|
type: Boolean,
|
|
45
|
-
default:
|
|
44
|
+
default: !1
|
|
46
45
|
},
|
|
47
46
|
/**
|
|
48
47
|
* @description 是否开启超出覆盖文件的确认框
|
|
49
48
|
*/
|
|
50
49
|
confirmExceed: {
|
|
51
50
|
type: Boolean,
|
|
52
|
-
default:
|
|
51
|
+
default: !1
|
|
53
52
|
},
|
|
54
53
|
/**
|
|
55
54
|
* @description 同 el-upload 的 slots
|
|
56
55
|
*/
|
|
57
56
|
slots: null
|
|
58
|
-
}
|
|
59
|
-
const createBindProps = bindPropsFactory(props);
|
|
60
|
-
const emits = {
|
|
57
|
+
}, ge = W(L), B = {
|
|
61
58
|
"update:fileList": null,
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
const createOnEmits = onEmitsFactory(emits);
|
|
65
|
-
|
|
66
|
-
var ctx = /*#__PURE__*/Object.freeze({
|
|
59
|
+
remove: (e) => e
|
|
60
|
+
}, N = X(B), Ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
67
61
|
__proto__: null,
|
|
68
|
-
createBindProps:
|
|
69
|
-
createOnEmits:
|
|
70
|
-
emits:
|
|
71
|
-
props:
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
const restFetch = new RestFetch({
|
|
62
|
+
createBindProps: ge,
|
|
63
|
+
createOnEmits: N,
|
|
64
|
+
emits: B,
|
|
65
|
+
props: L
|
|
66
|
+
}, Symbol.toStringTag, { value: "Module" })), Ee = new ve({
|
|
75
67
|
baseURL: ""
|
|
76
|
-
})
|
|
77
|
-
var _sfc_main$2 = defineComponent({
|
|
68
|
+
}), Ue = T({
|
|
78
69
|
components: {
|
|
79
|
-
ElProgress,
|
|
80
|
-
ElIcon,
|
|
81
|
-
Check:
|
|
82
|
-
ZoomIn:
|
|
83
|
-
Delete:
|
|
84
|
-
Close:
|
|
85
|
-
CircleCheck:
|
|
86
|
-
Document:
|
|
87
|
-
Download:
|
|
88
|
-
ElButton
|
|
70
|
+
ElProgress: x,
|
|
71
|
+
ElIcon: ee,
|
|
72
|
+
Check: de,
|
|
73
|
+
ZoomIn: re,
|
|
74
|
+
Delete: ue,
|
|
75
|
+
Close: pe,
|
|
76
|
+
CircleCheck: me,
|
|
77
|
+
Document: ce,
|
|
78
|
+
Download: fe,
|
|
79
|
+
ElButton: oe
|
|
89
80
|
},
|
|
90
81
|
props: {
|
|
91
82
|
listType: {
|
|
@@ -98,11 +89,11 @@ var _sfc_main$2 = defineComponent({
|
|
|
98
89
|
},
|
|
99
90
|
disabled: {
|
|
100
91
|
type: Boolean,
|
|
101
|
-
default:
|
|
92
|
+
default: !1
|
|
102
93
|
},
|
|
103
94
|
onPreview: {
|
|
104
95
|
type: Function,
|
|
105
|
-
default: () =>
|
|
96
|
+
default: () => ye
|
|
106
97
|
},
|
|
107
98
|
onDownload: {
|
|
108
99
|
type: Function,
|
|
@@ -110,7 +101,7 @@ var _sfc_main$2 = defineComponent({
|
|
|
110
101
|
},
|
|
111
102
|
preview: {
|
|
112
103
|
type: [Boolean, Function],
|
|
113
|
-
default:
|
|
104
|
+
default: !1
|
|
114
105
|
},
|
|
115
106
|
previewLabel: {
|
|
116
107
|
type: String,
|
|
@@ -120,537 +111,352 @@ var _sfc_main$2 = defineComponent({
|
|
|
120
111
|
emits: {
|
|
121
112
|
remove: (e) => e
|
|
122
113
|
},
|
|
123
|
-
setup(
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
};
|
|
130
|
-
const handleDownload = (file = props.file) => {
|
|
131
|
-
if (props.onDownload) {
|
|
132
|
-
props.onDownload(file);
|
|
114
|
+
setup(e, { emit: o }) {
|
|
115
|
+
const E = V("upload"), c = V("icon"), { tr: U } = j(), v = (a = e.file) => {
|
|
116
|
+
o("remove", a);
|
|
117
|
+
}, w = (a = e.file) => {
|
|
118
|
+
if (e.onDownload) {
|
|
119
|
+
e.onDownload(a);
|
|
133
120
|
return;
|
|
134
121
|
}
|
|
135
|
-
let
|
|
136
|
-
|
|
137
|
-
url
|
|
138
|
-
|
|
139
|
-
url = window.URL.createObjectURL(file.raw);
|
|
140
|
-
}
|
|
141
|
-
url && restFetch.download({
|
|
142
|
-
url,
|
|
143
|
-
fileName: file.name
|
|
122
|
+
let l = "";
|
|
123
|
+
a.url ? l = a.url : a.raw && (l = window.URL.createObjectURL(a.raw)), l && Ee.download({
|
|
124
|
+
url: l,
|
|
125
|
+
fileName: a.name
|
|
144
126
|
}, {
|
|
145
127
|
method: "GET"
|
|
146
128
|
});
|
|
147
|
-
};
|
|
148
|
-
const previewable = computed(() => {
|
|
149
|
-
if (isCallable(props.preview)) {
|
|
150
|
-
return props.preview(props.file);
|
|
151
|
-
}
|
|
152
|
-
return props.preview;
|
|
153
|
-
});
|
|
154
|
-
const previewText = computed(() => props.previewLabel || tr("el.upload.preview", "\u9884\u89C8"));
|
|
155
|
-
const handlePreview = (file = props.file) => {
|
|
156
|
-
previewable.value && props.onPreview(file);
|
|
157
|
-
};
|
|
129
|
+
}, r = F(() => be(e.preview) ? e.preview(e.file) : e.preview), k = F(() => e.previewLabel || U("el.upload.preview", "预览"));
|
|
158
130
|
return {
|
|
159
|
-
handleRemove,
|
|
160
|
-
nsIcon,
|
|
161
|
-
nsUpload,
|
|
162
|
-
handleDownload,
|
|
163
|
-
handlePreview
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
131
|
+
handleRemove: v,
|
|
132
|
+
nsIcon: c,
|
|
133
|
+
nsUpload: E,
|
|
134
|
+
handleDownload: w,
|
|
135
|
+
handlePreview: (a = e.file) => {
|
|
136
|
+
r.value && e.onPreview(a);
|
|
137
|
+
},
|
|
138
|
+
previewText: k,
|
|
139
|
+
previewable: r,
|
|
140
|
+
tr: U
|
|
167
141
|
};
|
|
168
142
|
}
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
},
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
disabled: !_ctx.previewable,
|
|
267
|
-
class: normalizeClass(_ctx.nsUpload.be("list", "item-file-action-preview")),
|
|
268
|
-
plain: "",
|
|
269
|
-
size: "small",
|
|
270
|
-
round: "",
|
|
271
|
-
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.handlePreview(_ctx.file))
|
|
272
|
-
}, {
|
|
273
|
-
default: withCtx(() => [
|
|
274
|
-
createTextVNode(
|
|
275
|
-
toDisplayString(_ctx.previewText),
|
|
276
|
-
1
|
|
277
|
-
/* TEXT */
|
|
278
|
-
)
|
|
279
|
-
]),
|
|
280
|
-
_: 1
|
|
281
|
-
/* STABLE */
|
|
282
|
-
}, 8, ["disabled", "class"]),
|
|
283
|
-
createCommentVNode(" \u4E0B\u8F7D "),
|
|
284
|
-
createVNode(_component_ElButton, {
|
|
285
|
-
plain: "",
|
|
286
|
-
size: "small",
|
|
287
|
-
round: "",
|
|
288
|
-
type: "primary",
|
|
289
|
-
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleDownload(_ctx.file))
|
|
290
|
-
}, {
|
|
291
|
-
default: withCtx(() => [
|
|
292
|
-
createTextVNode(
|
|
293
|
-
toDisplayString(_ctx.tr("vkf.common.download", "\u4E0B\u8F7D")),
|
|
294
|
-
1
|
|
295
|
-
/* TEXT */
|
|
296
|
-
)
|
|
297
|
-
]),
|
|
298
|
-
_: 1
|
|
299
|
-
/* STABLE */
|
|
300
|
-
})
|
|
301
|
-
],
|
|
302
|
-
2
|
|
303
|
-
/* CLASS */
|
|
304
|
-
)) : createCommentVNode("v-if", true),
|
|
305
|
-
_ctx.file.status === "uploading" ? (openBlock(), createBlock(_component_ElProgress, {
|
|
306
|
-
key: 1,
|
|
307
|
-
type: _ctx.listType === "picture-card" ? "circle" : "line",
|
|
308
|
-
"stroke-width": _ctx.listType === "picture-card" ? 6 : 2,
|
|
309
|
-
percentage: Number(_ctx.file.percentage),
|
|
310
|
-
style: normalizeStyle(_ctx.listType === "picture-card" ? "" : "margin-top: 0.5rem")
|
|
311
|
-
}, null, 8, ["type", "stroke-width", "percentage", "style"])) : createCommentVNode("v-if", true)
|
|
312
|
-
],
|
|
313
|
-
2
|
|
314
|
-
/* CLASS */
|
|
315
|
-
)) : createCommentVNode("v-if", true),
|
|
316
|
-
createCommentVNode(" label "),
|
|
317
|
-
createElementVNode(
|
|
318
|
-
"label",
|
|
319
|
-
{
|
|
320
|
-
class: normalizeClass(_ctx.nsUpload.be("list", "item-status-label"))
|
|
321
|
-
},
|
|
322
|
-
[
|
|
323
|
-
_ctx.listType === "text" ? (openBlock(), createBlock(_component_ElIcon, {
|
|
324
|
-
key: 0,
|
|
325
|
-
class: normalizeClass([
|
|
326
|
-
_ctx.nsIcon.m("upload-success"),
|
|
327
|
-
_ctx.nsIcon.m("circle-check")
|
|
328
|
-
])
|
|
329
|
-
}, {
|
|
330
|
-
default: withCtx(() => [
|
|
331
|
-
createVNode(_component_CircleCheck)
|
|
332
|
-
]),
|
|
333
|
-
_: 1
|
|
334
|
-
/* STABLE */
|
|
335
|
-
}, 8, ["class"])) : ["picture-card", "picture"].includes(_ctx.listType) ? (openBlock(), createBlock(_component_ElIcon, {
|
|
336
|
-
key: 1,
|
|
337
|
-
class: normalizeClass([_ctx.nsIcon.m("upload-success"), _ctx.nsIcon.m("check")])
|
|
338
|
-
}, {
|
|
339
|
-
default: withCtx(() => [
|
|
340
|
-
createVNode(_component_Check)
|
|
341
|
-
]),
|
|
342
|
-
_: 1
|
|
343
|
-
/* STABLE */
|
|
344
|
-
}, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
345
|
-
],
|
|
346
|
-
2
|
|
347
|
-
/* CLASS */
|
|
348
|
-
),
|
|
349
|
-
!_ctx.disabled ? (openBlock(), createBlock(_component_ElIcon, {
|
|
350
|
-
key: 2,
|
|
351
|
-
class: normalizeClass(_ctx.nsIcon.m("close")),
|
|
352
|
-
onClick: _cache[4] || (_cache[4] = ($event) => _ctx.handleRemove(_ctx.file))
|
|
143
|
+
}), he = ["src"];
|
|
144
|
+
function Ce(e, o, E, c, U, v) {
|
|
145
|
+
const w = m("Document"), r = m("ElIcon"), k = m("Download"), h = m("ElButton"), a = m("ElProgress"), l = m("CircleCheck"), i = m("Check"), d = m("Close"), f = m("ZoomIn"), y = m("Delete");
|
|
146
|
+
return p(), g(S, null, [
|
|
147
|
+
e.listType === "picture" || e.file.status !== "uploading" && e.listType === "picture-card" ? (p(), g(S, { key: 0 }, [
|
|
148
|
+
/\.(svg|png|jpg|jpeg)$/.test(e.file.name) ? (p(), g("img", {
|
|
149
|
+
key: 0,
|
|
150
|
+
class: n(e.nsUpload.be("list", "item-thumbnail")),
|
|
151
|
+
src: e.file.url,
|
|
152
|
+
alt: ""
|
|
153
|
+
}, null, 10, he)) : (p(), C(w, {
|
|
154
|
+
key: 1,
|
|
155
|
+
class: n([
|
|
156
|
+
e.nsUpload.be("list", "item-thumbnail"),
|
|
157
|
+
e.nsIcon.m("document")
|
|
158
|
+
])
|
|
159
|
+
}, null, 8, ["class"]))
|
|
160
|
+
], 64)) : b("", !0),
|
|
161
|
+
e.listType !== "picture-card" || e.file.status === "uploading" ? (p(), g("div", {
|
|
162
|
+
key: 1,
|
|
163
|
+
class: n(e.nsUpload.be("list", "item-info"))
|
|
164
|
+
}, [
|
|
165
|
+
I("a", {
|
|
166
|
+
class: n(e.nsUpload.be("list", "item-name")),
|
|
167
|
+
onClick: o[1] || (o[1] = R((t) => e.handlePreview(e.file), ["prevent"]))
|
|
168
|
+
}, [
|
|
169
|
+
s(r, {
|
|
170
|
+
class: n(e.nsIcon.m("document"))
|
|
171
|
+
}, {
|
|
172
|
+
default: u(() => [
|
|
173
|
+
s(w)
|
|
174
|
+
]),
|
|
175
|
+
_: 1
|
|
176
|
+
}, 8, ["class"]),
|
|
177
|
+
s(r, {
|
|
178
|
+
class: n([
|
|
179
|
+
e.nsIcon.m("download"),
|
|
180
|
+
e.nsIcon.m("download-primary")
|
|
181
|
+
]),
|
|
182
|
+
onClick: o[0] || (o[0] = R((t) => e.handleDownload(e.file), ["stop"]))
|
|
183
|
+
}, {
|
|
184
|
+
default: u(() => [
|
|
185
|
+
s(k)
|
|
186
|
+
]),
|
|
187
|
+
_: 1
|
|
188
|
+
}, 8, ["class"]),
|
|
189
|
+
I("span", {
|
|
190
|
+
class: n(e.nsUpload.be("list", "item-file-name"))
|
|
191
|
+
}, P(e.file.name), 3)
|
|
192
|
+
], 2),
|
|
193
|
+
e.listType === "picture" ? (p(), g("div", {
|
|
194
|
+
key: 0,
|
|
195
|
+
class: n(e.nsUpload.be("list", "item-file-actions"))
|
|
196
|
+
}, [
|
|
197
|
+
s(h, {
|
|
198
|
+
disabled: !e.previewable,
|
|
199
|
+
class: n(e.nsUpload.be("list", "item-file-action-preview")),
|
|
200
|
+
plain: "",
|
|
201
|
+
size: "small",
|
|
202
|
+
round: "",
|
|
203
|
+
onClick: o[2] || (o[2] = (t) => e.handlePreview(e.file))
|
|
204
|
+
}, {
|
|
205
|
+
default: u(() => [
|
|
206
|
+
D(P(e.previewText), 1)
|
|
207
|
+
]),
|
|
208
|
+
_: 1
|
|
209
|
+
}, 8, ["disabled", "class"]),
|
|
210
|
+
s(h, {
|
|
211
|
+
plain: "",
|
|
212
|
+
size: "small",
|
|
213
|
+
round: "",
|
|
214
|
+
type: "primary",
|
|
215
|
+
onClick: o[3] || (o[3] = (t) => e.handleDownload(e.file))
|
|
216
|
+
}, {
|
|
217
|
+
default: u(() => [
|
|
218
|
+
D(P(e.tr("vkf.common.download", "下载")), 1)
|
|
219
|
+
]),
|
|
220
|
+
_: 1
|
|
221
|
+
})
|
|
222
|
+
], 2)) : b("", !0),
|
|
223
|
+
e.file.status === "uploading" ? (p(), C(a, {
|
|
224
|
+
key: 1,
|
|
225
|
+
type: e.listType === "picture-card" ? "circle" : "line",
|
|
226
|
+
"stroke-width": e.listType === "picture-card" ? 6 : 2,
|
|
227
|
+
percentage: Number(e.file.percentage),
|
|
228
|
+
style: M(e.listType === "picture-card" ? "" : "margin-top: 0.5rem")
|
|
229
|
+
}, null, 8, ["type", "stroke-width", "percentage", "style"])) : b("", !0)
|
|
230
|
+
], 2)) : b("", !0),
|
|
231
|
+
I("label", {
|
|
232
|
+
class: n(e.nsUpload.be("list", "item-status-label"))
|
|
233
|
+
}, [
|
|
234
|
+
e.listType === "text" ? (p(), C(r, {
|
|
235
|
+
key: 0,
|
|
236
|
+
class: n([
|
|
237
|
+
e.nsIcon.m("upload-success"),
|
|
238
|
+
e.nsIcon.m("circle-check")
|
|
239
|
+
])
|
|
353
240
|
}, {
|
|
354
|
-
default:
|
|
355
|
-
|
|
241
|
+
default: u(() => [
|
|
242
|
+
s(l)
|
|
356
243
|
]),
|
|
357
244
|
_: 1
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
createVNode(_component_ElIcon, {
|
|
426
|
-
class: normalizeClass(_ctx.nsIcon.m("delete"))
|
|
427
|
-
}, {
|
|
428
|
-
default: withCtx(() => [
|
|
429
|
-
createVNode(_component_Delete)
|
|
430
|
-
]),
|
|
431
|
-
_: 1
|
|
432
|
-
/* STABLE */
|
|
433
|
-
}, 8, ["class"])
|
|
434
|
-
],
|
|
435
|
-
2
|
|
436
|
-
/* CLASS */
|
|
437
|
-
)) : createCommentVNode("v-if", true)
|
|
438
|
-
],
|
|
439
|
-
2
|
|
440
|
-
/* CLASS */
|
|
441
|
-
)) : createCommentVNode("v-if", true)
|
|
442
|
-
],
|
|
443
|
-
64
|
|
444
|
-
/* STABLE_FRAGMENT */
|
|
445
|
-
);
|
|
245
|
+
}, 8, ["class"])) : ["picture-card", "picture"].includes(e.listType) ? (p(), C(r, {
|
|
246
|
+
key: 1,
|
|
247
|
+
class: n([e.nsIcon.m("upload-success"), e.nsIcon.m("check")])
|
|
248
|
+
}, {
|
|
249
|
+
default: u(() => [
|
|
250
|
+
s(i)
|
|
251
|
+
]),
|
|
252
|
+
_: 1
|
|
253
|
+
}, 8, ["class"])) : b("", !0)
|
|
254
|
+
], 2),
|
|
255
|
+
e.disabled ? b("", !0) : (p(), C(r, {
|
|
256
|
+
key: 2,
|
|
257
|
+
class: n(e.nsIcon.m("close")),
|
|
258
|
+
onClick: o[4] || (o[4] = (t) => e.handleRemove(e.file))
|
|
259
|
+
}, {
|
|
260
|
+
default: u(() => [
|
|
261
|
+
s(d)
|
|
262
|
+
]),
|
|
263
|
+
_: 1
|
|
264
|
+
}, 8, ["class"])),
|
|
265
|
+
e.listType === "picture-card" ? (p(), g("span", {
|
|
266
|
+
key: 3,
|
|
267
|
+
class: n(e.nsUpload.be("list", "item-actions"))
|
|
268
|
+
}, [
|
|
269
|
+
e.previewable ? (p(), g("span", {
|
|
270
|
+
key: 0,
|
|
271
|
+
class: n(e.nsUpload.be("list", "item-preview")),
|
|
272
|
+
onClick: o[5] || (o[5] = (t) => e.handlePreview(e.file))
|
|
273
|
+
}, [
|
|
274
|
+
s(r, {
|
|
275
|
+
class: n(e.nsIcon.m("zoom-in"))
|
|
276
|
+
}, {
|
|
277
|
+
default: u(() => [
|
|
278
|
+
s(f)
|
|
279
|
+
]),
|
|
280
|
+
_: 1
|
|
281
|
+
}, 8, ["class"])
|
|
282
|
+
], 2)) : b("", !0),
|
|
283
|
+
I("span", {
|
|
284
|
+
class: n(e.nsUpload.be("list", "item-download")),
|
|
285
|
+
onClick: o[6] || (o[6] = (t) => e.handleDownload(e.file))
|
|
286
|
+
}, [
|
|
287
|
+
s(r, {
|
|
288
|
+
class: n(e.nsIcon.m("download"))
|
|
289
|
+
}, {
|
|
290
|
+
default: u(() => [
|
|
291
|
+
s(k)
|
|
292
|
+
]),
|
|
293
|
+
_: 1
|
|
294
|
+
}, 8, ["class"])
|
|
295
|
+
], 2),
|
|
296
|
+
e.disabled ? b("", !0) : (p(), g("span", {
|
|
297
|
+
key: 1,
|
|
298
|
+
class: n(e.nsUpload.be("list", "item-delete")),
|
|
299
|
+
onClick: o[7] || (o[7] = (t) => e.handleRemove(e.file))
|
|
300
|
+
}, [
|
|
301
|
+
s(r, {
|
|
302
|
+
class: n(e.nsIcon.m("delete"))
|
|
303
|
+
}, {
|
|
304
|
+
default: u(() => [
|
|
305
|
+
s(y)
|
|
306
|
+
]),
|
|
307
|
+
_: 1
|
|
308
|
+
}, 8, ["class"])
|
|
309
|
+
], 2))
|
|
310
|
+
], 2)) : b("", !0)
|
|
311
|
+
], 64);
|
|
446
312
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
var _sfc_main$1 = defineComponent({
|
|
313
|
+
const Ie = /* @__PURE__ */ z(Ue, [["render", Ce]]), Pe = T({
|
|
450
314
|
components: {
|
|
451
|
-
VkfFormItem,
|
|
452
|
-
ElUpload,
|
|
453
|
-
FileVue,
|
|
454
|
-
ElLink
|
|
315
|
+
VkfFormItem: Q,
|
|
316
|
+
ElUpload: le,
|
|
317
|
+
FileVue: Ie,
|
|
318
|
+
ElLink: ne
|
|
455
319
|
},
|
|
456
|
-
props,
|
|
457
|
-
emits,
|
|
458
|
-
setup(
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
uploadRef.value?.abort(file);
|
|
466
|
-
emit("update:fileList", props2.fileList);
|
|
467
|
-
};
|
|
468
|
-
const handleExceed = (files, uploadFiles) => {
|
|
469
|
-
if (props2.onExceed) {
|
|
470
|
-
props2.onExceed(files, uploadFiles);
|
|
320
|
+
props: L,
|
|
321
|
+
emits: B,
|
|
322
|
+
setup(e, { emit: o }) {
|
|
323
|
+
const E = O.createBindProps(e), { tr: c } = j(), U = ie(e, ["disabled", "fileList", "beforeUpload", "onSuccess"]), v = Z(), w = (l) => {
|
|
324
|
+
var i, d;
|
|
325
|
+
(i = v.value) == null || i.handleRemove(l), (d = v.value) == null || d.abort(l), o("update:fileList", e.fileList);
|
|
326
|
+
}, r = (l, i) => {
|
|
327
|
+
if (e.onExceed) {
|
|
328
|
+
e.onExceed(l, i);
|
|
471
329
|
return;
|
|
472
330
|
}
|
|
473
|
-
if (
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
});
|
|
480
|
-
uploadRef.value?.submit();
|
|
331
|
+
if (e.exceedable) {
|
|
332
|
+
const d = () => {
|
|
333
|
+
var f, y;
|
|
334
|
+
(f = v.value) == null || f.clearFiles(), l.forEach((t) => {
|
|
335
|
+
var $;
|
|
336
|
+
t.uid = te(), ($ = v.value) == null || $.handleStart(t);
|
|
337
|
+
}), (y = v.value) == null || y.submit();
|
|
481
338
|
};
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
type: "warning"
|
|
490
|
-
}
|
|
491
|
-
).then(doUpload);
|
|
492
|
-
} else {
|
|
493
|
-
doUpload();
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
};
|
|
497
|
-
const readonly = useComputedReadonly(props2);
|
|
498
|
-
const onSuccess = (response, uploadFile, uploadFiles) => {
|
|
499
|
-
const raw = uploadFile.raw;
|
|
500
|
-
raw.progress(true);
|
|
501
|
-
uploadFile.percentage = 100;
|
|
502
|
-
uploadFile.status = "success";
|
|
503
|
-
props2.onSuccess?.(response, uploadFile, uploadFiles);
|
|
504
|
-
};
|
|
505
|
-
const beforeUpload = async (rawFile) => {
|
|
506
|
-
const effect = (e, s) => {
|
|
507
|
-
const file = props2.fileList.find((item) => item.uid === rawFile.uid);
|
|
508
|
-
if (file) {
|
|
509
|
-
file.percentage = Number((e * 100).toFixed(2));
|
|
510
|
-
if (s === false) {
|
|
511
|
-
file.status = "uploading";
|
|
339
|
+
e.confirmExceed ? se.confirm(
|
|
340
|
+
c("vkf.upload.exceedConfirm", "已超过最大上传数量限制,是否使用新文件重新上传?"),
|
|
341
|
+
c("el.messagebox.title", "提示"),
|
|
342
|
+
{
|
|
343
|
+
confirmButtonText: c("el.upload.continue", "继续"),
|
|
344
|
+
cancelButtonText: c("el.messagebox.cancel", "取消"),
|
|
345
|
+
type: "warning"
|
|
512
346
|
}
|
|
513
|
-
|
|
514
|
-
};
|
|
515
|
-
rawFile.progress = progress(effect)(false);
|
|
516
|
-
if (props2.beforeUpload) {
|
|
517
|
-
const res = await props2.beforeUpload?.(rawFile);
|
|
518
|
-
return res;
|
|
347
|
+
).then(d) : d();
|
|
519
348
|
}
|
|
520
|
-
|
|
521
|
-
};
|
|
349
|
+
}, k = we(e);
|
|
522
350
|
return {
|
|
523
|
-
formItemBindProps,
|
|
524
|
-
pickObject,
|
|
525
|
-
coreBindProps,
|
|
526
|
-
uploadRef,
|
|
527
|
-
handleRemove,
|
|
528
|
-
readonly,
|
|
529
|
-
onSuccess,
|
|
351
|
+
formItemBindProps: E,
|
|
352
|
+
pickObject: ae,
|
|
353
|
+
coreBindProps: U,
|
|
354
|
+
uploadRef: v,
|
|
355
|
+
handleRemove: w,
|
|
356
|
+
readonly: k,
|
|
357
|
+
onSuccess: (l, i, d) => {
|
|
358
|
+
var y, t;
|
|
359
|
+
const f = i.raw;
|
|
360
|
+
(y = f.progress) == null || y.call(f, !0), i.percentage = 100, i.status = "success", (t = e.onSuccess) == null || t.call(e, l, i, d);
|
|
361
|
+
},
|
|
530
362
|
// onProgress,
|
|
531
|
-
beforeUpload
|
|
532
|
-
|
|
533
|
-
|
|
363
|
+
beforeUpload: async (l) => {
|
|
364
|
+
var d;
|
|
365
|
+
const i = (f, y) => {
|
|
366
|
+
const t = e.fileList.find(($) => $.uid === l.uid);
|
|
367
|
+
t && (t.percentage = Number((f * 100).toFixed(2)), y === !1 && (t.status = "uploading"));
|
|
368
|
+
};
|
|
369
|
+
return l.progress = ke(i)(!1), e.beforeUpload ? await ((d = e.beforeUpload) == null ? void 0 : d.call(e, l)) : !0;
|
|
370
|
+
},
|
|
371
|
+
handleExceed: r,
|
|
372
|
+
tr: c
|
|
534
373
|
};
|
|
535
374
|
}
|
|
536
|
-
});
|
|
537
|
-
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
return openBlock(), createBlock(
|
|
545
|
-
_component_VkfFormItem,
|
|
546
|
-
normalizeProps(guardReactiveProps(_ctx.formItemBindProps)),
|
|
547
|
-
{
|
|
548
|
-
default: withCtx(() => [
|
|
549
|
-
createVNode(_component_ElUpload, mergeProps(_ctx.coreBindProps, {
|
|
375
|
+
}), $e = { class: "el-upload__tip" };
|
|
376
|
+
function Le(e, o, E, c, U, v) {
|
|
377
|
+
const w = m("ElLink"), r = m("FileVue"), k = m("ElUpload"), h = m("VkfFormItem");
|
|
378
|
+
return p(), C(h, G(q(e.formItemBindProps)), {
|
|
379
|
+
default: u(() => {
|
|
380
|
+
var a, l, i;
|
|
381
|
+
return [
|
|
382
|
+
s(k, A(e.coreBindProps, {
|
|
550
383
|
ref: "uploadRef",
|
|
551
384
|
class: ["vkf-upload", {
|
|
552
|
-
"is-readonly":
|
|
553
|
-
"is-empty":
|
|
554
|
-
"is-limit":
|
|
555
|
-
"is-exceedable":
|
|
385
|
+
"is-readonly": e.readonly,
|
|
386
|
+
"is-empty": ((a = e.fileList) == null ? void 0 : a.length) === 0,
|
|
387
|
+
"is-limit": e.limit && ((l = e.fileList) == null ? void 0 : l.length) >= e.limit,
|
|
388
|
+
"is-exceedable": e.exceedable
|
|
556
389
|
}],
|
|
557
|
-
"file-list":
|
|
558
|
-
"on-success":
|
|
559
|
-
"before-upload":
|
|
560
|
-
disabled:
|
|
561
|
-
"on-exceed":
|
|
562
|
-
"onUpdate:fileList":
|
|
563
|
-
}),
|
|
564
|
-
file:
|
|
565
|
-
|
|
566
|
-
file,
|
|
567
|
-
"list-type":
|
|
568
|
-
disabled:
|
|
569
|
-
"on-preview":
|
|
570
|
-
preview:
|
|
571
|
-
"on-download":
|
|
572
|
-
"preview-label":
|
|
573
|
-
onRemove:
|
|
390
|
+
"file-list": e.fileList ?? [],
|
|
391
|
+
"on-success": e.onSuccess,
|
|
392
|
+
"before-upload": e.beforeUpload,
|
|
393
|
+
disabled: e.readonly || e.disabled,
|
|
394
|
+
"on-exceed": e.handleExceed,
|
|
395
|
+
"onUpdate:fileList": o[0] || (o[0] = (d) => e.$emit("update:fileList", d))
|
|
396
|
+
}), H({
|
|
397
|
+
file: u(({ file: d }) => [
|
|
398
|
+
s(r, {
|
|
399
|
+
file: d,
|
|
400
|
+
"list-type": e.listType,
|
|
401
|
+
disabled: e.readonly || e.disabled,
|
|
402
|
+
"on-preview": e.onPreview,
|
|
403
|
+
preview: e.preview,
|
|
404
|
+
"on-download": e.onDownload,
|
|
405
|
+
"preview-label": e.previewLabel,
|
|
406
|
+
onRemove: e.handleRemove
|
|
574
407
|
}, null, 8, ["file", "list-type", "disabled", "on-preview", "preview", "on-download", "preview-label", "onRemove"])
|
|
575
408
|
]),
|
|
576
|
-
default:
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
default:
|
|
580
|
-
|
|
581
|
-
" + " + toDisplayString(_ctx.tr("vkf.upload.selectFile", "\u9009\u62E9\u6587\u4EF6")),
|
|
582
|
-
1
|
|
583
|
-
/* TEXT */
|
|
584
|
-
)
|
|
409
|
+
default: u(() => [
|
|
410
|
+
J(e.$slots, "default", {}, () => [
|
|
411
|
+
s(w, { type: "primary" }, {
|
|
412
|
+
default: u(() => [
|
|
413
|
+
D(" + " + P(e.tr("vkf.upload.selectFile", "选择文件")), 1)
|
|
585
414
|
]),
|
|
586
415
|
_: 1
|
|
587
|
-
/* STABLE */
|
|
588
416
|
})
|
|
589
417
|
])
|
|
590
418
|
]),
|
|
591
419
|
_: 2
|
|
592
|
-
/* DYNAMIC */
|
|
593
420
|
}, [
|
|
594
|
-
|
|
421
|
+
e.tip ? {
|
|
595
422
|
name: "tip",
|
|
596
|
-
fn:
|
|
597
|
-
|
|
598
|
-
"div",
|
|
599
|
-
_hoisted_1,
|
|
600
|
-
toDisplayString(_ctx.tip),
|
|
601
|
-
1
|
|
602
|
-
/* TEXT */
|
|
603
|
-
)
|
|
423
|
+
fn: u(() => [
|
|
424
|
+
I("div", $e, P(e.tip), 1)
|
|
604
425
|
]),
|
|
605
426
|
key: "0"
|
|
606
427
|
} : void 0
|
|
607
428
|
]), 1040, ["class", "file-list", "on-success", "before-upload", "disabled", "on-exceed"]),
|
|
608
|
-
|
|
609
|
-
"
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
/* TEXT, CLASS */
|
|
619
|
-
)
|
|
620
|
-
]),
|
|
621
|
-
_: 3
|
|
622
|
-
/* FORWARDED */
|
|
623
|
-
},
|
|
624
|
-
16
|
|
625
|
-
/* FULL_PROPS */
|
|
626
|
-
);
|
|
429
|
+
I("span", {
|
|
430
|
+
class: n(["vkf-upload-empty-tip", {
|
|
431
|
+
"is-readonly": e.readonly,
|
|
432
|
+
"is-empty": ((i = e.fileList) == null ? void 0 : i.length) === 0
|
|
433
|
+
}])
|
|
434
|
+
}, P(e.tr("vkf.upload.empty", "暂无")), 3)
|
|
435
|
+
];
|
|
436
|
+
}),
|
|
437
|
+
_: 3
|
|
438
|
+
}, 16);
|
|
627
439
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
var _sfc_main = defineComponent({
|
|
440
|
+
const Be = /* @__PURE__ */ z(Pe, [["render", Le]]), He = T({
|
|
631
441
|
name: "VkfUpload",
|
|
632
|
-
props,
|
|
633
|
-
emits,
|
|
634
|
-
setup(
|
|
635
|
-
const
|
|
636
|
-
return () =>
|
|
637
|
-
...
|
|
638
|
-
...
|
|
442
|
+
props: L,
|
|
443
|
+
emits: B,
|
|
444
|
+
setup(e, { emit: o, slots: E }) {
|
|
445
|
+
const c = N(o);
|
|
446
|
+
return () => K(Be, {
|
|
447
|
+
...e,
|
|
448
|
+
...Y(c)
|
|
639
449
|
}, {
|
|
640
|
-
...
|
|
641
|
-
...
|
|
450
|
+
...e.slots,
|
|
451
|
+
...E
|
|
642
452
|
});
|
|
643
453
|
}
|
|
644
|
-
})
|
|
645
|
-
|
|
646
|
-
var VkfUpload = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/upload/src/wraper.vue"]]);
|
|
647
|
-
|
|
648
|
-
var types = /*#__PURE__*/Object.freeze({
|
|
454
|
+
}), Je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
649
455
|
__proto__: null
|
|
650
|
-
});
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
456
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
457
|
+
export {
|
|
458
|
+
He as VkfUpload,
|
|
459
|
+
Ae as _VkfUploadCtx,
|
|
460
|
+
Je as __VkfUpload,
|
|
461
|
+
He as default
|
|
654
462
|
};
|
|
655
|
-
|
|
656
|
-
export { VkfUpload, ctx as _VkfUploadCtx, types as __VkfUpload, VkfUpload as default };
|