Browse Source

上传报告loading

liujiejie 8 months ago
parent
commit
8fee3f69ce

+ 3 - 3
src/components/map/index.vue

@@ -196,9 +196,9 @@ export default {
         new TileLayer({
           source: new XYZ({
             // url: "http://127.0.0.1:8010/tiles/{z}/{x}/{y}.png", //本地
-            // url: "http://192.168.50.235/tiles/{z}/{x}/{y}.png", //内网
-            url: "http://106.120.102.238:18000/tiles/{z}/{x}/{y}.png", //外网
-            //  url: "http://10.96.137.5:9080/tiles/{z}/{x}/{y}.png",
+            url: "http://192.168.50.235/tiles/{z}/{x}/{y}.png", //内网
+            // url: "http://106.120.102.238:18000/tiles/{z}/{x}/{y}.png", //外网
+            // url: "http://10.96.137.5:9080/tiles/{z}/{x}/{y}.png", //大~唐
           }),
         }),
         new VectorLayer({

+ 4 - 0
src/styles/global.scss

@@ -118,3 +118,7 @@
     width: 55px;
   }
 }
+
+::v-deep .el-loading-spinner .path {
+  stroke: #009688 !important;
+}

+ 14 - 0
src/views/performance/components/dialogCom.vue

@@ -1,5 +1,7 @@
 <template>
   <el-dialog
+    v-loading="defaultLoading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
     :visible.sync="dialogVisible"
     :title="title"
     :before-close="handleCloses"
@@ -108,6 +110,7 @@ export default {
   },
   data() {
     return {
+      defaultLoading: false,
       dialogVisible: this.visible,
       emptyFlag: false,
       batchCode: "",
@@ -150,6 +153,7 @@ export default {
     async handleUpload() {
       if (this.fileList.length > 0) {
         try {
+          this.defaultLoading = true;
           const results = await this.uploadFiles();
           const fileDatas = results.map((item, ind) => {
             return {
@@ -175,9 +179,11 @@ export default {
             (item) => item.reportType === null
           );
           if (nullFileDatas.length > 0) {
+            this.defaultLoading = false;
             this.$message.warning("请检查是否选择了文件类型");
           } else {
             if (hasDuplicates) {
+              this.defaultLoading = false;
               this.$message.warning("不可选择的相同文件类型,请重新选择!");
             } else {
               const res = await saveReportBatch(fileDatas);
@@ -189,12 +195,15 @@ export default {
               } else {
                 this.$message.error(res.msg + "上传失败请重新上传");
               }
+              this.defaultLoading = false;
             }
           }
         } catch (err) {
+          this.defaultLoading = false;
           console.error("error");
         }
       } else {
+        this.defaultLoading = false;
         this.$message.warning("请选择上传文件");
       }
     },
@@ -281,3 +290,8 @@ export default {
   },
 };
 </script>
+<style scoped>
+::v-deep .el-loading-spinner .path {
+  stroke: #009688 !important;
+}
+</style>