liu hace 6 años
padre
commit
bc154b0f48
Se han modificado 1 ficheros con 13 adiciones y 8 borrados
  1. 13
    8
      hksystem/src/views/product/index.vue

+ 13
- 8
hksystem/src/views/product/index.vue Ver fichero

23
                     </p>
23
                     </p>
24
                     <div class="edittable-table-height-con">
24
                     <div class="edittable-table-height-con">
25
                         <Table :columns="columns" :data="prosHandle"></Table>
25
                         <Table :columns="columns" :data="prosHandle"></Table>
26
-                        <Page :total="total" :page-size="pageSize"></Page>
26
+                        <Page :total="total" :page-size="pageSize" @on-change="getData"></Page>
27
                     </div>
27
                     </div>
28
                 </Card>
28
                 </Card>
29
             </Col>
29
             </Col>
108
                                         let id = params.row.id;
108
                                         let id = params.row.id;
109
                                         this.axios.delete(`/product/${id}`)
109
                                         this.axios.delete(`/product/${id}`)
110
                                             .then((res) => {
110
                                             .then((res) => {
111
+                                                console.log(this.products);
111
                                                 this.products = this.products.filter((product) => {
112
                                                 this.products = this.products.filter((product) => {
112
                                                     if (product.id != id) {
113
                                                     if (product.id != id) {
113
                                                         return true;
114
                                                         return true;
114
                                                     }
115
                                                     }
115
                                                 });
116
                                                 });
117
+                                                console.log(this.products);
116
                                             });
118
                                             });
117
                                     }
119
                                     }
118
                                 }
120
                                 }
133
             this.proShow = true;
135
             this.proShow = true;
134
             this.getData();
136
             this.getData();
135
         },
137
         },
136
-        getData () {
137
-            this.axios.get("products")
138
-                .then((res) => {
139
-                    this.products = res.data.data;
140
-                    this.pageSize = res.data.per_page;
141
-                    this.total = res.data.total;
142
-                });
138
+        getData (num) {
139
+            this.axios.get("products", {
140
+                params: {
141
+                    page: num || 1
142
+                }
143
+            }).then((res) => {
144
+                this.products = res.data.data;
145
+                this.pageSize = res.data.per_page;
146
+                this.total = res.data.total;
147
+            });
143
         }
148
         }
144
     },
149
     },
145
     created () {
150
     created () {

Loading…
Cancelar
Guardar