haojianlong 3 anni fa
parent
commit
41bfe6136f
2 ha cambiato i file con 19 aggiunte e 6 eliminazioni
  1. 7 2
      src/components/homeView/recycle.vue
  2. 12 4
      src/views/home.vue

+ 7 - 2
src/components/homeView/recycle.vue

@@ -60,8 +60,12 @@ export default {
     queryGraph() {
       this.recycleLoading = true;
       const pa = {
-        Filters: `state=4`,
-        Orders: `${this.selVal} desc`
+        filters: `state=4`
+      }
+      if (this.selVal == 'name') {
+        pa.orders = `${this.selVal} asc`;
+      } else {
+        pa.orders = `${this.selVal} desc`;
       }
       if (this.queryText) {
         pa.Filters += `;name contain "${this.queryText}"`
@@ -71,6 +75,7 @@ export default {
           t.checked = false;
           return t;
         });
+        console.log(this.cardList);
         this.queryText = '';
         this.recycleLoading = false;
       })

+ 12 - 4
src/views/home.vue

@@ -393,9 +393,13 @@ export default {
       this.cardLoading = true;
       this.selectCard = [];
       const pa = {
-        filters: `categoryId="${this.curCategory.code}"`,
-        orders: `${this.selVal} desc`,
+        filters: `categoryId="${this.curCategory.code}"`
       };
+      if (this.selVal == 'name') {
+        pa.orders = `${this.selVal} asc`;
+      } else {
+        pa.orders = `${this.selVal} desc`;
+      }
       if (this.queryText) {
         pa.filters += `;name contain "${this.queryText}"`;
       }
@@ -426,9 +430,13 @@ export default {
         return;
       }
       const pa = {
-        filters: `categoryId="${this.curCategory.code}"`,
-        orders: `${this.selVal} desc`,
+        filters: `categoryId="${this.curCategory.code}"`
       };
+      if (this.selVal == 'name') {
+        pa.orders = `${this.selVal} asc`;
+      } else {
+        pa.orders = `${this.selVal} desc`;
+      }
       if (this.queryText) {
         pa.filters += `;name contain ""`;
       }