https://ask.fastadmin.net/question/7678.html
按照这个代码也实现不了图片能够导出适配EXCEL,有什么办法吗?
exportOptions: {T2pykDq3HqUcuA9I5EdfxA==ignoreColumn: [],
htmlContent: true,
// 处理导出图片
onCellHtmlData: function ($cell, row, col, htmlData) {
var html = $.parseHTML(htmlData);
var inputidx = 0;
var selectidx = 0;
var result = '';
$.each(html, function () {
if ($(this).is("input")) {
result += $cell.find('input').eq(inputidx++).val();
}
else if ($(this).is("select")) {
result += $cell.find('select option:selected').eq(selectidx++).text();
}
else if ($(this).is("img")) {
var src = $(this).attr('src');
if (src.indexOf('http') === -1) {
$(this).attr('src', window.location.origin + src);
}
$(this).attr("width", "100").attr("height", "100").attr('class', '');
result += '
} else {
if (typeof $(this).html() === 'undefined') {
result += $(this).text();
}
else if (jQuery().bootstrapTable === undefined ||
($(this).hasClass('filterControl') !== true &&
$cell.parents('.detail-view').length === 0)) {
result += $(this).html();
}
}
});
return result;
},
},