@dt-frames/ui 2.0.16 → 2.0.18

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.
Files changed (43) hide show
  1. package/es/components/drawer/index.d.ts +3 -4
  2. package/es/components/drawer/index.js +11 -15
  3. package/es/components/drawer/index.less +6 -0
  4. package/es/components/drawer/src/index.d.ts +5 -7
  5. package/es/components/drawer/src/types/index.type.d.ts +3 -1
  6. package/es/components/form/index.js +33 -7
  7. package/es/components/form/src/components/FormButtons.d.ts +3056 -4
  8. package/es/components/form/src/components/FormItem.d.ts +2 -2
  9. package/es/components/form/src/components/formIcon.d.ts +0 -1209
  10. package/es/components/form/src/components/formInputUseDialog.d.ts +0 -894
  11. package/es/components/form/src/props.d.ts +3 -3
  12. package/es/components/form/src/types/items.type.d.ts +8 -0
  13. package/es/components/modal/index.js +19 -7
  14. package/es/components/modal/index.less +1 -9
  15. package/es/components/source/index.js +15 -7
  16. package/es/components/table/index.js +210 -201
  17. package/es/components/table/index.less +29 -0
  18. package/es/components/table/src/components/editTable/EditTableCell.d.ts +1 -0
  19. package/es/components/table/src/index.d.ts +0 -10
  20. package/es/components/table/src/props.d.ts +0 -4
  21. package/es/components/table/src/types/table.type.d.ts +8 -0
  22. package/es/components/tree/index.js +46 -44
  23. package/es/components/tree/index.less +13 -0
  24. package/es/components/tree/src/basicProps.d.ts +9 -4
  25. package/es/components/tree/src/components/ContextMenu.d.ts +6 -0
  26. package/es/components/tree/src/index.d.ts +11 -11
  27. package/es/components/tree/src/type/menu.d.ts +3 -0
  28. package/es/components/tree/src/type/tree.d.ts +0 -5
  29. package/es/components/tree/src/utils/tree.d.ts +3 -1
  30. package/es/components/upload/index.js +170 -69
  31. package/es/components/upload/index.less +7 -0
  32. package/es/components/upload/src/basicProps.d.ts +5 -1
  33. package/es/components/upload/src/components/WordView.d.ts +1 -0
  34. package/es/components/upload/src/hooks/useFile.d.ts +7 -6
  35. package/es/components/upload/src/index.d.ts +17 -0
  36. package/es/components/upload/src/type/file.d.ts +9 -2
  37. package/es/components/upload/src/utils/fileSize.d.ts +1 -0
  38. package/es/theme/index.js +157 -100
  39. package/es/theme/index.less +14 -0
  40. package/es/theme/src/components/sider/index.d.ts +1 -1
  41. package/es/theme/src/components/sider/mix-sider.d.ts +1 -1
  42. package/es/theme/src/index.d.ts +1 -1
  43. package/package.json +1 -1
@@ -2,12 +2,11 @@ import { Button, Upload, Image } from "ant-design-vue/es";
2
2
  import "ant-design-vue/es/image/style";
3
3
  import "ant-design-vue/es/upload/style";
4
4
  import "ant-design-vue/es/button/style";
5
- import { computed, unref, ref, watch, defineComponent, openBlock, createBlock, withCtx, createVNode, createElementVNode, toRefs, createElementBlock, mergeProps, isRef, createSlots, toDisplayString, Fragment, renderList, normalizeClass, createCommentVNode, renderSlot, normalizeProps, guardReactiveProps } from "vue";
5
+ import { computed, unref, ref, watch, defineComponent, openBlock, createBlock, withCtx, createVNode, createElementVNode, toRefs, createElementBlock, mergeProps, isRef, createSlots, normalizeClass, createTextVNode, toDisplayString, createCommentVNode, normalizeStyle, Fragment, renderList, renderSlot, normalizeProps, guardReactiveProps } from "vue";
6
6
  import { takeRight, omit } from "lodash-es";
7
- import { useAppStore, useMessage, isString, dispatchResize, isFunction, http, HttpContentTypeEnum } from "@dt-frames/core";
7
+ import { isString, useAppStore, useMessage, dispatchResize, isFunction, http, HttpContentTypeEnum } from "@dt-frames/core";
8
8
  import { useModal, DtModal, useModalOut } from "../modal";
