Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conditionBuilder可以扩充内置类型吗 #11422

Open
blankzust opened this issue Dec 24, 2024 · 1 comment
Open

conditionBuilder可以扩充内置类型吗 #11422

blankzust opened this issue Dec 24, 2024 · 1 comment

Comments

@blankzust
Copy link
Contributor

blankzust commented Dec 24, 2024

实现场景:

希望新增type,继承于number,和number唯一的区别就是新增了一项运算符属于,右边的输入项是input-tag

存在的问题:

不知道怎么扩展

当前方案:

{
  "type": "condition-builder",
  "id": "u:3f776fae16f3",
  "name": "condition",
  "label": "<strong>${index === 0 ? 'if' : 'elseif'}</strong>",
  "fields": [
    {
      "name": "number",
      "type": "numberNew",
      "label": "数字",
      "operators": [
        "equal",
        "not_equal",
        "less",
        "less_or_equal",
        "greater",
        "greater_or_equal",
        "is_empty",
        "is_not_empty",
        "belong"
      ]
    },
  ]
}
@blankzust
Copy link
Contributor Author

希望支持

{
  "type": "condition-builder",
  "id": "u:3f776fae16f3",
  "name": "condition",
  "label": "<strong>${index === 0 ? 'if' : 'elseif'}</strong>",
  "fields": [
    {
      "name": "number",
      "type": "number",
      "label": "数字",
      "operators": [
        "equal",
        "not_equal",
        "less",
        "less_or_equal",
        "greater",
        "greater_or_equal",
        "is_empty",
        "is_not_empty",
        {
                "label": "属于",
                "value": "belong",
                "values": [
                  {
                    "type": "input-text",
                    "name": "color1"
                  },
                  {
                    "type": "tpl",
                    "tpl": "~"
                  },
                  {
                    "type": "input-text",
                    "name": "color2"
                  }
                ]
              }
             ]
    },
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant