mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
feat: 设置表格默认值为空,避免显示null和undefined
This commit is contained in:
@@ -1118,9 +1118,11 @@
|
||||
|
||||
|
||||
if (val.sort === undefined) {
|
||||
|
||||
cols[i][index]['sort'] = true;
|
||||
}
|
||||
if (val.defaultValue === undefined) {
|
||||
cols[i][index]['defaultValue'] = '';
|
||||
}
|
||||
|
||||
// 判断是否包含初始化数据
|
||||
if (val.init === undefined) {
|
||||
@@ -1477,20 +1479,25 @@
|
||||
return '';
|
||||
}
|
||||
var option = data.LAY_COL;
|
||||
|
||||
field = field || option.field;
|
||||
defaultValue = defaultValue || option.defaultValue;
|
||||
|
||||
var valueParser = option.valueParser;
|
||||
var value = defaultValue;
|
||||
var value = undefined;
|
||||
try {
|
||||
value = eval("data." + field);
|
||||
} catch (e) {
|
||||
value = undefined;
|
||||
}
|
||||
|
||||
}
|
||||
if (typeof valueParser == 'function') {
|
||||
value = valueParser(value, data);
|
||||
}
|
||||
|
||||
if(value === null || value === undefined) {
|
||||
value = defaultValue
|
||||
}
|
||||
|
||||
return value;
|
||||
},
|
||||
listenTableSearch: function (tableId) {
|
||||
|
||||
Reference in New Issue
Block a user