modified: public/lib/inter.js
modified: views/admin/objects/object_groups.ejs modified: views/header.ejs modified: views/load.ejs modified: views/project.ejs modified: views/static/end.ejs modified: views/static/start.ejs
This commit is contained in:
parent
5133931122
commit
b511d033f5
|
@ -52,6 +52,7 @@ function create(clas,x,y,body,id,size){
|
||||||
obj.style.height = `${db_data["height"] * 2}px`;
|
obj.style.height = `${db_data["height"] * 2}px`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
calc_total();
|
||||||
})
|
})
|
||||||
root.append(obj);
|
root.append(obj);
|
||||||
set_pos(obj,x,y);
|
set_pos(obj,x,y);
|
||||||
|
@ -90,21 +91,35 @@ function wall_size_change(type,value = null){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function calc_total(){
|
function calc_total(start = false){
|
||||||
|
document.getElementById("cost_list").innerHTML = ""
|
||||||
|
if (start) {
|
||||||
|
document.getElementById("proj_cost").setAttribute("value",`стоимость: ${objs["total"]} руб.`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
let total=0;
|
let total=0;
|
||||||
Object.entries(objs).forEach(([key,value]) => {
|
Object.entries(objs).forEach(([key,value]) => {
|
||||||
|
// console.log(key);
|
||||||
if(key != "height"&&key!="width"&key!="total"){
|
if(key != "height"&&key!="width"&key!="total"){
|
||||||
// console.log(key,value);
|
|
||||||
// console.log(Object.keys(value).length);
|
// console.log(Object.keys(value).length);
|
||||||
// console.log(objs_store[key]);
|
// console.log(objs_store[key]);
|
||||||
if(objs_store[key] != null){
|
if(objs_store[key] != null){
|
||||||
|
// console.log(key,value);
|
||||||
total += parseInt(parseInt(objs_store[key]["cost"]) * Object.keys(value).length);
|
total += parseInt(parseInt(objs_store[key]["cost"]) * Object.keys(value).length);
|
||||||
|
let obj_cost_div = document.createElement("li");
|
||||||
|
obj_cost_div.innerHTML =
|
||||||
|
`<div style="display:flex;"> <div id='obj_cost_name'>${key.split("/g/")[0].replace("$"," ")}</div>`+
|
||||||
|
`<div id='obj_cost_count'> ${Object.keys(value).length}x</div> </div>`+
|
||||||
|
`<div id='obj_cost'>${parseInt(parseInt(objs_store[key]["cost"]) * Object.keys(value).length)}</div>`;
|
||||||
|
document.getElementById("cost_list").append(obj_cost_div);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// console.log(Object.keys(objs).at(-1));
|
// console.log(Object.keys(objs).at(-1));
|
||||||
});
|
});
|
||||||
// return total;
|
// return total;
|
||||||
document.getElementById("proj_cost").innerText = total;
|
|
||||||
|
objs["total"] = total;
|
||||||
|
document.getElementById("proj_cost").setAttribute("value",`стоимость: ${total} руб.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function load(objss){
|
function load(objss){
|
||||||
|
@ -135,7 +150,6 @@ function load(objss){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
resize_drags();
|
resize_drags();
|
||||||
calc_total()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function load_proj_cloud(){
|
function load_proj_cloud(){
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#obj_group button,#obj_group select{
|
#obj_group button,#obj_group select{
|
||||||
height: 25px;
|
height: 50px;
|
||||||
margin: auto 0px;
|
margin: auto 0px;
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div id="obj_group">
|
<div id="obj_group">
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<h1>группы товаров</h1>
|
<h1>группы товаров</h1>
|
||||||
<select name="" id="group_select" onchange="edit_get_objs();"></select>
|
<select name="" id="group_select" onchange="edit_get_objs();"></select>
|
||||||
<div style="display: flex;justify-content: space-between;width: 220px;">
|
<div style="display: flex;justify-content: space-between;width: 350px;">
|
||||||
<button onclick="create_new_group()">создать группу</button>
|
<button onclick="create_new_group()">создать группу</button>
|
||||||
<button onclick="delete_group()">удалить группу</button>
|
<button onclick="delete_group()">удалить группу</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -49,16 +49,19 @@
|
||||||
background: ghostwhite;
|
background: ghostwhite;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: 1px black dashed;
|
border: 1px black dashed;
|
||||||
padding: 5px;
|
padding: 2px;
|
||||||
|
width: 220px;
|
||||||
}
|
}
|
||||||
.cmenu{
|
.cmenu{
|
||||||
position: fixed;
|
position: absolute;
|
||||||
display: grid;
|
display: grid;
|
||||||
background: ghostwhite;
|
background: ghostwhite;
|
||||||
color: black;
|
color: black;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: 1px black solid;
|
border: 1px black solid;
|
||||||
z-index: 100;
|
border-top: 0px;
|
||||||
|
z-index: 500;
|
||||||
|
/* width: 218px; */
|
||||||
}
|
}
|
||||||
#top_panel_right_main{
|
#top_panel_right_main{
|
||||||
/* float: right; */
|
/* float: right; */
|
||||||
|
@ -129,9 +132,10 @@
|
||||||
<div id="user_menu" class="cmenu"></div>
|
<div id="user_menu" class="cmenu"></div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="top_div" style="background-color: rgba(red, green, blue, 0.5); width: 100%;height: 100%;position: absolute;inset: 0px;z-index: 300; display: none;" onclick="hide_menus()"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// get_from_uuid((res)=>{
|
get_from_uuid((res)=>{
|
||||||
// let uname = document.getElementById("user_name");
|
// let uname = document.getElementById("user_name");
|
||||||
// let menu = document.getElementById("user_menu");
|
// let menu = document.getElementById("user_menu");
|
||||||
// let header = document.getElementById("top_panel");
|
// let header = document.getElementById("top_panel");
|
||||||
|
@ -141,15 +145,19 @@
|
||||||
// if(document.title != "main") menu.innerHTML += `<button onclick="goto('/');">проекты</button> <br>`;
|
// if(document.title != "main") menu.innerHTML += `<button onclick="goto('/');">проекты</button> <br>`;
|
||||||
// right.innerHTML += `<div id="user_name" class="menu_btn">${res["login"]}</div>`;
|
// right.innerHTML += `<div id="user_name" class="menu_btn">${res["login"]}</div>`;
|
||||||
|
|
||||||
// if (res["admin"] == true){
|
let menu = document.getElementById("top_panel_center");
|
||||||
// menu.innerHTML += `<button onclick='goto("/admin")'>админ. панель</button><br>`;
|
if (res["admin"] == true){
|
||||||
// }
|
menu.innerHTML += `<button onclick='goto("/admin")'>админ. панель</button><br>`;
|
||||||
|
}
|
||||||
// menu.innerHTML += "<button onclick='logout();'>выйти</button><br>";
|
// menu.innerHTML += "<button onclick='logout();'>выйти</button><br>";
|
||||||
// });
|
});
|
||||||
|
|
||||||
onscroll = (e)=>{
|
onscroll = (e)=>{
|
||||||
hide_menus();
|
hide_menus();
|
||||||
}
|
}
|
||||||
|
onresize = (e)=>{
|
||||||
|
hide_menus();
|
||||||
|
}
|
||||||
onclick = (e) => {
|
onclick = (e) => {
|
||||||
// e.preventDefault()
|
// e.preventDefault()
|
||||||
// console.log(e);
|
// console.log(e);
|
||||||
|
@ -214,7 +222,13 @@
|
||||||
// document.body.appendChild(menu)
|
// document.body.appendChild(menu)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else if(e.target.id == "proj_cost"){
|
||||||
|
document.getElementById("cost_list").style = `margin-top:3vw;left:${e.target.getBoundingClientRect().left}px`;
|
||||||
|
console.log("cost_list");
|
||||||
|
}
|
||||||
else if(e.target.id == "group_drop"){
|
else if(e.target.id == "group_drop"){
|
||||||
|
document.getElementById("group").style = `margin-top:2vw;left:${e.target.getBoundingClientRect().left}px;width: 14vw;padding: 7.5px;`;
|
||||||
|
console.log("group");
|
||||||
// hide_menus();
|
// hide_menus();
|
||||||
// let menu = document.getElementById("object_edit_menu");
|
// let menu = document.getElementById("object_edit_menu");
|
||||||
// let obj = e.target;
|
// let obj = e.target;
|
||||||
|
@ -226,8 +240,8 @@
|
||||||
// // document.body.appendChild(menu)
|
// // document.body.appendChild(menu)
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
// else{
|
||||||
hide_menus();
|
// hide_menus();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
|
@ -53,6 +53,7 @@
|
||||||
logo.style.left = loaded_pos.x;
|
logo.style.left = loaded_pos.x;
|
||||||
logo.style.top = loaded_pos.y;
|
logo.style.top = loaded_pos.y;
|
||||||
logo.style.width = loaded_pos.w
|
logo.style.width = loaded_pos.w
|
||||||
|
load_div.style.height = `${document.getElementsByTagName("body")[0].scrollHeight}px`;
|
||||||
}
|
}
|
||||||
function loading(){
|
function loading(){
|
||||||
let logo = document.getElementById("load_logo");
|
let logo = document.getElementById("load_logo");
|
||||||
|
@ -63,5 +64,6 @@
|
||||||
logo.style.left = loading_pos.x;
|
logo.style.left = loading_pos.x;
|
||||||
logo.style.top = loading_pos.y;
|
logo.style.top = loading_pos.y;
|
||||||
logo.style.width = loading_pos.w
|
logo.style.width = loading_pos.w
|
||||||
|
load_div.style.height = `${document.getElementsByTagName("body")[0].scrollHeight}px`;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
|
@ -112,7 +112,6 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
width: 200px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@ -142,6 +141,27 @@
|
||||||
<label for="wall_color" style="margin: auto;">цвет стены</label>
|
<label for="wall_color" style="margin: auto;">цвет стены</label>
|
||||||
<input type="color" id="wall_color" style="width: 50px;" value="#000000" onchange="wall_color_change()">
|
<input type="color" id="wall_color" style="width: 50px;" value="#000000" onchange="wall_color_change()">
|
||||||
</div>
|
</div>
|
||||||
|
<div style="display: flex;width: 15vw;justify-content: space-between; background-color: #aaa;">
|
||||||
|
<input type="button" id="proj_cost" class="menu_btn" value="Расчет стоимости" onclick="cost_drop();open_menu();" style="width: 100%;">
|
||||||
|
<style>
|
||||||
|
#cost_list li{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 14vw;
|
||||||
|
}
|
||||||
|
#cost_list{
|
||||||
|
list-style-type: none;
|
||||||
|
padding-left: 0px;
|
||||||
|
margin-top: 59px;
|
||||||
|
position: absolute;
|
||||||
|
width: 14vw;
|
||||||
|
padding: 0.45vw;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<ul id="cost_list" class="cmenu">
|
||||||
|
</ul>
|
||||||
|
<!-- <div style="display: flex;"><div id="proj_cost"></div> руб.</div> -->
|
||||||
|
</div>
|
||||||
<!-- <div style="display: flex;width: 150px;justify-content: space-between;">
|
<!-- <div style="display: flex;width: 150px;justify-content: space-between;">
|
||||||
<label style="margin: auto;">Расчёт стоимости</label>
|
<label style="margin: auto;">Расчёт стоимости</label>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
@ -154,14 +174,9 @@
|
||||||
<div class="wall dropzone" id="wall"></div>
|
<div class="wall dropzone" id="wall"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="display:flex; justify-content: space-around;"><div style="display: flex;"><div id="proj_cost"></div> руб.</div></div>
|
<div style="display:flex; justify-content: space-around;"></div>
|
||||||
|
|
||||||
<div class="inputs" style="display: flex;justify-content: space-between;">
|
<div class="inputs" style="display: flex;justify-content: space-between;">
|
||||||
<div id="obj_group" style="display: flex;justify-content: space-between; width: 30vw;">
|
|
||||||
<!-- <button name="" id="group_drop" >Помехи на стене</button> -->
|
|
||||||
<button name="" id="group_drop" onclick="group_drop()">Оборудование</button>
|
|
||||||
<ul id="group" class="cmenu"></ul>
|
|
||||||
</div>
|
|
||||||
<div style="display: flex;justify-content: space-between; width: 20vw;">
|
<div style="display: flex;justify-content: space-between; width: 20vw;">
|
||||||
<div>copy</div>
|
<div>copy</div>
|
||||||
<div>back</div>
|
<div>back</div>
|
||||||
|
@ -173,6 +188,14 @@
|
||||||
<div>load</div>
|
<div>load</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="inputs" style="display: flex;justify-content: space-between;margin-top: 0px;">
|
||||||
|
<div id="obj_group" style="display: flex;justify-content:space-evenly; width: 100vw;">
|
||||||
|
<!-- <button name="" id="group_drop" >Помехи на стене</button> -->
|
||||||
|
<button name="" id="group_drop" class="menu_btn" onclick="group_drop();open_menu();" style="width: 15vw;padding: 2px;">Оборудование</button>
|
||||||
|
<button name="" id="group_drop" class="menu_btn" onclick="group_drop();open_menu();" style="width: 15vw;padding: 2px;">помехи</button>
|
||||||
|
<ul id="group" class="cmenu"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="czones" style="height: 500px;"></div>
|
<div class="czones" style="height: 500px;"></div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -182,9 +205,9 @@
|
||||||
|
|
||||||
function group_drop(){
|
function group_drop(){
|
||||||
let e = document.getElementById("group_drop")
|
let e = document.getElementById("group_drop")
|
||||||
// document.getElementById("group").style = `top:${e.getBoundingClientRect().top+40}px;left:${e.getBoundingClientRect().left - 5}px`;
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
document.getElementById("group").style.display = "block";
|
document.getElementById("group").style.display = "block";
|
||||||
|
// document.getElementById("group").style.left = document.getElementById("group_drop").getBoundingClientRect().left;
|
||||||
let childs = document.getElementById("group").getElementsByTagName("input");
|
let childs = document.getElementById("group").getElementsByTagName("input");
|
||||||
let i = 0;
|
let i = 0;
|
||||||
Object.entries(childs).forEach(([key,value]) => {
|
Object.entries(childs).forEach(([key,value]) => {
|
||||||
|
@ -202,6 +225,28 @@
|
||||||
},1)
|
},1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cost_drop(id){
|
||||||
|
// let e = document.getElementById("cost")
|
||||||
|
// setTimeout(()=>{
|
||||||
|
// document.getElementById("group").style.display = "block";
|
||||||
|
// // document.getElementById("group").style.left = document.getElementById("group_drop").getBoundingClientRect().left;
|
||||||
|
// let childs = document.getElementById("group").getElementsByTagName("input");
|
||||||
|
// let i = 0;
|
||||||
|
// Object.entries(childs).forEach(([key,value]) => {
|
||||||
|
// console.log(key,value);
|
||||||
|
// if(value.checked == true){
|
||||||
|
// get_objs(value)
|
||||||
|
// i++;
|
||||||
|
// }
|
||||||
|
// if (i==0){
|
||||||
|
// document.getElementsByClassName("czones")[0].innerHTML = "";
|
||||||
|
// drag_start()
|
||||||
|
// // e.removeChild(e.getElementsByClassName(value))
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// },1)
|
||||||
|
}
|
||||||
|
|
||||||
function wall_color_change(){
|
function wall_color_change(){
|
||||||
let wall = document.getElementById("wall")
|
let wall = document.getElementById("wall")
|
||||||
let color = document.getElementById("wall_color")
|
let color = document.getElementById("wall_color")
|
||||||
|
|
|
@ -14,6 +14,13 @@
|
||||||
Object.entries(menus).forEach(([key,menu]) => {
|
Object.entries(menus).forEach(([key,menu]) => {
|
||||||
menu.style.display = "none";
|
menu.style.display = "none";
|
||||||
});
|
});
|
||||||
|
let menu_screen = document.getElementById("top_div");
|
||||||
|
menu_screen.style.display = "none";
|
||||||
|
}
|
||||||
|
function open_menu(){
|
||||||
|
let menu_screen = document.getElementById("top_div");
|
||||||
|
menu_screen.style.display = "block";
|
||||||
|
menu_screen.style.height = `${document.getElementsByTagName("body")[0].scrollHeight}px`;
|
||||||
}
|
}
|
||||||
hide_menus();
|
hide_menus();
|
||||||
$('form').on('submit', function(event) {
|
$('form').on('submit', function(event) {
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
:root{
|
:root{
|
||||||
--login-inp-w:30vw;
|
--login-inp-w:30vw;
|
||||||
--login-inp-h: 7.8vh;
|
--login-inp-h: 7.8vh;
|
||||||
--main-font-size: 1.5vw;
|
--main-font-size: 1.3vw;
|
||||||
}
|
}
|
||||||
.main{
|
.main{
|
||||||
width: 90vw;
|
width: 90vw;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user