59 lines
1.8 KiB
JavaScript
59 lines
1.8 KiB
JavaScript
$(function () {
|
|
common.dateTimePicker("from");
|
|
common.dateTimePicker("to");
|
|
$('[data-toggle="popover-hover"]').popover({
|
|
html: true,
|
|
trigger: 'hover',
|
|
placement: 'left',
|
|
container: 'body',
|
|
content: function () {
|
|
return '<img src="' + $(this).data('img') + '" style="max-width:500px;" />';
|
|
}
|
|
});
|
|
// setTimeout(function () {
|
|
// window.location.reload(true);
|
|
// }, 30000);
|
|
});
|
|
|
|
function resizeImage(e) {
|
|
var size = $(e).attr("data-size");
|
|
if (size === "min") {
|
|
$(e).attr("style", "width:200px;cursor:pointer;");
|
|
$(e).attr("data-size", "max");
|
|
}
|
|
if (size === "max") {
|
|
$(e).attr("style", "width:100px;cursor:pointer;");
|
|
$(e).attr("data-size", "min");
|
|
}
|
|
}
|
|
|
|
function openForm(e, field) {
|
|
var html = `<input type="text" class="form-control" value="` + $(e).data("text") + `" data-id="` + $(e).data("id") + `" data-field="` + field + `" onchange="_save(this);" autofocus>`;
|
|
$(e).closest("td").html(html);
|
|
}
|
|
|
|
function _save(e) {
|
|
$.ajax({
|
|
url: $("input[name='saveUrl']").val(),
|
|
type: 'POST',
|
|
data: {
|
|
id: $(e).data("id"),
|
|
field: $(e).data("field"),
|
|
value: $(e).val()
|
|
},
|
|
success: function (data) {
|
|
$(e).closest("td").html(data);
|
|
},
|
|
error: function (jqXHR, textStatus, errorThrown) {
|
|
common.modalBlock(false);
|
|
common.ajaxError();
|
|
}
|
|
});
|
|
}
|
|
|
|
function search(e) {
|
|
window.location = $(e).attr("data-href") + "?from=" + $("input[name='FromTime']").val() + "&to=" + $("input[name='ToTime']").val();
|
|
}
|
|
function _export(e) {
|
|
window.location = $(e).attr("data-href") + "?from=" + $("input[name='FromTime']").val() + "&to=" + $("input[name='ToTime']").val();
|
|
} |