0

我是 JSON 表单的新手,我正在使用 JSON 表单创建动态表单

我正在尝试创建一个简单的 JSON 表单

  "schema": {
    "ComunityCenter": {
      "type": "object",
      "title": "ComunityCenter",
      "properties": {
        "accessLevel": {
          "type": "string",
          "title": "accessLevel",
          "enum":["admin", "DBA", "user"]
        },
        "WriteCommunityCenterName": {
          "type": "string",
          "title": "CommunityCenterName",
          "rule": {
            "effect": "ENABLE",
            "condition":{
              "scope": "#/properties/accessLevel",
              "schema":  { 
                "enum": ["admin"] 
              }
            }
          }
        }
      }
    }
  }
}

我正在使用下面的 jsonform 操场是 url

https://ulion.github.io/jsonform/playground/?type=&label=&rule=

测试它

枚举和所需条件工作正常,但范围中指定的条件不工作

我上面的表单 id 访问级别是 admin 然后只应该启用 WriteCommunityCenterName 但这没有按预期工作

即使访问级别是 DBA 或用户,我也可以编辑

你能帮我吗

4

0 回答 0