_rmtKvT=origial
\RG3.BO.Qu\Services\PreVerifyService.cs
配置代码(origial如果每页配置,系统后台会自动生成)
\RG3.Web.Host.PaaS\Config\Mapper\basis\boapp\mapper_bo-app-config-setting_sql__responsefield.json
"base": {
//#region kv值转n, 配合参数 _rmtKvNT=origial
"rmtKvNMappers": {
"origial": "createTime,modifyTime,createUserId,modifyUserId,auditTime,auditUserId,startTime,endTime,auditStatus"
},
//#endregion kv值转n, 配合参数 _rmtKvNT=
//#region kv值转v, 配合参数 _rmtKvT=origial
"rmtKvMappers": {
"origial": "createTime,modifyTime,createUserId,modifyUserId,auditTime,auditUserId,startTime,endTime,auditStatus",
"extand": "openMethod"
}
//#endregion kv值转v, 配合参数 _rmtKvT=
},
实现代码
\RG3.Web.Host.PaaS\AppNodeJs\Plugins\fn-common-data.js
//#region kv对象的值转值 通常用于json序列化为对象
const _rmtKv = (paramsTemp["_rmtKvF"] || '').split(',');
if (paramsTemp["_rmtKvF"] && argResult.data && argResult.data.constructor === Array) {
argResult.data.forEach(temp => {
for (let [key, value] of Object.entries(temp)) {
if (_rmtKv.includes(key) && (value || {}).value !== 0) {
temp[key] = (value || {}).value || null;
} else if (_rmtKv.includes(key)) {
temp[key] = (value || {}).value;
}
}
});
} else if (paramsTemp["_rmtKvF"] && argResult.data && argResult.data.constructor === Object) {
for (let [key, value] of Object.entries(argResult.data)) {
if (_rmtKv.includes(key) && (value || {}).value !== 0) {
argResult.data[key] = (value || {}).value || null;
} else if (_rmtKv.includes(key)) {
argResult.data[key] = (value || {}).value;
}
}
}
//#endregion kv对象的值转值
文档更新时间: 2023-06-14 22:23 作者:admin