版本

RG3.PF.Web.StartUsed 7.1.26

_rmtKvNT=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 _rmtKvN = (paramsTemp["_rmtKvNF"] || '').split(',');
    if (paramsTemp["_rmtKvNF"] && argResult.data && argResult.data.constructor === Array) {
        argResult.data.forEach(temp => {
            for (let [key, value] of Object.entries(temp)) {
                if (_rmtKvN.includes(key) && (value || {}).value !== 0) {
                    temp[key] = (value || {}).name || (value || {}).value || null;
                } else if (_rmtKvN.includes(key)) {
                    temp[key] = (value || {}).name || (value || {}).value;
                }
            }
        });
    } else if (paramsTemp["_rmtKvNF"] && argResult.data && argResult.data.constructor === Object) {
        for (let [key, value] of Object.entries(argResult.data)) {
            if (_rmtKvN.includes(key) && (value || {}).value !== 0) {
                argResult.data[key] = (value || {}).name || (value || {}).value || null;
            } else if (_rmtKvN.includes(key)) {
                argResult.data[key] = (value || {}).name || (value || {}).value;
            }
        }
    }
    //#endregion kv对象的值转名称
文档更新时间: 2023-06-14 22:23   作者:admin