调整operat的_if流程

This commit is contained in:
2022-08-31 11:06:22 +08:00
parent ea13c06348
commit e73da7abcd

View File

@@ -751,23 +751,6 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
operat.titleField = operat.titleField || 'title';
operat.title = operat.title || operat.text;
operat.text = operat.text || operat.title;
operat._if = operat._if || function () { return true };
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 = '';
@@ -973,6 +956,19 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
operat.text = operat.text || operat.title;
operat.extend = operat.extend || '';
operat._if = operat._if || function () { return true };
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 ''
}
}
// 自定义表格opreat按钮的弹窗标题风格extra是表格里的欲加入标题中的字段
operat.extra = operat.extra || '';
if (data[operat.extra] !== undefined) {