![]() |
#2
guoyong90572021-05-07 12:32
|

<label><a class="btn btn-default" id="exportData2Excel" role="button">导出数据到Excel</a><input id="id_action" name="action" value="exportData2Excel" type="hidden" class="form-control form-control-inline"></label>
<!--
jQuery(function($) {
var actions = [];
var parents = $('.changelist-actions > label > select').parent();
$('.changelist-actions > label > select option').each(function(){
var v = $(this).val();
if(typeof v == "undefined" || v == "" || v == null){
return;
}
var text = $(this).text();
var btn = '';
if (v == "delete_selected") {
text = '<span class="glyphicon glyphicon-minus"></span> ' + text;
btn = '<a class="btn btn-danger" id="'+v+'" role="button">'+text+'</a>'
} else {
btn = '<a class="btn btn-default" id="'+v+'" role="button">'+text+'</a>';
}
$(parents).append(btn);
});
var hid = '<input id="id_action" name="action" value="" type="hidden">';
$('.changelist-actions > label > select').remove();
$(parents).append(hid);
$('.changelist-actions > label > .btn').each(function(){
$(this).click(function(){
if ($(this).attr('disabled')) {
// 已经无效,退出
return;
}
// 置为无效
$(this).attr('disabled', true);
var need = false;
if (actions) {
for(var i in actions) {
if ($(this).attr('id') == actions[i]) {
need = true;
break;
}
}
}
var r = false;
if (need) {
r = confirm($(this).text() + ",继续吗?");
} else {
r = true;
}
if (r==true) {
$('#id_action').val($(this).attr('id'));
var timeid = $(this).attr('id');
$('div.changelist-content form').submit();
setTimeout(function (){
// 置为有效
$('#'+timeid).attr('disabled', false);
}, 2500);
} else {
// 置为有效
$(this).attr('disabled', false);
}
});
});
});
//-->
以上为网页代码
只有本站会员才能查看附件,请 登录
以下代码无法实现点击下载,如何修改?

Private Sub Command3_Click()
Dim vDoc, vTag
Dim i As Integer
Set vDoc = WebBrowser1.Document
For i = 0 To vDoc.All.length - 1
If UCase(vDoc.All(i).tagName) = "INPUT" Then
Set vTag = vDoc.All(i)
If vTag.Name = "action" Then
Select Case vTag.id
Case "id_action"
vTag.Select
vTag.Click
End Select
End If
End If
Next i
[此贴子已经被作者于2021-5-6 23:51编辑过]