解决layui的templet不传入lay_col的问题

This commit is contained in:
augushong
2022-08-31 23:20:39 +08:00
parent e73da7abcd
commit 35683b704b

View File

@@ -865,9 +865,9 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
}
// 如果未定义则默认使用value
// if (val.templet === undefined) {
// cols[i][index]['templet'] = admin.table.value;
// }
if (val.templet === undefined) {
cols[i][index]['templet'] = admin.table.value;
}
if (val.fieldFormat == undefined) {
@@ -894,6 +894,20 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
}
}
// 重新整理配置参数兼容templet在edit时缺少LAY_COL的问题如果在layui2.8解决,那么应当删除这些代码
var endVal = {...col[index]};
endVal.endTemplet = endVal.templet;
endVal.templet = function(data){
if(!data.LAY_COL){
data.LAY_COL = this
}
return this.endTemplet(data)
}
cols[i][index] = endVal;
}