9
9
  import { DtIframe } from "../iframe";
10
- import { renderAsync } from "docx-preview";
11
10
  const basicProps = {
12
11
  uploadUrl: {
13
12
  type: Object
@@ -27,6 +26,10 @@ const basicProps = {
27
26
  type: Object,
28
27
  default: {}
29
28
  },
29
+ fieldNames: {
30
+ type: Object,
31
+ default: {}
32
+ },
30
33
  fileName: {
31
34
  type: String,
32
35
  default: "file"
@@ -78,6 +81,10 @@ const basicProps = {
78
81
  type: Object,
79
82
  default: () => ({})
80
83
  },
84
+ emitSnippet: {
85
+ type: Boolean,
86
+ default: false
87
+ },
81
88
  showView: {
82
89
  type: Boolean,
83
90
  default: true
@@ -91,12 +98,28 @@ const basicProps = {
91
98
  default: true
92
99
  }
93
100
  };
101
+ function getFileSize(size) {
102
+ if (!size)
103
+ return "\u672A\u77E5\u5927\u5C0F";
104
+ if (isString(size))
105
+ return size;
106
+ if (size >= 1073741824) {
107
+ return size % 1073741824 === 0 ? size / 1073741824 + "G" : Math.trunc(size / 1073741824) + "G";
108
+ } else if (size >= 1048576) {
109
+ return size % 1048576 === 0 ? size / 1048576 + "MB" : Math.trunc(size / 1048576) + "MB";
110
+ } else if (size >= 1024) {
111
+ return size % 1024 === 0 ? size / 1024 + "KB" : Math.trunc(size / 1024) + "KB";
112
+ } else {
113
+ return size + "B";
114
+ }
115
+ }
94
116
  function useFile({
95
117
  fileListRef = ref([]),
96
118
  acceptRef,
97
119
  helpTextRef,
98
120
  maxCountRef,
99
- maxSizeRef
121
+ maxSizeRef,
122
+ fieldNamesRef
100
123
  }) {
101
124
  const { getAppConf } = useAppStore();
102
125
  const { message } = useMessage();
@@ -135,13 +158,17 @@ function useFile({
135
158
  });
136
159
  const setFile = (file) => {
137
160
  let _downloadUrl = getAppConf.pages?.downloadUrl;
161
+ const { fileName, fileType, fileId, filePath, fileSize } = unref(fieldNamesRef);
162
+ const url = file[filePath] || `${getAppConf.http?.baseUrl}${isString(_downloadUrl) ? _downloadUrl : _downloadUrl.api}?id=${file[fileId]}`;
138
163
  return {
139
164
  ...file,
140
- name: file.fileName ?? file.fileId,
141
- fileType: file.fileName ? takeRight(file.fileName.split("."))[0] : null,
165
+ name: file[fileName],
166
+ fileType: file[fileType] || takeRight(file[fileName].split("."))[0],
142
167
  status: "done",
143
- uid: file.id ?? file.fileId,
144
- url: `${getAppConf.http?.baseUrl}${isString(_downloadUrl) ? _downloadUrl : _downloadUrl.api}?id=${file.fileId}`
168
+ fileSize: getFileSize(file[fileSize]),
169
+ uid: file[fileId],
170
+ url,
171
+ filePath: url
145
172
  };
146
173
  };
147
174
  const fileList = ref(unref(fileListRef).map((it) => setFile(it)));
@@ -243,10 +270,19 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
243
270
  };
244
271
  }
245
272
  });
273
+ const _export_sfc = (sfc, props) => {
274
+ const target = sfc.__vccOpts || sfc;
275
+ for (const [key, val] of props) {
276
+ target[key] = val;
277
+ }
278
+ return target;
279
+ };
280
+ const PdfView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/upload/src/components/PdfView.vue"]]);
246
281
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
247
282
  __name: "WordView",
