baidu / amis

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

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

Open taoyao-code opened 1 week ago

taoyao-code commented 1 week 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 1 week ago

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

Please review the labels and make any necessary changes.

CheshireJCat commented 1 week ago

在 editor 里,或者示例页面,或者运行项目中不会复现,只在文档里可以复现,你实际使用试试呢?

taoyao-code commented 1 week ago

在 editor 里,或者示例页面,或者运行项目中不会复现,只在文档里可以复现,你实际使用试试呢?

实际使用如上述视频所示。editor中不会出现这个问题,editor在同一个项目中,打开一次后,在返回来,项目中就会正常显示。

lhtuling commented 2 days ago

应该是amis渲染器的小bug吧 影响不大 设置下快速编辑就行了 实测ok image

Amis低代码前端框架交流群【QQ1群】:717791727 Amis低代码前端框架交流群【QQ2群】:721182449