Merge pull request #2378 from int2001/contest_multiop
Contest Multi-Op (with same Account and Call)
这个提交包含在:
当前提交
b427f78b2d
共有 1 个文件被更改,包括 71 次插入 和 66 次删除
|
|
@ -1,8 +1,10 @@
|
||||||
// Callsign always has focus on load
|
// Callsign always has focus on load
|
||||||
$("#callsign").focus();
|
$("#callsign").focus();
|
||||||
|
|
||||||
$(document).ready(function () {
|
var sessiondata={};
|
||||||
getSession().done(restoreContestSession);
|
$(document).ready(async function () {
|
||||||
|
sessiondata=await getSession(); // save sessiondata global (we need it later, when adding qso)
|
||||||
|
await restoreContestSession(sessiondata); // wait for restoring until finished
|
||||||
setRst($("#mode").val());
|
setRst($("#mode").val());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -435,8 +437,6 @@ function logQso() {
|
||||||
vuccr,
|
vuccr,
|
||||||
]];
|
]];
|
||||||
|
|
||||||
table.rows.add(data).draw();
|
|
||||||
|
|
||||||
var formdata = new FormData(document.getElementById("qso_input"));
|
var formdata = new FormData(document.getElementById("qso_input"));
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: base_url + 'index.php/qso/saveqso',
|
url: base_url + 'index.php/qso/saveqso',
|
||||||
|
|
@ -445,7 +445,7 @@ function logQso() {
|
||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
enctype: 'multipart/form-data',
|
enctype: 'multipart/form-data',
|
||||||
success: function (html) {
|
success: async function (html) {
|
||||||
var exchangetype = $("#exchangetype").val();
|
var exchangetype = $("#exchangetype").val();
|
||||||
if (exchangetype == "Serial" || exchangetype == 'Serialexchange' || exchangetype == 'Serialgridsquare') {
|
if (exchangetype == "Serial" || exchangetype == 'Serialexchange' || exchangetype == 'Serialgridsquare') {
|
||||||
$("#exch_serial_s").val(+$("#exch_serial_s").val() + 1);
|
$("#exch_serial_s").val(+$("#exch_serial_s").val() + 1);
|
||||||
|
|
@ -462,6 +462,7 @@ function logQso() {
|
||||||
$("#callsign").focus();
|
$("#callsign").focus();
|
||||||
setSession(formdata);
|
setSession(formdata);
|
||||||
|
|
||||||
|
await refresh_qso_table(sessiondata);
|
||||||
var qTable = $('.qsotable').DataTable();
|
var qTable = $('.qsotable').DataTable();
|
||||||
qTable.search('').order([0, 'desc']).draw();
|
qTable.search('').order([0, 'desc']).draw();
|
||||||
|
|
||||||
|
|
@ -470,14 +471,14 @@ function logQso() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSession() {
|
async function getSession() {
|
||||||
return $.ajax({
|
return await $.ajax({
|
||||||
url: base_url + 'index.php/contesting/getSession',
|
url: base_url + 'index.php/contesting/getSession',
|
||||||
type: 'post',
|
type: 'post',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function restoreContestSession(data) {
|
async function restoreContestSession(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
if (data.copytodok == "1") {
|
if (data.copytodok == "1") {
|
||||||
$('#copyexchangetodok').prop('checked', true);
|
$('#copyexchangetodok').prop('checked', true);
|
||||||
|
|
@ -498,70 +499,74 @@ function restoreContestSession(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.qso != "") {
|
if (data.qso != "") {
|
||||||
$.ajax({
|
await refresh_qso_table(data);
|
||||||
url: base_url + 'index.php/contesting/getSessionQsos',
|
|
||||||
type: 'post',
|
|
||||||
data: { 'qso': data.qso, },
|
|
||||||
success: function (html) {
|
|
||||||
var mode = '';
|
|
||||||
|
|
||||||
$.each(html, function () {
|
|
||||||
if (this.col_submode == null || this.col_submode == '') {
|
|
||||||
mode = this.col_mode;
|
|
||||||
} else {
|
|
||||||
mode = this.col_submode;
|
|
||||||
}
|
|
||||||
|
|
||||||
$(".qsotable tbody").prepend('<tr>' +
|
|
||||||
'<td>' + this.col_time_on + '</td>' +
|
|
||||||
'<td>' + this.col_call + '</td>' +
|
|
||||||
'<td>' + this.col_band + '</td>' +
|
|
||||||
'<td>' + mode + '</td>' +
|
|
||||||
'<td>' + this.col_rst_sent + '</td>' +
|
|
||||||
'<td>' + this.col_rst_rcvd + '</td>' +
|
|
||||||
'<td>' + this.col_stx_string + '</td>' +
|
|
||||||
'<td>' + this.col_srx_string + '</td>' +
|
|
||||||
'<td>' + this.col_stx + '</td>' +
|
|
||||||
'<td>' + this.col_srx + '</td>' +
|
|
||||||
'<td>' + this.col_gridsquare + '</td>' +
|
|
||||||
'<td>' + this.col_vucc_grids + '</td>' +
|
|
||||||
'</tr>');
|
|
||||||
});
|
|
||||||
if (!$.fn.DataTable.isDataTable('.qsotable')) {
|
|
||||||
$.fn.dataTable.moment('DD-MM-YYYY HH:mm:ss');
|
|
||||||
$('.qsotable').DataTable({
|
|
||||||
"stateSave": true,
|
|
||||||
"pageLength": 25,
|
|
||||||
responsive: false,
|
|
||||||
"scrollY": "400px",
|
|
||||||
"scrollCollapse": true,
|
|
||||||
"paging": false,
|
|
||||||
"scrollX": true,
|
|
||||||
order: [0, 'desc'],
|
|
||||||
"columnDefs": [
|
|
||||||
{
|
|
||||||
"render": function ( data, type, row ) {
|
|
||||||
return pad(row[8],3);
|
|
||||||
},
|
|
||||||
"targets" : 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"render": function ( data, type, row ) {
|
|
||||||
return pad(row[9],3);
|
|
||||||
},
|
|
||||||
"targets" : 9
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$("#exch_serial_s").val("1");
|
$("#exch_serial_s").val("1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function refresh_qso_table(data) {
|
||||||
|
$.ajax({
|
||||||
|
url: base_url + 'index.php/contesting/getSessionQsos',
|
||||||
|
type: 'post',
|
||||||
|
data: { 'qso': data.qso, },
|
||||||
|
success: function (html) {
|
||||||
|
var mode = '';
|
||||||
|
$(".contest_qso_table_contents").empty();
|
||||||
|
$.each(html, function () {
|
||||||
|
if (this.col_submode == null || this.col_submode == '') {
|
||||||
|
mode = this.col_mode;
|
||||||
|
} else {
|
||||||
|
mode = this.col_submode;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(".qsotable tbody").prepend('<tr>' +
|
||||||
|
'<td>' + this.col_time_on + '</td>' +
|
||||||
|
'<td>' + this.col_call + '</td>' +
|
||||||
|
'<td>' + this.col_band + '</td>' +
|
||||||
|
'<td>' + mode + '</td>' +
|
||||||
|
'<td>' + this.col_rst_sent + '</td>' +
|
||||||
|
'<td>' + this.col_rst_rcvd + '</td>' +
|
||||||
|
'<td>' + this.col_stx_string + '</td>' +
|
||||||
|
'<td>' + this.col_srx_string + '</td>' +
|
||||||
|
'<td>' + this.col_stx + '</td>' +
|
||||||
|
'<td>' + this.col_srx + '</td>' +
|
||||||
|
'<td>' + this.col_gridsquare + '</td>' +
|
||||||
|
'<td>' + this.col_vucc_grids + '</td>' +
|
||||||
|
'</tr>');
|
||||||
|
});
|
||||||
|
if (!$.fn.DataTable.isDataTable('.qsotable')) {
|
||||||
|
$.fn.dataTable.moment('DD-MM-YYYY HH:mm:ss');
|
||||||
|
$('.qsotable').DataTable({
|
||||||
|
"stateSave": true,
|
||||||
|
"pageLength": 25,
|
||||||
|
responsive: false,
|
||||||
|
"scrollY": "400px",
|
||||||
|
"scrollCollapse": true,
|
||||||
|
"paging": false,
|
||||||
|
"scrollX": true,
|
||||||
|
order: [0, 'desc'],
|
||||||
|
"columnDefs": [
|
||||||
|
{
|
||||||
|
"render": function ( data, type, row ) {
|
||||||
|
return pad(row[8],3);
|
||||||
|
},
|
||||||
|
"targets" : 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"render": function ( data, type, row ) {
|
||||||
|
return pad(row[9],3);
|
||||||
|
},
|
||||||
|
"targets" : 9
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function pad (str, max) {
|
function pad (str, max) {
|
||||||
str = str.toString();
|
str = str.toString();
|
||||||
return str.length < max ? pad("0" + str, max) : str;
|
return str.length < max ? pad("0" + str, max) : str;
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用