|
|
|
@ -33,40 +33,18 @@ methods = {
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
SelectDevice(e) {
|
|
|
|
|
var checkbox = $(e.target);
|
|
|
|
|
if (checkbox.hasClass('checkall')) {
|
|
|
|
|
if (e.target.checked) {
|
|
|
|
|
$('input.item').not(':checked').prop("checked", true);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$('input.item').filter(':checked').prop("checked", false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (checkbox.hasClass('uncheck')) {
|
|
|
|
|
$('input.item').each(function () {
|
|
|
|
|
$(this).prop("checked", !$(this).prop("checked")).change();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
var parent = $('input.checkall');
|
|
|
|
|
if ($('input.item').not(':checked').length === 0) {
|
|
|
|
|
parent.prop("indeterminate", false);
|
|
|
|
|
parent.prop("checked", true);
|
|
|
|
|
}
|
|
|
|
|
else if ($('input.item').filter(':checked').length === 0) {
|
|
|
|
|
parent.prop("indeterminate", false);
|
|
|
|
|
parent.prop("checked", false);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
parent.prop("indeterminate", true);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
SelectDevice:Select,
|
|
|
|
|
CallApiAll(method) {
|
|
|
|
|
var numbers = [];
|
|
|
|
|
$('.item:checked').each(function () {
|
|
|
|
|
numbers.push($(this).val());
|
|
|
|
|
});
|
|
|
|
|
ajax('/App/ExecApiAll', { token: token, connectionId: connectionId, method: vm.model.Path + method, numbers: numbers }, 'post');
|
|
|
|
|
if (numbers.length) {
|
|
|
|
|
ajax('/App/ExecApiAll', { token: token, connectionId: connectionId, method: vm.model.Path + method, numbers: numbers }, 'post');
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
toastr.error('没有选中任何项');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
function onMessage(method, json, to, from) {
|
|
|
|
|