@newview/file-ui 1.1.37 → 1.1.38
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/README.md +4 -0
- package/dist/file-ui.js +214 -64
- package/dist/file-ui.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/file-ui.js
CHANGED
|
@@ -260,6 +260,11 @@ const propDefine$6 = {
|
|
|
260
260
|
uploadQuantity: {
|
|
261
261
|
type: Number,
|
|
262
262
|
default: 0
|
|
263
|
+
},
|
|
264
|
+
isShowFileName: {
|
|
265
|
+
// 是否显示文件名称
|
|
266
|
+
type: Boolean,
|
|
267
|
+
default: true
|
|
263
268
|
}
|
|
264
269
|
};
|
|
265
270
|
const _sfc_main$6 = defineComponent({
|
|
@@ -288,7 +293,8 @@ let UploadFileInstance$1 = class UploadFileInstance extends BaseInstance {
|
|
|
288
293
|
// 当前Token
|
|
289
294
|
// 响应属性 | ref、reactive、computed
|
|
290
295
|
__publicField(this, "fileList", ref([]));
|
|
291
|
-
__publicField(this, "uploading", ref(
|
|
296
|
+
__publicField(this, "uploading", ref(true));
|
|
297
|
+
__publicField(this, "uploadingPercent", ref(0));
|
|
292
298
|
__publicField(this, "uploadFilePos", reactive({}));
|
|
293
299
|
// 文件上传参数
|
|
294
300
|
__publicField(this, "action", ref("/FileServiceApi/Upload/file"));
|
|
@@ -309,8 +315,10 @@ let UploadFileInstance$1 = class UploadFileInstance extends BaseInstance {
|
|
|
309
315
|
this.uploading.value = false;
|
|
310
316
|
if (result.Code != "0") {
|
|
311
317
|
this.message.error(result.Msg);
|
|
318
|
+
this.uploadingPercent.value = 100;
|
|
312
319
|
return;
|
|
313
320
|
}
|
|
321
|
+
this.uploadingPercent.value = 100;
|
|
314
322
|
this.message.success("上传成功");
|
|
315
323
|
this.ctx.emit("success", { token: result.Token, fileId: result.FileId });
|
|
316
324
|
this.loadFileList(true);
|
|
@@ -337,10 +345,12 @@ let UploadFileInstance$1 = class UploadFileInstance extends BaseInstance {
|
|
|
337
345
|
}
|
|
338
346
|
this.uploading.value = false;
|
|
339
347
|
});
|
|
348
|
+
/** 当前选择上传的分组 */
|
|
349
|
+
__publicField(this, "activeGroupName", ref(""));
|
|
340
350
|
/**
|
|
341
351
|
* 上传之前
|
|
342
352
|
*/
|
|
343
|
-
__publicField(this, "doBeforeUpload", () => {
|
|
353
|
+
__publicField(this, "doBeforeUpload", (file) => {
|
|
344
354
|
return new Promise(async (resolve, reject) => {
|
|
345
355
|
let flag = true;
|
|
346
356
|
if (this.props.uploadQuantity > 0) {
|
|
@@ -354,10 +364,8 @@ let UploadFileInstance$1 = class UploadFileInstance extends BaseInstance {
|
|
|
354
364
|
flag = true;
|
|
355
365
|
}
|
|
356
366
|
if (flag) {
|
|
357
|
-
resolve(() => {
|
|
358
|
-
});
|
|
359
367
|
this.message.info("文件上传中,请稍等");
|
|
360
|
-
this.
|
|
368
|
+
this.multipartUpload(file);
|
|
361
369
|
} else {
|
|
362
370
|
reject();
|
|
363
371
|
}
|
|
@@ -552,8 +560,7 @@ let UploadFileInstance$1 = class UploadFileInstance extends BaseInstance {
|
|
|
552
560
|
* @param fileInfo
|
|
553
561
|
*/
|
|
554
562
|
__publicField(this, "doView", async (fileInfo, index = 0) => {
|
|
555
|
-
const
|
|
556
|
-
const result = this.utilities.parseApiResult(apiResult);
|
|
563
|
+
const result = this.fileList.value;
|
|
557
564
|
this.previewFileInfo = result[index];
|
|
558
565
|
this.previewVisible.value = true;
|
|
559
566
|
this.previewIndex.value = this.previewIndexData[fileInfo.Id];
|
|
@@ -605,7 +612,7 @@ let UploadFileInstance$1 = class UploadFileInstance extends BaseInstance {
|
|
|
605
612
|
*/
|
|
606
613
|
async loadFileList(isChange = false) {
|
|
607
614
|
this.uploading.value = true;
|
|
608
|
-
const apiResult = await this.fileInfoApi.getEntities(QueryWrapper.create().eq("Token", this.currentToken));
|
|
615
|
+
const apiResult = await this.fileInfoApi.getEntities(QueryWrapper.create().eq("Token", this.currentToken).orderBy(["CreateTime"], true));
|
|
609
616
|
this.fileList.value = this.utilities.parseApiResult(apiResult);
|
|
610
617
|
this.uploading.value = false;
|
|
611
618
|
if (isChange) {
|
|
@@ -613,6 +620,106 @@ let UploadFileInstance$1 = class UploadFileInstance extends BaseInstance {
|
|
|
613
620
|
}
|
|
614
621
|
this.setPreviewList();
|
|
615
622
|
}
|
|
623
|
+
/**
|
|
624
|
+
* 文件分片上传
|
|
625
|
+
* @param file
|
|
626
|
+
*/
|
|
627
|
+
async multipartUpload(file) {
|
|
628
|
+
let _this = this;
|
|
629
|
+
let fileName = file.name;
|
|
630
|
+
let temp1 = fileName.split(".");
|
|
631
|
+
let ext = temp1[temp1.length - 1];
|
|
632
|
+
let ossContentType = this.getOssContentType(fileName);
|
|
633
|
+
let fileMark = this.utilities.getCurrentDate("YYYYMMDDHHmmss") + "." + ext;
|
|
634
|
+
let ossClient = await new OSSFileApi().getOSSClient();
|
|
635
|
+
const userInfo = this.storageInfo.getUser();
|
|
636
|
+
const module = this.storageInfo.getCurrentModule();
|
|
637
|
+
const platform = this.storageInfo.getCurrentPlatform();
|
|
638
|
+
let moduleName = module ? module == null ? void 0 : module.ModuleAlias : "无模块";
|
|
639
|
+
let newFileName = `${(platform == null ? void 0 : platform.OssRootPath) + "/" + moduleName + "/"}${this.props.catalog}/${this.currentToken}/${fileMark}`;
|
|
640
|
+
const result = await ossClient.multipartUpload(newFileName, file, {
|
|
641
|
+
async progress(p) {
|
|
642
|
+
_this.uploadingPercent.value = (p * 100).toFixed(0);
|
|
643
|
+
},
|
|
644
|
+
mime: ossContentType
|
|
645
|
+
});
|
|
646
|
+
if (result.res.statusCode === 200) {
|
|
647
|
+
let fileInfo = {
|
|
648
|
+
"FileCabinetId": (module == null ? void 0 : module.Id) ? module == null ? void 0 : module.Id : 0,
|
|
649
|
+
"FileCabinePath": (platform == null ? void 0 : platform.OssRootPath) + "/" + moduleName + "/",
|
|
650
|
+
"Catalog": this.props.catalog,
|
|
651
|
+
"Token": this.currentToken,
|
|
652
|
+
"GroupName": this.activeGroupName.value,
|
|
653
|
+
"FileMark": fileMark,
|
|
654
|
+
"FileName": fileName,
|
|
655
|
+
"FileExt": ext,
|
|
656
|
+
"FileSize": file.size,
|
|
657
|
+
"ExtraInfo": this.props.extraInfo,
|
|
658
|
+
"CreateUserId": userInfo == null ? void 0 : userInfo.Id,
|
|
659
|
+
"CreateUserName": userInfo == null ? void 0 : userInfo.UserName,
|
|
660
|
+
"CreateTime": this.utilities.getCurrentDate(),
|
|
661
|
+
"Id": 0
|
|
662
|
+
};
|
|
663
|
+
await this.fileInfoApi.save(fileInfo);
|
|
664
|
+
this.message.success("上传成功!");
|
|
665
|
+
this.uploadingPercent.value = 100;
|
|
666
|
+
this.loadFileList(true);
|
|
667
|
+
} else {
|
|
668
|
+
this.message.error("网络出现异常,再次上传");
|
|
669
|
+
this.uploadingPercent.value = 0;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
getOssContentType(fileName) {
|
|
673
|
+
if (fileName.indexOf(".bmp") > -1) {
|
|
674
|
+
return "image/bmp";
|
|
675
|
+
}
|
|
676
|
+
if (fileName.indexOf(".gif") > -1) {
|
|
677
|
+
return "image/gif";
|
|
678
|
+
}
|
|
679
|
+
if (fileName.indexOf(".jpeg") > -1 || fileName.indexOf(".jpg") > -1 || fileName.indexOf(".png") > -1) {
|
|
680
|
+
return "image/jpg";
|
|
681
|
+
}
|
|
682
|
+
if (fileName.indexOf(".html") > -1) {
|
|
683
|
+
return "text/html";
|
|
684
|
+
}
|
|
685
|
+
if (fileName.indexOf(".txt") > -1) {
|
|
686
|
+
return "text/plain";
|
|
687
|
+
}
|
|
688
|
+
if (fileName.indexOf(".vsd") > -1) {
|
|
689
|
+
return "application/vnd.visio";
|
|
690
|
+
}
|
|
691
|
+
if (fileName.indexOf(".pptx") > -1 || fileName.indexOf(".ppt") > -1) {
|
|
692
|
+
return "application/vnd.ms-powerpoint";
|
|
693
|
+
}
|
|
694
|
+
if (fileName.indexOf(".docx") > -1 || fileName.indexOf(".doc") > -1) {
|
|
695
|
+
return "application/msword";
|
|
696
|
+
}
|
|
697
|
+
if (fileName.indexOf(".xls") > -1 || fileName.indexOf(".xlsx") > -1 || fileName.indexOf(".xla") > -1) {
|
|
698
|
+
return "application/vnd.ms-excel";
|
|
699
|
+
}
|
|
700
|
+
if (fileName.indexOf(".xml") > -1) {
|
|
701
|
+
return "text/xml";
|
|
702
|
+
}
|
|
703
|
+
if (fileName.indexOf(".pdf") > -1) {
|
|
704
|
+
return "application/pdf";
|
|
705
|
+
}
|
|
706
|
+
if (fileName.indexOf(".zip") > -1) {
|
|
707
|
+
return "application/zip";
|
|
708
|
+
}
|
|
709
|
+
if (fileName.indexOf(".tar") > -1) {
|
|
710
|
+
return "application/x-tar";
|
|
711
|
+
}
|
|
712
|
+
if (fileName.indexOf(".avi") > -1) {
|
|
713
|
+
return "video/avi";
|
|
714
|
+
}
|
|
715
|
+
if (fileName.indexOf(".mp4") > -1) {
|
|
716
|
+
return "video/mp4";
|
|
717
|
+
}
|
|
718
|
+
if (fileName.indexOf(".mp3") > -1) {
|
|
719
|
+
return "audio/mp3";
|
|
720
|
+
}
|
|
721
|
+
return "application/octet-stream";
|
|
722
|
+
}
|
|
616
723
|
// 私有方法 | private 方法名() {}
|
|
617
724
|
/**
|
|
618
725
|
* 设置预览列表
|
|
@@ -631,22 +738,29 @@ let UploadFileInstance$1 = class UploadFileInstance extends BaseInstance {
|
|
|
631
738
|
}
|
|
632
739
|
//#endregion 业务逻辑 文件预览 END
|
|
633
740
|
};
|
|
634
|
-
const
|
|
635
|
-
const _withScopeId$1 = (n) => (pushScopeId("data-v-
|
|
741
|
+
const UploadFile_vue_vue_type_style_index_0_scoped_6ac1e6fe_lang = "";
|
|
742
|
+
const _withScopeId$1 = (n) => (pushScopeId("data-v-6ac1e6fe"), n = n(), popScopeId(), n);
|
|
636
743
|
const _hoisted_1$3 = { class: "uploadFile uploadPage" };
|
|
637
|
-
const _hoisted_2$3 = ["
|
|
638
|
-
const _hoisted_3$3 =
|
|
639
|
-
const _hoisted_4$2 = { class: "file-upload-
|
|
744
|
+
const _hoisted_2$3 = ["title"];
|
|
745
|
+
const _hoisted_3$3 = ["onClick"];
|
|
746
|
+
const _hoisted_4$2 = { class: "file-upload-list-cover" };
|
|
640
747
|
const _hoisted_5$2 = {
|
|
641
|
-
key:
|
|
748
|
+
key: 0,
|
|
749
|
+
class: "file-upload-list-name nv-text-nowrap"
|
|
750
|
+
};
|
|
751
|
+
const _hoisted_6$2 = { class: "file-upload-loading" };
|
|
752
|
+
const _hoisted_7$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", null, "上传进度", -1));
|
|
753
|
+
const _hoisted_8$2 = ["onClick"];
|
|
754
|
+
const _hoisted_9$2 = {
|
|
755
|
+
key: 2,
|
|
642
756
|
class: "nv-flex",
|
|
643
757
|
style: { "color": "#949494", "border": "1px dashed #dcdee2", "height": "60px", "padding": "0 20px", "font-size": "16px", "justify-content": "center" }
|
|
644
758
|
};
|
|
645
|
-
const
|
|
759
|
+
const _hoisted_10$2 = {
|
|
646
760
|
class: "nv-flex",
|
|
647
761
|
style: { "width": "40px", "margin-right": "6px" }
|
|
648
762
|
};
|
|
649
|
-
const
|
|
763
|
+
const _hoisted_11$2 = {
|
|
650
764
|
t: "1706683071705",
|
|
651
765
|
class: "icon",
|
|
652
766
|
viewBox: "0 0 1566 1024",
|
|
@@ -655,19 +769,21 @@ const _hoisted_7$2 = {
|
|
|
655
769
|
"p-id": "4559",
|
|
656
770
|
style: { "fill": "currentColor" }
|
|
657
771
|
};
|
|
658
|
-
const
|
|
772
|
+
const _hoisted_12$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("path", {
|
|
659
773
|
d: "M156.661991 699.757959h21.096999a10.443999 10.443999 0 0 1 10.235999 10.443999c0 5.765-4.491 10.443999-10.235999 10.444h-21.096999v21.097999a10.443999 10.443999 0 0 1-10.444 10.234999 10.276999 10.276999 0 0 1-10.443999-10.234999v-21.097999h-21.096999a10.443999 10.443999 0 0 1-10.234999-10.444c0-5.765 4.49-10.443999 10.234999-10.443999h21.096999v-21.096999a10.443999 10.443999 0 0 1 10.443999-10.234999c5.765 0 10.443999 4.49 10.444 10.234999v21.096999z m1378.627919-83.552995v-21.096999a10.276999 10.276999 0 0 0-10.443999-10.234999 10.443999 10.443999 0 0 0-10.444 10.234999v21.096999h-21.096998a10.276999 10.276999 0 0 0-10.235 10.443999c0 5.598 4.595 10.443999 10.235 10.444h21.096998v21.096998c0 5.745 4.679 10.235999 10.444 10.236a10.443999 10.443999 0 0 0 10.443999-10.236v-21.096998h21.097999c5.744 0 10.234999-4.679 10.234999-10.444a10.443999 10.443999 0 0 0-10.234999-10.443999h-21.097999zM776.459955 960.861944H250.596985a20.804999 20.804999 0 0 1-20.825998-20.887999c0-11.529999 9.462999-20.888999 20.825998-20.888999h94.727995a83.009995 83.009995 0 0 1-11.112-41.671997v-605.969965a83.489995 83.489995 0 0 1 83.636996-83.447995h62.580996v-20.992999a83.489995 83.489995 0 0 1 83.636995-83.448995h501.151971a83.448995 83.448995 0 0 1 83.636995 83.448995v605.969965c0 15.184999-4.053 29.409998-11.134 41.671997h115.553994c11.551999 0 20.909999 9.273999 20.909998 20.887999 0 11.529999-9.295999 20.887999-20.888998 20.887999h-250.659986v20.992999c0 15.185999-4.052 29.409998-11.132999 41.671997h11.195999c11.488999 0 20.825999 9.274999 20.825999 20.888999 0 11.529999-9.462999 20.887999-20.825999 20.887999H892.807948a41.657998 41.657998 0 0 1-6.413 50.862997 41.671998 41.671998 0 0 1-59.071996 0l-50.862997-50.862997z m76.367995-41.776998h66.423996c22.977999 0 41.609998-18.589999 41.609998-41.879997V270.460984c0-22.559999-18.047999-40.689998-40.313998-40.689997H416.303976c-22.266999 0-40.314998 18.213999-40.314998 40.689997v606.741965c0 23.123999 18.799999 41.880998 41.589998 41.880997h317.083981l-10.736999-10.756999a41.692998 41.692998 0 0 1-10.862-40.376998l-19.718999-19.739999a146.259991 146.259991 0 0 1-190.980988-220.516987 146.217991 146.217991 0 0 1 220.517987 190.980989l19.738998 19.739999a41.629998 41.629998 0 0 1 40.376998 10.839999l69.829996 69.829996z m149.809991-104.440994h62.852997a41.796998 41.796998 0 0 0 41.589997-41.776997v-605.759965c0-23.144999-18.632999-41.776998-41.589997-41.776997H563.774967a41.796998 41.796998 0 0 0-41.566998 41.775997v20.888999h396.793977a83.448995 83.448995 0 0 1 83.636995 83.448995v543.199968zM266.326984 46.998997h31.122999c8.773999 0 15.875999 6.955 15.875999 15.665999 0 8.647999-7.102 15.665999-15.875999 15.665999h-31.122999v31.123999c0 8.772999-6.956 15.874999-15.665999 15.874999a15.769999 15.769999 0 0 1-15.666999-15.874999V78.329995H203.869988a15.728999 15.728999 0 0 1-15.874999-15.665999c0-8.647999 7.102-15.665999 15.874999-15.665999h31.122998V15.874999C234.992986 7.102 241.949986 0 250.659985 0c8.646999 0 15.665999 7.102 15.665999 15.874999V46.999997zM20.887999 939.973945c0-11.529999 9.462999-20.888999 20.825999-20.888999h125.454992c11.488999 0 20.825999 9.274999 20.825999 20.888999 0 11.529999-9.462999 20.887999-20.825999 20.887999H41.713998a20.804999 20.804999 0 0 1-20.825999-20.887999z m658.733961-135.021992A104.441994 104.441994 0 1 0 531.899969 657.229961a104.441994 104.441994 0 0 0 147.721991 147.721992z m-220.079987-491.626971a20.887999 20.887999 0 0 1 20.867999-20.888999h229.791986a20.887999 20.887999 0 1 1 0 41.776997H480.430972a20.825999 20.825999 0 0 1-20.887999-20.887998z m0 104.440994c0-11.529999 9.295999-20.887999 20.742999-20.887999H814.789952c11.446999 0 20.741999 9.273999 20.741999 20.887999 0 11.529999-9.294999 20.887999-20.741999 20.887998H480.284972a20.762999 20.762999 0 0 1-20.741999-20.887998z m0 104.441993c0-11.529999 9.316999-20.888999 20.846999-20.888998h146.301991c11.509999 0 20.845999 9.274999 20.845999 20.888998 0 11.529999-9.315999 20.887999-20.845999 20.887999H480.388972a20.804999 20.804999 0 0 1-20.845999-20.887999zM62.665996 396.877977a62.664996 62.664996 0 1 1 0-125.329993 62.664996 62.664996 0 0 1 0 125.329993z m0-31.332998a31.331998 31.331998 0 1 0 0-62.664997 31.331998 31.331998 0 0 0 0 62.664997z m1295.074924-93.996995a62.664996 62.664996 0 1 1 0-125.329993 62.664996 62.664996 0 0 1 0 125.329993z m0-31.332998a31.331998 31.331998 0 1 0 0-62.663996 31.331998 31.331998 0 0 0 0 62.663996z",
|
|
660
774
|
"p-id": "4560"
|
|
661
775
|
}, null, -1));
|
|
662
|
-
const
|
|
663
|
-
|
|
776
|
+
const _hoisted_13$1 = [
|
|
777
|
+
_hoisted_12$2
|
|
664
778
|
];
|
|
665
|
-
const
|
|
666
|
-
const
|
|
779
|
+
const _hoisted_14$1 = { class: "file-upload-list-cover" };
|
|
780
|
+
const _hoisted_15$1 = { class: "file-upload-loading" };
|
|
781
|
+
const _hoisted_16$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", null, "上传进度", -1));
|
|
667
782
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
668
783
|
const _component_Image = resolveComponent("Image");
|
|
669
784
|
const _component_Icon = resolveComponent("Icon");
|
|
670
785
|
const _component_Space = resolveComponent("Space");
|
|
786
|
+
const _component_Circle = resolveComponent("Circle");
|
|
671
787
|
const _component_Upload = resolveComponent("Upload");
|
|
672
788
|
const _component_Card = resolveComponent("Card");
|
|
673
789
|
const _component_Spin = resolveComponent("Spin");
|
|
@@ -681,14 +797,12 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
681
797
|
default: withCtx(() => [
|
|
682
798
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.getGroupFiles(groupName), (item, index) => {
|
|
683
799
|
return openBlock(), createElementBlock("div", {
|
|
684
|
-
class:
|
|
685
|
-
|
|
686
|
-
)
|
|
800
|
+
class: "file-upload-list",
|
|
801
|
+
title: item.FileName
|
|
687
802
|
}, [
|
|
688
803
|
createElementVNode("div", {
|
|
689
|
-
class: "file-upload-list-content",
|
|
690
|
-
onClick: ($event) => _ctx.doView(item, index)
|
|
691
|
-
title: item.FileName
|
|
804
|
+
class: normalizeClass(["file-upload-list-content", { "file-upload-list-bs": _ctx.isImage(item) }]),
|
|
805
|
+
onClick: ($event) => _ctx.doView(item, index)
|
|
692
806
|
}, [
|
|
693
807
|
createVNode(_component_Image, {
|
|
694
808
|
src: _ctx.getThumbnailUrl(item),
|
|
@@ -697,7 +811,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
697
811
|
width: "100%",
|
|
698
812
|
height: "100%"
|
|
699
813
|
}, null, 8, ["src"]),
|
|
700
|
-
createElementVNode("div",
|
|
814
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
701
815
|
createVNode(_component_Space, null, {
|
|
702
816
|
default: withCtx(() => [
|
|
703
817
|
createVNode(_component_Icon, {
|
|
@@ -715,41 +829,59 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
715
829
|
_: 2
|
|
716
830
|
}, 1024)
|
|
717
831
|
])
|
|
718
|
-
],
|
|
719
|
-
|
|
832
|
+
], 10, _hoisted_3$3),
|
|
833
|
+
_ctx.isShowFileName ? (openBlock(), createElementBlock("div", _hoisted_5$2, toDisplayString(item.FileName), 1)) : createCommentVNode("", true)
|
|
834
|
+
], 8, _hoisted_2$3);
|
|
720
835
|
}), 256)),
|
|
721
|
-
|
|
836
|
+
_ctx.uploadingPercent > 0 && _ctx.uploadingPercent < 100 ? (openBlock(), createBlock(_component_Circle, {
|
|
722
837
|
key: 0,
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
name: "FormFile",
|
|
727
|
-
multiple: _ctx.multiple,
|
|
728
|
-
"show-upload-list": false,
|
|
729
|
-
format: _ctx.format,
|
|
730
|
-
"max-size": _ctx.maxSize,
|
|
731
|
-
action: _ctx.action,
|
|
732
|
-
headers: _ctx.headers,
|
|
733
|
-
data: _ctx.uploadFilePos[groupName],
|
|
734
|
-
"on-success": _ctx.doSuccess,
|
|
735
|
-
"on-format-error": _ctx.doFormatError,
|
|
736
|
-
"on-exceeded-size": _ctx.doMaxSize,
|
|
737
|
-
"before-upload": _ctx.doBeforeUpload,
|
|
738
|
-
style: { "display": "inline-block", "width": "78px" }
|
|
838
|
+
size: "78",
|
|
839
|
+
percent: _ctx.uploadingPercent,
|
|
840
|
+
"stroke-color": ["#108ee9", "#87d068"]
|
|
739
841
|
}, {
|
|
740
842
|
default: withCtx(() => [
|
|
741
|
-
createElementVNode("div",
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
size: "20"
|
|
745
|
-
})
|
|
843
|
+
createElementVNode("div", _hoisted_6$2, [
|
|
844
|
+
createElementVNode("div", null, toDisplayString(_ctx.uploadingPercent) + "%", 1),
|
|
845
|
+
_hoisted_7$2
|
|
746
846
|
])
|
|
747
847
|
]),
|
|
748
|
-
_:
|
|
749
|
-
},
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
848
|
+
_: 1
|
|
849
|
+
}, 8, ["percent"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
850
|
+
!_ctx.readonly ? (openBlock(), createBlock(_component_Upload, {
|
|
851
|
+
key: 0,
|
|
852
|
+
ref_for: true,
|
|
853
|
+
ref: "uploadRef",
|
|
854
|
+
type: "drag",
|
|
855
|
+
name: "FormFile",
|
|
856
|
+
multiple: _ctx.multiple,
|
|
857
|
+
"show-upload-list": false,
|
|
858
|
+
format: _ctx.format,
|
|
859
|
+
"max-size": _ctx.maxSize,
|
|
860
|
+
headers: _ctx.headers,
|
|
861
|
+
data: _ctx.uploadFilePos[groupName],
|
|
862
|
+
"on-success": _ctx.doSuccess,
|
|
863
|
+
"on-format-error": _ctx.doFormatError,
|
|
864
|
+
"on-exceeded-size": _ctx.doMaxSize,
|
|
865
|
+
"before-upload": _ctx.doBeforeUpload,
|
|
866
|
+
style: { "display": "inline-block", "width": "78px" }
|
|
867
|
+
}, {
|
|
868
|
+
default: withCtx(() => [
|
|
869
|
+
createElementVNode("div", {
|
|
870
|
+
class: "file-upload-btn",
|
|
871
|
+
onClick: ($event) => _ctx.activeGroupName = groupName
|
|
872
|
+
}, [
|
|
873
|
+
createVNode(_component_Icon, {
|
|
874
|
+
type: "ios-camera",
|
|
875
|
+
size: "20"
|
|
876
|
+
})
|
|
877
|
+
], 8, _hoisted_8$2)
|
|
878
|
+
]),
|
|
879
|
+
_: 2
|
|
880
|
+
}, 1032, ["multiple", "format", "max-size", "headers", "data", "on-success", "on-format-error", "on-exceeded-size", "before-upload"])) : createCommentVNode("", true)
|
|
881
|
+
], 64)),
|
|
882
|
+
_ctx.readonly && _ctx.fileList.length == 0 ? (openBlock(), createElementBlock("div", _hoisted_9$2, [
|
|
883
|
+
createElementVNode("i", _hoisted_10$2, [
|
|
884
|
+
(openBlock(), createElementBlock("svg", _hoisted_11$2, _hoisted_13$1))
|
|
753
885
|
]),
|
|
754
886
|
createElementVNode("div", null, toDisplayString(_ctx.nullMsg), 1)
|
|
755
887
|
])) : createCommentVNode("", true)
|
|
@@ -777,7 +909,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
777
909
|
width: "100%",
|
|
778
910
|
height: "100%"
|
|
779
911
|
}, null, 8, ["src"]),
|
|
780
|
-
createElementVNode("div",
|
|
912
|
+
createElementVNode("div", _hoisted_14$1, [
|
|
781
913
|
createVNode(_component_Space, null, {
|
|
782
914
|
default: withCtx(() => [
|
|
783
915
|
createVNode(_component_Icon, {
|
|
@@ -802,7 +934,21 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
802
934
|
style: { "margin-bottom": "8px" }
|
|
803
935
|
}, {
|
|
804
936
|
default: withCtx(() => [
|
|
805
|
-
|
|
937
|
+
_ctx.uploadingPercent > 0 && _ctx.uploadingPercent < 100 ? (openBlock(), createBlock(_component_Circle, {
|
|
938
|
+
key: 0,
|
|
939
|
+
size: "78",
|
|
940
|
+
percent: _ctx.uploadingPercent,
|
|
941
|
+
"stroke-color": ["#108ee9", "#87d068"]
|
|
942
|
+
}, {
|
|
943
|
+
default: withCtx(() => [
|
|
944
|
+
createElementVNode("div", _hoisted_15$1, [
|
|
945
|
+
createElementVNode("div", null, toDisplayString(_ctx.uploadingPercent) + "%", 1),
|
|
946
|
+
_hoisted_16$1
|
|
947
|
+
])
|
|
948
|
+
]),
|
|
949
|
+
_: 1
|
|
950
|
+
}, 8, ["percent"])) : (openBlock(), createBlock(_component_Upload, {
|
|
951
|
+
key: 1,
|
|
806
952
|
ref: "uploadRef",
|
|
807
953
|
type: "drag",
|
|
808
954
|
name: "FormFile",
|
|
@@ -820,7 +966,10 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
820
966
|
style: { "display": "inline-block", "width": "78px" }
|
|
821
967
|
}, {
|
|
822
968
|
default: withCtx(() => [
|
|
823
|
-
createElementVNode("div",
|
|
969
|
+
createElementVNode("div", {
|
|
970
|
+
class: "file-upload-btn",
|
|
971
|
+
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.activeGroupName = _ctx.groups[0])
|
|
972
|
+
}, [
|
|
824
973
|
createVNode(_component_Icon, {
|
|
825
974
|
type: "ios-camera",
|
|
826
975
|
size: "20"
|
|
@@ -828,7 +977,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
828
977
|
])
|
|
829
978
|
]),
|
|
830
979
|
_: 1
|
|
831
|
-
}, 8, ["multiple", "format", "max-size", "action", "headers", "data", "on-success", "on-format-error", "on-exceeded-size", "before-upload"])
|
|
980
|
+
}, 8, ["multiple", "format", "max-size", "action", "headers", "data", "on-success", "on-format-error", "on-exceeded-size", "before-upload"]))
|
|
832
981
|
]),
|
|
833
982
|
_: 1
|
|
834
983
|
})) : createCommentVNode("", true)
|
|
@@ -840,14 +989,14 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
840
989
|
})) : createCommentVNode("", true),
|
|
841
990
|
createVNode(_component_filePreview, {
|
|
842
991
|
modelValue: _ctx.previewVisible,
|
|
843
|
-
"onUpdate:modelValue": _cache[
|
|
992
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => _ctx.previewVisible = $event),
|
|
844
993
|
"preview-list": _ctx.previewList,
|
|
845
994
|
"preview-index": _ctx.previewIndex,
|
|
846
995
|
"file-info": _ctx.previewFileInfo
|
|
847
996
|
}, null, 8, ["modelValue", "preview-list", "preview-index", "file-info"])
|
|
848
997
|
]);
|
|
849
998
|
}
|
|
850
|
-
const UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-
|
|
999
|
+
const UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-6ac1e6fe"]]);
|
|
851
1000
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
852
1001
|
function getDefaultExportFromCjs(x) {
|
|
853
1002
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -19823,9 +19972,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19823
19972
|
readonly: _ctx.getPropValue(item.uploadFileProp, "readonly") || _ctx.onlyView,
|
|
19824
19973
|
token: _ctx.formModel[item.model],
|
|
19825
19974
|
multiple: _ctx.getPropValue(item.uploadFileProp, "multiple"),
|
|
19975
|
+
isShowFileName: _ctx.getPropValue(item.uploadFileProp, "isShowFileName"),
|
|
19826
19976
|
uploadQuantity: _ctx.getPropValue(item.uploadFileProp, "uploadQuantity", 0),
|
|
19827
19977
|
onReturnFileList: ($event) => _ctx.tokenList($event, item)
|
|
19828
|
-
}, null, 8, ["readonly", "token", "multiple", "uploadQuantity", "onReturnFileList"])) : createCommentVNode("", true),
|
|
19978
|
+
}, null, 8, ["readonly", "token", "multiple", "isShowFileName", "uploadQuantity", "onReturnFileList"])) : createCommentVNode("", true),
|
|
19829
19979
|
item.type === "TextEditor" ? (openBlock(), createBlock(_component_TextEditor, {
|
|
19830
19980
|
key: 1,
|
|
19831
19981
|
ref: "textEditorRef",
|