Kaynağa Gözat

修复文件路径修改后回显问题

Danj0rr 1 yıl önce
ebeveyn
işleme
8ade8b2dba
1 değiştirilmiş dosya ile 30 ekleme ve 16 silme
  1. 30 16
      src/views/system/modelModify.vue

+ 30 - 16
src/views/system/modelModify.vue

@@ -161,18 +161,22 @@ export default {
                 return;
             }
 
-            // this.$message.success('修改成功');
-            this.$router.push({
-                path: '/modelEdit',
-                query: {
-                    modelId: this.modelId,
-                    modelNo: this.modelNo,
-                    modelName: this.modelName,
-                    modelType: this.modelType,
-                    modelState: this.modelState,
-                    filePath: this.filePath,
-                }
-            })
+            // 异步请求,增加一层条件判断
+            if(isModifyName&&!isModifyFile)
+            {
+                this.$message.success('修改成功');
+                this.$router.push({
+                    path: '/modelEdit',
+                    query: {
+                        modelId: this.modelId,
+                        modelNo: this.modelNo,
+                        modelName: this.modelName,
+                        modelType: this.modelType,
+                        modelState: this.modelState,
+                        filePath: this.filePath,
+                    }
+                });
+            }
         },
         returnLink() {
             //指定跳转地址
@@ -299,14 +303,24 @@ export default {
                         }
                     )
                     .then((res) => {
-
-                        this.$alert("上传成功");
-                        // location.reload();
+                        this.filePath=res.data.file_path;
+                        this.$message.success('修改成功');
                         console.log(res);
+
+                        this.$router.push({
+                            path: '/modelEdit',
+                            query: {
+                                modelId: this.modelId,
+                                modelNo: this.modelNo,
+                                modelName: this.modelName,
+                                modelType: this.modelType,
+                                modelState: this.modelState,
+                                filePath: this.filePath,
+                            }
+                        })
                     });
             }
 
-            // location.reload();
         }
 
     }