248
283
  setup(__props) {
249
284
  const ID = `word-view-${Math.ceil(Math.random() * 1e6)}`;
285
+ const domRef = ref(null);
250
286
  const [register] = useModal({
251
287
  width: "900px",
252
288
  title: (data) => `\u9644\u4EF6\u9884\u89C8 - ${data.fileName}`,
@@ -256,56 +292,69 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
256
292
  wrapClassName: "dt-word",
257
293
  maskClosable: false,
258
294
  footer: null
259
- }, (data) => {
295
+ }, async (data) => {
260
296
  const fileReader = new FileReader();
261
- fileReader.addEventListener("load", (event) => {
262
- const arrayBuffer = event.target.result;
263
- renderAsync(arrayBuffer, document.getElementById(ID), null, {
264
- className: "docx",
265
- inWrapper: true,
266
- ignoreWidth: false,
267
- ignoreHeight: false,
268
- ignoreFonts: false,
269
- breakPages: true,
270
- ignoreLastRenderedPageBreak: true,
271
- experimental: false,
272
- trimXmlDeclaration: true,
273
- debug: false
274
- }).then((rsp) => {
275
- dispatchResize();
297
+ if (typeof window !== "undefined") {
298
+ let { renderAsync } = await import("docx-preview");
299
+ fileReader.addEventListener("load", (event) => {
300
+ const arrayBuffer = event.target.result;
301
+ renderAsync(arrayBuffer, unref(domRef), null, {
302
+ className: "docx",
303
+ inWrapper: true,
304
+ ignoreWidth: false,
305
+ ignoreHeight: false,
306
+ ignoreFonts: false,
307
+ breakPages: true,
308
+ ignoreLastRenderedPageBreak: true,
309
+ experimental: false,
310
+ trimXmlDeclaration: true,
311
+ debug: false
312
+ }).then((rsp) => {
313
+ dispatchResize();
314
+ });
276
315
  });
277
- });
278
- fileReader.readAsArrayBuffer(data.data);
316
+ fileReader.readAsArrayBuffer(data.data);
317
+ }
279
318
  });
280
319
  return (_ctx, _cache) => {
281
320
  return openBlock(), createBlock(unref(DtModal), { onRegister: unref(register) }, {
282
321
  default: withCtx(() => [
283
322
  createElementVNode("div", {
323
+ ref_key: "domRef",
324
+ ref: domRef,
284
325
  id: ID,
285
326
  class: "word-view"
286
- })
327
+ }, null, 512)
287
328
  ]),
288
329
  _: 1
289
330
  }, 8, ["onRegister"]);
290
331
  };
291
332
  }
292
333
  });
334
+ const DocxView = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/upload/src/components/WordView.vue"]]);
293
335
  const _hoisted_1 = {
294
336
  key: 0,
295
337
  class: "flex items-center"
296
338
  };
297
339
  const _hoisted_2 = { class: "pl-3" };
298
- const _hoisted_3 = { class: "flex justify-between border border-solid border-gray-300 p-1 mt-2" };
299
- const _hoisted_4 = { class: "flex items-center" };
300
- const _hoisted_5 = ["src"];
301
- const _hoisted_6 = { class: "flex items-center" };
302
- const _hoisted_7 = ["onClick"];
303
- const _hoisted_8 = { key: 0 };
304
- const _hoisted_9 = /* @__PURE__ */ createElementVNode("i", { class: "i ic:baseline-file-upload" }, null, -1);
305
- const _hoisted_10 = /* @__PURE__ */ createElementVNode("div", null, "\u6587\u4EF6\u4E0A\u4F20", -1);
306
- const _hoisted_11 = [
307
- _hoisted_9,
308
- _hoisted_10
340
+ const _hoisted_3 = { class: "flex items-center flex-1" };
341
+ const _hoisted_4 = ["src"];
342
+ const _hoisted_5 = { class: "flex-1 pr-4" };
343
+ const _hoisted_6 = { class: "not-italic text-12 text-gray-400 ml-1" };
344
+ const _hoisted_7 = {
345
+ key: 0,
346
+ class: "ant-progress ant-progress-line ant-progress-default ant-progress-status-normal"
347
+ };
348
+ const _hoisted_8 = { class: "ant-progress-outer" };
349
+ const _hoisted_9 = { class: "ant-progress-inner" };
350
+ const _hoisted_10 = { class: "flex items-center" };
351
+ const _hoisted_11 = ["onClick"];
352
+ const _hoisted_12 = { key: 0 };
353
+ const _hoisted_13 = /* @__PURE__ */ createElementVNode("i", { class: "i ic:baseline-file-upload" }, null, -1);
354
+ const _hoisted_14 = /* @__PURE__ */ createElementVNode("div", null, "\u6587\u4EF6\u4E0A\u4F20", -1);
355
+ const _hoisted_15 = [
356
+ _hoisted_13,
357
+ _hoisted_14
309
358
  ];
310
359
  const _sfc_main = /* @__PURE__ */ defineComponent({
311
360
  __name: "index",
@@ -323,6 +372,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
323
372
  maxCount: maxCountRef,
324
373
  maxSize: maxSizeRef
325
374
  } = toRefs(props);
375
+ const fieldNamesRef = computed(() => {
376
+ return {
377
+ ...{
378
+ fileId: "id",
379
+ fileName: "fileName",
380
+ filePath: "fileUrl",
381
+ fileSize: "fileSize",
382
+ fileType: "extendName"
383
+ },
384
+ ...unref(props.fieldNames)
385
+ };
386
+ });
326
387
  const {
327
388
  getStringAccept,
328
389
  getHelpText,
@@ -333,7 +394,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
333
394
  acceptRef,
334
395
  helpTextRef,
335
396
  maxCountRef,
336
- maxSizeRef
397
+ maxSizeRef,
398
+ fieldNamesRef
337
399
  });
338
400
  const btns = [
339
401
  {
@@ -380,7 +442,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
380
442
  };
381
443
  });
