@lemon30_npm/csit-vue3 1.0.72 → 1.0.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,6 +1,6 @@
1
- import { ElUpload as oe, ElButton as te, ElLink as se, ElTooltip as le, ElDivider as ae } from "element-plus/es";
2
- import { defineComponent as ne, mergeDefaults as ie, useSlots as re, ref as E, watch as de, createElementBlock as l, openBlock as s, normalizeClass as w, createBlock as v, createCommentVNode as n, mergeProps as ue, unref as f, createSlots as pe, withCtx as r, renderSlot as S, Fragment as g, createElementVNode as a, toDisplayString as y, renderList as z, normalizeProps as me, guardReactiveProps as ce, createTextVNode as h, createVNode as b, normalizeStyle as P, nextTick as fe } from "vue";
3
- import T from "./icons/icon-upload-btn.svg.js";
1
+ import { ElUpload as oe, ElButton as te, ElLink as se, ElTooltip as ae, ElDivider as le } from "element-plus/es";
2
+ import { defineComponent as ne, mergeDefaults as ie, useSlots as re, ref as _, watch as de, createElementBlock as a, openBlock as s, normalizeClass as w, createBlock as v, createCommentVNode as n, mergeProps as ue, unref as f, createSlots as pe, withCtx as r, renderSlot as U, Fragment as g, createElementVNode as l, toDisplayString as y, renderList as $, normalizeProps as me, guardReactiveProps as ce, createTextVNode as h, createVNode as b, normalizeStyle as z, nextTick as fe } from "vue";
3
+ import P from "./icons/icon-upload-btn.svg.js";
4
4
  import R from "./icons/icon-upload-btn-hover.svg.js";
5
5
  import F from "./icons/icon-upload-btn-disabled.svg.js";
6
6
  import ge from "./icons/icon-loading-blue.svg.js";
@@ -11,16 +11,16 @@ import { ElMessageBox as ve, ElMessage as he } from "element-plus";
11
11
  import { useUpload as be } from "./hooks/useUpload.js";
12
12
  import { useUploadRetry as Be } from "./hooks/useUploadRetry.js";
13
13
  import { downloadFileWithAxios as Ce } from "./utils/file.js";
14
- import { getFileIconByName as Ue } from "./utils/file-icon-maps.js";
15
- import { useExposeMethods as Se } from "./expose/index.js";
16
- import { useCiUploadComputed as _e } from "./computed/index.js";
14
+ import { getFileIconByName as Se } from "./utils/file-icon-maps.js";
15
+ import { useExposeMethods as Ue } from "./expose/index.js";
16
+ import { useCiUploadComputed as Te } from "./computed/index.js";
17
17
  import { defaultProps as Ne } from "./props/index.js";
