当前位置:   article > 正文

RuoYi单体版选中导出Excel(前端)_ruoyi 选中导出

ruoyi 选中导出

<div class="btn-group-sm" id="toolbar" role="group">
    <a class="btn btn-warning" οnclick="exportData()">
        <i class="fa fa-download"></i> 导出
    </a>
</div>

function exportData() {
    table.set();
    var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
    if (rows.length == 0) {
        $.modal.alertWarning("请至少选择一条记录");
        return;
    }
    $.modal.confirm("确认要导出选中的" + rows.length + "条数据吗?", function() {
        var data = { "vcNoList": rows.join() };
        $.modal.loading("正在导出数据,请稍后...");
        $.post(prefix + "/export", data, function(result) {
            if (result.code == web_status.SUCCESS) {
                window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
            } else if (result.code == web_status.WARNING) {
                $.modal.alertWarning(result.msg)
            } else {
                $.modal.alertError(result.msg);
            }
            $.modal.closeLoading();
        });
    });
}

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/595016
推荐阅读
相关标签
  

闽ICP备14008679号