DmitrMakeev
commited on
Update bas_vk_tab.html
Browse files- bas_vk_tab.html +31 -88
bas_vk_tab.html
CHANGED
@@ -1,37 +1,13 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
-
<html lang="
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>
|
|
|
|
|
|
|
7 |
|
8 |
-
|
9 |
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
10 |
-
<script src="https://unpkg.com/@vkontakte/vk-bridge/dist/browser.min.js"></script>
|
11 |
-
<script type="text/javascript" src="https://vk.com/js/api/openapi.js?169"></script>
|
12 |
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">
|
13 |
-
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">
|
19 |
-
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
<link href="https://unpkg.com/tabulator-tables@6.2.1/dist/css/tabulator.min.css" rel="stylesheet">
|
30 |
-
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@6.2.1/dist/js/tabulator.min.js"></script>
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
35 |
<style>
|
36 |
body {
|
37 |
font-family: Arial, sans-serif;
|
@@ -173,27 +149,11 @@
|
|
173 |
background-color: #388E3C;
|
174 |
}
|
175 |
</style>
|
176 |
-
|
177 |
-
<style>
|
178 |
-
.swal-button-custom {
|
179 |
-
background-color: #4CAF50;
|
180 |
-
font-size: 16px;
|
181 |
-
padding: 10px 20px;
|
182 |
-
}
|
183 |
-
.swal-title-custom {
|
184 |
-
font-size: 24px;
|
185 |
-
color: #333;
|
186 |
-
}
|
187 |
-
.swal-content-custom {
|
188 |
-
font-size: 16px;
|
189 |
-
color: #666;
|
190 |
-
}
|
191 |
-
</style>
|
192 |
</head>
|
193 |
|
194 |
<body>
|
195 |
<div id="header">
|
196 |
-
<h1>
|
197 |
</div>
|
198 |
<div>
|
199 |
<select id="filter-field">
|
@@ -201,17 +161,18 @@
|
|
201 |
<option value="id">Номер в списке</option>
|
202 |
<option value="name">Имя</option>
|
203 |
<option value="phone">WhatsApp</option>
|
204 |
-
<option value="vk_id">Ссылка на VK</option>
|
205 |
-
<option value="chat_id">Ссылка на Tg</option>
|
206 |
-
<option value="gc_url">Ссылка на пользователя в GC</option>
|
207 |
-
<option value="b_city">Город</option>
|
208 |
<option value="email">Email</option>
|
209 |
-
<option value="b_mess">Реплики</option>
|
210 |
<option value="curator">Куратор</option>
|
211 |
<option value="shop_st">Статус покупки</option>
|
212 |
-
<option value="
|
|
|
|
|
|
|
213 |
<option value="web_st">Вебинары</option>
|
214 |
-
<option value="fin_prog"
|
|
|
|
|
|
|
215 |
<option value="pr4">Канал трафика</option>
|
216 |
<option value="pr5">Дата</option>
|
217 |
<option value="key_pr">Ключ PR</option>
|
@@ -232,9 +193,9 @@
|
|
232 |
<input id="filter-value" type="text" placeholder="Значение фильтра">
|
233 |
|
234 |
<button id="filter-clear">Очистить фильтр</button>
|
235 |
-
|
236 |
-
<button id="download-json"
|
237 |
-
<button id="take-for-yourself">Взять себе</button>
|
238 |
</div>
|
239 |
<div id="example-table"></div>
|
240 |
|
@@ -244,14 +205,13 @@
|
|
244 |
.then(response => response.json())
|
245 |
.then(data => {
|
246 |
console.log('Data received:', data); // Логирование данных
|
247 |
-
|
248 |
-
|
249 |
var linkFormatter = function(cell, formatterParams, onRendered) {
|
250 |
var curator = cell.getValue();
|
251 |
var curatorLink = cell.getData().curator_link;
|
252 |
return `<a href="${curatorLink}" target="_blank">${curator}</a>`;
|
253 |
};
|
254 |
-
|
255 |
var table = new Tabulator("#example-table", {
|
256 |
data: data, // set table data
|
257 |
layout: "fitColumns", // fit columns to width of table
|
@@ -315,11 +275,9 @@
|
|
315 |
{title:"Дата", field:"data_t"}
|
316 |
],
|
317 |
});
|
318 |
-
|
319 |
var fieldEl = document.getElementById("filter-field");
|
320 |
var typeEl = document.getElementById("filter-type");
|
321 |
var valueEl = document.getElementById("filter-value");
|
322 |
-
|
323 |
function updateFilter() {
|
324 |
var filterVal = fieldEl.options[fieldEl.selectedIndex].value;
|
325 |
var typeVal = typeEl.options[typeEl.selectedIndex].value;
|
@@ -327,42 +285,27 @@
|
|
327 |
table.setFilter(filterVal, typeVal, valueEl.value);
|
328 |
}
|
329 |
}
|
330 |
-
|
331 |
document.getElementById("filter-field").addEventListener("change", updateFilter);
|
332 |
document.getElementById("filter-type").addEventListener("change", updateFilter);
|
333 |
document.getElementById("filter-value").addEventListener("keyup", updateFilter);
|
334 |
-
|
335 |
document.getElementById("filter-clear").addEventListener("click", function() {
|
336 |
fieldEl.value = "";
|
337 |
typeEl.value = "=";
|
338 |
valueEl.value = "";
|
339 |
table.clearFilter();
|
340 |
});
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
}
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
var a = document.createElement("a");
|
354 |
-
a.href = url;
|
355 |
-
a.download = "data.json";
|
356 |
-
a.click();
|
357 |
-
URL.revokeObjectURL(url);
|
358 |
-
});
|
359 |
-
|
360 |
-
// Взять себе (тоже скачивание JSON, если требуется)
|
361 |
-
document.getElementById("take-for-yourself").addEventListener("click", function() {
|
362 |
-
var selectedRows = table.getSelectedData(); // Получаем выбранные строки
|
363 |
-
var jsonData = JSON.stringify(selectedRows, null, 2);
|
364 |
-
console.log("Данные для себя:", jsonData); // Можно заменить на другую логику
|
365 |
-
});
|
366 |
})
|
367 |
.catch(error => console.error('Error fetching data:', error));
|
368 |
});
|
|
|
1 |
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Tabulator Example</title>
|
7 |
+
<link href="https://unpkg.com/tabulator-tables@6.2.1/dist/css/tabulator.min.css" rel="stylesheet">
|
8 |
+
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@6.2.1/dist/js/tabulator.min.js"></script>
|
9 |
+
<script type="text/javascript" src="https://oss.sheetjs.com/sheetjs/xlsx.full.min.js"></script>
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
<style>
|
12 |
body {
|
13 |
font-family: Arial, sans-serif;
|
|
|
149 |
background-color: #388E3C;
|
150 |
}
|
151 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
</head>
|
153 |
|
154 |
<body>
|
155 |
<div id="header">
|
156 |
+
<h1>WhatsCRM - Автопилот + Tilda + Бизон 365 + GetCurse</h1>
|
157 |
</div>
|
158 |
<div>
|
159 |
<select id="filter-field">
|
|
|
161 |
<option value="id">Номер в списке</option>
|
162 |
<option value="name">Имя</option>
|
163 |
<option value="phone">WhatsApp</option>
|
|
|
|
|
|
|
|
|
164 |
<option value="email">Email</option>
|
|
|
165 |
<option value="curator">Куратор</option>
|
166 |
<option value="shop_st">Статус покупки</option>
|
167 |
+
<option value="ad_url">Ссылка на пользователя в GC</option>
|
168 |
+
<option value="vk_id">Ссылка на VK</option>
|
169 |
+
<option value="chat_id">Ссылка на Tg</option>
|
170 |
+
<option value="ws_stop">Стутус подписки</option>
|
171 |
<option value="web_st">Вебинары</option>
|
172 |
+
<option value="fin_prog">Прогрес по воронке</option>
|
173 |
+
<option value="pr1">pr1</option>
|
174 |
+
<option value="pr2">pr2</option>
|
175 |
+
<option value="pr3">pr3</option>
|
176 |
<option value="pr4">Канал трафика</option>
|
177 |
<option value="pr5">Дата</option>
|
178 |
<option value="key_pr">Ключ PR</option>
|
|
|
193 |
<input id="filter-value" type="text" placeholder="Значение фильтра">
|
194 |
|
195 |
<button id="filter-clear">Очистить фильтр</button>
|
196 |
+
|
197 |
+
<button id="download-json">Рассылка по выбранным</button>
|
198 |
+
<button id="take-for-yourself">Взять себе</button> <!-- Добавлена вторая кнопка -->
|
199 |
</div>
|
200 |
<div id="example-table"></div>
|
201 |
|
|
|
205 |
.then(response => response.json())
|
206 |
.then(data => {
|
207 |
console.log('Data received:', data); // Логирование данных
|
208 |
+
// Переворачиваем массив данных
|
209 |
+
data.reverse();
|
210 |
var linkFormatter = function(cell, formatterParams, onRendered) {
|
211 |
var curator = cell.getValue();
|
212 |
var curatorLink = cell.getData().curator_link;
|
213 |
return `<a href="${curatorLink}" target="_blank">${curator}</a>`;
|
214 |
};
|
|
|
215 |
var table = new Tabulator("#example-table", {
|
216 |
data: data, // set table data
|
217 |
layout: "fitColumns", // fit columns to width of table
|
|
|
275 |
{title:"Дата", field:"data_t"}
|
276 |
],
|
277 |
});
|
|
|
278 |
var fieldEl = document.getElementById("filter-field");
|
279 |
var typeEl = document.getElementById("filter-type");
|
280 |
var valueEl = document.getElementById("filter-value");
|
|
|
281 |
function updateFilter() {
|
282 |
var filterVal = fieldEl.options[fieldEl.selectedIndex].value;
|
283 |
var typeVal = typeEl.options[typeEl.selectedIndex].value;
|
|
|
285 |
table.setFilter(filterVal, typeVal, valueEl.value);
|
286 |
}
|
287 |
}
|
|
|
288 |
document.getElementById("filter-field").addEventListener("change", updateFilter);
|
289 |
document.getElementById("filter-type").addEventListener("change", updateFilter);
|
290 |
document.getElementById("filter-value").addEventListener("keyup", updateFilter);
|
|
|
291 |
document.getElementById("filter-clear").addEventListener("click", function() {
|
292 |
fieldEl.value = "";
|
293 |
typeEl.value = "=";
|
294 |
valueEl.value = "";
|
295 |
table.clearFilter();
|
296 |
});
|
297 |
+
function handleDownloadJson() {
|
298 |
+
var tableData = table.getData("active");
|
299 |
+
var jsonData = JSON.stringify(tableData, null, 2);
|
300 |
+
console.log("Данные для рассылки:", jsonData);
|
301 |
+
}
|
302 |
+
function handleTakeForYourself() {
|
303 |
+
var tableData = table.getData("active");
|
304 |
+
var jsonData = JSON.stringify(tableData, null, 2);
|
305 |
+
console.log("Данные для себя:", jsonData);
|
306 |
+
}
|
307 |
+
document.getElementById("download-json").addEventListener("click", handleDownloadJson);
|
308 |
+
document.getElementById("take-for-yourself").addEventListener("click", handleTakeForYourself);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
})
|
310 |
.catch(error => console.error('Error fetching data:', error));
|
311 |
});
|