This commit is contained in:
2023-06-05 10:10:22 +08:00
parent 9da1c4cf30
commit 634e8b71ab
18 changed files with 367 additions and 143 deletions

View File

@ -166,6 +166,39 @@
opacity: 1;
opacity: initial
}
html::-webkit-scrollbar {
width: 8px;
height: 8px;
}
html::-webkit-scrollbar-thumb {
background-color: rgba(168, 168, 168, 0.9);
border-radius: 4px;
}
#workorderspliter {
height: 6px;
background-color: gray;
cursor: ns-resize;
margin: 6px 0 4px;
}
#workorderdetail {
position: relative;
overflow: auto;
}
#workorderdetail::-webkit-scrollbar {
width: 8px;
height: 8px;
}
#workorderdetail::-webkit-scrollbar-thumb {
background-color: rgba(168, 168, 168, 0.9);
border-radius: 4px;
}
#workorderdetail>.ui-popup-mask {
position: absolute;
}
</style>
<link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" />
@ -1010,6 +1043,10 @@
var dialogWidgets;
var widgetHeight = Number(localStorage.getItem('spliter_height'));
if (isNaN(widgetHeight) || widgetHeight < 100 || widgetHeight > 1000) {
widgetHeight = 300;
}
$(function () {
setPageTitle(GetTextByKey("P_WORKORDER", "Work Order"), true);
$('.iconlayout').on('click', function (ev) {
@ -1062,8 +1099,17 @@
});
$(window).resize(function () {
$("#workorderlist").css("height", $(window).height() - $("#workorderlist").offset().top - 10);
var top = $("#workorderlist").offset().top;
var height = $(window).height() - top - 10;
var widget = wowidgetobj?.workorderwidgets?.length > 0;
if (widget) {
height -= widgetHeight + 10;
}
$("#workorderlist").css("height", height);
grid_dt && grid_dt.resize();
//if (widget) {
// $('#workorderdetail').css('height', top + height + 6);
//}
}).resize();
$('#dialog_alerts').prop('iframe', true).dialog(function () {
@ -1102,6 +1148,46 @@
$('#spExport').hide();
}
var list = document.querySelector('#workorderlist');
var detail = document.querySelector('#workorderdetail');
detail.style.height = widgetHeight + 'px';
document.querySelector('#workorderspliter').addEventListener('mousedown', function (e) {
if (e.buttons !== 1) {
return;
}
var oy = e.clientY;
var oheight = widgetHeight;
var parent = document.body;
var top = document.querySelector('#workorderlist').offsetTop;
var windowHeight = window.innerHeight;
var gridbody = list.querySelector('.data-grid-body');
var headerHeight = list.querySelector('.data-grid-table-header').offsetHeight;
var move = function (e2) {
if (e2.buttons !== 1) {
parent.dispatchEvent(new MouseEvent('mouseup'));
return;
}
var y = e2.clientY - oy;
var height = oheight - y;
if (height > 100) {
widgetHeight = height;
detail.style.height = widgetHeight + 'px';
height = windowHeight - top - 10 - height - 10;
list.style.height = height + 'px';
gridbody.style.height = (height - headerHeight) + 'px';
}
};
parent.addEventListener('mousemove', move, { passive: false });
var up = function () {
grid_dt?.resize();
parent.removeEventListener('mousemove', move, { passive: false });
parent.removeEventListener('mouseup', up);
localStorage.setItem('spliter_height', String(widgetHeight));
};
parent.addEventListener('mouseup', up);
});
openmsgwebsocket();
});
@ -1437,7 +1523,8 @@
</div>
<div class="clear"></div>
<div id="workorderlist"></div>
<div id="workorderdetail"></div>
<div id="workorderspliter" style="display: none"></div>
<div id="workorderdetail" style="display: none"></div>
</div>
<div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>