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

CRUD组件使用mapping映射数据,使用tag组件展示时,配置的label不生效 #11339

Open
BobsLi opened this issue Dec 7, 2024 · 0 comments

Comments

@BobsLi
Copy link

BobsLi commented Dec 7, 2024

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的?
    npm

  2. amis 版本:截止当前时间最新版本

  3. 粘贴有问题的完整 amis schema 代码:

{
  "type": "page",
  "data": {
    "list": [
      {
        "id": "045.1802.000000.000018",
        "currentState": "EXECUTE"
      },
      {
        "id": "045.1302.000000.000015",
        "currentState": "END"
      },
      {
        "id": "045.1252.000000.000014",
        "currentState": "EXECUTE"
      },
      {
        "id": "045.1202.000000.000013",
        "currentState": "EDIT"
      },
      {
        "id": "045.1152.000000.000012",
        "currentState": "EXECUTE",
        "purchasePlanAmount": 50
      },
      {
        "id": "045.1152.000000.000011",
        "currentState": "COMPLETE",
        "purchasePlanAmount": 14
      },
      {
        "currentState": "EXECUTE",
        "purchasePlanAmount": 70
      },
      {
        "id": "045.1102.000000.000009",
        "currentState": "EXECUTE",
        "purchasePlanAmount": 25
      }
    ]
  },
  "body": {
    "type": "crud",
    "source": "${list}",
    "columns": [
      {
        "name": "id",
        "label": "ID"
      },

      {
        "label": "当前状态",
        "type": "mapping",
        "name": "currentState",
        "map": {
          "开立": {
            "type": "tag",
            "displayMode": "normal",
            "label": "开立",
            "color": "active"
          },
          "EDIT": {
            "type": "tag",
            "displayMode": "normal",
            "label": "开立",
            "color": "active"
          },
          "执行中": {
            "type": "tag",
            "displayMode": "normal",
            "label": "执行中",
            "color": "processing"
          },
          "EXECUTE": {
            "type": "tag",
            "displayMode": "normal",
            "label": "执行中",
            "color": "processing"
          },
          "完成": {
            "type": "tag",
            "displayMode": "normal",
            "label": "完成",
            "color": "success"
          },
          "COMPLETE": {
            "type": "tag",
            "displayMode": "normal",
            "label": "完成",
            "color": "success"
          },
          "终止": {
            "type": "tag",
            "displayMode": "normal",
            "label": "终止",
            "color": "active"
          },
          "END": {
            "type": "tag",
            "displayMode": "normal",
            "label": "终止",
            "color": "active"
          },
          "*": "${currentState}"
        }
      }
    ]
  }
}

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

No branches or pull requests

1 participant