Przeglądaj źródła

Merge branch 'master' of http://113.44.0.55:8014/jiaxiaoqiang/SynthesisManagement

luoxiao 3 tygodni temu
rodzic
commit
70b0e5e0cd

+ 2 - 0
src/components/Upload/FilesUpload.vue

@@ -99,6 +99,7 @@ const emit = defineEmits([
   "update:pdfList",
   "update:fileNameList",
   "finished",
+  "initiate",
 ]);
 
 // 上传文件成功返回的值
@@ -119,6 +120,7 @@ const handleChange = async (uploadFile: UploadFile) => {
     return;
   }
   loading.value = true;
+  emit("initiate");
   uploadFileApi(uploadFile.raw as File, props.generatePdf)
     .then((res: any) => {
       loading.value = false;

+ 12 - 1
src/views/messages/index.vue

@@ -28,6 +28,7 @@
           :limit="1"
           :size="4000"
           :showTip="false"
+          @initiate="isUploading = true"
           @finished="photoChange"
         />
       </template>
@@ -66,7 +67,7 @@ import { treeList } from "@/api/user/index";
 import { getMessageOrgList } from "@/api/messageOrg/index";
 
 const userTableRef = ref(null);
-
+const isUploading = ref(false)
 const photoUrlList = ref([]);
 const photoNameList = ref([]);
 const deptList = ref([]); //部门列表
@@ -78,6 +79,7 @@ const getDeptList = async () => {
 };
 const photoChange = () => {
   if (photoUrlList.value.length > 0) {
+    isUploading.value = false;
     form.value.fileLists = [
       {
         name: photoNameList.value[0],
@@ -290,6 +292,15 @@ option.value = Object.assign(option.value, {
       type: "array",
       span: 24,
       hide: true,
+      rules: [{
+        validator: (rule, value, callback) => {
+          if (isUploading.value) {
+            callback(new Error('文件正在上传中,请等待!!'))
+          } else {
+            callback()
+          }
+        }
+      }]
     },
   ],
 });