const dirtyValue = [{"id":1,"name":"Проект1","parent":null,
"children":[{"id":3,"name":"Задача1.1","parent":1,
"children":[ {"id":2,"name":"Задача 1_1_1","parent":3,"children":[]},
{"id":8,"name":"Задача 1_1_2","parent":3, "children":[]}
]}]}];
const formatJson = item => {
const result = { ...item, Rec: { children: item?.children?.map?.(formatJson) } };
delete result?.children;
return result;
};
const value = dirtyValue.map(formatJson);
console.log(value);
const readline = require('readline-sync');
const key = '';
function hydrusTags(tags){
let url = 'http://127.0.0.1:45869/get_files/search_files?Hydrus-Client-API-Access-Key='+key+'&tags=%5B%22'+tags+'%22%5D';
return fetch(url).then(res => res.json());
}
var query = readline.question('Enter tags:\n');
hydrusTags(query).then(foundIds => console.log(foundIds));
new Swiper(".mySwiper2", {
loop: true,
pagination: {
el: ".pg2",
dynamicBullets: true,
},
})
var swiper = new Swiper(".mySwiper", {
-- loop: true,
spaceBetween : '5px',
pagination: {
el: ".pg1",
dynamicBullets: true,
},
breakpoints : {
0: {
slidesPerView: 2,
},
800: {
slidesPerView: 3,
},
1200: {
slidesPerView: 4,
},
1600: {
slidesPerView: 5,
}
},
});
--const modalTrigger = document.querySelector("[data-modal]),
++const modalTrigger = document.querySelector("[data-modal]"),
// Фильтрация элементов, удовлетворяющих хотя бы одному из слов
-- const filtered = data.filter(function(item) {
++ const filtered = data.items.filter(function(item) {
const text = (item.code || '') + ' ' + (item.name || '');
return words.every(function(word) {
return text.toLowerCase().indexOf(word) >= 0;
});
});
<form style="position:relative" target="area" method="POST">
<input id="texexpert" name="texe"class="header-search-input" autocomplete="off" placeholder="Искать" value="" >
<input id="button" class="texex" type="submit" title="Нажмите,чтобы найти">
</form
<script>
$('.texex').on('click', function(e){
e.preventDefault();
const texex = document.querySelector("input[name='texe']").value;
sessionStorage.setItem('texexperto', texex);
const texoton = sessionStorage.getItem('texexperto');
console.log(texoton);
});
</script>