DmitrMakeev
commited on
Commit
•
ac4eec7
1
Parent(s):
3cfa8b8
Update bas_vk_tab.html
Browse files- bas_vk_tab.html +34 -32
bas_vk_tab.html
CHANGED
@@ -185,28 +185,28 @@ button:hover, #filter-clear:hover, #download-json:hover, #take-for-yourself:hove
|
|
185 |
<h1>WhatsMasterCRM</h1>
|
186 |
</div>
|
187 |
<div>
|
188 |
-
<select id="filter-field">
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
</select>
|
210 |
|
211 |
<select id="filter-type">
|
212 |
<option value="=">=</option>
|
@@ -224,7 +224,7 @@ button:hover, #filter-clear:hover, #download-json:hover, #take-for-yourself:hove
|
|
224 |
<button id="download-xlsx">Скачать в XLSX</button>
|
225 |
<button id="download-json">Рассылка по выбранным</button>
|
226 |
<button id="take-for-yourself">Взять себе</button>
|
227 |
-
<button id="download-
|
228 |
</div>
|
229 |
<div id="example-table"></div>
|
230 |
|
@@ -242,7 +242,6 @@ button:hover, #filter-clear:hover, #download-json:hover, #take-for-yourself:hove
|
|
242 |
var curatorLink = cell.getData().curator_link;
|
243 |
return `<a href="${curatorLink}" target="_blank">${curator}</a>`;
|
244 |
};
|
245 |
-
|
246 |
var table = new Tabulator("#example-table", {
|
247 |
data: data,
|
248 |
layout: "fitColumns",
|
@@ -351,17 +350,14 @@ button:hover, #filter-clear:hover, #download-json:hover, #take-for-yourself:hove
|
|
351 |
{title:"Дата", field:"data_t", width:95},
|
352 |
],
|
353 |
});
|
354 |
-
|
355 |
// Clear filter
|
356 |
document.getElementById('filter-clear').addEventListener('click', function() {
|
357 |
table.clearFilter(true);
|
358 |
});
|
359 |
-
|
360 |
// Download XLSX functionality
|
361 |
document.getElementById('download-xlsx').addEventListener('click', function() {
|
362 |
table.download("xlsx", "data.xlsx");
|
363 |
});
|
364 |
-
|
365 |
// Download JSON functionality
|
366 |
document.getElementById('download-json').addEventListener('click', function() {
|
367 |
var selectedRows = table.getSelectedData();
|
@@ -375,12 +371,18 @@ button:hover, #filter-clear:hover, #download-json:hover, #take-for-yourself:hove
|
|
375 |
a.click();
|
376 |
URL.revokeObjectURL(url);
|
377 |
});
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
382 |
});
|
383 |
-
|
384 |
// Take for yourself functionality
|
385 |
document.getElementById('take-for-yourself').addEventListener('click', function() {
|
386 |
var selectedRows = table.getSelectedData();
|
|
|
185 |
<h1>WhatsMasterCRM</h1>
|
186 |
</div>
|
187 |
<div>
|
188 |
+
<select id="filter-field">
|
189 |
+
<option></option>
|
190 |
+
<option value="id">Номер в списке</option>
|
191 |
+
<option value="name">Имя</option>
|
192 |
+
<option value="phone">WhatsApp</option>
|
193 |
+
<option value="vk_id">Ссылка на VK</option>
|
194 |
+
<option value="chat_id">Ссылка на Tg</option>
|
195 |
+
<option value="gc_url">Ссылка на пользователя в GC</option>
|
196 |
+
<option value="b_city">Город</option>
|
197 |
+
<option value="email">Email</option>
|
198 |
+
<option value="b_mess">Реплики</option>
|
199 |
+
<option value="curator">Куратор</option>
|
200 |
+
<option value="shop_st">Статус покупки</option>
|
201 |
+
<option value="ws_stop">Стутус подписки</option>
|
202 |
+
<option value="web_st">Вебинары</option>
|
203 |
+
<option value="fin_prog">Прогрес по воронке</option>
|
204 |
+
<option value="pr4">Канал трафика</option>
|
205 |
+
<option value="pr5">Дата</option>
|
206 |
+
<option value="key_pr">Ключ PR</option>
|
207 |
+
<option value="canal">Канал</option>
|
208 |
+
<option value="data_t">Дата</option>
|
209 |
+
</select>
|
210 |
|
211 |
<select id="filter-type">
|
212 |
<option value="=">=</option>
|
|
|
224 |
<button id="download-xlsx">Скачать в XLSX</button>
|
225 |
<button id="download-json">Рассылка по выбранным</button>
|
226 |
<button id="take-for-yourself">Взять себе</button>
|
227 |
+
<button id="download-json-new">Скачать JSON</button> <!-- Новая кнопка для скачивания JSON -->
|
228 |
</div>
|
229 |
<div id="example-table"></div>
|
230 |
|
|
|
242 |
var curatorLink = cell.getData().curator_link;
|
243 |
return `<a href="${curatorLink}" target="_blank">${curator}</a>`;
|
244 |
};
|
|
|
245 |
var table = new Tabulator("#example-table", {
|
246 |
data: data,
|
247 |
layout: "fitColumns",
|
|
|
350 |
{title:"Дата", field:"data_t", width:95},
|
351 |
],
|
352 |
});
|
|
|
353 |
// Clear filter
|
354 |
document.getElementById('filter-clear').addEventListener('click', function() {
|
355 |
table.clearFilter(true);
|
356 |
});
|
|
|
357 |
// Download XLSX functionality
|
358 |
document.getElementById('download-xlsx').addEventListener('click', function() {
|
359 |
table.download("xlsx", "data.xlsx");
|
360 |
});
|
|
|
361 |
// Download JSON functionality
|
362 |
document.getElementById('download-json').addEventListener('click', function() {
|
363 |
var selectedRows = table.getSelectedData();
|
|
|
371 |
a.click();
|
372 |
URL.revokeObjectURL(url);
|
373 |
});
|
374 |
+
// New Download JSON functionality
|
375 |
+
document.getElementById('download-json-new').addEventListener('click', function() {
|
376 |
+
var jsonData = JSON.stringify(data);
|
377 |
+
var blob = new Blob([jsonData], { type: 'application/json' });
|
378 |
+
var url = URL.createObjectURL(blob);
|
379 |
+
var a = document.createElement('a');
|
380 |
+
a.href = url;
|
381 |
+
a.download = 'data.json';
|
382 |
+
document.body.appendChild(a);
|
383 |
+
a.click();
|
384 |
+
URL.revokeObjectURL(url);
|
385 |
});
|
|
|
386 |
// Take for yourself functionality
|
387 |
document.getElementById('take-for-yourself').addEventListener('click', function() {
|
388 |
var selectedRows = table.getSelectedData();
|