@fecp/mobile 1.0.54 → 1.0.55

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/es/mobile.css CHANGED
@@ -89,7 +89,7 @@
89
89
  :root,:host{--van-image-preview-index-text-color: var(--van-white);--van-image-preview-index-font-size: var(--van-font-size-md);--van-image-preview-index-line-height: var(--van-line-height-md);--van-image-preview-index-text-shadow: 0 1px 1px var(--van-gray-8);--van-image-preview-overlay-background: rgba(0, 0, 0, .9);--van-image-preview-close-icon-size: 22px;--van-image-preview-close-icon-color: var(--van-gray-5);--van-image-preview-close-icon-margin: var(--van-padding-md);--van-image-preview-close-icon-z-index: 1}.van-image-preview{position:fixed;top:0;left:0;width:100%;height:100%;max-width:none;background-color:transparent;transform:none}.van-image-preview__swipe{height:100%}.van-image-preview__swipe-item{display:flex;align-items:center;justify-content:center;overflow:hidden}.van-image-preview__cover{position:absolute;top:0;left:0}.van-image-preview__image,.van-image-preview__image-wrap{width:100%;transition-property:transform}.van-image-preview__image--vertical,.van-image-preview__image-wrap--vertical{width:auto;height:100%}.van-image-preview__image img,.van-image-preview__image-wrap img,.van-image-preview__image video,.van-image-preview__image-wrap video{-webkit-user-drag:none}.van-image-preview__image .van-image__error,.van-image-preview__image-wrap .van-image__error{top:30%;height:40%}.van-image-preview__image .van-image__error-icon,.van-image-preview__image-wrap .van-image__error-icon{font-size:36px}.van-image-preview__image .van-image__loading,.van-image-preview__image-wrap .van-image__loading{background-color:transparent}.van-image-preview__index{position:absolute;top:var(--van-padding-md);left:50%;color:var(--van-image-preview-index-text-color);font-size:var(--van-image-preview-index-font-size);line-height:var(--van-image-preview-index-line-height);text-shadow:var(--van-image-preview-index-text-shadow);transform:translate(-50%)}.van-image-preview__overlay{background:var(--van-image-preview-overlay-background)}.van-image-preview__close-icon{position:absolute;z-index:var(--van-image-preview-close-icon-z-index);color:var(--van-image-preview-close-icon-color);font-size:var(--van-image-preview-close-icon-size)}.van-image-preview__close-icon--top-left{top:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--top-right{top:var(--van-image-preview-close-icon-margin);right:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-left{bottom:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-right{right:var(--van-image-preview-close-icon-margin);bottom:var(--van-image-preview-close-icon-margin)}
90
90
  :root,:host{--van-uploader-size: 80px;--van-uploader-icon-size: 24px;--van-uploader-icon-color: var(--van-gray-4);--van-uploader-text-color: var(--van-text-color-2);--van-uploader-text-font-size: var(--van-font-size-sm);--van-uploader-upload-background: var(--van-gray-1);--van-uploader-upload-active-color: var(--van-active-color);--van-uploader-delete-color: var(--van-white);--van-uploader-delete-icon-size: 14px;--van-uploader-delete-background: rgba(0, 0, 0, .7);--van-uploader-file-background: var(--van-background);--van-uploader-file-icon-size: 20px;--van-uploader-file-icon-color: var(--van-gray-7);--van-uploader-file-name-padding: 0 var(--van-padding-base);--van-uploader-file-name-margin-top: var(--van-padding-xs);--van-uploader-file-name-font-size: var(--van-font-size-sm);--van-uploader-file-name-text-color: var(--van-gray-7);--van-uploader-mask-text-color: var(--van-white);--van-uploader-mask-background: rgba(50, 50, 51, .88);--van-uploader-mask-icon-size: 22px;--van-uploader-mask-message-font-size: var(--van-font-size-sm);--van-uploader-mask-message-line-height: var(--van-line-height-xs);--van-uploader-loading-icon-size: 22px;--van-uploader-loading-icon-color: var(--van-white);--van-uploader-disabled-opacity: var(--van-disabled-opacity);--van-uploader-border-radius: 0px}.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:flex;flex-wrap:wrap}.van-uploader__wrapper--disabled{opacity:var(--van-uploader-disabled-opacity)}.van-uploader__input{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;cursor:pointer;opacity:0}.van-uploader__input-wrapper{position:relative}.van-uploader__input:disabled{cursor:not-allowed}.van-uploader__upload{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;width:var(--van-uploader-size);height:var(--van-uploader-size);margin:0 var(--van-padding-xs) var(--van-padding-xs) 0;background:var(--van-uploader-upload-background);border-radius:var(--van-uploader-border-radius)}.van-uploader__upload:active{background-color:var(--van-uploader-upload-active-color)}.van-uploader__upload--readonly:active{background-color:var(--van-uploader-upload-background)}.van-uploader__upload-icon{color:var(--van-uploader-icon-color);font-size:var(--van-uploader-icon-size)}.van-uploader__upload-text{margin-top:var(--van-padding-xs);color:var(--van-uploader-text-color);font-size:var(--van-uploader-text-font-size)}.van-uploader__preview{position:relative;margin:0 var(--van-padding-xs) var(--van-padding-xs) 0;cursor:pointer}.van-uploader__preview-image{display:block;width:var(--van-uploader-size);height:var(--van-uploader-size);overflow:hidden;border-radius:var(--van-uploader-border-radius)}.van-uploader__preview-delete{position:absolute;top:0;right:0}.van-uploader__preview-delete--shadow{width:var(--van-uploader-delete-icon-size);height:var(--van-uploader-delete-icon-size);background:var(--van-uploader-delete-background);border-radius:0 0 0 12px}.van-uploader__preview-delete-icon{position:absolute;top:0;right:0;color:var(--van-uploader-delete-color);font-size:var(--van-uploader-delete-icon-size);transform:scale(.7) translate(10%,-10%)}.van-uploader__preview-cover{position:absolute;top:0;right:0;bottom:0;left:0}.van-uploader__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-uploader-mask-text-color);background:var(--van-uploader-mask-background);border-radius:var(--van-uploader-border-radius)}.van-uploader__mask-icon{font-size:var(--van-uploader-mask-icon-size)}.van-uploader__mask-message{margin-top:6px;padding:0 var(--van-padding-base);font-size:var(--van-uploader-mask-message-font-size);line-height:var(--van-uploader-mask-message-line-height)}.van-uploader__loading{width:var(--van-uploader-loading-icon-size);height:var(--van-uploader-loading-icon-size);color:var(--van-uploader-loading-icon-color)}.van-uploader__file{display:flex;flex-direction:column;align-items:center;justify-content:center;width:var(--van-uploader-size);height:var(--van-uploader-size);background:var(--van-uploader-file-background)}.van-uploader__file-icon{color:var(--van-uploader-file-icon-color);font-size:var(--van-uploader-file-icon-size)}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:var(--van-uploader-file-name-margin-top);padding:var(--van-uploader-file-name-padding);color:var(--van-uploader-file-name-text-color);font-size:var(--van-uploader-file-name-font-size);text-align:center}
