特殊数据验证

https://doc.rg1008.com/docs/rg_pass_api/rg_pass_api-1d2u881iuqkb0

{
  //#region 操作前验证
  "ruleDb": {
    "addRefField": "appId",
    "addShowField": "appName",
    "selectSql": "select app_id,app_name from bo_app_config where app_id=@appId",
    "sql": "select app_name name,app_id value from bo_app_config where ({primary_where_sql}) and (@_developer=1 or create_user_id=@_userId or create_user_id in @_mergeUserId or app_id in (select object_id from bo_app_config_user where (user_id=@_userId or user_id in @_mergeUserId) and user_type=2 and is_enabled=1))",
    "where": " or app_id=@appId",
    "field": "appId",
    "showField": "appName",
    //添加新增验证
    //"addEnabled": true,
    //如果上面数据存在,表示有权限
    "reverse": true,
    "value": null,
    "messageD": "无权限【{0}】,一定要删除,请联系管理员",
    "messageI": "无权限【{0}】,一定要添加,请联系管理员",
    "messageU": "无权限【{0}】,一定要修改,请联系管理员"
  },
  //#endregion 操作前验证
  "rules": {}
}

//#region 操作前验证
  "ruleDb": {
    //和field关联的字段,新增时候使用
    "addRefField": "appId",
    "addShowField": "appName",
    "selectSql": "select app_id,app_name from bo_app_config_setting_keys where setting_id=@settingId",
    "sql": "select app_name name,app_id value from bo_app_config where app_id=@appId and (@_developer=1 or create_user_id=@_userId or create_user_id in @_mergeUserId or app_id in (select object_id from bo_app_config_user where (user_id=@_userId or user_id in @_mergeUserId) and user_type=2 and is_enabled=1))",
    "where": " or (app_id=@appId and setting_type=@settingType)",
    "field": "appId",
    "showField": "appName",
    //添加新增验证
    "addEnabled": true,
    //如果值addField值在在addValue里面,addEnabled=true
    //"addValue": [ "2" ],
    //"addField": "userType",
    //如果上面数据存在,表示有权限
    "reverse": true,
    "value": null,
    "messageD": "无权限【{0}】,一定要删除,请联系管理员",
    "messageI": "无权限【{0}】,一定要添加,请联系管理员",
    "messageU": "无权限【{0}】,一定要修改,请联系管理员"
  },
  //#endregion 操作前验证
文档更新时间: 2023-06-12 08:39   作者:admin