فهرست منبع

算法列表返回保持算法类别不变

shiyu 3 سال پیش
والد
کامیت
43b3411e59

+ 16 - 4
src/views/algorithmsLibrary/algorithmsLibraryList.vue

@@ -183,6 +183,12 @@ export default {
             }
         },
     },
+    created(){
+        if(this.$route.query.activeName){
+            this.activeName = this.$route.query.activeName
+        }
+        this.$route.query.activeName = '2'
+    },
     methods: {
         doSearch() {
             if (this.activeName === "2") {
@@ -222,10 +228,16 @@ export default {
         addOne() {
             if (this.activeName === "2") {
                 // 私有导入
-                this.$router.push({ path: "/exportAlgorithms" });
+                this.$router.push({ 
+                    path: "/exportAlgorithms",
+                    query: {activeName: this.activeName}
+                });
             } else {
                 // 私有仓库
-                this.$router.push({ path: "/gitAlgorithms" });
+                this.$router.push({ 
+                    path: "/gitAlgorithms",
+                    query: {activeName: this.activeName}
+                });
             }
         },
         editRow(row) {
@@ -233,13 +245,13 @@ export default {
                 // 私有导入
                 this.$router.push({
                     path: "/exportAlgorithms",
-                    query: { id: row.id, share: row.share },
+                    query: { id: row.id, share: row.share, activeName: this.activeName },
                 });
             } else {
                 // 私有仓库
                 this.$router.push({
                     path: "/gitAlgorithms",
-                    query: { id: row.id, share: row.share },
+                    query: { id: row.id, share: row.share, activeName: this.activeName },
                 });
             }
         },

+ 4 - 1
src/views/algorithmsLibrary/exportAlgorithms.vue

@@ -160,7 +160,10 @@ export default {
             });
         },
         cancel() {
-            this.$router.replace({ path: "/algorithmsLibraryList" });
+            this.$router.replace({ 
+                path: "/algorithmsLibraryList", 
+                query:{activeName: this.$route.query.activeName}
+            });
         },
         onProgress() {
             this.$axios({

+ 4 - 1
src/views/algorithmsLibrary/gitAlgorithms.vue

@@ -195,7 +195,10 @@ export default {
             });
         },
         cancel(){
-            this.$router.replace({ path: "/algorithmsLibraryList" });
+            this.$router.replace({ 
+                path: "/algorithmsLibraryList", 
+                query:{activeName: this.$route.query.activeName}
+            });
         }
         /* typeChange(val) {
             if (val === "1") {