91
91
 
92
- .preview-cover[data-v-cbd8c56a] {
92
+ .preview-cover[data-v-29fd81a1] {
93
93
  position: absolute;
94
94
  bottom: 0;
95
95
  box-sizing: border-box;
@@ -99,6 +99,9 @@
99
99
  text-align: center;
100
100
  background: rgba(0, 0, 0, 0.3);
101
101
  line-height: 24px;
102
+ }
103
+ .fac-uploader[data-v-29fd81a1] .van-uploader__upload {
104
+ margin: 0;
102
105
  }
103
106
  :root,:host{--van-action-bar-background: var(--van-background-2);--van-action-bar-height: 50px}.van-action-bar{position:fixed;right:0;bottom:0;left:0;display:flex;align-items:center;box-sizing:content-box;height:var(--van-action-bar-height);background:var(--van-action-bar-background)}
104
107
  :root,:host{--van-back-top-size: 40px;--van-back-top-right: 30px;--van-back-top-bottom: 40px;--van-back-top-z-index: 100;--van-back-top-icon-size: 20px;--van-back-top-text-color: #fff;--van-back-top-background: var(--van-blue)}.van-back-top{position:fixed;display:flex;align-items:center;justify-content:center;width:var(--van-back-top-size);height:var(--van-back-top-size);right:var(--van-back-top-right);bottom:var(--van-back-top-bottom);z-index:var(--van-back-top-z-index);cursor:pointer;color:var(--van-back-top-text-color);border-radius:var(--van-radius-max);box-shadow:0 2px 8px rgba(0,0,0,.12);transform:scale(0);transition:var(--van-duration-base) cubic-bezier(.25,.8,.5,1);background-color:var(--van-back-top-background)}.van-back-top:active{opacity:var(--van-active-opacity)}.van-back-top__placeholder{display:none}.van-back-top--active{transform:scale(1)}.van-back-top__icon{font-size:var(--van-back-top-icon-size);font-weight:var(--van-font-bold)}
@@ -42,6 +42,7 @@ import { MobileFormItem } from "./src/components/form/formItem/index.mjs";
42
42
  import { MobileRadioGroup } from "./src/components/form/radioGroup/index.mjs";
43
43
  import { MobileSearch } from "./src/components/form/search/index.mjs";
44
44
  import { MobileUploader } from "./src/components/form/uploader/index.mjs";
45
+ import { MobileFieldUploader } from "./src/components/form/fieldUploader/index.mjs";
45
46
  import { MobileSubmitButton } from "./src/components/form/submitButton/index.mjs";
46
47
  import { MobileActionBar } from "./src/components/navigation/actionBar/index.mjs";
47
48
  import { MobileBackTop } from "./src/components/navigation/backTop/index.mjs";
@@ -92,6 +93,7 @@ export {
92
93
  MobileFieldPicker,
93
94
  MobileFieldRadio,
94
95
  MobileFieldTimePicker,
96
+ MobileFieldUploader,
95
97
  MobileFloatingBubble,
96
98
  MobileFloatingPanel,
97
99
  MobileForm,
@@ -97,6 +97,9 @@ const axios = () => {
97
97
  put(url, data, config) {
98
98
  return service.put(url, data, config);
99
99
  },
100
+ upload(url, data, config) {
101
+ return service.postForm(url, data, config);
102
+ },
100
103
  interceptors: {
101
104
  request: {
102
105
  use(fnHandle, fnError) {
@@ -39,6 +39,7 @@ import { MobileFormItem } from "./form/formItem/index.mjs";
39
39
  import { MobileRadioGroup } from "./form/radioGroup/index.mjs";
40
40
  import { MobileSearch } from "./form/search/index.mjs";
41
41
  import { MobileUploader } from "./form/uploader/index.mjs";
42
+ import { MobileFieldUploader } from "./form/fieldUploader/index.mjs";
42
43
  import { MobileSubmitButton } from "./form/submitButton/index.mjs";
43
44
  import { MobileActionBar } from "./navigation/actionBar/index.mjs";
44
45
  import { MobileBackTop } from "./navigation/backTop/index.mjs";
@@ -78,6 +79,7 @@ export {
78
79
  MobileFieldPicker,
79
80
  MobileFieldRadio,
80
81
  MobileFieldTimePicker,
82
+ MobileFieldUploader,
81
83
  MobileFloatingBubble,
82
84
  MobileFloatingPanel,
83
85
  MobileForm,
@@ -0,0 +1,52 @@
1
+ import { useAttrs, computed, createBlock, openBlock, unref, mergeProps, isRef, withCtx, createVNode } from "vue";
2
+ import { MobileField } from "../field/index.mjs";
3
+ import { MobileUploader } from "../uploader/index.mjs";
4
+ const _sfc_main = {
5
+ __name: "FieldUploader",
6
+ props: {
7
+ modelValue: {
8
+ type: Array,
9
+ default: []
10
+ },
11
+ readonly: {
12
+ type: Boolean,
13
+ default: false
14
+ }
15
+ },
16
+ emits: ["update:modelValue"],
17
+ setup(__props, { emit: __emit }) {
18
+ const props = __props;
19
+ useAttrs();
20
+ const emit = __emit;
21
+ const compValue = computed({
22
+ get: () => {
23
+ return props.modelValue;
24
+ },
25
+ set: (val) => {
26
+ emit("update:modelValue", val);
27
+ }
28
+ });
29
+ const fieldTextValue = computed(() => {
30
+ return "";
31
+ });
32
+ return (_ctx, _cache) => {
33
+ return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
34
+ readonly: "",
35
+ modelValue: unref(fieldTextValue),
36
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null)
37
+ }), {
38
+ input: withCtx(() => [
39
+ createVNode(unref(MobileUploader), mergeProps(_ctx.$attrs, {
40
+ readonly: __props.readonly,
41
+ modelValue: unref(compValue),
42
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(compValue) ? compValue.value = $event : null)
43
+ }), null, 16, ["readonly", "modelValue"])
44
+ ]),
45
+ _: 1
46
+ }, 16, ["modelValue"]);
47
+ };
48
+ }
49
+ };
50
+ export {
51
+ _sfc_main as default
52
+ };
@@ -0,0 +1,10 @@
1
+ import _sfc_main from "./FieldUploader.vue.mjs";
2
+ import install from "../../../utils/install.mjs";
3
+ const MobileFieldUploader = install.withInstall(
4
+ "MobileFieldUploader",
5
+ _sfc_main
6
+ );
7
+ export {
8
+ MobileFieldUploader,
9
+ MobileFieldUploader as default
10
+ };
@@ -9,7 +9,7 @@
9
9
  /* empty css */
10
10
  /* empty css */
11
11
  /* empty css */
12
- import { computed, createBlock, openBlock, mergeProps, unref, isRef, createSlots, withCtx, createElementBlock, createCommentVNode, createVNode, createElementVNode, toDisplayString, renderList, renderSlot } from "vue";
12
+ import { computed, createBlock, openBlock, mergeProps, unref, isRef, createSlots, withCtx, createElementBlock, createCommentVNode, createVNode, toDisplayString, renderList, renderSlot } from "vue";
13
13
  import { useDataSource } from "../../../utils/dataSourceUtil.mjs";
14
14
  /* empty css */
15
15
  import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
@@ -17,8 +17,15 @@ import { Uploader } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3
17
17
  import { showToast } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/toast/function-call.mjs";
18
18
  import "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/toast/index.mjs";
19
19
  import { Icon } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/icon/index.mjs";
20
- const _hoisted_1 = { class: "preview-cover van-ellipsis" };
20
+ const _hoisted_1 = {
21
+ key: 0,
22
+ class: "preview-cover van-ellipsis"
23
+ };
21
24
  const _hoisted_2 = {
25
+ key: 1,
26
+ class: "preview-cover van-ellipsis"
27
+ };
28
+ const _hoisted_3 = {
22
29
  key: 0,
23
30
  class: "van-uploader__preview-delete--shadow"
24
31
  };
@@ -79,6 +86,9 @@ const _sfc_main = {
79
86
  });
80
87
  const accept = computed(() => {
81
88
  const acceptArr = [];
89
+ if (props.acceptType.includes("all")) {
90
+ return "";
91
+ }
82
92
  if (props.acceptType.includes("image")) {
83
93
  acceptArr.push("image/*");
84
94
  }
@@ -113,9 +123,7 @@ const _sfc_main = {
113
123
  return acceptArr.join(",");
114
124
  });
115
125
  const validators = {
116
- image: (file) => ["image/jpeg", "image/png", "image/gif", "image/svg+xml"].includes(
117
- file.type
118
- ),
126
+ image: (file) => isImage(file),
119
127
  video: (file) => file.type.startsWith("video/"),
120
128
  audio: (file) => file.type.startsWith("audio/"),
121
129
  text: (file) => file.type === "text/plain",
@@ -125,6 +133,11 @@ const _sfc_main = {
125
133
  pdf: (file) => file.type === "application/pdf",
126
134
  zip: (file) => ["application/zip", "application/x-rar-compressed"].includes(file.type)
127
135
  };
136
+ const isImage = (file) => {
137
+ return ["image/jpeg", "image/png", "image/gif", "image/svg+xml"].includes(
138
+ file == null ? void 0 : file.type
139
+ );
140
+ };
128
141
  const typeChineseMap = {
129
142
  image: "图片",
130
143
  video: "视频",
@@ -137,7 +150,6 @@ const _sfc_main = {
137
150
  zip: "压缩包"
138
151
  };
139
152
  const beforeRead = (file) => {
140
- console.log("🚀 ~ beforeRead:", file);
141
153
  for (const type of props.acceptType) {
142
154
  if (validators[type] && !validators[type](file)) {
143
155
  showToast(`上传的文件不是有效的${typeChineseMap[type]}`);
@@ -147,19 +159,14 @@ const _sfc_main = {
147
159
  return true;
148
160
  };
149
161
  const afterRead = (file) => {
150
- console.log("🚀 ~ file:", file);
151
162
  if (!props.autoUpload) {
152
163
  return;
153
164
  }
154
165
  file.status = "uploading";
155
166
  file.message = "上传中...";
156
- fileList.value.map((item) => {
157
- return {
158
- file: item.file
159
- };
160
- });
161
167
  const dataSource = useDataSource(props.dataSource);
162
- dataSource == null ? void 0 : dataSource.load({ fileList: fileList.value, ...props.dataSourceParams }).then((res) => {
168
+ dataSource == null ? void 0 : dataSource.load({ file: file.file, ...props.dataSourceParams }).then((res) => {
169
+ file.status = "done";
163
170
  }).catch((err) => {
164
171
  file.status = "failed";
165
172
  file.message = "上传失败";
@@ -172,7 +179,7 @@ const _sfc_main = {
172
179
  return (_ctx, _cache) => {
173
180
  const _component_van_icon = Icon;
174
181
  const _component_van_uploader = Uploader;
175
- return openBlock(), createBlock(_component_van_uploader, mergeProps(_ctx.$attrs, {
182
+ return openBlock(), createBlock(_component_van_uploader, mergeProps({ class: "fac-uploader" }, _ctx.$attrs, {
176
183
  modelValue: unref(fileList),
177
184
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(fileList) ? fileList.value = $event : null),
178
185
  accept: unref(accept),
@@ -183,11 +190,11 @@ const _sfc_main = {
183
190
  "result-type": "file",
184
191
  "preview-size": __props.previewSize + "px"
185
192
  }), createSlots({
186
- "preview-cover": withCtx(({ file }) => [
187
- createElementVNode("div", _hoisted_1, toDisplayString((file == null ? void 0 : file.name) || ""), 1)
193
+ "preview-cover": withCtx(({ file, name }) => [
194
+ isImage(file) ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString((file == null ? void 0 : file.name) || ""), 1)) : name ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(name), 1)) : createCommentVNode("", true)
188
195
  ]),
189
196
  "preview-delete": withCtx(() => [
190
- !__props.readonly ? (openBlock(), createElementBlock("div", _hoisted_2, [
197
+ !__props.readonly ? (openBlock(), createElementBlock("div", _hoisted_3, [
191
198
  createVNode(_component_van_icon, {
192
199
  name: "cross",
193
200
  class: "van-uploader__preview-delete-icon"
@@ -208,7 +215,7 @@ const _sfc_main = {
208
215
  };
209
216
  }
210
217
  };
211
- const _Uploader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cbd8c56a"]]);
218
+ const _Uploader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-29fd81a1"]]);
212
219
  export {
213
220
  _Uploader as default
214
221
  };
@@ -64,6 +64,12 @@ const createLoad = (http, dataSource, shouldFetch) => (params) => {
64
64
  } else {
65
65
  config.data = data;
66
66
  }
67
+ if (method.toLowerCase() === "upload") {
68
+ config.headers = {
69
+ "Content-Type": "multipart/form-data"
70
+ };
71
+ config.method = "post";
72
+ }
67
73
  return http.request(config);
68
74
  };
69
75
  export {
package/lib/mobile.css CHANGED
@@ -89,7 +89,7 @@
89
89
  :root,:host{--van-image-preview-index-text-color: var(--van-white);--van-image-preview-index-font-size: var(--van-font-size-md);--van-image-preview-index-line-height: var(--van-line-height-md);--van-image-preview-index-text-shadow: 0 1px 1px var(--van-gray-8);--van-image-preview-overlay-background: rgba(0, 0, 0, .9);--van-image-preview-close-icon-size: 22px;--van-image-preview-close-icon-color: var(--van-gray-5);--van-image-preview-close-icon-margin: var(--van-padding-md);--van-image-preview-close-icon-z-index: 1}.van-image-preview{position:fixed;top:0;left:0;width:100%;height:100%;max-width:none;background-color:transparent;transform:none}.van-image-preview__swipe{height:100%}.van-image-preview__swipe-item{display:flex;align-items:center;justify-content:center;overflow:hidden}.van-image-preview__cover{position:absolute;top:0;left:0}.van-image-preview__image,.van-image-preview__image-wrap{width:100%;transition-property:transform}.van-image-preview__image--vertical,.van-image-preview__image-wrap--vertical{width:auto;height:100%}.van-image-preview__image img,.van-image-preview__image-wrap img,.van-image-preview__image video,.van-image-preview__image-wrap video{-webkit-user-drag:none}.van-image-preview__image .van-image__error,.van-image-preview__image-wrap .van-image__error{top:30%;height:40%}.van-image-preview__image .van-image__error-icon,.van-image-preview__image-wrap .van-image__error-icon{font-size:36px}.van-image-preview__image .van-image__loading,.van-image-preview__image-wrap .van-image__loading{background-color:transparent}.van-image-preview__index{position:absolute;top:var(--van-padding-md);left:50%;color:var(--van-image-preview-index-text-color);font-size:var(--van-image-preview-index-font-size);line-height:var(--van-image-preview-index-line-height);text-shadow:var(--van-image-preview-index-text-shadow);transform:translate(-50%)}.van-image-preview__overlay{background:var(--van-image-preview-overlay-background)}.van-image-preview__close-icon{position:absolute;z-index:var(--van-image-preview-close-icon-z-index);color:var(--van-image-preview-close-icon-color);font-size:var(--van-image-preview-close-icon-size)}.van-image-preview__close-icon--top-left{top:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--top-right{top:var(--van-image-preview-close-icon-margin);right:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-left{bottom:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-right{right:var(--van-image-preview-close-icon-margin);bottom:var(--van-image-preview-close-icon-margin)}
90
90
  :root,:host{--van-uploader-size: 80px;--van-uploader-icon-size: 24px;--van-uploader-icon-color: var(--van-gray-4);--van-uploader-text-color: var(--van-text-color-2);--van-uploader-text-font-size: var(--van-font-size-sm);--van-uploader-upload-background: var(--van-gray-1);--van-uploader-upload-active-color: var(--van-active-color);--van-uploader-delete-color: var(--van-white);--van-uploader-delete-icon-size: 14px;--van-uploader-delete-background: rgba(0, 0, 0, .7);--van-uploader-file-background: var(--van-background);--van-uploader-file-icon-size: 20px;--van-uploader-file-icon-color: var(--van-gray-7);--van-uploader-file-name-padding: 0 var(--van-padding-base);--van-uploader-file-name-margin-top: var(--van-padding-xs);--van-uploader-file-name-font-size: var(--van-font-size-sm);--van-uploader-file-name-text-color: var(--van-gray-7);--van-uploader-mask-text-color: var(--van-white);--van-uploader-mask-background: rgba(50, 50, 51, .88);--van-uploader-mask-icon-size: 22px;--van-uploader-mask-message-font-size: var(--van-font-size-sm);--van-uploader-mask-message-line-height: var(--van-line-height-xs);--van-uploader-loading-icon-size: 22px;--van-uploader-loading-icon-color: var(--van-white);--van-uploader-disabled-opacity: var(--van-disabled-opacity);--van-uploader-border-radius: 0px}.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:flex;flex-wrap:wrap}.van-uploader__wrapper--disabled{opacity:var(--van-uploader-disabled-opacity)}.van-uploader__input{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;cursor:pointer;opacity:0}.van-uploader__input-wrapper{position:relative}.van-uploader__input:disabled{cursor:not-allowed}.van-uploader__upload{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;width:var(--van-uploader-size);height:var(--van-uploader-size);margin:0 var(--van-padding-xs) var(--van-padding-xs) 0;background:var(--van-uploader-upload-background);border-radius:var(--van-uploader-border-radius)}.van-uploader__upload:active{background-color:var(--van-uploader-upload-active-color)}.van-uploader__upload--readonly:active{background-color:var(--van-uploader-upload-background)}.van-uploader__upload-icon{color:var(--van-uploader-icon-color);font-size:var(--van-uploader-icon-size)}.van-uploader__upload-text{margin-top:var(--van-padding-xs);color:var(--van-uploader-text-color);font-size:var(--van-uploader-text-font-size)}.van-uploader__preview{position:relative;margin:0 var(--van-padding-xs) var(--van-padding-xs) 0;cursor:pointer}.van-uploader__preview-image{display:block;width:var(--van-uploader-size);height:var(--van-uploader-size);overflow:hidden;border-radius:var(--van-uploader-border-radius)}.van-uploader__preview-delete{position:absolute;top:0;right:0}.van-uploader__preview-delete--shadow{width:var(--van-uploader-delete-icon-size);height:var(--van-uploader-delete-icon-size);background:var(--van-uploader-delete-background);border-radius:0 0 0 12px}.van-uploader__preview-delete-icon{position:absolute;top:0;right:0;color:var(--van-uploader-delete-color);font-size:var(--van-uploader-delete-icon-size);transform:scale(.7) translate(10%,-10%)}.van-uploader__preview-cover{position:absolute;top:0;right:0;bottom:0;left:0}.van-uploader__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-uploader-mask-text-color);background:var(--van-uploader-mask-background);border-radius:var(--van-uploader-border-radius)}.van-uploader__mask-icon{font-size:var(--van-uploader-mask-icon-size)}.van-uploader__mask-message{margin-top:6px;padding:0 var(--van-padding-base);font-size:var(--van-uploader-mask-message-font-size);line-height:var(--van-uploader-mask-message-line-height)}.van-uploader__loading{width:var(--van-uploader-loading-icon-size);height:var(--van-uploader-loading-icon-size);color:var(--van-uploader-loading-icon-color)}.van-uploader__file{display:flex;flex-direction:column;align-items:center;justify-content:center;width:var(--van-uploader-size);height:var(--van-uploader-size);background:var(--van-uploader-file-background)}.van-uploader__file-icon{color:var(--van-uploader-file-icon-color);font-size:var(--van-uploader-file-icon-size)}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:var(--van-uploader-file-name-margin-top);padding:var(--van-uploader-file-name-padding);color:var(--van-uploader-file-name-text-color);font-size:var(--van-uploader-file-name-font-size);text-align:center}
91
91
 
92
- .preview-cover[data-v-cbd8c56a] {
92
+ .preview-cover[data-v-29fd81a1] {
93
93
  position: absolute;
94
94
  bottom: 0;
95
95
  box-sizing: border-box;
@@ -99,6 +99,9 @@
99
99
  text-align: center;
100
100
  background: rgba(0, 0, 0, 0.3);
101
101
  line-height: 24px;
102
+ }
103
+ .fac-uploader[data-v-29fd81a1] .van-uploader__upload {
104
+ margin: 0;
102
105
  }
103
106
  :root,:host{--van-action-bar-background: var(--van-background-2);--van-action-bar-height: 50px}.van-action-bar{position:fixed;right:0;bottom:0;left:0;display:flex;align-items:center;box-sizing:content-box;height:var(--van-action-bar-height);background:var(--van-action-bar-background)}
104
107
  :root,:host{--van-back-top-size: 40px;--van-back-top-right: 30px;--van-back-top-bottom: 40px;--van-back-top-z-index: 100;--van-back-top-icon-size: 20px;--van-back-top-text-color: #fff;--van-back-top-background: var(--van-blue)}.van-back-top{position:fixed;display:flex;align-items:center;justify-content:center;width:var(--van-back-top-size);height:var(--van-back-top-size);right:var(--van-back-top-right);bottom:var(--van-back-top-bottom);z-index:var(--van-back-top-z-index);cursor:pointer;color:var(--van-back-top-text-color);border-radius:var(--van-radius-max);box-shadow:0 2px 8px rgba(0,0,0,.12);transform:scale(0);transition:var(--van-duration-base) cubic-bezier(.25,.8,.5,1);background-color:var(--van-back-top-background)}.van-back-top:active{opacity:var(--van-active-opacity)}.van-back-top__placeholder{display:none}.van-back-top--active{transform:scale(1)}.van-back-top__icon{font-size:var(--van-back-top-icon-size);font-weight:var(--van-font-bold)}
@@ -44,22 +44,23 @@ const index$C = require("./src/components/form/formItem/index.js");
44
44
  const index$D = require("./src/components/form/radioGroup/index.js");
45
45
  const index$E = require("./src/components/form/search/index.js");
46
46
  const index$F = require("./src/components/form/uploader/index.js");
47
- const index$G = require("./src/components/form/submitButton/index.js");
48
- const index$H = require("./src/components/navigation/actionBar/index.js");
49
- const index$I = require("./src/components/navigation/backTop/index.js");
50
- const index$J = require("./src/components/navigation/grid/index.js");
51
- const index$K = require("./src/components/navigation/gridItem/index.js");
52
- const index$L = require("./src/components/navigation/indexBar/index.js");
53
- const index$M = require("./src/components/navigation/indexAnchor/index.js");
54
- const index$N = require("./src/components/navigation/navBar/index.js");
55
- const index$O = require("./src/components/navigation/pagination/index.js");
56
- const index$P = require("./src/components/navigation/sidebar/index.js");
57
- const index$Q = require("./src/components/navigation/sidebarItem/index.js");
58
- const index$R = require("./src/components/navigation/tab/index.js");
59
- const index$S = require("./src/components/navigation/tabs/index.js");
60
- const index$T = require("./src/components/navigation/tabbar/index.js");
61
- const index$U = require("./src/components/navigation/tabbarItem/index.js");
62
- const index$V = require("./src/components/navigation/treeSelect/index.js");
47
+ const index$G = require("./src/components/form/fieldUploader/index.js");
48
+ const index$H = require("./src/components/form/submitButton/index.js");
49
+ const index$I = require("./src/components/navigation/actionBar/index.js");
50
+ const index$J = require("./src/components/navigation/backTop/index.js");
51
+ const index$K = require("./src/components/navigation/grid/index.js");
52
+ const index$L = require("./src/components/navigation/gridItem/index.js");
53
+ const index$M = require("./src/components/navigation/indexBar/index.js");
54
+ const index$N = require("./src/components/navigation/indexAnchor/index.js");
55
+ const index$O = require("./src/components/navigation/navBar/index.js");
56
+ const index$P = require("./src/components/navigation/pagination/index.js");
57
+ const index$Q = require("./src/components/navigation/sidebar/index.js");
58
+ const index$R = require("./src/components/navigation/sidebarItem/index.js");
59
+ const index$S = require("./src/components/navigation/tab/index.js");
60
+ const index$T = require("./src/components/navigation/tabs/index.js");
61
+ const index$U = require("./src/components/navigation/tabbar/index.js");
62
+ const index$V = require("./src/components/navigation/tabbarItem/index.js");
63
+ const index$W = require("./src/components/navigation/treeSelect/index.js");
63
64
  const functionCall = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/function-call.js");
64
65
  const functionCall$1 = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/image-preview/function-call.js");
65
66
  const functionCall$2 = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/notify/function-call.js");
@@ -112,22 +113,23 @@ exports.MobileFormItem = index$C.MobileFormItem;
112
113
  exports.MobileRadioGroup = index$D.MobileRadioGroup;
113
114
  exports.MobileSearch = index$E.MobileSearch;
114
115
  exports.MobileUploader = index$F.MobileUploader;
115
- exports.MobileSubmitButton = index$G.MobileSubmitButton;
116
- exports.MobileActionBar = index$H.MobileActionBar;
117
- exports.MobileBackTop = index$I.MobileBackTop;
118
- exports.MobileGrid = index$J.MobileGrid;
119
- exports.MobileGridItem = index$K.MobileGridItem;
120
- exports.MobileIndexBar = index$L.MobileIndexBar;
121
- exports.MobileIndexAnchor = index$M.MobileIndexAnchor;
122
- exports.MobileNavBar = index$N.MobileNavBar;
123
- exports.MobilePagination = index$O.MobilePagination;
124
- exports.MobileSidebar = index$P.MobileSidebar;
125
- exports.MobileSidebarItem = index$Q.MobileSidebarItem;
126
- exports.MobileTab = index$R.MobileTab;
127
- exports.MobileTabs = index$S.MobileTabs;
128
- exports.MobileTabbar = index$T.MobileTabbar;
129
- exports.MobileTabbarItem = index$U.MobileTabbarItem;
130
- exports.MobileTreeSelect = index$V.MobileTreeSelect;
116
+ exports.MobileFieldUploader = index$G.MobileFieldUploader;
117
+ exports.MobileSubmitButton = index$H.MobileSubmitButton;
118
+ exports.MobileActionBar = index$I.MobileActionBar;
119
+ exports.MobileBackTop = index$J.MobileBackTop;
120
+ exports.MobileGrid = index$K.MobileGrid;
121
+ exports.MobileGridItem = index$L.MobileGridItem;
122
+ exports.MobileIndexBar = index$M.MobileIndexBar;
123
+ exports.MobileIndexAnchor = index$N.MobileIndexAnchor;
124
+ exports.MobileNavBar = index$O.MobileNavBar;
125
+ exports.MobilePagination = index$P.MobilePagination;
126
+ exports.MobileSidebar = index$Q.MobileSidebar;
127
+ exports.MobileSidebarItem = index$R.MobileSidebarItem;
128
+ exports.MobileTab = index$S.MobileTab;
129
+ exports.MobileTabs = index$T.MobileTabs;
130
+ exports.MobileTabbar = index$U.MobileTabbar;
131
+ exports.MobileTabbarItem = index$V.MobileTabbarItem;
132
+ exports.MobileTreeSelect = index$W.MobileTreeSelect;
131
133
  exports.closeDialog = functionCall.closeDialog;
132
134
  exports.showConfirmDialog = functionCall.showConfirmDialog;
133
135
  exports.showDialog = functionCall.showDialog;
@@ -99,6 +99,9 @@ const axios = () => {
99
99
  put(url, data, config) {
100
100
  return service.put(url, data, config);
101
101
  },
102
+ upload(url, data, config) {
103
+ return service.postForm(url, data, config);
104
+ },
102
105
  interceptors: {
103
106
  request: {
104
107
  use(fnHandle, fnError) {
@@ -41,22 +41,23 @@ const index$B = require("./form/formItem/index.js");
41
41
  const index$C = require("./form/radioGroup/index.js");
42
42
  const index$D = require("./form/search/index.js");
43
43
  const index$E = require("./form/uploader/index.js");
44
- const index$F = require("./form/submitButton/index.js");
45
- const index$G = require("./navigation/actionBar/index.js");
46
- const index$H = require("./navigation/backTop/index.js");
47
- const index$I = require("./navigation/grid/index.js");
48
- const index$J = require("./navigation/gridItem/index.js");
49
- const index$K = require("./navigation/indexBar/index.js");
50
- const index$L = require("./navigation/indexAnchor/index.js");
51
- const index$M = require("./navigation/navBar/index.js");
52
- const index$N = require("./navigation/pagination/index.js");
53
- const index$O = require("./navigation/sidebar/index.js");
54
- const index$P = require("./navigation/sidebarItem/index.js");
55
- const index$Q = require("./navigation/tab/index.js");
56
- const index$R = require("./navigation/tabs/index.js");
57
- const index$S = require("./navigation/tabbar/index.js");
58
- const index$T = require("./navigation/tabbarItem/index.js");
59
- const index$U = require("./navigation/treeSelect/index.js");
44
+ const index$F = require("./form/fieldUploader/index.js");
45
+ const index$G = require("./form/submitButton/index.js");
46
+ const index$H = require("./navigation/actionBar/index.js");
47
+ const index$I = require("./navigation/backTop/index.js");
48
+ const index$J = require("./navigation/grid/index.js");
49
+ const index$K = require("./navigation/gridItem/index.js");
50
+ const index$L = require("./navigation/indexBar/index.js");
51
+ const index$M = require("./navigation/indexAnchor/index.js");
52
+ const index$N = require("./navigation/navBar/index.js");
53
+ const index$O = require("./navigation/pagination/index.js");
54
+ const index$P = require("./navigation/sidebar/index.js");
55
+ const index$Q = require("./navigation/sidebarItem/index.js");
56
+ const index$R = require("./navigation/tab/index.js");
57
+ const index$S = require("./navigation/tabs/index.js");
58
+ const index$T = require("./navigation/tabbar/index.js");
59
+ const index$U = require("./navigation/tabbarItem/index.js");
60
+ const index$V = require("./navigation/treeSelect/index.js");
60
61
  exports.MobileButton = index.MobileButton;
61
62
  exports.MobileCell = index$1.MobileCell;
62
63
  exports.MobileCellGroup = index$2.MobileCellGroup;
@@ -98,19 +99,20 @@ exports.MobileFormItem = index$B.MobileFormItem;
98
99
  exports.MobileRadioGroup = index$C.MobileRadioGroup;
99
100
  exports.MobileSearch = index$D.MobileSearch;
100
101
  exports.MobileUploader = index$E.MobileUploader;
101
- exports.MobileSubmitButton = index$F.MobileSubmitButton;
102
- exports.MobileActionBar = index$G.MobileActionBar;
103
- exports.MobileBackTop = index$H.MobileBackTop;
104
- exports.MobileGrid = index$I.MobileGrid;
105
- exports.MobileGridItem = index$J.MobileGridItem;
106
- exports.MobileIndexBar = index$K.MobileIndexBar;
107
- exports.MobileIndexAnchor = index$L.MobileIndexAnchor;
108
- exports.MobileNavBar = index$M.MobileNavBar;
109
- exports.MobilePagination = index$N.MobilePagination;
110
- exports.MobileSidebar = index$O.MobileSidebar;
111
- exports.MobileSidebarItem = index$P.MobileSidebarItem;
112
- exports.MobileTab = index$Q.MobileTab;
113
- exports.MobileTabs = index$R.MobileTabs;
114
- exports.MobileTabbar = index$S.MobileTabbar;
115
- exports.MobileTabbarItem = index$T.MobileTabbarItem;
116
- exports.MobileTreeSelect = index$U.MobileTreeSelect;
102
+ exports.MobileFieldUploader = index$F.MobileFieldUploader;
103
+ exports.MobileSubmitButton = index$G.MobileSubmitButton;
104
+ exports.MobileActionBar = index$H.MobileActionBar;
105
+ exports.MobileBackTop = index$I.MobileBackTop;
106
+ exports.MobileGrid = index$J.MobileGrid;
107
+ exports.MobileGridItem = index$K.MobileGridItem;
108
+ exports.MobileIndexBar = index$L.MobileIndexBar;
109
+ exports.MobileIndexAnchor = index$M.MobileIndexAnchor;
110
+ exports.MobileNavBar = index$N.MobileNavBar;
111
+ exports.MobilePagination = index$O.MobilePagination;
112
+ exports.MobileSidebar = index$P.MobileSidebar;
113
+ exports.MobileSidebarItem = index$Q.MobileSidebarItem;
114
+ exports.MobileTab = index$R.MobileTab;
115
+ exports.MobileTabs = index$S.MobileTabs;
116
+ exports.MobileTabbar = index$T.MobileTabbar;
117
+ exports.MobileTabbarItem = index$U.MobileTabbarItem;
118
+ exports.MobileTreeSelect = index$V.MobileTreeSelect;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const index = require("../field/index.js");
5
+ const index$1 = require("../uploader/index.js");
6
+ const _sfc_main = {
7
+ __name: "FieldUploader",
8
+ props: {
9
+ modelValue: {
10
+ type: Array,
11
+ default: []
12
+ },
13
+ readonly: {
14
+ type: Boolean,
15
+ default: false
16
+ }
17
+ },
18
+ emits: ["update:modelValue"],
19
+ setup(__props, { emit: __emit }) {
20
+ const props = __props;
21
+ vue.useAttrs();
22
+ const emit = __emit;
23
+ const compValue = vue.computed({
24
+ get: () => {
25
+ return props.modelValue;
26
+ },
27
+ set: (val) => {
28
+ emit("update:modelValue", val);
29
+ }
30
+ });
31
+ const fieldTextValue = vue.computed(() => {
32
+ return "";
33
+ });
34
+ return (_ctx, _cache) => {
35
+ return vue.openBlock(), vue.createBlock(vue.unref(index.MobileField), vue.mergeProps(_ctx.$attrs, {
36
+ readonly: "",
37
+ modelValue: vue.unref(fieldTextValue),
38
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(fieldTextValue) ? fieldTextValue.value = $event : null)
39
+ }), {
40
+ input: vue.withCtx(() => [
41
+ vue.createVNode(vue.unref(index$1.MobileUploader), vue.mergeProps(_ctx.$attrs, {
42
+ readonly: __props.readonly,
43
+ modelValue: vue.unref(compValue),
44
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(compValue) ? compValue.value = $event : null)
45
+ }), null, 16, ["readonly", "modelValue"])
46
+ ]),
47
+ _: 1
48
+ }, 16, ["modelValue"]);
49
+ };
50
+ }
51
+ };
52
+ exports.default = _sfc_main;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const FieldUploader = require("./FieldUploader.vue.js");
4
+ const install = require("../../../utils/install.js");
5
+ const MobileFieldUploader = install.default.withInstall(
6
+ "MobileFieldUploader",
7
+ FieldUploader.default
8
+ );
9
+ exports.MobileFieldUploader = MobileFieldUploader;
10
+ exports.default = MobileFieldUploader;
@@ -19,8 +19,15 @@ const index = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.
19
19
  const functionCall = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/toast/function-call.js");
20
20
  require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/toast/index.js");
21
21
  const index$1 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/icon/index.js");
22
- const _hoisted_1 = { class: "preview-cover van-ellipsis" };
22
+ const _hoisted_1 = {
23
+ key: 0,
24
+ class: "preview-cover van-ellipsis"
25
+ };
23
26
  const _hoisted_2 = {
27
+ key: 1,
28
+ class: "preview-cover van-ellipsis"
29
+ };
30
+ const _hoisted_3 = {
24
31
  key: 0,
25
32
  class: "van-uploader__preview-delete--shadow"
26
33
  };
@@ -81,6 +88,9 @@ const _sfc_main = {
81
88
  });
82
89
  const accept = vue.computed(() => {
83
90
  const acceptArr = [];
91
+ if (props.acceptType.includes("all")) {
92
+ return "";
93
+ }
84
94
  if (props.acceptType.includes("image")) {
85
95
  acceptArr.push("image/*");
86
96
  }
@@ -115,9 +125,7 @@ const _sfc_main = {
115
125
  return acceptArr.join(",");
116
126
  });
117
127
  const validators = {
118
- image: (file) => ["image/jpeg", "image/png", "image/gif", "image/svg+xml"].includes(
119
- file.type
120
- ),
128
+ image: (file) => isImage(file),
121
129
  video: (file) => file.type.startsWith("video/"),
122
130
  audio: (file) => file.type.startsWith("audio/"),
123
131
  text: (file) => file.type === "text/plain",
@@ -127,6 +135,11 @@ const _sfc_main = {
127
135
  pdf: (file) => file.type === "application/pdf",
128
136
  zip: (file) => ["application/zip", "application/x-rar-compressed"].includes(file.type)
129
137
  };
138
+ const isImage = (file) => {
139
+ return ["image/jpeg", "image/png", "image/gif", "image/svg+xml"].includes(
140
+ file == null ? void 0 : file.type
141
+ );
142
+ };
130
143
  const typeChineseMap = {
131
144
  image: "图片",
132
145
  video: "视频",
@@ -139,7 +152,6 @@ const _sfc_main = {
139
152
  zip: "压缩包"
140
153
  };
141
154
  const beforeRead = (file) => {
142
- console.log("🚀 ~ beforeRead:", file);
143
155
  for (const type of props.acceptType) {
144
156
  if (validators[type] && !validators[type](file)) {
145
157
  functionCall.showToast(`上传的文件不是有效的${typeChineseMap[type]}`);
@@ -149,19 +161,14 @@ const _sfc_main = {
149
161
  return true;
150
162
  };
151
163
  const afterRead = (file) => {
152
- console.log("🚀 ~ file:", file);
153
164
  if (!props.autoUpload) {
154
165
  return;
155
166
  }
156
167
  file.status = "uploading";
157
168
  file.message = "上传中...";
158
- fileList.value.map((item) => {
159
- return {
160
- file: item.file
161
- };
162
- });
163
169
  const dataSource = dataSourceUtil.useDataSource(props.dataSource);
164
- dataSource == null ? void 0 : dataSource.load({ fileList: fileList.value, ...props.dataSourceParams }).then((res) => {
170
+ dataSource == null ? void 0 : dataSource.load({ file: file.file, ...props.dataSourceParams }).then((res) => {
171
+ file.status = "done";
165
172
  }).catch((err) => {
166
173
  file.status = "failed";
167
174
  file.message = "上传失败";
@@ -174,7 +181,7 @@ const _sfc_main = {
174
181
  return (_ctx, _cache) => {
175
182
  const _component_van_icon = index$1.Icon;
176
183
  const _component_van_uploader = index.Uploader;
177
- return vue.openBlock(), vue.createBlock(_component_van_uploader, vue.mergeProps(_ctx.$attrs, {
184
+ return vue.openBlock(), vue.createBlock(_component_van_uploader, vue.mergeProps({ class: "fac-uploader" }, _ctx.$attrs, {
178
185
  modelValue: vue.unref(fileList),
179
186
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(fileList) ? fileList.value = $event : null),
180
187
  accept: vue.unref(accept),
@@ -185,11 +192,11 @@ const _sfc_main = {
185
192
  "result-type": "file",
186
193
  "preview-size": __props.previewSize + "px"
187
194
  }), vue.createSlots({
188
- "preview-cover": vue.withCtx(({ file }) => [
189
- vue.createElementVNode("div", _hoisted_1, vue.toDisplayString((file == null ? void 0 : file.name) || ""), 1)
195
+ "preview-cover": vue.withCtx(({ file, name }) => [
196
+ isImage(file) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, vue.toDisplayString((file == null ? void 0 : file.name) || ""), 1)) : name ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, vue.toDisplayString(name), 1)) : vue.createCommentVNode("", true)
190
197
  ]),
191
198
  "preview-delete": vue.withCtx(() => [
192
- !__props.readonly ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
199
+ !__props.readonly ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
193
200
  vue.createVNode(_component_van_icon, {
194
201
  name: "cross",
195
202
  class: "van-uploader__preview-delete-icon"
@@ -210,5 +217,5 @@ const _sfc_main = {
210
217
  };
211
218
  }
212
219
  };
213
- const _Uploader = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-cbd8c56a"]]);
220
+ const _Uploader = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-29fd81a1"]]);
214
221
  exports.default = _Uploader;
@@ -66,6 +66,12 @@ const createLoad = (http, dataSource, shouldFetch) => (params) => {
66
66
  } else {
67
67
  config.data = data;
68
68
  }
69
+ if (method.toLowerCase() === "upload") {
70
+ config.headers = {
71
+ "Content-Type": "multipart/form-data"
72
+ };
73
+ config.method = "post";
74
+ }
69
75
  return http.request(config);
70
76
  };
71
77
  exports.useDataSource = useDataSource;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/mobile",
3
- "version": "1.0.54",
3
+ "version": "1.0.55",
4
4
  "main": "lib/packages/mobile/index.js",
5
5
  "module": "es/packages/mobile/index.mjs",
6
6
  "files": [