@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/dist/element-ui-extended.common.js +17 -26
- package/dist/element-ui-extended.common.js.map +1 -1
- package/dist/element-ui-extended.umd.js +17 -26
- package/dist/element-ui-extended.umd.js.map +1 -1
- package/dist/element-ui-extended.umd.min.js +1 -1
- package/dist/element-ui-extended.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CompositeTable/index.vue +20 -25
package/package.json
CHANGED
|
@@ -124,7 +124,10 @@ export default {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
search = Object.assign(search, listQueryService.getListQuery().search);
|
|
127
|
-
topSearch = Object.assign(
|
|
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:
|
|
136
|
-
|
|
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
|
|
147
|
-
|
|
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({
|
|
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.
|
|
158
|
-
return this.
|
|
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.
|
|
164
|
-
return this.
|
|
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
|
|
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.
|
|
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.
|
|
213
|
+
Vue.set(this.meta, "page", val);
|
|
218
214
|
this.fetch();
|
|
219
215
|
},
|
|
220
216
|
handleFilterChange() {
|
|
221
|
-
|
|
222
|
-
this.fetch();
|
|
217
|
+
this.handleCurrentChange(1);
|
|
223
218
|
},
|
|
224
219
|
handleApplyFilter() {
|
|
225
220
|
this.listQueryService.updateListQuery({ search: this.search });
|