Browse Source

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

Danj0rr 1 year ago
parent
commit
8ade8b2dba
1 changed files with 30 additions and 16 deletions
  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();
         }
 
     }