优化表格转卡片底层逻辑,不再占用表格配置项done

This commit is contained in:
2022-04-16 16:41:32 +08:00
parent ffef1ab1df
commit bdd1c1c2c7

View File

@@ -209,7 +209,8 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
extend: 'data-table-id="' + options.id + '"'
}];
options.done = function () {
var table2card = function () {
if (admin.checkMobile()) {
var domTable = $('[lay-id="' + options.id + '"]');
@@ -231,9 +232,17 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
$('<div class="data-item">' + colsHeader[indexTd] + '</div>').insertBefore($(domTd).find('.layui-table-cell'))
})
})
}
}
var optionDone = function (){}
if (options.done != undefined) {
optionDone = options.done;
}
options.done = function(){
optionDone()
table2card()
}
// 判断是否为移动端