update : 18.07.2025 14:12:59,63

This commit is contained in:
Sabron 2025-07-18 14:12:59 +07:00
parent 4aeee723c6
commit 6aff26951a
18 changed files with 153 additions and 305 deletions

View File

@ -88,18 +88,32 @@ def save_external_system(request):
post_param = request.POST.dict()
print(post_param)
if 'id' in post_param:
external_system = GtoExternalSystem.objects.filter(id=post_param['id']).first()
if external_system is not None:
external_system.external_system = post_param['external_system']
external_system.adress = post_param['adress']
external_system.login = post_param['login']
external_system.password = post_param['password']
external_system.token = post_param['token']
external_system.bd_name = post_param['bd_name']
external_system.active = False
if post_param['id'] == '0':
active = False
if 'active' in post_param:
external_system.active = True
external_system.save()
active = True
external_system = GtoExternalSystem.objects.create(
external_system = post_param['external_system'],
adress = post_param['adress'],
login = post_param['login'],
password = post_param['password'],
token = post_param['token'],
bd_name = post_param['bd_name'],
active = active
)
else:
external_system = GtoExternalSystem.objects.filter(id=post_param['id']).first()
if external_system is not None:
external_system.external_system = post_param['external_system']
external_system.adress = post_param['adress']
external_system.login = post_param['login']
external_system.password = post_param['password']
external_system.token = post_param['token']
external_system.bd_name = post_param['bd_name']
external_system.active = False
if 'active' in post_param:
external_system.active = True
external_system.save()
data =dict()
data.update(status='ok')
data.update(response=post_param)

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "management_base.html" %}
{% load static %}
{% load mysettings %}
@ -31,8 +31,8 @@
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="/management/">Главная</a></li>
<li class="breadcrumb-item"><a href="/management/">Параметры системы </a></li>
<li class="breadcrumb-item"><a href="/management/gto/">Горнотранспортное оборудование</a></li>
<li class="breadcrumb-item active">Настройка отображения</li>
</ol>
</div>
</div>

View File

@ -104,7 +104,7 @@
</div> <!-- /.card-header -->
<div class="card-body table-responsive p-0">
<table class="table table-bordered table-hover table-head-fixed text-nowrap">
<table class="table table-bordered table-hover table-head-fixed text-nowrap text-sm">
<thead>
<tr role="row" >
<th></th>
@ -259,7 +259,7 @@
</form>
</div>
<div class="modal-footer justify-content-between">
<button id="id_external_system_ok" type="button" class="btn btn-primary" onclick="ClickOK()">Сохранить</button>
<button id="id_external_system_ok" type="button" class="btn btn-primary" onclick="ClickGtoOK()">Сохранить</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>
</div>
</div>
@ -273,39 +273,8 @@
{% block footer %}{% endblock %}
{% block script_footer %}
<script>
<script src="{% static 'js/management/gto.js' %}?ver={% settings_value 'APP_VER' %}"></script>
function delete_user(id) {
var Rec = $.ajax({
method: 'POST',
url: window.location.icon.image.urlname + 'user/delete/',
async: true,
data: {
id: id,
cmd: 'delete',
},
success: function (data) {
document.getElementById("tr_" + id).remove();
$('#large_' + id).modal('hide');
$('body').removeClass('modal-open');
$('body').css({"height": "auto", "padding-right": "0px"});
$('.modal-backdrop').remove();
},
error: function (dataerr) {
$('#large_' + id).modal('hide');
$('body').removeClass('modal-open');
$('.modal-backdrop').remove();
alert('Ошибка выполнение команды')
}
//timeout: 120000
});
return false;
}
</script>
<script>
const forms = document.querySelectorAll('.form-horizontal');
for (const form of forms) {

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "management_base.html" %}
{% load static %}
{% load mysettings %}
@ -30,9 +30,9 @@
<h4>Добавление изображения горнотранспортного оборудования</h4>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="/management/">Главная</a></li>
<li class="breadcrumb-item"><a href="/management/">Параметры системы </a></li>
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="/management/gto/">Горнотранспортное оборудование</a></li>
<li class="breadcrumb-item active">Настройка отображения</li>
</ol>
</div>
</div>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "management_base.html" %}
{% load static %}
{% load mysettings %}

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "management_base.html" %}
{% load static %}
{% load mysettings %}

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "management_base.html" %}
{% load static %}
{% load mysettings %}

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "management_base.html" %}
{% load static %}
{% load mysettings %}

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "management_base.html" %}
{% load static %}
{% load mysettings %}
@ -31,8 +31,8 @@
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="/management/">Главная</a></li>
<li class="breadcrumb-item"><a href="/management/">Параметры системы</a></li>
<li class="breadcrumb-item"><a href="/management/general/">Главная</a></li>
<li class="breadcrumb-item">Параметры системы</li>
</ol>
</div>
</div>

