This commit is contained in:
2024-03-26 15:56:31 +08:00
parent 634e8b71ab
commit 0855ae42cd
547 changed files with 94818 additions and 60463 deletions

View File

@ -60,20 +60,14 @@
function InitGridData() {
var div_grid = $('<div style="flex: 1 1 auto"></div>');
var grid_dt = new GridView(div_grid);
var grid_dt = createGridView(div_grid);
layouts.grid = grid_dt;
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt.canMultiSelect = false;
grid_dt.columns = [
{
caption: GetTextByKey('P_LAYOUT_NAME', 'Layout Name'),
key: 'Name',
width: 200,
isurl: true,
events: {
onclick: function () {
doedit(this.Id);
@ -92,31 +86,28 @@
width: 300
},
{
isurl: true,
sortable : false,
resizable: false,
orderable: false,
sortable: false,
type: GridView.ColumnTypes.Icon,
text: 'edit',
width: 40,
align: 'center',
text: '\uf044',
events: {
onclick: function () {
doedit(this.Id);
}
},
classFilter: function () { return 'icon-col' },
attrs: {
title: GetTextByKey('P_WOS_EDIT', 'Edit')
}
},
{
isurl: true,
resizable: false,
orderable: false,
sortable: false,
resizable: false,
type: GridView.ColumnTypes.Icon,
text: 'times',
width: 40,
align: 'center',
text: '\uf00d',
events: {
onclick: function () {
var id = this.Id;
@ -141,16 +132,15 @@
);
}
},
classFilter: function () { return 'icon-col' },
attrs: {
title: GetTextByKey('P_WOS_DELETE', 'Delete')
}
}
];
grid_dt.init();
grid_dt.rowdblclick = layouts.onedit;
grid_dt.onRowDblClicked = layouts.onedit;
grid_dt.selectedrowchanged = function (rowindex) {
grid_dt.onSelectedRowChanged = function (rowindex) {
layouts.ui.edit.prop('disabled', rowindex >= 0);
}
return div_grid;
@ -177,7 +167,7 @@
JSON.stringify([layouts.isteam ? 1 : 0, layouts.searchInput.val()])
), function (data) {
if ($.isArray(data)) {
layouts.grid.setData(data.map(function (i) { return { Values: i } }));
layouts.grid.setData(data.map(function (i) { return i }));
} else {
showAlert(data, GetTextByKey('P_LAYOUTS', 'Layouts'));
}
@ -318,7 +308,7 @@
}
function editLayout(info) {
$('#right_popup').load('js/modules/layouts/addlayout.html?v=5', function () {
$('#right_popup').load('js/modules/layouts/addlayout.html?v=6', function () {
var modified = false;
var deleteIcon = false;
var deleteCenterIcon = false;
@ -437,7 +427,13 @@
});
content.find('#layout-highlightcolor-input').keyup(null, function () {
$("#layout-highlightcolor-selector").spectrum("set", $('#layout-highlightcolor-input').val());
})
});
function resizeContent() {
content.find('.subcontent').css('height', $(window).height() - 95);
}
window.onresize = resizeContent;
resizeContent();
var save = function (exit) {
@ -611,15 +607,17 @@
showmaskbg(true);
var p = [layouts.isteam ? 1 : 0, id];
inspectionrequest('GetInspectLayout', JSON.stringify(p), function (data) {
showmaskbg(false);
editLayout(data);
}, function () {
showmaskbg(false);
});
}
Object.defineProperty(layouts, 'onedit', {
value: function () {
if (layouts.grid && layouts.grid.selectedIndex >= 0) {
var id = layouts.grid.source[layouts.grid.selectedIndex].Values.Id;
var id = layouts.grid.source[layouts.grid.selectedIndex].Id;
doedit(id);
}
}