mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 21:45:41 +00:00
feat: arrastar mesas tambem para depósito
This commit is contained in:
Binary file not shown.
@@ -34,22 +34,25 @@ RRB&C - Mapa de Mesas
|
||||
style="background-color: rgba(0, 0, 255, 0);
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
left: {{eixo.y}}px;
|
||||
top: {{eixo.x}}px;position: absolute">
|
||||
left: {{eixo.y}}px;
|
||||
top: {{eixo.x}}px;position: absolute" >
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
|
||||
<h2>Depósito</h2>
|
||||
<div id="drop" >
|
||||
{% for mesa in mesas %}
|
||||
|
||||
{% if mesa.active == True %}
|
||||
<div id="{{mesa.id}}" class="m-card" ondragend="saveLocal()" draggable="true" style=" position: absolute; background-color: indianred;" >{{mesa.name}} <input type="text" hidden value="{{mesa.location}}"> </div>
|
||||
<div id="{{mesa.id}}" class="m-card" ondragend="saveLocal()" draggable="true" style=" background-color: indianred;" >{{mesa.name}} <input type="text" hidden value="{{mesa.location}}"> </div>
|
||||
{% else %}
|
||||
<div id="{{mesa.id}}" class="m-card" ondragend="saveLocal()" draggable="true" >{{mesa.name}} <input type="text" hidden value="{{mesa.location}}"></div>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -54,4 +54,15 @@
|
||||
.espaco {
|
||||
border: 0.3px solid #cccccc56;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
|
||||
#drop {
|
||||
display: flex;
|
||||
background-color: rgb(75, 75, 75);
|
||||
border-radius: 15px;
|
||||
padding: 15px;
|
||||
margin: 15px;
|
||||
min-height: 300px;
|
||||
max-width: 1370px;
|
||||
}
|
||||
@@ -44,8 +44,13 @@ function saveLocal() {
|
||||
const mesaElement = event.target;
|
||||
const targetElement = event.target.parentNode;
|
||||
const mesaId = mesaElement.id
|
||||
|
||||
const targetId = targetElement.id;
|
||||
const parentNodeClass = targetElement.classList.value
|
||||
console.log(parentNodeClass)
|
||||
|
||||
|
||||
if (parentNodeClass == 'espaco' || targetId == 'drop'){
|
||||
|
||||
const url = `/mesas/locationMesa/${mesaId}/${targetId}/`;
|
||||
var resposta = fetch(url, {method: 'POST',
|
||||
headers: {'Content-Type': 'application/json',
|
||||
@@ -61,6 +66,9 @@ var resposta = fetch(url, {method: 'POST',
|
||||
console.log(document.cookie)
|
||||
console.error('Erro ao salvar local:', error);
|
||||
});
|
||||
}else{
|
||||
alert('Aqui não pode!!!')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user