flameresttable 1.0.25 → 1.0.27
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 +1 -1
- package/src/Table/FlameTable.ts +39 -4
- package/src/Table/Table.vue +1 -1
package/package.json
CHANGED
package/src/Table/FlameTable.ts
CHANGED
|
@@ -162,8 +162,22 @@ export default class FlameTable<T> {
|
|
|
162
162
|
|
|
163
163
|
// Виртуальные элементы не фильтруем, но добавляем в массив
|
|
164
164
|
if (this.columns[key].isVirtual) {
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
switch (el.type) {
|
|
166
|
+
case 'date':
|
|
167
|
+
case 'fixed':
|
|
168
|
+
case 'fulltext':
|
|
169
|
+
case 'selector':
|
|
170
|
+
case 'text':
|
|
171
|
+
customFilters.params[key] = el.valueString;
|
|
172
|
+
continue;
|
|
173
|
+
case 'daterange':
|
|
174
|
+
case 'number':
|
|
175
|
+
customFilters.params[key] = el.valueRange;
|
|
176
|
+
continue;
|
|
177
|
+
default:
|
|
178
|
+
alert('НЕИЗВЕСТНЫЙ ТИП')
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
167
181
|
}
|
|
168
182
|
|
|
169
183
|
switch (el.type) {
|
|
@@ -198,8 +212,8 @@ export default class FlameTable<T> {
|
|
|
198
212
|
case 'daterange':
|
|
199
213
|
|
|
200
214
|
if (el.valueRange.length > 0) {
|
|
201
|
-
customFilters.where[key] = ['>=', key, el.valueRange[0]];
|
|
202
|
-
customFilters.where[key] = ['<=', key, el.valueRange[1]];
|
|
215
|
+
customFilters.where[key + '_from'] = ['>=', key, el.valueRange[0]];
|
|
216
|
+
customFilters.where[key + '_to'] = ['<=', key, el.valueRange[1]];
|
|
203
217
|
}
|
|
204
218
|
|
|
205
219
|
break;
|
|
@@ -293,4 +307,25 @@ export default class FlameTable<T> {
|
|
|
293
307
|
return result;
|
|
294
308
|
}
|
|
295
309
|
|
|
310
|
+
/**
|
|
311
|
+
* Выгрузить существующие колонки в CSV
|
|
312
|
+
* @param filename
|
|
313
|
+
* @param arr
|
|
314
|
+
*/
|
|
315
|
+
public exportSelectedToCSV(filename: string = "table.csv", arr: any = null) {
|
|
316
|
+
|
|
317
|
+
arr = arr ?? this.getSelectedRows();
|
|
318
|
+
|
|
319
|
+
const array = [Object.keys(arr[0])].concat(arr);
|
|
320
|
+
const csv = array.map(row => Object.values(row).map(val => `"${val}"`).join(';')).join('\n');
|
|
321
|
+
|
|
322
|
+
const csvData = new Blob([csv], { type: 'text/csv' });
|
|
323
|
+
const csvURL = URL.createObjectURL(csvData);
|
|
324
|
+
const link = document.createElement('a');
|
|
325
|
+
link.href = csvURL;
|
|
326
|
+
link.download = filename;
|
|
327
|
+
link.click();
|
|
328
|
+
|
|
329
|
+
}
|
|
330
|
+
|
|
296
331
|
}
|
package/src/Table/Table.vue
CHANGED
|
@@ -451,7 +451,7 @@ export default defineComponent({
|
|
|
451
451
|
color: rgb(55, 53, 47);
|
|
452
452
|
font-size: 14px;
|
|
453
453
|
line-height: 16.8px;
|
|
454
|
-
font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
|
454
|
+
font-family: "Roboto", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
|
455
455
|
border: 1px solid rgb(233, 233, 231);
|
|
456
456
|
}
|
|
457
457
|
|