382
444
  const handlePreview = async (file) => {
383
- imgSrcRef.value = file.url;
445
+ imgSrcRef.value = file.filePath;
384
446
  imgVisable.value = true;
385
447
  };
386
448
  const uploadFile = async ({ file, onSuccess, onError, onProgress }) => {
@@ -409,12 +471,29 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
409
471
  [fileName || "file"]: file
410
472
  }
411
473
  );
412
- Object.assign(file, {
413
- fileId: result?.data?.fileId,
414
- url: `${getAppConf.http?.baseUrl}${_downloadUrl}?id=${result?.data?.fileId}`,
415
- fileName: result?.data?.fileName,
416
- fileType: takeRight(result?.data?.fileName?.split("."))?.[0]
417
- });
474
+ let field = {}, fieldNames = unref(fieldNamesRef);
475
+ for (let key in fieldNames) {
476
+ let val = fieldNames[key];
477
+ if (key === "filePath") {
478
+ field[key] = result?.data?.[val] ?? `${getAppConf.http?.baseUrl}${_downloadUrl}?id=${result?.data?.fileId}`;
479
+ field["url"] = field["thumbUrl"] = field[key];
480
+ continue;
481
+ }
482
+ if (key === "fileType") {
483
+ field[key] = result?.data?.[val] ?? takeRight(file.name?.split("."))?.[0];
484
+ continue;
485
+ }
486
+ if (key === "fileSize") {
487
+ field[key] = getFileSize(file.size);
488
+ continue;
489
+ }
490
+ if (key === "fileName") {
491
+ field[key] = file.name;
492
+ continue;
493
+ }
494
+ field[key] = result?.data?.[val] ?? null;
495
+ }
496
+ Object.assign(file, field);
418
497
  onSuccess(result);