View File

@ -102,8 +102,8 @@
{% endblock %}
</div> <!-- /.card-header -->
<div class="card-body table-responsive">
<table class="table table-bordered table-hover table-head-fixed table-sm">
<div class="card-body table-responsive p-0">
<table class="table table-bordered table-hover table-head-fixed text-nowrap text-sm">
<thead>
<tr role="row" >
<th></th>
@ -179,7 +179,7 @@
<input type="checkbox" disabled {% if catalog.profile.isredonly %} checked {% endif %} id="checkboxSuccess{{ catalog.id }}"">
<label for="checkboxSuccess{{ catalog.id }}"></label>
</div>
</div>
</td>
</tr>
{% endfor %}

View File

@ -17,7 +17,7 @@ def manage_gto_icons(request):
context = generalmodule.get_context_template()
gto_icons = ModelTypeIcons.objects.all().order_by("model")
context.update({"gto_icons": gto_icons})
return render(request, "gto_icons.html", context)
return render(request, "gto/gto_icons.html", context)
@login_required(login_url="/")
@ -58,7 +58,7 @@ def add_gto_icon(request):
else:
form = ModelTypeIconsForm()
return render(request, "icon_add.html", {"form": form})
return render(request, "gto/icon_add.html", {"form": form})
except Exception:
logging.error(traceback.format_exc())
return redirect("management:main_index")

View File

