|
|
|
@ -57,11 +57,6 @@ function loadTemplate() {
|
|
|
|
|
axios.post(url, { crossDomain: true })
|
|
|
|
|
.then(function (response) {
|
|
|
|
|
var html = response.data;
|
|
|
|
|
$(html).each(function (i, n) {
|
|
|
|
|
if (n.tagName === 'STYLE') {
|
|
|
|
|
$('head').append(n);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$('#template').html(html);
|
|
|
|
|
init();
|
|
|
|
|
})
|
|
|
|
@ -220,29 +215,16 @@ function updateItem(list, item) {
|
|
|
|
|
$(document).on('change', '#camera', function (e) {
|
|
|
|
|
UpdateCamera()
|
|
|
|
|
});
|
|
|
|
|
$('body').on('mousedown touchstart', 'img.camera.ajax', function (e) {
|
|
|
|
|
$(document).on('mousedown touchstart', 'img.camera.ajax', function (e) {
|
|
|
|
|
var number = $('#camera').val();
|
|
|
|
|
if ($(this).hasClass('Zoomin')) {
|
|
|
|
|
ajax('/App/ExecApi', { connectionId: connectionId, number: number, method: '/Onvif/Zoomin' }, 'post');
|
|
|
|
|
} else if ($(this).hasClass('Zoomout')) {
|
|
|
|
|
ajax('/App/ExecApi', { connectionId: connectionId, number: number, method: '/Onvif/Zoomout' }, 'post');
|
|
|
|
|
} else if ($(this).hasClass('Left')) {
|
|
|
|
|
ajax('/App/ExecApi', { connectionId: connectionId, number: number, method: '/Onvif/Left' }, 'post');
|
|
|
|
|
} else if ($(this).hasClass('Right')) {
|
|
|
|
|
ajax('/App/ExecApi', { connectionId: connectionId, number: number, method: '/Onvif/Right' }, 'post');
|
|
|
|
|
} else if ($(this).hasClass('Up')) {
|
|
|
|
|
ajax('/App/ExecApi', { connectionId: connectionId, number: number, method: '/Onvif/Up' }, 'post');
|
|
|
|
|
} else if ($(this).hasClass('Down')) {
|
|
|
|
|
ajax('/App/ExecApi', { connectionId: connectionId, number: number, method: '/Onvif/Down' }, 'post');
|
|
|
|
|
} else if ($(this).hasClass('Stop')) {
|
|
|
|
|
ajax('/App/ExecApi', { connectionId: connectionId, number: number, method: '/Onvif/Stop' }, 'post');
|
|
|
|
|
}
|
|
|
|
|
var cmd = $(this).attr('data-cmd');
|
|
|
|
|
ajax('/App/ExecApi', { connectionId: connectionId, number: number, method: '/Onvif/'+cmd }, 'post');
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
$('body').on('mouseup touchend', 'img.ajax', function (e) {
|
|
|
|
|
console.log($(this).html());
|
|
|
|
|
if (!$(this).hasClass('Stop')) {
|
|
|
|
|
var number = $('#camera').val();
|
|
|
|
|
$(document).on('mouseup touchend', 'img.camera.ajax', function (e) {
|
|
|
|
|
var number = $('#camera').val();
|
|
|
|
|
var cmd = $(this).attr('data-cmd');
|
|
|
|
|
if (cmd!=='Stop') {
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
ajax('/App/ExecApi', { number: number, method: '/Onvif/Stop' }, 'post');
|
|
|
|
|
}, 500);
|
|
|
|
@ -287,6 +269,9 @@ function onMessage(method, json, from) {
|
|
|
|
|
}
|
|
|
|
|
/*vue*/
|
|
|
|
|
function init() {
|
|
|
|
|
$('#template style').each(function (i, n) {
|
|
|
|
|
$('head').append(n);
|
|
|
|
|
});
|
|
|
|
|
vm = new Vue({
|
|
|
|
|
el: '#app',
|
|
|
|
|
data() {
|
|
|
|
|