18
- import { useFileSize as Ee } from "./hooks/useFileSize.js";
19
- import { handleUploadValidateFail as De } from "./hooks/useUploadValidateFail.js";
20
- import { createUploadRules as $e } from "./hooks/rules/createUploadRules.js";
21
- import { confirmBeforeUpload as ze } from "./hooks/useConfirmBeforeUpload.js";
22
- import { abortUploadFlow as Pe } from "./hooks/useAbortUploadFlow.js";
23
- const Te = {
18
+ import { useFileSize as _e } from "./hooks/useFileSize.js";
19
+ import { handleUploadValidateFail as Ee } from "./hooks/useUploadValidateFail.js";
20
+ import { createUploadRules as De } from "./hooks/rules/createUploadRules.js";
21
+ import { confirmBeforeUpload as $e } from "./hooks/useConfirmBeforeUpload.js";
22
+ import { abortUploadFlow as ze } from "./hooks/useAbortUploadFlow.js";
23
+ const Pe = {
24
24
  key: 0,
25
25
  class: "tip-slot-textInfo"
26
26
  }, Re = {
@@ -78,11 +78,12 @@ const Te = {
78
78
  minFileNameLength: {},
79
79
  confirmBeforeUpload: { type: Boolean },
80
80
  confirmBeforeUploadText: {},
81
- showUploadSecretTip: { type: Boolean }
81
+ showUploadSecretTip: { type: Boolean },
82
+ uploadSecretTipText: {}
82
83
  }, Ne),
83
84
  emits: ["update:fileList", "onSuccess", "onRemove", "onChange", "onError", "onCustomDownload"],
84
85
  setup(L, { expose: I, emit: K }) {
85
- const { formatFileSize: V } = Ee(), M = re(), D = E(), U = E(!1), k = E([]), { checkUploadStatus: q } = Se(k), i = L, { customHttpRequest: H } = be(i.axiosInstance), d = K;
86
+ const { formatFileSize: V } = _e(), M = re(), E = _(), S = _(!1), k = _([]), { checkUploadStatus: q } = Ue(k), i = L, { customHttpRequest: H } = be(i.axiosInstance), d = K;
86
87
  I({
87
88
  checkUploadStatus: q
88
89
  });
@@ -94,9 +95,9 @@ const Te = {
94
95
  },
95
96
  { immediate: !0 }
96
97
  );
97
- const _ = (e) => {
98
+ const T = (e) => {
98
99
  var o;
99
- U.value = !1, (o = D.value) == null || o.handleRemove(e);
100
+ S.value = !1, (o = E.value) == null || o.handleRemove(e);
100
101
  }, N = (e) => {
101
102
  if (i.customDownload) {
102
103
  d("onCustomDownload", e);
@@ -119,23 +120,23 @@ const Te = {
119
120
  }, O = async (e) => {
120
121
  if (i.confirmBeforeUpload)
121
122
  try {
122
- await ze(i.confirmBeforeUploadText);
123
+ await $e(i.confirmBeforeUploadText);
123
124
  } catch {
124
- return Pe(U);
125
+ return ze(S);
125
126
  }
126
- const o = $e(i);
127
+ const o = De(i);
127
128
  for (const u of o) {
128
129
  const p = u(e);
129
130
  if (p !== !0)
130
- return De(p, {
131
+ return Ee(p, {
131
132
  rawFile: e,
132
133
  fileList: i.fileList,
133
134
  emit: d,
134
- internalRemoveFlag: U
135
+ internalRemoveFlag: S
135
136
  });
136
137
  }
137
138
  return !0;
138
- }, W = (e, o) => U.value ? !0 : ve.confirm(
139
+ }, W = (e, o) => S.value ? !0 : ve.confirm(
139
140
  `确定删除 ${e.fileName || e.name} 文件?`,
140
141
  "温馨提示",
141
142
  {
@@ -163,10 +164,10 @@ const Te = {
163
164
  e.status === "success" && !e.response || (d("update:fileList", o), d("onChange", e, o));
164
165
  }, X = (e, o) => {
165
166
  d("update:fileList", o), d("onRemove", e, o);
166
- }, { hasRealDefaultSlot: Y, finalBeforeUpload: Z, defaultTipSlotTextInfo: $, otherSlots: x } = _e(i, M, O);
167
+ }, { hasRealDefaultSlot: Y, finalBeforeUpload: Z, defaultTipSlotTextInfo: D, otherSlots: x } = Te(i, M, O);
167
168
  return (e, o) => {
168
- const u = te, p = oe, m = se, B = le, C = ae;
169
- return s(), l("div", {
169
+ const u = te, p = oe, m = se, B = ae, C = le;
170
+ return s(), a("div", {
170
171
  class: w(["CiUpload", {}])
171
172
  }, [
172
173
  e.readonly ? n("", !0) : (s(), v(p, ue({
@@ -176,8 +177,9 @@ const Te = {
176
177
  "is-drag": e.drag,
177
178
  "is-disabled-upload-secret": e.showUploadSecretTip && e.drag
178
179
  }],
180
+ "data-secret-tip": e.uploadSecretTipText,
179
181
  ref_key: "uploadRef",
180
- ref: D,
182
+ ref: E,
181
183
  action: e.action,
182
184
  data: e.data,
183
185
  headers: e.headers,
@@ -198,56 +200,57 @@ const Te = {
198
200
  "show-file-list": !1
199
201
  }, e.$attrs), pe({
200
202
  default: r(() => [
201
- f(Y) ? S(e.$slots, "default", { key: 0 }, void 0, !0) : (s(), l(g, { key: 1 }, [
202
- e.drag ? (s(), l(g, { key: 0 }, [
203
- o[0] || (o[0] = a("img", {
203
+ f(Y) ? U(e.$slots, "default", { key: 0 }, void 0, !0) : (s(), a(g, { key: 1 }, [
204
+ e.drag ? (s(), a(g, { key: 0 }, [
205
+ o[0] || (o[0] = l("img", {
204
206
  class: "upload-btn-icon",
205
- src: T,
207
+ src: P,
206
208
  alt: ""
207
209
  }, null, -1)),
208
- o[1] || (o[1] = a("img", {
210
+ o[1] || (o[1] = l("img", {
209
211
  class: "upload-btn-icon-hover",
210
212
  src: R,
211
213
  alt: ""
212
214
  }, null, -1)),
213
- o[2] || (o[2] = a("img", {
215
+ o[2] || (o[2] = l("img", {
214
216
  class: "upload-btn-icon-disabled",
215
217
  src: F,
216
218
  alt: ""
217
219
  }, null, -1)),
218
- o[3] || (o[3] = a("div", { class: "drag-text-info" }, [
219
- a("span", { class: "drag-text-info-click" }, "点击上传"),
220
- a("span", { class: "drag-text-info-black" }, "或将文件拖拽到这里上传")
220
+ o[3] || (o[3] = l("div", { class: "drag-text-info" }, [
221
+ l("span", { class: "drag-text-info-click" }, "点击上传"),
222
+ l("span", { class: "drag-text-info-black" }, "或将文件拖拽到这里上传")
221
223
  ], -1)),
222
- e.$slots.tip ? (s(), l("div", Te, [
223
- S(e.$slots, "tip", {}, void 0, !0)
224
- ])) : (s(), l("div", Re, y(f($)), 1))
224
+ e.$slots.tip ? (s(), a("div", Pe, [
225
+ U(e.$slots, "tip", {}, void 0, !0)
226
+ ])) : (s(), a("div", Re, y(f(D)), 1))
225
227
  ], 64)) : (s(), v(u, {
226
228
  key: 1,
227
229
  class: w(["upload-btn", { "is-disabled-upload-secret": e.showUploadSecretTip }]),
230
+ "data-secret-tip": e.uploadSecretTipText,
228
231
  disabled: e.disabled
229
232
  }, {
230
233
  default: r(() => [
231
- o[4] || (o[4] = a("img", {
234
+ o[4] || (o[4] = l("img", {
232
235
  class: "upload-btn-icon",
233
- src: T,
236
+ src: P,
234
237
  alt: ""
235
238
  }, null, -1)),
236
- o[5] || (o[5] = a("img", {
239
+ o[5] || (o[5] = l("img", {
237
240
  class: "upload-btn-icon-hover",
238
241
  src: R,
239
242
  alt: ""
240
243
  }, null, -1)),
241
- o[6] || (o[6] = a("img", {
244
+ o[6] || (o[6] = l("img", {
242
245
  class: "upload-btn-icon-disabled",
243
246
  src: F,
244
247
  alt: ""
245
248
  }, null, -1)),
246
- a("span", Fe, y(e.uploadBtnText), 1)
249
+ l("span", Fe, y(e.uploadBtnText), 1)
247
250
  ]),
248
251
  _: 1,
249
252
  __: [4, 5, 6]
250
- }, 8, ["class", "disabled"]))
253
+ }, 8, ["class", "data-secret-tip", "disabled"]))
251
254
  ], 64))
252
255
  ]),
253
256
  _: 2
@@ -255,33 +258,33 @@ const Te = {
255
258
  e.drag ? void 0 : {
256
259
  name: "tip",
257
260
  fn: r(() => [
258
- e.$slots.tip ? (s(), l("div", Le, [
259
- S(e.$slots, "tip", {}, void 0, !0)
260
- ])) : (s(), l("div", Ie, y(f($)), 1))
261
+ e.$slots.tip ? (s(), a("div", Le, [
262
+ U(e.$slots, "tip", {}, void 0, !0)
263
+ ])) : (s(), a("div", Ie, y(f(D)), 1))
261
264
  ]),
262
265
  key: "0"
263
266
  },
264
- z(f(x), (t, c) => ({
267
+ $(f(x), (t, c) => ({
265
268
  name: c,
266
269
  fn: r((ee) => [
267
- S(e.$slots, c, me(ce(ee || {})), void 0, !0)
270
+ U(e.$slots, c, me(ce(ee || {})), void 0, !0)
268
271
  ])
269
272
  }))
270
- ]), 1040, ["class", "action", "data", "headers", "file-list", "accept", "limit", "multiple", "drag", "disabled", "before-upload", "http-request"])),
271
- k.value.length ? (s(), l("div", {
273
+ ]), 1040, ["class", "data-secret-tip", "action", "data", "headers", "file-list", "accept", "limit", "multiple", "drag", "disabled", "before-upload", "http-request"])),
274
+ k.value.length ? (s(), a("div", {
272
275
  key: 1,
273
276
  class: w(["custom-file-list-default", { "is-readonly": e.readonly }])
274
277
  }, [
275
- (s(!0), l(g, null, z(k.value, (t) => (s(), l("div", {
278
+ (s(!0), a(g, null, $(k.value, (t) => (s(), a("div", {
276
279
  class: "file-item-wrapper",
277
280
  key: t.uid
278
281
  }, [
279
- a("div", Ke, [
280
- a("div", Ve, [
281
- e.showFileExtIcon ? (s(), l("img", {
282
+ l("div", Ke, [
283
+ l("div", Ve, [
284
+ e.showFileExtIcon ? (s(), a("img", {
282
285
  key: 0,
283
286
  class: "file-icon",
284
- src: f(Ue)(t.fileName || t.name)
287
+ src: f(Se)(t.fileName || t.name)
285
288
  }, null, 8, Me)) : n("", !0),
286
289
  e.showFileNameEllipsisTooltip ? (s(), v(B, {
287
290
  key: 2,
@@ -314,13 +317,13 @@ const Te = {
314
317
  _: 2
315
318
  }, 1032, ["disabled", "onClick"]))
316
319
  ]),
317
- a("div", qe, [
318
- e.showFileSize ? (s(), l("span", He, y(f(V)(t.fileSize || t.size)), 1)) : n("", !0),
319
- t.status !== "fail" ? (s(), l("div", Ae, [
320
- t.status !== "uploading" ? (s(), l(g, { key: 0 }, [
321
- e.showPreviewBtn ? (s(), l(g, { key: 0 }, [
320
+ l("div", qe, [
321
+ e.showFileSize ? (s(), a("span", He, y(f(V)(t.fileSize || t.size)), 1)) : n("", !0),
322
+ t.status !== "fail" ? (s(), a("div", Ae, [
323
+ t.status !== "uploading" ? (s(), a(g, { key: 0 }, [
324
+ e.showPreviewBtn ? (s(), a(g, { key: 0 }, [
322
325
  b(m, {
323
- onClick: (c) => _(t)
326
+ onClick: (c) => T(t)
324
327
  }, {
325
328
  default: r(() => o[7] || (o[7] = [
326
329
  h(" 在线预览 ")
@@ -330,7 +333,7 @@ const Te = {
330
333
  }, 1032, ["onClick"]),
331
334
  b(C, { direction: "vertical" })
332
335
  ], 64)) : n("", !0),
333
- e.showDownloadBtn ? (s(), l(g, { key: 1 }, [
336
+ e.showDownloadBtn ? (s(), a(g, { key: 1 }, [
334
337
  b(m, {
335
338
  disabled: t.status === "downloading",
336
339
  onClick: (c) => N(t)
@@ -347,7 +350,7 @@ const Te = {
347
350
  ], 64)) : n("", !0),
348
351
  e.showDeleteBtn && !e.readonly ? (s(), v(m, {
349
352
  key: 2,
350
- onClick: (c) => _(t)
353
+ onClick: (c) => T(t)
351
354
  }, {
352
355
  default: r(() => o[8] || (o[8] = [
353
356
  h("删除")
@@ -357,34 +360,34 @@ const Te = {
357
360
  }, 1032, ["onClick"])) : n("", !0)
358
361
  ], 64)) : n("", !0)
359
362
  ])) : n("", !0),
360
- a("div", Oe, [
361
- t.status === "uploading" ? (s(), l("div", {
363
+ l("div", Oe, [
364
+ t.status === "uploading" ? (s(), a("div", {
362
365
  key: 0,
363
366
  class: w(t.status)
364
367
  }, [
365
- o[9] || (o[9] = a("img", {
368
+ o[9] || (o[9] = l("img", {
366
369
  class: "uploading-icon",
367
370
  src: ge
368
371
  }, null, -1)),
369
- a("span", We, y(t.percentage) + "%", 1)
372
+ l("span", We, y(t.percentage) + "%", 1)
370
373
  ], 2)) : n("", !0),
371
- e.readonly ? n("", !0) : (s(), l(g, { key: 1 }, [
372
- t.status === "success" || t.status === "downloading" ? (s(), l("span", {
374
+ e.readonly ? n("", !0) : (s(), a(g, { key: 1 }, [
375
+ t.status === "success" || t.status === "downloading" ? (s(), a("span", {
373
376
  key: 0,
374
377
  class: w(t.status)
375
378
  }, o[10] || (o[10] = [
376
- a("img", {
379
+ l("img", {
377
380
  class: "success-icon",
378
381
  src: ye
379
382
  }, null, -1)
380
383
  ]), 2)) : n("", !0)
381
384
  ], 64)),
382
- t.status === "fail" ? (s(), l("div", {
385
+ t.status === "fail" ? (s(), a("div", {
383
386
  key: 2,
384
387
  class: w(["fail-icon-wrapper", t.status])
385
388
  }, [
386
389
  b(m, {
387
- onClick: (c) => _(t)
390
+ onClick: (c) => T(t)
388
391
  }, {
389
392
  default: r(() => o[11] || (o[11] = [
390
393
  h(" 删除 ")
@@ -398,7 +401,7 @@ const Te = {
398
401
  placement: "bottom"
399
402
  }, {
400
403
  default: r(() => [
401
- a("img", {
404
+ l("img", {
402
405
  class: "retry-icon",
403
406
  src: we,
404
407
  onClick: (c) => f(A)(t)
@@ -406,7 +409,7 @@ const Te = {
406
409
  ]),
407
410
  _: 2
408
411
  }, 1024),
409
- o[12] || (o[12] = a("img", {
412
+ o[12] || (o[12] = l("img", {
410
413
  class: "fail-icon",
411
414
  src: ke
412
415
  }, null, -1))
@@ -414,19 +417,19 @@ const Te = {
414
417
  ])
415
418
  ])
416
419
  ]),
417
- e.showUploadProgress ? (s(), l(g, { key: 0 }, [
418
- t.status === "uploading" ? (s(), l("div", Ge, [
419
- a("div", {
420
+ e.showUploadProgress ? (s(), a(g, { key: 0 }, [
421
+ t.status === "uploading" ? (s(), a("div", Ge, [
422
+ l("div", {
420
423
  class: "file-progress-inner",
421
- style: P({ width: (t.percentage || 0) + "%" })
424
+ style: z({ width: (t.percentage || 0) + "%" })
422
425
  }, null, 4)
423
426
  ])) : n("", !0)
424
427
  ], 64)) : n("", !0),
425
- e.showDownloadProgress ? (s(), l(g, { key: 1 }, [
426
- t.status === "downloading" ? (s(), l("div", Je, [
427
- a("div", {
428
+ e.showDownloadProgress ? (s(), a(g, { key: 1 }, [
429
+ t.status === "downloading" ? (s(), a("div", Je, [
430
+ l("div", {
428
431
  class: "file-progress-inner",
429
- style: P({ width: (t.downloadPercentage || 0) + "%" })
432
+ style: z({ width: (t.downloadPercentage || 0) + "%" })
430
433
  }, null, 4)
431
434
  ])) : n("", !0)
432
435
  ], 64)) : n("", !0)
@@ -68,7 +68,9 @@ const e = {
68
68
  */
69
69
  confirmBeforeUploadText: "确定要上传该文件吗?",
70
70
  // 是否展示 '禁止上传国家秘密' 提示文案 - 默认值: false
71
- showUploadSecretTip: !1
71
+ showUploadSecretTip: !1,
72
+ // 自定义展示的保密提示文案 - 默认值: '禁止上传国家秘密和工作秘密文件'
73
+ uploadSecretTipText: "禁止上传国家秘密和工作秘密文件"
72
74
  };
73
75
  export {
74
76
  e as defaultProps
@@ -53,6 +53,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Ci
53
53
  confirmBeforeUpload: boolean;
54
54
  confirmBeforeUploadText: string;
55
55
  showUploadSecretTip: boolean;
56
+ uploadSecretTipText: string;
56
57
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
57
58
  uploadRef: unknown;
58
59
  }, HTMLDivElement>, Partial<Record<number, (_: any) => any>> & {
@@ -42,4 +42,5 @@ export declare const defaultProps: {
42
42
  */
43
43
  confirmBeforeUploadText: string;
44
44
  showUploadSecretTip: boolean;
45
+ uploadSecretTipText: string;
45
46
  };
@@ -43,6 +43,7 @@ export interface CiUploadProps {
43
43
  */
44
44
  confirmBeforeUploadText?: string;
45
45
  showUploadSecretTip?: boolean;
46
+ uploadSecretTipText?: string;
46
47
  }
47
48
  export type CiUploadFiles = CiUploadFile[];
48
49
  export interface CiUploadUserFile extends UploadUserFile {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon30_npm/csit-vue3",
3
- "version": "1.0.72",
3
+ "version": "1.0.73",
4
4
  "type": "module",
5
5
  "author": "cuiwq",
6
6
  "license": "MIT",