mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 19:12:48 +08:00
表格operat使用_if替代if
This commit is contained in:
@@ -69,7 +69,7 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
|||||||
auth: 'add',
|
auth: 'add',
|
||||||
class: 'layui-btn layui-btn-xs layui-btn-normal',
|
class: 'layui-btn layui-btn-xs layui-btn-normal',
|
||||||
extend: 'data-full="true"',
|
extend: 'data-full="true"',
|
||||||
if: function (data) {
|
_if: function (data) {
|
||||||
if (data.pid == 99999999) {
|
if (data.pid == 99999999) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,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'
|
_if: 'status'
|
||||||
}, {
|
}, {
|
||||||
text: '删除',
|
text: '删除',
|
||||||
method: 'none',
|
method: 'none',
|
||||||
|
|||||||
@@ -751,17 +751,17 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
|
|||||||
operat.titleField = operat.titleField || 'title';
|
operat.titleField = operat.titleField || 'title';
|
||||||
operat.title = operat.title || operat.text;
|
operat.title = operat.title || operat.text;
|
||||||
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 (typeof operat.if == 'function') {
|
if (typeof operat._if == 'function') {
|
||||||
|
|
||||||
if (operat.if(data, operat) !== true) {
|
if (operat._if(data, operat) !== true) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
} else if (typeof operat.if == 'string') {
|
} else if (typeof operat._if == 'string') {
|
||||||
|
|
||||||
var ifValue = admin.table.returnColumnValue(data, operat.if, false);
|
var ifValue = admin.table.returnColumnValue(data, operat._if, false);
|
||||||
|
|
||||||
if (!ifValue) {
|
if (!ifValue) {
|
||||||
return ''
|
return ''
|
||||||
|
|||||||
Reference in New Issue
Block a user