@newview/file-ui 1.1.37 → 1.1.39
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 +224 -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,116 @@ 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 business = this.storageInfo.getCurrentBusiness();
|
|
637
|
+
const module = this.storageInfo.getCurrentModule();
|
|
638
|
+
const platform = this.storageInfo.getCurrentPlatform();
|
|
639
|
+
let businessName = business ? business == null ? void 0 : business.ModuleAlias : "非业务";
|
|
640
|
+
let moduleName = module ? module == null ? void 0 : module.ModuleAlias : "非业务";
|
|
641
|
+
let moduleName2 = businessName + "/" + moduleName;
|
|
642
|
+
let FileCabinePath = (platform == null ? void 0 : platform.OssRootPath) + "/" + moduleName2 + "/";
|
|
643
|
+
let newFileName = `${FileCabinePath}${this.props.catalog}/${this.currentToken}/${fileMark}`;
|
|
644
|
+
const result = await ossClient.multipartUpload(newFileName, file, {
|
|
645
|
+
async progress(p) {
|
|
646
|
+
_this.uploadingPercent.value = (p * 100).toFixed(0);
|
|
647
|
+
},
|
|
648
|
+
mime: ossContentType
|
|
649
|
+
});
|
|
650
|
+
if (result.res.statusCode === 200) {
|
|
651
|
+
let fileInfo = {
|
|
652
|
+
"FileCabinetId": (module == null ? void 0 : module.Id) ? module == null ? void 0 : module.Id : 0,
|
|
653
|
+
"FileCabinePath": FileCabinePath,
|
|
654
|
+
"Catalog": this.props.catalog,
|
|
655
|
+
"Token": this.currentToken,
|
|
656
|
+
"GroupName": this.activeGroupName.value,
|
|
657
|
+
"FileMark": fileMark,
|
|
658
|
+
"FileName": fileName,
|
|
659
|
+
"FileExt": ext,
|
|
660
|
+
"FileSize": file.size,
|
|
661
|
+
"ExtraInfo": this.props.extraInfo,
|
|
662
|
+
"CreateUserId": userInfo == null ? void 0 : userInfo.Id,
|
|
663
|
+
"CreateUserName": userInfo == null ? void 0 : userInfo.UserName,
|
|
664
|
+
"CreateTime": this.utilities.getCurrentDate(),
|
|
665
|
+
"Id": 0
|
|
666
|
+
};
|
|
667
|
+
let infoSaveRes = this.utilities.parseApiResult(await this.fileInfoApi.save(fileInfo));
|
|
668
|
+
if (infoSaveRes) {
|
|
669
|
+
this.message.success("上传成功!");
|
|
670
|
+
this.ctx.emit("success", { token: this.currentToken, fileId: infoSaveRes });
|
|
671
|
+
this.loadFileList(true);
|
|
672
|
+
this.uploadingPercent.value = 100;
|
|
673
|
+
} else {
|
|
674
|
+
this.message.error("网络出现异常,再次上传");
|
|
675
|
+
this.uploadingPercent.value = 0;
|
|
676
|
+
}
|
|
677
|
+
} else {
|
|
678
|
+
this.message.error("网络出现异常,再次上传");
|
|
679
|
+
this.uploadingPercent.value = 0;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
getOssContentType(fileName) {
|
|
683
|
+
if (fileName.indexOf(".bmp") > -1) {
|
|
684
|
+
return "image/bmp";
|
|
685
|
+
}
|
|
686
|
+
if (fileName.indexOf(".gif") > -1) {
|
|
687
|
+
return "image/gif";
|
|
688
|
+
}
|
|
689
|
+
if (fileName.indexOf(".jpeg") > -1 || fileName.indexOf(".jpg") > -1 || fileName.indexOf(".png") > -1) {
|
|
690
|
+
return "image/jpg";
|
|
691
|
+
}
|
|
692
|
+
if (fileName.indexOf(".html") > -1) {
|
|
693
|
+
return "text/html";
|
|
694
|
+
}
|
|
695
|
+
if (fileName.indexOf(".txt") > -1) {
|
|
696
|
+
return "text/plain";
|
|
697
|
+
}
|
|
698
|
+
if (fileName.indexOf(".vsd") > -1) {
|
|
699
|
+
return "application/vnd.visio";
|
|
700
|
+
}
|
|
701
|
+
if (fileName.indexOf(".pptx") > -1 || fileName.indexOf(".ppt") > -1) {
|
|
702
|
+
return "application/vnd.ms-powerpoint";
|
|
703
|
+
}
|
|
704
|
+
if (fileName.indexOf(".docx") > -1 || fileName.indexOf(".doc") > -1) {
|
|
705
|
+
return "application/msword";
|
|
706
|
+
}
|
|
707
|
+
if (fileName.indexOf(".xls") > -1 || fileName.indexOf(".xlsx") > -1 || fileName.indexOf(".xla") > -1) {
|
|
708
|
+
return "application/vnd.ms-excel";
|
|
709
|
+
}
|
|
710
|
+
if (fileName.indexOf(".xml") > -1) {
|
|
711
|
+
return "text/xml";
|
|
712
|
+
}
|
|
713
|
+
if (fileName.indexOf(".pdf") > -1) {
|
|
714
|
+
return "application/pdf";
|
|
715
|
+
}
|
|
716
|
+
if (fileName.indexOf(".zip") > -1) {
|
|
717
|
+
return "application/zip";
|
|
718
|
+
}
|
|
719
|
+
if (fileName.indexOf(".tar") > -1) {
|
|
720
|
+
return "application/x-tar";
|
|
721
|
+
}
|
|
722
|
+
if (fileName.indexOf(".avi") > -1) {
|
|
723
|
+
return "video/avi";
|
|
724
|
+
}
|
|
725
|
+
if (fileName.indexOf(".mp4") > -1) {
|
|
726
|
+
return "video/mp4";
|
|
727
|
+
}
|
|
728
|
+
if (fileName.indexOf(".mp3") > -1) {
|
|
729
|
+
return "audio/mp3";
|
|
730
|
+
}
|
|
731
|
+
return "application/octet-stream";
|
|
732
|
+
}
|
|
616
733
|
// 私有方法 | private 方法名() {}
|
|
617
734
|
/**
|
|
618
735
|
* 设置预览列表
|
|
@@ -631,22 +748,29 @@ let UploadFileInstance$1 = class UploadFileInstance extends BaseInstance {
|
|
|
631
748
|
}
|
|
632
749
|
//#endregion 业务逻辑 文件预览 END
|
|
633
750
|
};
|
|
634
|
-
const
|
|
635
|
-
const _withScopeId$1 = (n) => (pushScopeId("data-v-
|
|
751
|
+
const UploadFile_vue_vue_type_style_index_0_scoped_6ac1e6fe_lang = "";
|
|
752
|
+
const _withScopeId$1 = (n) => (pushScopeId("data-v-6ac1e6fe"), n = n(), popScopeId(), n);
|
|
636
753
|
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-
|
|
754
|
+
const _hoisted_2$3 = ["title"];
|
|
755
|
+
const _hoisted_3$3 = ["onClick"];
|
|
756
|
+
const _hoisted_4$2 = { class: "file-upload-list-cover" };
|
|
640
757
|
const _hoisted_5$2 = {
|
|
641
|
-
key:
|
|
758
|
+
key: 0,
|
|
759
|
+
class: "file-upload-list-name nv-text-nowrap"
|
|
760
|
+
};
|
|
761
|
+
const _hoisted_6$2 = { class: "file-upload-loading" };
|
|
762
|
+
const _hoisted_7$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", null, "上传进度", -1));
|
|
763
|
+
const _hoisted_8$2 = ["onClick"];
|
|
764
|
+
const _hoisted_9$2 = {
|
|
765
|
+
key: 2,
|
|
642
766
|
class: "nv-flex",
|
|
643
767
|
style: { "color": "#949494", "border": "1px dashed #dcdee2", "height": "60px", "padding": "0 20px", "font-size": "16px", "justify-content": "center" }
|
|
644
768
|
};
|
|
645
|
-
const
|
|
769
|
+
const _hoisted_10$2 = {
|
|
646
770
|
class: "nv-flex",
|
|
647
771
|
style: { "width": "40px", "margin-right": "6px" }
|
|
648
772
|
};
|
|
649
|
-
const
|
|
773
|
+
const _hoisted_11$2 = {
|
|
650
774
|
t: "1706683071705",
|
|
651
775
|
class: "icon",
|
|
652
776
|
viewBox: "0 0 1566 1024",
|
|
@@ -655,19 +779,21 @@ const _hoisted_7$2 = {
|
|
|
655
779
|
"p-id": "4559",
|
|
656
780
|
style: { "fill": "currentColor" }
|
|
657
781
|
};
|
|
658
|
-
const
|
|
782
|
+
const _hoisted_12$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("path", {
|
|
659
783
|
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
784
|
"p-id": "4560"
|
|
661
785
|
}, null, -1));
|
|
662
|
-
const
|
|
663
|
-
|
|
786
|
+
const _hoisted_13$1 = [
|
|
787
|
+
_hoisted_12$2
|
|
664
788
|
];
|
|
665
|
-
const
|
|
666
|
-
const
|
|
789
|
+
const _hoisted_14$1 = { class: "file-upload-list-cover" };
|
|
790
|
+
const _hoisted_15$1 = { class: "file-upload-loading" };
|
|
791
|
+
const _hoisted_16$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", null, "上传进度", -1));
|
|
667
792
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
668
793
|
const _component_Image = resolveComponent("Image");
|
|
669
794
|
const _component_Icon = resolveComponent("Icon");
|
|
670
795
|
const _component_Space = resolveComponent("Space");
|
|
796
|
+
const _component_Circle = resolveComponent("Circle");
|
|
671
797
|
const _component_Upload = resolveComponent("Upload");
|
|
672
798
|
const _component_Card = resolveComponent("Card");
|
|
673
799
|
const _component_Spin = resolveComponent("Spin");
|
|
@@ -681,14 +807,12 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
681
807
|
default: withCtx(() => [
|
|
682
808
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.getGroupFiles(groupName), (item, index) => {
|
|
683
809
|
return openBlock(), createElementBlock("div", {
|
|
684
|
-
class:
|
|
685
|
-
|
|
686
|
-
)
|
|
810
|
+
class: "file-upload-list",
|
|
811
|
+
title: item.FileName
|
|
687
812
|
}, [
|
|
688
813
|
createElementVNode("div", {
|
|
689
|
-
class: "file-upload-list-content",
|
|
690
|
-
onClick: ($event) => _ctx.doView(item, index)
|
|
691
|
-
title: item.FileName
|
|
814
|
+
class: normalizeClass(["file-upload-list-content", { "file-upload-list-bs": _ctx.isImage(item) }]),
|
|
815
|
+
onClick: ($event) => _ctx.doView(item, index)
|
|
692
816
|
}, [
|
|
693
817
|
createVNode(_component_Image, {
|
|
694
818
|
src: _ctx.getThumbnailUrl(item),
|
|
@@ -697,7 +821,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
697
821
|
width: "100%",
|
|
698
822
|
height: "100%"
|
|
699
823
|
}, null, 8, ["src"]),
|
|
700
|
-
createElementVNode("div",
|
|
824
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
701
825
|
createVNode(_component_Space, null, {
|
|
702
826
|
default: withCtx(() => [
|
|
703
827
|
createVNode(_component_Icon, {
|
|
@@ -715,41 +839,59 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
715
839
|
_: 2
|
|
716
840
|
}, 1024)
|
|
717
841
|
])
|
|
718
|
-
],
|
|
719
|
-
|
|
842
|
+
], 10, _hoisted_3$3),
|
|
843
|
+
_ctx.isShowFileName ? (openBlock(), createElementBlock("div", _hoisted_5$2, toDisplayString(item.FileName), 1)) : createCommentVNode("", true)
|
|
844
|
+
], 8, _hoisted_2$3);
|
|
720
845
|
}), 256)),
|
|
721
|
-
|
|
846
|
+
_ctx.uploadingPercent > 0 && _ctx.uploadingPercent < 100 ? (openBlock(), createBlock(_component_Circle, {
|
|
722
847
|
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" }
|
|
848
|
+
size: "78",
|
|
849
|
+
percent: _ctx.uploadingPercent,
|
|
850
|
+
"stroke-color": ["#108ee9", "#87d068"]
|
|
739
851
|
}, {
|
|
740
852
|
default: withCtx(() => [
|
|
741
|
-
createElementVNode("div",
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
size: "20"
|
|
745
|
-
})
|
|
853
|
+
createElementVNode("div", _hoisted_6$2, [
|
|
854
|
+
createElementVNode("div", null, toDisplayString(_ctx.uploadingPercent) + "%", 1),
|
|
855
|
+
_hoisted_7$2
|
|
746
856
|
])
|
|
747
857
|
]),
|
|
748
|
-
_:
|
|
749
|
-
},
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
858
|
+
_: 1
|
|
859
|
+
}, 8, ["percent"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
860
|
+
!_ctx.readonly ? (openBlock(), createBlock(_component_Upload, {
|
|
861
|
+
key: 0,
|
|
862
|
+
ref_for: true,
|
|
863
|
+
ref: "uploadRef",
|
|
864
|
+
type: "drag",
|
|
865
|
+
name: "FormFile",
|
|
866
|
+
multiple: _ctx.multiple,
|
|
867
|
+
"show-upload-list": false,
|
|
868
|
+
format: _ctx.format,
|
|
869
|
+
"max-size": _ctx.maxSize,
|
|
870
|
+
headers: _ctx.headers,
|
|
871
|
+
data: _ctx.uploadFilePos[groupName],
|
|
872
|
+
"on-success": _ctx.doSuccess,
|
|
873
|
+
"on-format-error": _ctx.doFormatError,
|
|
874
|
+
"on-exceeded-size": _ctx.doMaxSize,
|
|
875
|
+
"before-upload": _ctx.doBeforeUpload,
|
|
876
|
+
style: { "display": "inline-block", "width": "78px" }
|
|
877
|
+
}, {
|
|
878
|
+
default: withCtx(() => [
|
|
879
|
+
createElementVNode("div", {
|
|
880
|
+
class: "file-upload-btn",
|
|
881
|
+
onClick: ($event) => _ctx.activeGroupName = groupName
|
|
882
|
+
}, [
|
|
883
|
+
createVNode(_component_Icon, {
|
|
884
|
+
type: "ios-camera",
|
|
885
|
+
size: "20"
|
|
886
|
+
})
|
|
887
|
+
], 8, _hoisted_8$2)
|
|
888
|
+
]),
|
|
889
|
+
_: 2
|
|
890
|
+
}, 1032, ["multiple", "format", "max-size", "headers", "data", "on-success", "on-format-error", "on-exceeded-size", "before-upload"])) : createCommentVNode("", true)
|
|
891
|
+
], 64)),
|
|
892
|
+
_ctx.readonly && _ctx.fileList.length == 0 ? (openBlock(), createElementBlock("div", _hoisted_9$2, [
|
|
893
|
+
createElementVNode("i", _hoisted_10$2, [
|
|
894
|
+
(openBlock(), createElementBlock("svg", _hoisted_11$2, _hoisted_13$1))
|
|
753
895
|
]),
|
|
754
896
|
createElementVNode("div", null, toDisplayString(_ctx.nullMsg), 1)
|
|
755
897
|
])) : createCommentVNode("", true)
|
|
@@ -777,7 +919,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
777
919
|
width: "100%",
|
|
778
920
|
height: "100%"
|
|
779
921
|
}, null, 8, ["src"]),
|
|
780
|
-
createElementVNode("div",
|
|
922
|
+
createElementVNode("div", _hoisted_14$1, [
|
|
781
923
|
createVNode(_component_Space, null, {
|
|
782
924
|
default: withCtx(() => [
|
|
783
925
|
createVNode(_component_Icon, {
|
|
@@ -802,7 +944,21 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
802
944
|
style: { "margin-bottom": "8px" }
|
|
803
945
|
}, {
|
|
804
946
|
default: withCtx(() => [
|
|
805
|
-
|
|
947
|
+
_ctx.uploadingPercent > 0 && _ctx.uploadingPercent < 100 ? (openBlock(), createBlock(_component_Circle, {
|
|
948
|
+
key: 0,
|
|
949
|
+
size: "78",
|
|
950
|
+
percent: _ctx.uploadingPercent,
|
|
951
|
+
"stroke-color": ["#108ee9", "#87d068"]
|
|
952
|
+
}, {
|
|
953
|
+
default: withCtx(() => [
|
|
954
|
+
createElementVNode("div", _hoisted_15$1, [
|
|
955
|
+
createElementVNode("div", null, toDisplayString(_ctx.uploadingPercent) + "%", 1),
|
|
956
|
+
_hoisted_16$1
|
|
957
|
+
])
|
|
958
|
+
]),
|
|
959
|
+
_: 1
|
|
960
|
+
}, 8, ["percent"])) : (openBlock(), createBlock(_component_Upload, {
|
|
961
|
+
key: 1,
|
|
806
962
|
ref: "uploadRef",
|
|
807
963
|
type: "drag",
|
|
808
964
|
name: "FormFile",
|
|
@@ -820,7 +976,10 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
820
976
|
style: { "display": "inline-block", "width": "78px" }
|
|
821
977
|
}, {
|
|
822
978
|
default: withCtx(() => [
|
|
823
|
-
createElementVNode("div",
|
|
979
|
+
createElementVNode("div", {
|
|
980
|
+
class: "file-upload-btn",
|
|
981
|
+
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.activeGroupName = _ctx.groups[0])
|
|
982
|
+
}, [
|
|
824
983
|
createVNode(_component_Icon, {
|
|
825
984
|
type: "ios-camera",
|
|
826
985
|
size: "20"
|
|
@@ -828,7 +987,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
828
987
|
])
|
|
829
988
|
]),
|
|
830
989
|
_: 1
|
|
831
|
-
}, 8, ["multiple", "format", "max-size", "action", "headers", "data", "on-success", "on-format-error", "on-exceeded-size", "before-upload"])
|
|
990
|
+
}, 8, ["multiple", "format", "max-size", "action", "headers", "data", "on-success", "on-format-error", "on-exceeded-size", "before-upload"]))
|
|
832
991
|
]),
|
|
833
992
|
_: 1
|
|
834
993
|
})) : createCommentVNode("", true)
|
|
@@ -840,14 +999,14 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
840
999
|
})) : createCommentVNode("", true),
|
|
841
1000
|
createVNode(_component_filePreview, {
|
|
842
1001
|
modelValue: _ctx.previewVisible,
|
|
843
|
-
"onUpdate:modelValue": _cache[
|
|
1002
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => _ctx.previewVisible = $event),
|
|
844
1003
|
"preview-list": _ctx.previewList,
|
|
845
1004
|
"preview-index": _ctx.previewIndex,
|
|
846
1005
|
"file-info": _ctx.previewFileInfo
|
|
847
1006
|
}, null, 8, ["modelValue", "preview-list", "preview-index", "file-info"])
|
|
848
1007
|
]);
|
|
849
1008
|
}
|
|
850
|
-
const UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-
|
|
1009
|
+
const UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-6ac1e6fe"]]);
|
|
851
1010
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
852
1011
|
function getDefaultExportFromCjs(x) {
|
|
853
1012
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -19823,9 +19982,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19823
19982
|
readonly: _ctx.getPropValue(item.uploadFileProp, "readonly") || _ctx.onlyView,
|
|
19824
19983
|
token: _ctx.formModel[item.model],
|
|
19825
19984
|
multiple: _ctx.getPropValue(item.uploadFileProp, "multiple"),
|
|
19985
|
+
isShowFileName: _ctx.getPropValue(item.uploadFileProp, "isShowFileName"),
|
|
19826
19986
|
uploadQuantity: _ctx.getPropValue(item.uploadFileProp, "uploadQuantity", 0),
|
|
19827
19987
|
onReturnFileList: ($event) => _ctx.tokenList($event, item)
|
|
19828
|
-
}, null, 8, ["readonly", "token", "multiple", "uploadQuantity", "onReturnFileList"])) : createCommentVNode("", true),
|
|
19988
|
+
}, null, 8, ["readonly", "token", "multiple", "isShowFileName", "uploadQuantity", "onReturnFileList"])) : createCommentVNode("", true),
|
|
19829
19989
|
item.type === "TextEditor" ? (openBlock(), createBlock(_component_TextEditor, {
|
|
19830
19990
|
key: 1,
|
|
19831
19991
|
ref: "textEditorRef",
|