DmitrMakeev
commited on
Commit
•
8e93fec
1
Parent(s):
712faa4
Update data_gc_tab.html
Browse files- data_gc_tab.html +143 -86
data_gc_tab.html
CHANGED
@@ -153,115 +153,172 @@
|
|
153 |
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
154 |
transition: background-color 0.3s ease;
|
155 |
}
|
156 |
-
|
157 |
#take-for-yourself:hover {
|
158 |
background-color: #388E3C;
|
159 |
}
|
160 |
</style>
|
161 |
-
<style>
|
162 |
-
body {
|
163 |
-
font-family: Arial, sans-serif;
|
164 |
-
text-align: center;
|
165 |
-
background-color: #f0f0f0;
|
166 |
-
margin: 0;
|
167 |
-
padding: 0;
|
168 |
-
}
|
169 |
-
#content {
|
170 |
-
display: none; /* Скрыть содержимое до авторизации */
|
171 |
-
}
|
172 |
-
/* Ваш CSS код */
|
173 |
-
</style>
|
174 |
</head>
|
175 |
|
176 |
<body>
|
177 |
<div id="header">
|
178 |
<h1>WhatsCRM - Автопилот + Tilda + Бизон 365 + GetCurse</h1>
|
179 |
</div>
|
180 |
-
<div
|
181 |
<select id="filter-field">
|
182 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
</select>
|
|
|
184 |
<select id="filter-type">
|
185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
</select>
|
|
|
187 |
<input id="filter-value" type="text" placeholder="Значение фильтра">
|
|
|
188 |
<button id="filter-clear">Очистить фильтр</button>
|
|
|
189 |
<button id="download-json">Рассылка по выбранным</button>
|
190 |
-
<button id="take-for-yourself">Взять себе</button>
|
191 |
</div>
|
192 |
<div id="example-table"></div>
|
193 |
|
194 |
<script>
|
|
|
195 |
document.addEventListener('DOMContentLoaded', function() {
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
}
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
}
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
});
|
266 |
</script>
|
267 |
</body>
|
|
|
153 |
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
154 |
transition: background-color 0.3s ease;
|
155 |
}
|
|
|
156 |
#take-for-yourself:hover {
|
157 |
background-color: #388E3C;
|
158 |
}
|
159 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
</head>
|
161 |
|
162 |
<body>
|
163 |
<div id="header">
|
164 |
<h1>WhatsCRM - Автопилот + Tilda + Бизон 365 + GetCurse</h1>
|
165 |
</div>
|
166 |
+
<div>
|
167 |
<select id="filter-field">
|
168 |
+
<option></option>
|
169 |
+
<option value="id">Номер в списке</option>
|
170 |
+
<option value="name">Имя</option>
|
171 |
+
<option value="phone">WhatsApp</option>
|
172 |
+
<option value="email">Email</option>
|
173 |
+
<option value="b_mess">Реплики</option>
|
174 |
+
<option value="curator">Куратор</option>
|
175 |
+
<option value="shop_st">Статус покупки</option>
|
176 |
+
<option value="ad_url">Ссылка на пользователя в GC</option>
|
177 |
+
<option value="vk_id">Ссылка на VK</option>
|
178 |
+
<option value="chat_id">Ссылка на Tg</option>
|
179 |
+
<option value="ws_stop">Стутус подписки</option>
|
180 |
+
<option value="web_st">Вебинары</option>
|
181 |
+
<option value="fin_prog">Прогрес по воронке</option>
|
182 |
+
<option value="pr1">pr1</option>
|
183 |
+
<option value="pr2">pr2</option>
|
184 |
+
<option value="pr3">pr3</option>
|
185 |
+
<option value="pr4">Канал трафика</option>
|
186 |
+
<option value="pr5">Дата</option>
|
187 |
+
<option value="key_pr">Ключ PR</option>
|
188 |
+
<option value="canal">Канал</option>
|
189 |
+
<option value="data_t">Дата</option>
|
190 |
</select>
|
191 |
+
|
192 |
<select id="filter-type">
|
193 |
+
<option value="=">=</option>
|
194 |
+
<option value="<"><</option>
|
195 |
+
<option value="<="><=</option>
|
196 |
+
<option value=">">></option>
|
197 |
+
<option value=">=">>=</option>
|
198 |
+
<option value="!=">!=</option>
|
199 |
+
<option value="like">like</option>
|
200 |
</select>
|
201 |
+
|
202 |
<input id="filter-value" type="text" placeholder="Значение фильтра">
|
203 |
+
|
204 |
<button id="filter-clear">Очистить фильтр</button>
|
205 |
+
|
206 |
<button id="download-json">Рассылка по выбранным</button>
|
207 |
+
<button id="take-for-yourself">Взять себе</button> <!-- Добавлена вторая кнопка -->
|
208 |
</div>
|
209 |
<div id="example-table"></div>
|
210 |
|
211 |
<script>
|
212 |
+
vkBridge.send('VKWebAppInit');
|
213 |
document.addEventListener('DOMContentLoaded', function() {
|
214 |
+
fetch('https://dmtuit-gcapirabiz.hf.space/data_gc_tab_out?api_sys=fasSd345D')
|
215 |
+
.then(response => response.json())
|
216 |
+
.then(data => {
|
217 |
+
console.log('Data received:', data); // Логирование данных
|
218 |
+
// Переворачиваем массив данных
|
219 |
+
data.reverse();
|
220 |
+
var linkFormatter = function(cell, formatterParams, onRendered) {
|
221 |
+
var curator = cell.getValue();
|
222 |
+
var curatorLink = cell.getData().curator_link;
|
223 |
+
return `<a href="${curatorLink}" target="_blank">${curator}</a>`;
|
224 |
+
};
|
225 |
+
var table = new Tabulator("#example-table", {
|
226 |
+
data: data, // set table data
|
227 |
+
layout: "fitColumns", // fit columns to width of table
|
228 |
+
pagination: "local", // enable local pagination
|
229 |
+
paginationSize: 50, // number of rows per page
|
230 |
+
selectable: true, // enable row selection
|
231 |
+
columns: [
|
232 |
+
{title:"Номер в списке", field:"id"},
|
233 |
+
{title:"Имя", field:"name", width:100},
|
234 |
+
{title:"WhatsApp", field:"phone", formatter: function(cell, formatterParams, onRendered) {
|
235 |
+
var phone = cell.getValue();
|
236 |
+
return `<a href="https://web.whatsapp.com/send?phone=${phone}" target="_blank">${phone}</a>`;
|
237 |
+
}, width:120},
|
238 |
+
{title:"Город", field:"b_city", width:110},
|
239 |
+
{title:"Email", field:"email", width:110},
|
240 |
+
{title:"Реплики", field:"b_mess", width:95},
|
241 |
+
{title:"Куратор", field:"curator", formatter: linkFormatter},
|
242 |
+
{title:"Статус покупки", field:"shop_st", formatter: function(cell, formatterParams, onRendered) {
|
243 |
+
var status = cell.getValue();
|
244 |
+
var color;
|
245 |
+
switch (status) {
|
246 |
+
case 'green':
|
247 |
+
color = 'green';
|
248 |
+
break;
|
249 |
+
case 'red':
|
250 |
+
color = 'red';
|
251 |
+
break;
|
252 |
+
case 'yellow':
|
253 |
+
color = 'yellow';
|
254 |
+
break;
|
255 |
+
default:
|
256 |
+
color = 'gray';
|
257 |
+
}
|
258 |
+
return `<div style="width: 20px; height: 20px; background-color: ${color};"></div>`;
|
259 |
+
}},
|
260 |
+
{title:"Ссылка на пользователя в GC", field:"ad_url", formatter: function(cell, formatterParams, onRendered) {
|
261 |
+
var ad_url = cell.getValue();
|
262 |
+
return `<a href="${ad_url}" target="_blank">${ad_url}</a>`;
|
263 |
+
}},
|
264 |
+
{title:"Ссылка на VK", field:"vk_id", formatter: function(cell, formatterParams, onRendered) {
|
265 |
+
var vk_id = cell.getValue();
|
266 |
+
return `<a href="https://vk.com/id${vk_id}" target="_blank">${vk_id}</a>`;
|
267 |
+
}},
|
268 |
+
{title:"Ссылка на Tg", field:"chat_id", formatter: function(cell, formatterParams, onRendered) {
|
269 |
+
var chatId = cell.getValue();
|
270 |
+
if (chatId.startsWith('@')) {
|
271 |
+
chatId = chatId.substring(1); // Удаление символа @ в начале
|
272 |
}
|
273 |
+
return `<a href="https://t.me/${chatId}" target="_blank">${chatId}</a>`;
|
274 |
+
}},
|
275 |
+
{title:"Статус WhatsApp", field:"ws_st"},
|
276 |
+
{title:"Стутус подписки", field:"ws_stop"},
|
277 |
+
{title:"Вебинары", field:"web_st", formatter:"star", formatterParams:{stars:7}, hozAlign:"center", width:120},
|
278 |
+
{title:"Прогрес по воронке", field:"fin_prog", formatter:"progress", formatterParams:{color:["#00dd00", "orange", "rgb(255,0,0)"]}, sorter:"number", width:100},
|
279 |
+
{title:"pr1", field:"pr1"},
|
280 |
+
{title:"pr2", field:"pr2"},
|
281 |
+
{title:"pr3", field:"pr3"},
|
282 |
+
{title:"Канал трафика", field:"pr4"},
|
283 |
+
{title:"Дата", field:"pr5"},
|
284 |
+
{title:"Ключ PR", field:"key_pr"},
|
285 |
+
{title:"Канал", field:"canal"},
|
286 |
+
{title:"Дата", field:"data_t"}
|
287 |
+
],
|
288 |
+
});
|
289 |
+
var fieldEl = document.getElementById("filter-field");
|
290 |
+
var typeEl = document.getElementById("filter-type");
|
291 |
+
var valueEl = document.getElementById("filter-value");
|
292 |
+
function updateFilter() {
|
293 |
+
var filterVal = fieldEl.options[fieldEl.selectedIndex].value;
|
294 |
+
var typeVal = typeEl.options[typeEl.selectedIndex].value;
|
295 |
+
if (filterVal) {
|
296 |
+
table.setFilter(filterVal, typeVal, valueEl.value);
|
297 |
+
}
|
298 |
+
}
|
299 |
+
document.getElementById("filter-field").addEventListener("change", updateFilter);
|
300 |
+
document.getElementById("filter-type").addEventListener("change", updateFilter);
|
301 |
+
document.getElementById("filter-value").addEventListener("keyup", updateFilter);
|
302 |
+
document.getElementById("filter-clear").addEventListener("click", function() {
|
303 |
+
fieldEl.value = "";
|
304 |
+
typeEl.value = "=";
|
305 |
+
valueEl.value = "";
|
306 |
+
table.clearFilter();
|
307 |
+
});
|
308 |
+
function handleDownloadJson() {
|
309 |
+
var tableData = table.getData("active");
|
310 |
+
var jsonData = JSON.stringify(tableData, null, 2);
|
311 |
+
console.log("Данные для рассылки:", jsonData);
|
312 |
+
}
|
313 |
+
function handleTakeForYourself() {
|
314 |
+
var tableData = table.getData("active");
|
315 |
+
var jsonData = JSON.stringify(tableData, null, 2);
|
316 |
+
console.log("Данные для себя:", jsonData);
|
317 |
+
}
|
318 |
+
document.getElementById("download-json").addEventListener("click", handleDownloadJson);
|
319 |
+
document.getElementById("take-for-yourself").addEventListener("click", handleTakeForYourself);
|
320 |
+
})
|
321 |
+
.catch(error => console.error('Error fetching data:', error));
|
322 |
});
|
323 |
</script>
|
324 |
</body>
|