419
498
  } catch (err) {
420
499
  onError(err);
@@ -427,7 +506,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
427
506
  let _downloadUrl = isString(downloadUrl) ? downloadUrl : downloadUrl.api;
428
507
  let _downloadType = isString(downloadUrl) ? "get" : downloadUrl.type;
429
508
  if (["jpg", "jpeg", "png", "bmp", "gif"].includes(file.fileType)) {
430
- imgSrcRef.value = `${getAppConf.http?.baseUrl}${_downloadUrl}?id=${file.fileId}`;
509
+ imgSrcRef.value = file.filePath ?? `${getAppConf.http?.baseUrl}${_downloadUrl}?id=${file.fileId}`;
431
510
  imgVisable.value = true;
432
511
  return;
433
512
  }
@@ -465,13 +544,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
465
544
  watch(
466
545
  () => unref(fileList),
467
546
  async (v) => {
468
- let ids = unref(fileList).map((it) => it.fileId);
469
- if (ids.length === v.length)
470
- emits("change", ids.join(","));
471
- },
472
- {
473
- deep: true,
474
- immediate: true
547
+ let ids = [];
548
+ unref(fileList).forEach((it) => {
549
+ ids.push(it.fileId);
550
+ });
551
+ if (props.emitSnippet || !props.emitSnippet && !ids.includes(void 0)) {
552
+ emits("change", ids.join(","), unref(fileList));
553
+ }
475
554
  }
476
555
  );
477
556
  return (_ctx, _cache) => {
@@ -484,15 +563,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
484
563
  "onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => isRef(fileList) ? fileList.value = $event : null)
485
564
  }), createSlots({
486
565
  itemRender: withCtx(({ file, actions }) => [
487
- createElementVNode("div", _hoisted_3, [
488
- createElementVNode("div", _hoisted_4, [
566
+ createElementVNode("div", {
567
+ class: normalizeClass(["flex justify-between border border-solid border-gray-300 p-1 mt-2", file?.status === "error" ? "ant-upload-list-item-error" : ""])
568
+ }, [
569
+ createElementVNode("div", _hoisted_3, [
489
570
  createElementVNode("img", {
490
571
  src: unref(getFileThumb)(file.fileType),
491
572
  class: "w-9 h-9 mr-2 p-1"
492
- }, null, 8, _hoisted_5),
493
- createElementVNode("span", null, toDisplayString(file.fileName), 1)
573
+ }, null, 8, _hoisted_4),
574
+ createElementVNode("div", _hoisted_5, [
575
+ createElementVNode("span", null, [
576
+ createTextVNode(toDisplayString(file.fileName || file.name) + " ", 1),
577
+ createElementVNode("i", _hoisted_6, "(" + toDisplayString(file.fileSize) + ")", 1)
578
+ ]),
579
+ createCommentVNode(" \u8BBE\u7F6E\u8FDB\u5EA6 "),
580
+ file.percent < 100 && file.percent > 0 ? (openBlock(), createElementBlock("div", _hoisted_7, [
581
+ createElementVNode("div", _hoisted_8, [
582
+ createElementVNode("div", _hoisted_9, [
583
+ createElementVNode("div", {
584
+ class: "ant-progress-bg",
585
+ style: normalizeStyle({
586
+ width: `${file.percent}%`,
587
+ height: "2px"
588
+ })
589
+ }, null, 4)
590
+ ])
591
+ ])
592
+ ])) : createCommentVNode("v-if", true)
593
+ ])
494
594
  ]),
495
- createElementVNode("div", _hoisted_6, [
595
+ createElementVNode("div", _hoisted_10, [
496
596
  (openBlock(), createElementBlock(Fragment, null, renderList(btns, (btn) => {
497
597
  return openBlock(), createElementBlock(Fragment, {
498
598
  key: btn.class
@@ -501,11 +601,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
501
601
  key: 0,
502
602
  class: normalizeClass(["i w-7 h-7 !text-base text-center leading-7 text-gray-600 cursor-pointer hover:bg-gray-200 hover:bg-opacity-50 transition-all duration-300", btn.class]),
503
603
  onClick: ($event) => btn.click(file)
504
- }, null, 10, _hoisted_7)) : createCommentVNode("", true)
604
+ }, null, 10, _hoisted_11)) : createCommentVNode("v-if", true)
505
605
  ], 64);
506
606
  }), 64))
507
607
  ])
508
- ])
608
+ ], 2)
509
609
  ]),
510
610
  default: withCtx(() => [
511
611
  !unref(getBind).disabled ? (openBlock(), createElementBlock("div", _hoisted_1, [
@@ -519,9 +619,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
519
619
  _: 1
520
620
  }),
521
621
  createElementVNode("p", _hoisted_2, toDisplayString(unref(getHelpText)), 1)
522
- ])) : createCommentVNode("", true),
523
- createVNode(_sfc_main$2, { onRegister: unref(registerPdf) }, null, 8, ["onRegister"]),
524
- createVNode(_sfc_main$1, { onRegister: unref(registerDocx) }, null, 8, ["onRegister"])
622
+ ])) : createCommentVNode("v-if", true),
623
+ createVNode(PdfView, { onRegister: unref(registerPdf) }, null, 8, ["onRegister"]),
624
+ createVNode(DocxView, { onRegister: unref(registerDocx) }, null, 8, ["onRegister"])
525
625
  ]),