@ -36,7 +36,7 @@ def save(request):
def main(request):
try:
get_param = request.GET.dict()
external_system_list = GtoExternalSystem.objects.all()
external_system_list = GtoExternalSystem.objects.order_by('external_system').all()
context = generalmodule.get_context_template()
context.update({
'external_system_list':external_system_list,

View File

@ -76,8 +76,6 @@ INSTALLED_APPS = [
# Местоположение персонала
"apps.workerslocation.apps.WorkersLocationConfig",
"django_cleanup.apps.CleanupConfig",
# Версионирование
"versioning",
]
"""Информация о приложении """

View File

@ -7,7 +7,6 @@ from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.urls import path
from django.views.generic import RedirectView
from versioning.core import Update
from apps.general.views import settingsmodule
from apps.schedulers import tasks
@ -43,7 +42,6 @@ if settings.DEBUG:
urlpatterns += static(settings.DOWNLOAD_URL, document_root=settings.DOWNLOAD_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
settingsmodule.settings_install()
Update().ready()
if not settings.DEBUG:
tasks.load_navigation()

79
r.txt
View File

@ -1,79 +0,0 @@
amqp==5.1.1
anyio==3.3.0
APScheduler==3.6.3
asgiref==3.8.1
async-timeout==4.0.2
backports.zoneinfo==0.2.1
beautifulsoup4==4.12.2
billiard==3.6.4.0
branca==0.7.1
bs4==0.0.1
cached-property==1.5.2
cachetools==4.2.2
celery==5.2.7
certifi==2021.5.30
charset-normalizer==2.0.4
click==8.1.3
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
colorama==0.4.6
cron_descriptor==1.4.0
cx-Oracle==8.3.0
Deprecated==1.2.13
Django==3.2.25
django-celery-beat==2.5.0
django-celery-results==2.1.0
django-cleanup==8.1.0
django-cors-headers==3.8.0
django-environ==0.11.2
django-timezone-field==5.1
et_xmlfile==2.0.0
folium==0.16.0
GDAL @ file:///C:/Project/VC/ÊèáåðÊîä/mfssogr/mfssogr/mfssogr/gdal/GDAL-3.6.2-cp310-cp310-win_amd64.whl#sha256=a51f9ee183b9d4b2978ea266e2b85ca4ee50bc6f15a91f56779edd16929e4cff
gunicorn==20.1.0
haversine==2.8.1
idna==3.4
importlib-metadata==4.5.0
Jinja2==3.1.3
kombu==5.2.4
lxml==4.9.3
Markdown==3.7
MarkupSafe==2.1.5
numpy==1.26.4
openpyxl==3.1.5
packaging==21.3
pillow==11.2.1
prompt-toolkit==3.0.38
psutil==7.0.0
psycopg2-binary==2.9.1
pydub==0.25.1
pyodbc==5.1.0
pyparsing==3.0.9
python-crontab==2.7.1
python-dateutil==2.8.2
python-telegram-bot==13.7
pytz==2024.2
pytz-deprecation-shim==0.1.0.post0
redis==4.3.4
requests==2.31.0
six==1.16.0
sniffio==1.3.0
soupsieve==2.6
sqlparse==0.5.3
tabulate==0.9.0
tornado==6.2
tqdm==4.64.1
typing_extensions==4.12.2
tzdata==2023.3
tzlocal==4.3
urllib3==1.26.15
utm==0.7.0
versioning @ git+https://git.cybercode.pro/zakhy/versioning.git@84c14a95590e853bf2656fb0ee1fc0730c8a771a
vine==5.0.0
wcwidth==0.2.6
websocket-client==1.8.0
websockets==13.1
wrapt==1.15.0
xyzservices==2023.10.1
zipp==3.15.0

BIN
reg.txt

Binary file not shown.

View File

@ -1,15 +1,10 @@
btn_general_save = document.getElementById('id_general_btn_save').onclick = ClickGeneralSave;
async function ClickGeneralSave() {
var Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 2000
});
formdata = new FormData(id_form_general)
async function LoadData(id) {
console.log(id)
formdata = new FormData()
formdata.append('id',id)
const csrftoken = getCookie('csrftoken');
let response = await fetch('/management/general/save/', {
let response = await fetch('/gto/get_external_system/', {
method: 'POST',
body: formdata,
headers: {"X-CSRFToken": csrftoken},
@ -17,13 +12,108 @@ async function ClickGeneralSave() {
let result = await response.json();
if (result.status=='ok'){
toastr.success('Параметры сохранены')
console.log(result.response.active)
$("#id").val(result.response.id)
$("#id_adress").val(result.response.adress)
$("#id_login").val(result.response.login)
$("#id_password").val(result.response.password)
$("#id_bd_name").val(result.response.bd_name)
$("#id_token").val(result.response.token)
$('#id_active').prop('checked', result.response.active);
}else{
toastr.error('Ошибка. Параметры не записы.')
}
}
$("#modal-edit").modal('show')
}
async function openedit(id) {
if (id>0){
LoadData(id)
}
$("#modal-edit").modal('show')
}
async function ClickGtoOK() {
var Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 2000
});
id= $("#id").val()
//if (validateFormIncidentResolution()==false){return}
formdata = new FormData(id_form_external_system)
const csrftoken = getCookie('csrftoken');
let response = await fetch('/gto/save_external_system/', {
method: 'POST',
body: formdata,
headers: {"X-CSRFToken": csrftoken},
});
let result = await response.json();
if (result.status=='ok'){
if (id>0){
$("#id_td_adress"+id).html(result.response.adress)
$("#id_td_name"+id).html(result.name)
$('#id_td_active'+id).prop('checked', false);
if (result.response.active=='on'){
$('#id_td_active'+id).prop('checked', true);
}
}else{
location.reload()
}
$('#modal-edit').modal('hide')
toastr.success('Запись "'+result.name+'" успешно сохранена.')
const form = document.getElementById("id_form_external_system");
form.reset();
}else{
}
//const form = document.getElementById('id_form_external_system'+id);
//form.reset();
}
async function delete_external_system(id) {
var Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 2000
});
formdata = new FormData()
formdata.append('id',id)
const csrftoken = getCookie('csrftoken');
let response = await fetch('/gto/delete_external_system/', {
method: 'POST',
body: formdata,
headers: {"X-CSRFToken": csrftoken},
});
let result = await response.json();
if (result.status=='ok'){
$('#large_'+id).modal('hide')
$('#tr_'+id).remove()
$('.modal-backdrop').remove()
toastr.success('Запись "'+result.name+'" удалена.')
}else{
}
//const form = document.getElementById('id_form_external_system'+id);
//form.reset();
}
// Событие после загрузки страницы
document.addEventListener("DOMContentLoaded", async () => { });
document.addEventListener("DOMContentLoaded", async () => {
//Initialize Select2 Elements
$('.select2').select2()
});

View File

@ -71,148 +71,6 @@ async function updateIncident() {
}
async function ClickOKExternalSystem(id) {
var Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 2000
});
form_data = document.getElementById('id_form_external_system'+id)
//if (validateFormIncidentResolution()==false){return}
formdata = new FormData(form_data)
const csrftoken = getCookie('csrftoken');
let response = await fetch('/gto/save_external_system/', {
method: 'POST',
body: formdata,
headers: {"X-CSRFToken": csrftoken},
});
let result = await response.json();
if (result.status=='ok'){
$("#id_td_adress"+id).html(result.response.adress)
$("#id_td_name"+id).html(result.name)
$('#id_td_active'+id).prop('checked', false);
if (result.response.active=='on'){
$('#id_td_active'+id).prop('checked', true);
}
$('#modal-edit_'+id).modal('hide')
toastr.success('Запись "'+result.name+'" успешно сохранена.')
}else{
}
//const form = document.getElementById('id_form_external_system'+id);
//form.reset();
}
async function delete_external_system(id) {
var Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 2000
});
form_data = document.getElementById('id_form_external_system'+id)
//if (validateFormIncidentResolution()==false){return}
formdata = new FormData(form_data)
const csrftoken = getCookie('csrftoken');
let response = await fetch('/gto/delete_external_system/', {
method: 'POST',
body: formdata,
headers: {"X-CSRFToken": csrftoken},
});
let result = await response.json();
if (result.status=='ok'){
$('#large_'+id).modal('hide')
$('#tr_'+id).remove()
$('.modal-backdrop').remove()
toastr.success('Запись "'+result.name+'" удалена.')
}else{
}
//const form = document.getElementById('id_form_external_system'+id);
//form.reset();
}
async function LoadData(id) {
console.log(id)
formdata = new FormData()
formdata.append('id',id)
const csrftoken = getCookie('csrftoken');
let response = await fetch('/gto/get_external_system/', {
method: 'POST',
body: formdata,
headers: {"X-CSRFToken": csrftoken},
});
let result = await response.json();
if (result.status=='ok'){
console.log(result.response.active)
$("#id").val(result.response.id)
$("#id_adress").val(result.response.adress)
$("#id_login").val(result.response.login)
$("#id_password").val(result.response.password)
$("#id_bd_name").val(result.response.bd_name)
$("#id_token").val(result.response.token)
$('#id_active').prop('checked', result.response.active);
}else{
}
$("#modal-edit").modal('show')
}
async function openedit(id) {
console.log(id)
if (id>0){
LoadData(id)
}
$("#modal-edit").modal('show')
}
async function ClickOK() {
var Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 2000
});
id= $("#id").val()
//if (validateFormIncidentResolution()==false){return}
formdata = new FormData(id_form_external_system)
const csrftoken = getCookie('csrftoken');
let response = await fetch('/gto/save_external_system/', {
method: 'POST',
body: formdata,
headers: {"X-CSRFToken": csrftoken},
});
let result = await response.json();
if (result.status=='ok'){
$("#id_td_adress"+id).html(result.response.adress)
$("#id_td_name"+id).html(result.name)
$('#id_td_active'+id).prop('checked', false);
if (result.response.active=='on'){
$('#id_td_active'+id).prop('checked', true);
}
$('#modal-edit').modal('hide')
toastr.success('Запись "'+result.name+'" успешно сохранена.')
}else{
}
//const form = document.getElementById('id_form_external_system'+id);
//form.reset();
}
// Событие после загрузки страницы
document.addEventListener("DOMContentLoaded", async () => {