@vunk/form 1.1.72 → 1.1.73
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
2
|
-
import {
|
|
3
|
-
import { defineComponent, ref, watch, onBeforeUnmount, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createElementVNode, createVNode, createElementBlock, Fragment, renderList, normalizeClass, normalizeStyle, createCommentVNode, createTextVNode } from 'vue';
|
|
2
|
+
import { openBlock, createElementBlock, createElementVNode, defineComponent, watchEffect, ref, watch, onBeforeUnmount, resolveComponent, createBlock, mergeProps, withCtx, createVNode, Fragment, renderList, normalizeClass, normalizeStyle, createCommentVNode, createTextVNode } from 'vue';
|
|
4
3
|
import { rFile } from '@skzz/platform/api/basic';
|
|
4
|
+
import { restFetch as restFetch$1 } from '@skzz/platform/shared/fetch/platform';
|
|
5
5
|
import { ElButtonGroup, ElButton, ElInput } from 'element-plus';
|
|
6
6
|
import { RestFetch } from '@vunk/core/shared/utils-fetch';
|
|
7
7
|
import { useModelComputed } from '@vunk/core/composables';
|
|
@@ -14,7 +14,7 @@ const props = {
|
|
|
14
14
|
},
|
|
15
15
|
url: {
|
|
16
16
|
type: String,
|
|
17
|
-
default:
|
|
17
|
+
default: void 0
|
|
18
18
|
},
|
|
19
19
|
/**
|
|
20
20
|
* @description 分片大小
|
|
@@ -113,6 +113,35 @@ const downChunk = (params, init) => {
|
|
|
113
113
|
});
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
+
/*! Element Plus Icons Vue v2.1.0 */
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
// unplugin-vue:/plugin-vue/export-helper
|
|
120
|
+
var export_helper_default = (sfc, props) => {
|
|
121
|
+
let target = sfc.__vccOpts || sfc;
|
|
122
|
+
for (let [key, val] of props) target[key] = val;
|
|
123
|
+
return target;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// unplugin-vue:/home/runner/work/element-plus-icons/element-plus-icons/packages/vue/src/components/download.vue?vue&type=script&lang.ts
|
|
127
|
+
var download_vue_vue_type_script_lang_default = {
|
|
128
|
+
name: "Download"
|
|
129
|
+
};
|
|
130
|
+
var _hoisted_191 = {
|
|
131
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
132
|
+
viewBox: "0 0 1024 1024"
|
|
133
|
+
},
|
|
134
|
+
_hoisted_291 = /* @__PURE__ */createElementVNode("path", {
|
|
135
|
+
fill: "currentColor",
|
|
136
|
+
d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64zm384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64v450.304z"
|
|
137
|
+
}, null, -1
|
|
138
|
+
/* HOISTED */),
|
|
139
|
+
_hoisted_390 = [_hoisted_291];
|
|
140
|
+
function _sfc_render91(_ctx, _cache, $props, $setup, $data, $options) {
|
|
141
|
+
return openBlock(), createElementBlock("svg", _hoisted_191, _hoisted_390);
|
|
142
|
+
}
|
|
143
|
+
var download_default = /* @__PURE__ */export_helper_default(download_vue_vue_type_script_lang_default, [["render", _sfc_render91], ["__file", "download.vue"]]);
|
|
144
|
+
|
|
116
145
|
var script = defineComponent({
|
|
117
146
|
name: "VkfDownloadPlus",
|
|
118
147
|
components: {
|
|
@@ -127,6 +156,9 @@ var script = defineComponent({
|
|
|
127
156
|
emit
|
|
128
157
|
}) {
|
|
129
158
|
const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
|
|
159
|
+
watchEffect(() => {
|
|
160
|
+
restFetch.baseURL = props2.url || restFetch$1.baseURL;
|
|
161
|
+
});
|
|
130
162
|
const fileInfo = ref();
|
|
131
163
|
rFileInfo();
|
|
132
164
|
watch(() => props2.fileId, rFileInfo);
|
|
@@ -274,7 +306,8 @@ var script = defineComponent({
|
|
|
274
306
|
handlePause,
|
|
275
307
|
Status,
|
|
276
308
|
chunks,
|
|
277
|
-
fileStatus
|
|
309
|
+
fileStatus,
|
|
310
|
+
Download: download_default
|
|
278
311
|
};
|
|
279
312
|
}
|
|
280
313
|
});
|
|
@@ -301,9 +334,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
301
334
|
}),
|
|
302
335
|
{
|
|
303
336
|
default: withCtx(() => [createElementVNode("div", _hoisted_1, [createElementVNode("label", _hoisted_2, [createVNode(_component_ElInput, {
|
|
337
|
+
"prefix-icon": _ctx.Download,
|
|
304
338
|
"model-value": _ctx.fileInfo?.realName,
|
|
305
339
|
readonly: ""
|
|
306
|
-
}, null, 8, ["model-value"]), _ctx.fileStatus === _ctx.Status.downloading || _ctx.fileStatus === _ctx.Status.pause ? (openBlock(), createElementBlock("div", _hoisted_3, [(openBlock(true), createElementBlock(
|
|
340
|
+
}, null, 8, ["prefix-icon", "model-value"]), _ctx.fileStatus === _ctx.Status.downloading || _ctx.fileStatus === _ctx.Status.pause ? (openBlock(), createElementBlock("div", _hoisted_3, [(openBlock(true), createElementBlock(
|
|
307
341
|
Fragment,
|
|
308
342
|
null,
|
|
309
343
|
renderList(_ctx.chunks, (chunk) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
2
1
|
import { Status } from './const';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
3
|
export declare const props: {
|
|
4
4
|
fileId: {
|
|
5
5
|
type: StringConstructor;
|
|
@@ -7,7 +7,7 @@ export declare const props: {
|
|
|
7
7
|
};
|
|
8
8
|
url: {
|
|
9
9
|
type: StringConstructor;
|
|
10
|
-
default:
|
|
10
|
+
default: any;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* @description 分片大小
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_VkfFormItemCtx as t}from"@vunk/form/components/form-item";
|
|
1
|
+
import{_VkfFormItemCtx as t}from"@vunk/form/components/form-item";const e={...t.props,fileId:{type:String,default:""},url:{type:String,default:void 0},chunkSize:{type:Number,default:1024*1024*10},fileServiceType:{type:String,default:void 0},fileStatus:{type:String,default:void 0}},i={"update:fileStatus":null};export{i as emits,e as props};
|
|
@@ -6,7 +6,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6
6
|
};
|
|
7
7
|
url: {
|
|
8
8
|
type: StringConstructor;
|
|
9
|
-
default:
|
|
9
|
+
default: any;
|
|
10
10
|
};
|
|
11
11
|
chunkSize: {
|
|
12
12
|
type: NumberConstructor;
|
|
@@ -105,6 +105,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
105
105
|
data?: Blob;
|
|
106
106
|
}[]>;
|
|
107
107
|
fileStatus: import("vue").WritableComputedRef<Status>;
|
|
108
|
+
Download: import("vue").DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
108
109
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
109
110
|
'update:fileStatus': any;
|
|
110
111
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -114,7 +115,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
114
115
|
};
|
|
115
116
|
url: {
|
|
116
117
|
type: StringConstructor;
|
|
117
|
-
default:
|
|
118
|
+
default: any;
|
|
118
119
|
};
|
|
119
120
|
chunkSize: {
|
|
120
121
|
type: NumberConstructor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
2
|
-
import { openBlock, createElementBlock, createElementVNode, defineComponent, watch, ref, computed,
|
|
2
|
+
import { openBlock, createElementBlock, createElementVNode, defineComponent, watchEffect, watch, ref, computed, onBeforeUnmount, resolveComponent, resolveDirective, createBlock, mergeProps, withCtx, createVNode, normalizeClass, createCommentVNode, Fragment, renderList, normalizeStyle, withDirectives, createTextVNode } from 'vue';
|
|
3
3
|
import { ElMessage, ElInput, ElButtonGroup, ElButton, ElIcon, vLoading } from 'element-plus';
|
|
4
4
|
import { createFileChunk, calculateFileHashSample } from '@vunk/form/shared/upload';
|
|
5
5
|
import { RestFetch } from '@vunk/core/shared/utils-fetch';
|
|
@@ -9705,6 +9705,9 @@ var script = defineComponent({
|
|
|
9705
9705
|
default: Status.wait,
|
|
9706
9706
|
key: "fileStatus"
|
|
9707
9707
|
}, props2, emit);
|
|
9708
|
+
watchEffect(() => {
|
|
9709
|
+
restFetch.baseURL = props2.url || restFetch$1.baseURL;
|
|
9710
|
+
});
|
|
9708
9711
|
watch(() => fileStatus.value, (v, ov) => {
|
|
9709
9712
|
if (v === Status.doUpload) {
|
|
9710
9713
|
handleUpload();
|
|
@@ -9729,10 +9732,6 @@ var script = defineComponent({
|
|
|
9729
9732
|
}
|
|
9730
9733
|
return upload_filled_default;
|
|
9731
9734
|
});
|
|
9732
|
-
watchEffect(() => {
|
|
9733
|
-
if (props2.url)
|
|
9734
|
-
restFetch.baseURL = props2.url;
|
|
9735
|
-
});
|
|
9736
9735
|
const handleFileChange = (e) => {
|
|
9737
9736
|
handlePause();
|
|
9738
9737
|
const target = e.target;
|
|
@@ -9762,6 +9761,7 @@ var script = defineComponent({
|
|
|
9762
9761
|
message: "\u4E0A\u4F20\u6210\u529F"
|
|
9763
9762
|
});
|
|
9764
9763
|
emit("success", mergedFile);
|
|
9764
|
+
fileStatus.value = Status.done;
|
|
9765
9765
|
return;
|
|
9766
9766
|
}
|
|
9767
9767
|
const sliceSize = chunkFiles[0].size;
|