526
626
  _: 2
527
627
  }, [
@@ -533,22 +633,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
533
633
  ])
534
634
  };
535
635
  })
536
- ]), 1040, ["fileList"])) : createCommentVNode("", true),
636
+ ]), 1040, ["fileList"])) : createCommentVNode("v-if", true),
537
637
  unref(getBind).listType === "picture-card" ? (openBlock(), createBlock(_component_AUpload, mergeProps({ key: 1 }, unref(getBind), {
538
638
  fileList: unref(fileList),
539
639
  "onUpdate:fileList": _cache[1] || (_cache[1] = ($event) => isRef(fileList) ? fileList.value = $event : null),
540
640
  onPreview: handlePreview
541
641
  }), {
542
642
  default: withCtx(() => [
543
- !unref(getBind).disabled && (!_ctx.maxCount || !unref(fileList).length || unref(fileList).length < _ctx.maxCount) ? (openBlock(), createElementBlock("div", _hoisted_8, _hoisted_11)) : createCommentVNode("", true)
643
+ !unref(getBind).disabled && (!_ctx.maxCount || !unref(fileList).length || unref(fileList).length < _ctx.maxCount) ? (openBlock(), createElementBlock("div", _hoisted_12, _hoisted_15)) : createCommentVNode("v-if", true)
544
644
  ]),
545
645
  _: 1
546
- }, 16, ["fileList"])) : createCommentVNode("", true),
547
- unref(bindImg).src ? (openBlock(), createBlock(_component_AImage, mergeProps({ key: 2 }, unref(bindImg), { style: { display: "none" } }), null, 16)) : createCommentVNode("", true)
646
+ }, 16, ["fileList"])) : createCommentVNode("v-if", true),
647
+ unref(bindImg).src ? (openBlock(), createBlock(_component_AImage, mergeProps({ key: 2 }, unref(bindImg), { style: { display: "none" } }), null, 16)) : createCommentVNode("v-if", true)
548
648
  ]);
549
649
  };
550
650
  }
551
651
  });
652
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/upload/src/index.vue"]]);
552
653
  export {
553
- _sfc_main as DtUpload
654
+ index as DtUpload
554
655
  };
@@ -72,5 +72,12 @@
72
72
  .ant-upload-list-item-actions{
73
73
  display: flex;
74
74
  }
75
+
76
+ .ant-upload-list-item-error{
77
+ border-color: #ED6F6F;
78
+ i{
79
+ color: #ED6F6F;
80
+ }
81
+ }
75
82
 
76
83
  }
@@ -1,5 +1,5 @@
1
1
  import { PropType, Ref, ComputedRef } from "vue";
2
- import { UploadFile } from "./type/file";
2
+ import { FieldNames, UploadFile } from "./type/file";
3
3
  import { UploadRequestOption } from "ant-design-vue/es/vc-upload/interface";
4
4
  import { ApiType, Recordable } from "@dt-frames/core";
