@tripup-company/element-ui-extended 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tripup-company/element-ui-extended",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "./dist/element-ui-extended.umd.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -124,7 +124,10 @@ export default {
124
124
  }
125
125
 
126
126
  search = Object.assign(search, listQueryService.getListQuery().search);
127
- topSearch = Object.assign(topSearch, listQueryService.getListQuery().topSearch);
127
+ topSearch = Object.assign(
128
+ topSearch,
129
+ listQueryService.getListQuery().topSearch
130
+ );
128
131
  return {
129
132
  loading: false,
130
133
  filter: {},
@@ -132,43 +135,36 @@ export default {
132
135
  search: search,
133
136
  topSearch: topSearch,
134
137
  filterConvertor: filterConvertor,
135
- meta: Object.assign(
136
- new MetaModel(),
137
- listQueryService.getListQuery().meta
138
- ),
138
+ meta: listQueryService.getListQuery().meta,
139
+ metaModel: new MetaModel(),
139
140
  listQueryService: listQueryService,
140
141
  };
141
142
  },
142
143
  computed: {
143
144
  queryFilter() {
144
- const meta = this.listQueryService.getListQuery().meta;
145
145
  const query = {
146
- page: this.meta?.pagination?.current_page
147
- ? this.meta.pagination.current_page
148
- : meta.page,
149
- limit: this.meta?.pagination?.per_page
150
- ? this.meta.pagination.per_page
151
- : meta.limit,
146
+ page: this.meta.page,
147
+ limit: this.meta.limit,
152
148
  };
153
- const filter = this.filterConvertor.applyFilter({ ...this.search, ...this.topSearch });
149
+ const filter = this.filterConvertor.applyFilter({
150
+ ...this.search,
151
+ ...this.topSearch,
152
+ });
154
153
  return { ...query, ...filter };
155
154
  },
156
155
  currentPage() {
157
- if (this.data.meta?.pagination) {
158
- return this.data.meta.pagination.current_page;
156
+ if (this.listQueryService.getListQuery().meta) {
157
+ return this.listQueryService.getListQuery().meta.page;
159
158
  }
160
159
  return 0;
161
160
  },
162
161
  total() {
163
- if (this.data.meta?.pagination) {
164
- return this.data.meta.pagination.total;
162
+ if (this.metaModel?.pagination) {
163
+ return this.metaModel.pagination.total;
165
164
  }
166
165
  return 0;
167
166
  },
168
167
  limit() {
169
- if (this.data.meta?.pagination) {
170
- return this.data.meta.pagination.per_page;
171
- }
172
168
  if (this.listQueryService.getListQuery().meta?.limit) {
173
169
  return this.listQueryService.getListQuery().meta?.limit;
174
170
  }
@@ -187,7 +183,7 @@ export default {
187
183
  this.includes
188
184
  );
189
185
  this.data = response.data;
190
- Vue.set(this.data, "meta", response.meta);
186
+ Vue.set(this, "metaModel", response.meta);
191
187
  } catch (e) {
192
188
  this.$message.error(e.message);
193
189
  }
@@ -204,7 +200,7 @@ export default {
204
200
  page: this.listQueryService.getListQuery().meta.page,
205
201
  },
206
202
  });
207
- Vue.set(this.data, "meta.per_page.current_page", val);
203
+ Vue.set(this.meta, "limit", val);
208
204
  this.fetch();
209
205
  },
210
206
  handleCurrentChange(val) {
@@ -214,12 +210,11 @@ export default {
214
210
  limit: this.listQueryService.getListQuery().meta.limit,
215
211
  },
216
212
  });
217
- Vue.set(this.data, "meta.pagination.current_page", val);
213
+ Vue.set(this.meta, "page", val);
218
214
  this.fetch();
219
215
  },
220
216
  handleFilterChange() {
221
- Vue.set(this.data, "meta.pagination.current_page", 1);
222
- this.fetch();
217
+ this.handleCurrentChange(1);
223
218
  },
224
219
  handleApplyFilter() {
225
220
  this.listQueryService.updateListQuery({ search: this.search });