设置前效果

进入接口工具

1、复制工具里面的内容到文件,然后修改对应字段名称
2、把内容复制到 bridge_zt-user-vip-info__biz.primary.json
C:\0_RG\Code\RG6.PF\rg3-pf\RG3.Web.Host.PaaS\Config\Bridge\basis\zentao\bridge_zt-user-vip-info__biz.primary.json


1、data-edit-readonly控制编辑时候只读
2、 “hidden”: “show”,控制显示

方法1:空值+特殊验证


 {
        "type": "nullvalue",
        "required": false,
        "isAdd": true,
        "isEdit": true,
        "nullValue":["无", "-", "空","确认单未下"],
        "message": "【{confirm_a_no}】数值必填,且不能包含【{0}】,比如填写UNKNOWN01,且需要唯一,确定新增,请填写0;当前值【{1}】。"
      },

{
  "responseField": {},
  "rules": {
    "confirmANo": [
      {
        "type": "required",
        "required": true,
        "isAdd": true,
        "isEdit": true,
        "message": "【{confirm_a_no}】值必须填写。"
      },
      {
        "type": "maxlength",
        "required": false,
        "isAdd": true,
        "isEdit": true,
        "max": 36,
        "message": "【{confirm_a_no}】值最大长度为36。"
      },
      {
        "type": "nullvalue",
        "required": false,
        "isAdd": true,
        "isEdit": true,
        "message": "【{confirm_a_no}】数值必填,且不能包含【{0}】,比如填写UNKNOWN01,且需要唯一,确定新增,请填写0。"
      },
      {
        "type": "db",
        "url": "~/bo/api/v3/remote/unique/{mkey}/{resField}?ownerId={ownerId}&sysId={sysId}&rule={rule}&{params}",
        "sql": "select count(confirm_a_no) from pm_project_order_confirm where confirm_a_no=@confirmANo",
        "isAdd": true,
        "isEdit": false,
        "message": "【{confirm_a_no}】已存在,可进入修改页面进行内容修改。"
      }
    ]
  },
  "columns": {
    "confirmANo": {
      "defaultValue": null
    }
  }
}

方法1:完整配置

{
  "table": {
    "columns": {
      "userId": {
        "attrs": {
          "label": "用户编号",
          "hidden": "show",
          "positionType": "main"
        },
        "attrsInt": {},
        "styles": {},
        "meta": {
          "edit": false,
          "html": false,
          "component": "bs-text",
          "componentOp": "bs-input",
          "rowId": "1",
          "tabId": "1",
          "type": "basis",
          "span": 12
        }
      }
    }
  },
  "form": {
    "columns": {
      "userId": {
        "attrs": {
          "hidden": "show",
          "label": "用户编号",
          "data-edit-readonly": true
        }
      }
    }
  },
  "search": {
    "userId": {
      "attrsForm": {},
      "attrsFormInt": {},
      "query": {},
      "queryLeft": {},
      "queryRight": {},
      "queryMenu": {},
      "params": {},
      "sortId": 9999,
      "alias": "user_id",
      "field": "userId",
      "events": {},
      "attrs": {
        "label": "用户编号",
        "placeholder": "用户编号",
        "maxlength": 50,
        "clearable": true
      },
      "attrsInt": {},
      "styles": {},
      "meta": {
        "component": "bo-search",
        "rowId": "1",
        "tabId": "1",
        "span": 12
      }
    }
  }
}

方法2:简单配置

\RG3.Web.Host.PaaS\Config\Bridge\basis\boapp\bridge_bo-app-config-version__biz.primary.json

{
  "table": {
    "columns": {
      "versionId": {
        "attrs": {
          "label": "版本编号",
          "hidden": "show",
          "positionType": "main"
        }
      }
    }
  },
  "form": {
    "columns": {
      "versionId": {
        "attrs": {
          "hidden": "show",
          "label": "版本编号",
          "data-edit-readonly": true
        }
      }
    }
  },
  "search": {
  }
}

1、唯一验证配置
\RG3.Web.Host.PaaS\Config\Mapper\basis\boapp\mapper_bo-app-config-version_sql__biz.primary.json

{
  "rules": {
    "versionId": [
      {
        "type": "required",
        "required": true,
        "isAdd": true,
        "isEdit": true,
        "message": "【{version_id}】值必须填写。"
      },
      {
        "type": "maxlength",
        "required": false,
        "isAdd": true,
        "isEdit": true,
        "max": 50,
        "message": "【{version_id}】值最大长度为50。"
      },
      {
        "type": "db", //remote db  远程验证 rule 和 sql必须填写;  db:sql必须填写
        "url": "~/bo/api/v3/remote/unique/{mkey}/{resField}?ownerId={ownerId}&sysId={sysId}&rule={rule}&{params}",
        "sql": "select count(version_id) from bo_app_config_version where version_id=@versionId",
        "isAdd": true,
        "isEdit": false,
        "message": "【{version_id}】已存在,可进入修改页面进行内容修改。"
      }
    ]
  },
  "responseField": {

  },
  "columns": {
    "versionId": {
      "editPropertie": {
        "defaultValue": null
      }
    }
  },
  "dimDatas": {}
}

推送并令配置生效(build-bridge-used)

http://localhost:5775/auth/main-content

设置后效果


文档更新时间: 2024-10-08 11:50   作者:admin