lex 2 years ago
parent
commit
4406f7630d

+ 13 - 1
src/components/VueFormMaking/components/Upload/file.vue

@@ -5,6 +5,7 @@
       :on-success="handleSuccess"
       :on-preview="handlePreview"
       :on-remove="handleRemove"
+      :before-upload="beforeUploadFile"
       :before-remove="beforeRemove"
       multiple
       :limit="element.options.length"
@@ -53,8 +54,19 @@ export default {
         `最多允许上传 ${this.element.options.length} 个文件。`
       );
     },
+    async beforeUploadFile(file) {
+      return new Promise((resolve, reject) => {
+        const isLt2M = file.size / 1024 / 1024 < 20;
+        if (!isLt2M) {
+          this.$message.error("上传附件大小不能超过 20MB!");
+          return reject(false);
+        } else {
+          return resolve(true);
+        }
+      });
+    },
     beforeRemove(file, fileList) {
-      return this.$confirm(`确定要移除 ${file.name}?`);
+      // return this.$confirm(`确定要移除 ${file.name}?`);
     },
     handleSuccess(response, file, fileList) {
       console.log(response, file, fileList);

+ 4 - 4
src/components/VueFormMaking/components/Upload/index.vue

@@ -43,15 +43,14 @@
             :style="{ 'font-size': miniWidth / 8 + 'px' }"
             @click="handlePreviewFile(item.key)"
           />
-          <i
+          <!-- <i
             v-if="isEdit"
             class="iconfont icon-sync1"
             :title="$t('fm.upload.edit')"
             :style="{ 'font-size': miniWidth / 8 + 'px' }"
             @click="handleEdit(item.key)"
-          />
+          /> -->
           <i
-            v-if="isDelete && fileList.length > min"
             class="iconfont icon-delete"
             :title="$t('fm.upload.delete')"
             :style="{ 'font-size': miniWidth / 8 + 'px' }"
@@ -169,7 +168,7 @@ export default {
     },
     isDelete: {
       type: Boolean,
-      default: false
+      default: true
     },
     min: {
       type: Number,
@@ -251,6 +250,7 @@ export default {
       const isLt2M = file.size / 1024 / 1024 < 5;
       if (!isLt2M) {
         this.$message.error("上传图片大小不能超过 5MB!");
+        return;
       }
       try {
         let filename = file.name.replaceAll(" ", "_");

+ 2 - 2
src/views/process/list/model/upload.vue

@@ -145,9 +145,9 @@ export default {
       }
     },
     async beforeUploadFile(file) {
-      const isLt2M = file.size / 1024 / 1024 < 5;
+      const isLt2M = file.size / 1024 / 1024 < 20;
       if (!isLt2M) {
-        this.$message.error("上传附件大小不能超过 5MB!");
+        this.$message.error("上传附件大小不能超过 20MB!");
         return false;
       }
       this.uploadFileLoading = true;

File diff suppressed because it is too large
+ 0 - 0
web/index.html


File diff suppressed because it is too large
+ 0 - 0
web/static/web/css/chunk-896f1a5c.2cea308d.css


File diff suppressed because it is too large
+ 0 - 0
web/static/web/js/app.aaa07f77.js


File diff suppressed because it is too large
+ 0 - 0
web/static/web/js/chunk-4853c1fa.0cdb385d.js


File diff suppressed because it is too large
+ 0 - 0
web/static/web/js/chunk-896f1a5c.4db5a68f.js


Some files were not shown because too many files changed in this diff