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