mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
if参数支持传入一个字段名
This commit is contained in:
@@ -83,6 +83,7 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
||||
auth: 'edit',
|
||||
class: 'layui-btn layui-btn-xs layui-btn-success',
|
||||
extend: 'data-full="true"',
|
||||
if:'status'
|
||||
}, {
|
||||
text: '删除',
|
||||
method: 'none',
|
||||
|
||||
@@ -746,10 +746,23 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
|
||||
operat.text = operat.text || operat.title;
|
||||
operat.if = operat.if || function () { return true };
|
||||
|
||||
if (operat.if(data, operat) !== true) {
|
||||
return '';
|
||||
|
||||
if (typeof operat.if == 'function') {
|
||||
|
||||
if (operat.if(data, operat) !== true) {
|
||||
return '';
|
||||
}
|
||||
} else if (typeof operat.if == 'string') {
|
||||
|
||||
var ifValue = admin.table.returnColumnValue(data,operat.if,false);
|
||||
|
||||
if(!ifValue){
|
||||
return ''
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
var titleEndfix = '';
|
||||
|
||||
if (typeof operat.titleField == 'function') {
|
||||
@@ -1096,13 +1109,13 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
|
||||
return '0B'
|
||||
},
|
||||
// 统一列返回数据处理
|
||||
returnColumnValue(data) {
|
||||
returnColumnValue(data, field, defaultValue) {
|
||||
if (!data.LAY_COL) {
|
||||
return '';
|
||||
}
|
||||
var option = data.LAY_COL;
|
||||
var field = option.field;
|
||||
var defaultValue = option.defaultValue;
|
||||
field = field || option.field;
|
||||
defaultValue = defaultValue || option.defaultValue;
|
||||
var value = defaultValue;
|
||||
try {
|
||||
value = eval("data." + field);
|
||||
|
||||
Reference in New Issue
Block a user