5
5
  export declare const basicProps: {
@@ -21,6 +21,10 @@ export declare const basicProps: {
21
21
  type: PropType<object | ((file: UploadFile) => object)>;
22
22
  default: {};
23
23
  };
24
+ fieldNames: {
25
+ type: PropType<FieldNames>;
26
+ default: {};
27
+ };
24
28
  fileName: {
25
29
  type: StringConstructor;
26
30
  default: string;
@@ -1,5 +1,6 @@
1
1
  declare const _sfc_main: import("vue").DefineComponent<{}, {
2
2
  ID: string;
3
+ domRef: any;
3
4
  register: import("../../../modal/src/types/modal.type").RegisterFn;
4
5
  readonly DtModal: import("vue").DefineComponent<{}, {}, any, 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<{}>>, {}>;
5
6
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
@@ -1,15 +1,16 @@
1
- import { Ref } from "vue";
2
- import { UploadFile } from "../type/file";
3
- export declare function useFile({ fileListRef, acceptRef, helpTextRef, maxCountRef, maxSizeRef, }: {
1
+ import { Ref, ComputedRef } from "vue";
2
+ import { FieldNames, UploadFile } from "../type/file";
3
+ export declare function useFile({ fileListRef, acceptRef, helpTextRef, maxCountRef, maxSizeRef, fieldNamesRef }: {
4
4
  fileListRef: Ref<UploadFile[]>;
5
5
  acceptRef: Ref<string[]>;
6
6
  helpTextRef: Ref<string>;
7
7
  maxCountRef: Ref<number>;
8
8
  maxSizeRef: Ref<number>;
9
+ fieldNamesRef: ComputedRef<FieldNames>;
9
10
  }): {
10
- getAccept: import("vue").ComputedRef<string[]>;
11
- getStringAccept: import("vue").ComputedRef<string>;
12
- getHelpText: import("vue").ComputedRef<string>;
11
+ getAccept: ComputedRef<string[]>;
12
+ getStringAccept: ComputedRef<string>;
13
+ getHelpText: ComputedRef<string>;
13
14
  fileList: Ref<any[]>;
14
15
  setFile: (file: any) => any;
15
16
  beforeUpload: (file: File) => void;
@@ -19,6 +19,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
19
19
  type: import("vue").PropType<object | ((file: UploadFile) => object)>;
20
20
  default: {};
21
21
  };
22
+ fieldNames: {
23
+ type: import("vue").PropType<import("./type/file").FieldNames>;
24
+ default: {};
25
+ };
22
26
  fileName: {
23
27
  type: StringConstructor;
24
28
  default: string;
@@ -95,6 +99,13 @@ declare const _sfc_main: import("vue").DefineComponent<{
95
99
  helpTextRef: import("vue").Ref<string>;
96
100
  maxCountRef: import("vue").Ref<number>;
97
101
  maxSizeRef: import("vue").Ref<number>;
102
+ fieldNamesRef: import("vue").ComputedRef<{
103
+ fileId: string;
104
+ fileName: string;
105
+ filePath: string;
106
+ size: string;
107
+ fileType: string;
108
+ }>;
98
109
  getStringAccept: import("vue").ComputedRef<string>;
99
110
  getHelpText: import("vue").ComputedRef<string>;
100
111
  fileList: import("vue").Ref<any[]>;
@@ -134,6 +145,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
134
145
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
135
146
  DocxView: import("vue").DefineComponent<{}, {
136
147
  ID: string;
148
+ domRef: any;
137
149
  register: import("../../modal/src/types/modal.type").RegisterFn;
138
150
  readonly DtModal: import("vue").DefineComponent<{}, {}, any, 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<{}>>, {}>;
139
151
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
@@ -156,6 +168,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
156
168
  type: import("vue").PropType<object | ((file: UploadFile) => object)>;
157
169
  default: {};
158
170
  };
171
+ fieldNames: {
172
+ type: import("vue").PropType<import("./type/file").FieldNames>;
173
+ default: {};
174
+ };
159
175
  fileName: {
160
176
  type: StringConstructor;
161
177
  default: string;
@@ -225,6 +241,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
225
241
  data: object | ((file: UploadFile) => object);
226
242
  buttonText: string;
227
243
  preIcon: string;
244
+ fieldNames: {};
228
245
  fileName: string;
229
246
  accept: string[];
230
247
  disabled: Boolean | import("vue").Ref<Boolean> | import("vue").ComputedRef<Boolean>;
@@ -2,9 +2,16 @@ export declare type UploadFile = {
2
2
  name?: string;
3
3
  percent?: number;
4
4
  status?: 'error' | 'success' | 'done' | 'uploading' | 'removed';
5
- thumbUrl?: string;
6
5
  uid?: string;
7
- url?: string;
6
+ fileSize?: string | number;
7
+ filePath?: string;
8
8
  fileId?: string;
9
9
  [key: string]: any;
10
10
  };
11
+ export declare type FieldNames = {
12
+ fileId?: string;
13
+ fileName?: string;
14
+ filePath?: string;
15
+ fileSize?: string;
16
+ fileType?: string;
17
+ };
@@ -0,0 +1 @@
1
+ export declare function getFileSize(size: string | number): string;