tables places fix

This commit is contained in:
Ahmedvolga 2024-10-08 18:20:40 +03:00
parent 34335ae2a3
commit cb7641ee53
3 changed files with 41 additions and 25 deletions

View File

@ -427,7 +427,7 @@ footer {
} }
#excelTable { .tableplace {
font-family: Calibri, sans-serif; font-family: Calibri, sans-serif;
font-size: 15px; font-size: 15px;
text-align: center; text-align: center;
@ -440,7 +440,7 @@ min-width: 680px;
background-color: yellow; /* Change background color for the second column */ background-color: yellow; /* Change background color for the second column */
/* } */ /* } */
#excelTable tr td { .tableplace tr td {
text-align: center; text-align: center;
padding: 0px 6px; padding: 0px 6px;
background-color: white; background-color: white;
@ -451,7 +451,7 @@ background-color: white;
border-color: red; border-color: red;
border-style: solid !important; border-style: solid !important;
} }
#excelTableContainer { .tableplaceContainer {
margin: auto; margin: auto;
text-align: -webkit-center; text-align: -webkit-center;
text-align: center; text-align: center;
@ -467,7 +467,22 @@ background-color: white;
border-radius: 10px; border-radius: 10px;
} }
.tableplacedown{
.repeatedx { color: aliceblue;
margin: auto;
text-align: -webkit-center; text-align: -webkit-center;
/* background-color: white; */
display: flex;
gap: 5px;
justify-content: center;
}
.search2table{
color: blue;
}
.searchlivetable{
color: red;
}
.searchpriomtable{
color: green;
} }

View File

@ -520,8 +520,9 @@ const cleanAll = () => {
tempDetails = []; tempDetails = [];
$('#titleInput').val('Cleaned!') $('#titleInput').val('Cleaned!')
prepareTable('excelTable', ['Модель','Сер.номер','Заявленная неисправность','Произведенная работа']) prepareTable('excelTable', ['Модель','Сер.номер','Заявленная неисправность','Произведенная работа'])
$('#tablePlace').text('') $('#RepeatedTablePlace').text('')
$('#tablePlace2').text('') $('#SearchLiveTablePlace').text('')
$('#SearchPriomTablePlace').text('')
const dancers = document.querySelector('.bg-tarakan'); const dancers = document.querySelector('.bg-tarakan');
dancers.classList.remove("show-tarakan"); dancers.classList.remove("show-tarakan");
@ -656,7 +657,8 @@ SerialNumber.addEventListener("submit", (e) => {
for (var key in data) { for (var key in data) {
if (data.hasOwnProperty(key)) { if (data.hasOwnProperty(key)) {
console.dir(data[key]); console.dir(data[key]);
$('.repeated').append(buildHtmlTable([data[key]])) $('#RepeatedTablePlace').text('Повтор:')
$('#RepeatedTablePlace').append(buildHtmlTable([data[key]],'search2'))
} }
} }
}) })
@ -671,7 +673,8 @@ SerialNumber.addEventListener("submit", (e) => {
for (var key in data) { for (var key in data) {
if (data.hasOwnProperty(key)) { if (data.hasOwnProperty(key)) {
console.dir(data[key]); console.dir(data[key]);
$('.repeatedx').append(buildHtmlTable([data[key]])) $('#SearchLiveTablePlace').text('Повтор Live:')
$('#SearchLiveTablePlace').append(buildHtmlTable([data[key]],'searchlive'))
} }
} }
}) })
@ -686,7 +689,8 @@ SerialNumber.addEventListener("submit", (e) => {
for (var key in data) { for (var key in data) {
if (data.hasOwnProperty(key)) { if (data.hasOwnProperty(key)) {
console.dir(data[key]); console.dir(data[key]);
$('.repeatedpriom').append(buildHtmlTable([data[key]])) $('#SearchPriomTablePlace').text('АКТ Прием:')
$('#SearchPriomTablePlace').append(buildHtmlTable([data[key]],'searchpriom'))
} }
} }
}) })
@ -714,14 +718,14 @@ async function fetchData(serial, location) {
console.error('Fetch Error:', error); console.error('Fetch Error:', error);
$('#searchText').text(error.message) $('#searchText').text(error.message)
$('.form-btn').css('background-color', 'orangered') $('.form-btn').css('background-color', 'orangered')
throw error; // Re-throw the error to be caught in the main function throw error; // Re-throw the error to be caught in the main function
} }
} }
function buildHtmlTable(arr) {
function buildHtmlTable(arr,search) {
const table = document.createElement('table'); const table = document.createElement('table');
table.setAttribute('id', 'excelTable'); table.setAttribute('id', search);
table.setAttribute('class', 'redtable'); table.setAttribute('class', `${search}table tableplace`);
table.setAttribute('border', '2'); table.setAttribute('border', '2');
// const columns = addAllColumnHeaders(arr, table); // const columns = addAllColumnHeaders(arr, table);
const columns = addRowWithoutHeaders(arr, table); const columns = addRowWithoutHeaders(arr, table);
@ -772,12 +776,9 @@ $("#selectmodel").change(function () {
manualSelectModel = true; manualSelectModel = true;
$("#selectmodel").removeClass("blinking"); $("#selectmodel").removeClass("blinking");
tempModel = document.getElementById("selectmodel").value; tempModel = document.getElementById("selectmodel").value;
// checkModel(tempSerial, tempModel);
cleanCoords(); cleanCoords();
imageFromModel(tempModel) imageFromModel(tempModel)
checkDetails() checkDetails()
// console.log(tempSerial, tempModel);
}); });
const checkModel = (serial, models) => { const checkModel = (serial, models) => {
@ -787,7 +788,6 @@ const checkModel = (serial, models) => {
tempModel = document.getElementById("selectmodel").value; tempModel = document.getElementById("selectmodel").value;
// updateCoords(tempModel); // updateCoords(tempModel);
return; return;
} }

View File

@ -109,8 +109,8 @@
<div class="display-info"> <div class="display-info">
<!-- <textarea id="titleInput" class="inputHolder" placeholder="" rows="" cols="" name="" form=""> </textarea> --> <!-- <textarea id="titleInput" class="inputHolder" placeholder="" rows="" cols="" name="" form=""> </textarea> -->
<div id="excelTableContainer"> <div id="excelTableContainer" class="tableplaceContainer">
<table id="excelTable" border="1"> <table id="excelTable" class="tableplace" border="1">
<tr> <tr>
<td>Модель <td>Модель
</td> </td>
@ -184,13 +184,11 @@
</div> </div>
</div> </div>
<div id="tablePlace" class="repeated"> </div> <div id="RepeatedTablePlace" class="tableplacedown"></div>
<div id="tablePlace2" class="repeatedx"> <div id="SearchLiveTablePlace" class="tableplacedown"></div>
<div id="tablePlace2" class="repeatedpriom"> <div id="SearchPriomTablePlace" class="tableplacedown"></div>
</div>
<div class="additionalButtonsContainer"> <div class="additionalButtonsContainer">
<div id="top2ButtonsContainer"></div> <div id="top2ButtonsContainer"></div>
@ -416,6 +414,9 @@
<area shape="poly" gid="sensor" id="sensor" coords=" " <area shape="poly" gid="sensor" id="sensor" coords=" "
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}' data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#"> href="#">
<area shape="poly" gid="connector" id="connector" coords=" "
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
</map> </map>