优化tableData;新增dataGet;

This commit is contained in:
2024-04-11 10:27:24 +08:00
parent 1c9560cff8
commit 84e879f8f0
5 changed files with 18 additions and 16 deletions

View File

@@ -12,12 +12,12 @@ use think\console\Output;
class VersionBase extends Command
{
public const VERSION = 'v2.0.98';
public const VERSION = 'v2.0.99';
public const LAYUI_VERSION = '2.8.17';
public const COMMENT = [
'修复表格选择字段渲染',
'优化tableData;新增dataGet',
'发布新版本',
];

View File

@@ -4,15 +4,15 @@
justify-content: left;
flex-wrap: wrap;
}
.table-data-container .layui-input .placeholder {
color: #808080;
}
.table-data-container .layui-input .layui-btn {
pointer-events: none;
}
.table-data-container .layui-input .layui-btn i {
pointer-events: all;
}
.table-data-container .placeholder {
color: #808080;
}
.table-data-container .layui-form-danger + .layui-input {
border-color: #ff5722 !important;
}

View File

@@ -40,8 +40,8 @@
height: clientHeight,
placeholder: '请选择',
selectConfirmCallback: 'onTableDataConfirm',
type:'input',
className:'layui-input',
type: 'input',
className: 'layui-input',
};
var options = $.extend(defaultOption, data);
@@ -56,7 +56,7 @@
options.index += 'select_mode=' + options.selectType;
if(options.type == 'textarea'){
if (options.type == 'textarea') {
options.className = 'layui-textarea';
}
@@ -82,7 +82,7 @@
if (this.setting.fieldName.indexOf('|') < 0) {
return this.listSelected.map(
(item) => {
item['_select_show'] = item[this.setting.fieldName];
item['_select_show'] = ua.dataGet(item, this.setting.fieldName);
return item;
}
);
@@ -92,7 +92,7 @@
return this.listSelected.map(item => {
var showText = '';
fieldNameList.forEach(fieldName => {
showText += item[fieldName] + ' ';
showText += ua.dataGet(item, fieldName) + ' ';
});
item['_select_show'] = showText;

View File

@@ -5,10 +5,6 @@
justify-content: left;
flex-wrap: wrap;
.placeholder {
color: #808080
}
.layui-btn {
pointer-events: none;
@@ -18,6 +14,10 @@
}
}
.placeholder {
color: #808080
}
.layui-form-danger+.layui-input {
border-color: #ff5722 !important;
}

View File

@@ -2433,13 +2433,15 @@
defaultValue = undefined;
}
return admin.dataGet(this.dataBrage, keys, defaultValue);
},
dataGet(data, keys, defaultValue) {
return (
(!Array.isArray(keys)
? keys.replace(/\[/g, '.').replace(/\]/g, '').split('.')
: keys
).reduce((o, k) => (o || {})[k], this.dataBrage) || defaultValue
).reduce((o, k) => (o || {})[k], data) || defaultValue
);
},
getExtGroupName(ext) {
var groupName = 'file';