baidu / amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
https://baidu.github.io/amis/
Apache License 2.0
17.35k stars 2.52k forks source link

日期时间组件显示成文本框 #11184

Open taoyao-code opened 2 days ago

taoyao-code commented 2 days ago

描述问题:

请用一段清晰简洁的文字描述问题是什么...

截图或视频:

https://github.com/user-attachments/assets/e4c70dd7-6bf5-4961-bdf9-efbde1fb5656

image

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

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

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在 6.9

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

    {
    "type": "wrapper",
    "id": "input_wl_travel_guide",
    "label": "信息",
    "name": "wl_travel_guide",
    "placeholder": "请输入信息",
    "body": [
    {
      "type": "input-table",
      "name": "wl_travel_guide",
      "id": "wl_travel_guide",
      "label": "信息",
      "canAccessSuperData": true,
      "strictMode": false,
      "addable": true,
      "editable": true,
      "removable": true,
      "columnsTogglable": false,
      "placeholder": "请输入信息",
      "columns": [
        {
          "type": "input-datetime-range",
          "name": "booking_start_date",
          "id": "booking_start_date",
          "label": "预定日期",
          "valueFormat": "YYYY-MM-DD HH:mm:ss",
          "displayFormat": "YYYY-MM-DD HH:mm",
          "shortcuts": [
            "today",
            "tomorrow",
            "2dayslater",
            "1weekslater",
            "1monthslater"
          ],
          "clearable": true,
          "required": true,
          "placeholder": "-"
        },
        {
          "type": "select",
          "source": "",
          "autoComplete": "",
          "name": "guide_id",
          "id": "guide_id",
          "label": "(姓名/证号搜索)",
          "searchable": true,
          "clearable": true,
          "required": true
        },
        {
          "type": "tpl",
          "name": "DetailInfo",
          "id": "DetailInfo",
          "label": "详细信息",
          "quickEdit": false
        },
        {
          "type": "tpl",
          "name": "Status",
          "id": "Status",
          "label": "状态",
          "quickEdit": false,
          "tpl": ""
        }
      ],
      "body": [
        {
          "type": "combo",
          "name": "wl_travel_guide",
          "id": "wl_travel_guide",
          "label": "信息",
          "needConfirm": false,
          "canAccessSuperData": true,
          "strictMode": false,
          "addable": true,
          "editable": true,
          "removable": true,
          "columnsTogglable": false,
          "placeholder": "请输入信息",
          "columns": [
            {
              "type": "input-datetime-range",
              "name": "booking_start_date",
              "id": "booking_start_date",
              "label": "预定日期",
              "valueFormat": "YYYY-MM-DD HH:mm:ss",
              "displayFormat": "YYYY-MM-DD HH:mm",
              "shortcuts": [
                "today",
                "tomorrow",
                "2dayslater",
                "1weekslater",
                "1monthslater"
              ],
              "clearable": true,
              "required": true
            },
            {
              "type": "select",
              "source": "",
              "autoComplete": "",
              "name": "guide_id",
              "id": "guide_id",
              "label": "(姓名/证号搜索)",
              "searchable": true,
              "clearable": true,
              "required": true
            },
            {
              "type": "tpl",
              "name": "DetailInfo",
              "id": "DetailInfo",
              "label": "详细信息",
              "quickEdit": false
            },
            {
              "type": "tpl",
              "name": "Status",
              "id": "Status",
              "label": "状态",
              "quickEdit": false,
              "tpl": ""
            }
          ]
        }
      ]
    }
    ],
    "asideResizor": false,
    "pullRefresh": {
    "disabled": true
    },
    "style": {
    "position": "static",
    "display": "block"
    },
    "isFixedHeight": false,
    "isFixedWidth": false
    }
  4. 操作步骤 直接粘贴上面的json数据,无法正常显示日期时间组件,例如直接粘贴到官网文档的amis渲染器中,但在amis-editor中是正常显示的,如果在文档中无法正常显示,需要强制刷新一次界面,然后在将json数据放入渲染器中。

github-actions[bot] commented 2 days ago

👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.