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

打印事件,无法正常使用 #11312

Open
taoyao-code opened this issue Dec 3, 2024 · 4 comments
Open

打印事件,无法正常使用 #11312

taoyao-code opened this issue Dec 3, 2024 · 4 comments

Comments

@taoyao-code
Copy link

描述问题:

在amis编辑器中无法正常显示,但在官网文档是正常显示的。无法正常弹出打印界面,以及弹出的界面没有进行分页显示打印

截图或视频:

可以的话,尽可能提供截图或视频来补充描述你的问题...

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

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

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

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

{
  "type": "page",
  "body": [
    {
      "type": "button",
      "label": "打印",
      "level": "primary",
      "className": "mr-2",
      "onEvent": {
        "click": {
          "actions": [
            {
              "actionType": "print",
              "args": {
                "id": "mycrud"
              }
            }
          ]
        }
      }
    },
    {
      "type": "crud",
      "api": "/amis/api/mock2/sample",
      "id": "mycrud",
      "syncLocation": false,
      "columns": [
        {
          "name": "id",
          "label": "ID"
        },
        {
          "name": "engine",
          "label": "Rendering engine"
        },
        {
          "name": "browser",
          "label": "Browser"
        },
        {
          "name": "platform",
          "label": "Platform(s)"
        },
        {
          "name": "version",
          "label": "Engine version"
        },
        {
          "name": "grade",
          "label": "CSS grade"
        }
      ]
    }
  ]
}
  1. 操作步骤
    请简单描述一下复现的操作步骤...
@nwind
Copy link
Contributor

nwind commented Dec 5, 2024

截图看看,编辑器里的预览模式应该是支持的吧,分页没法支持了,目前就是页面显示什么打印什么

@taoyao-code
Copy link
Author

截图看看,编辑器里的预览模式应该是支持的吧,分页没法支持了,目前就是页面显示什么打印什么

{
  "type": "page",
  "body": [
    {
      "type": "button",
      "label": "打印",
      "level": "primary",
      "className": "mr-2",
      "onEvent": {
        "click": {
          "actions": [
            {
              "actionType": "print",
              "args": {
                "ids": [
                  "mycrud1",
                  "mycrud2",
                  "mycrud3",
                  "mycrud4"
                ]
              }
            }
          ]
        }
      }
    },
    {
      "type": "crud",
      "api": "/amis/api/mock2/sample",
      "id": "mycrud1",
      "syncLocation": false,
      "columns": [
        {
          "name": "id",
          "label": "ID"
        },
        {
          "name": "engine",
          "label": "Rendering engine"
        },
        {
          "name": "browser",
          "label": "Browser"
        },
        {
          "name": "platform",
          "label": "Platform(s)"
        },
        {
          "name": "version",
          "label": "Engine version"
        },
        {
          "name": "grade",
          "label": "CSS grade"
        }
      ]
    },
    {
      "type": "crud",
      "api": "/amis/api/mock2/sample",
      "id": "mycrud2",
      "syncLocation": false,
      "columns": [
        {
          "name": "id",
          "label": "ID"
        },
        {
          "name": "engine",
          "label": "Rendering engine"
        },
        {
          "name": "browser",
          "label": "Browser"
        },
        {
          "name": "platform",
          "label": "Platform(s)"
        },
        {
          "name": "version",
          "label": "Engine version"
        },
        {
          "name": "grade",
          "label": "CSS grade"
        }
      ]
    },
    {
      "type": "crud",
      "api": "/amis/api/mock2/sample",
      "id": "mycrud3",
      "syncLocation": false,
      "columns": [
        {
          "name": "id",
          "label": "ID"
        },
        {
          "name": "engine",
          "label": "Rendering engine"
        },
        {
          "name": "browser",
          "label": "Browser"
        },
        {
          "name": "platform",
          "label": "Platform(s)"
        },
        {
          "name": "version",
          "label": "Engine version"
        },
        {
          "name": "grade",
          "label": "CSS grade"
        }
      ]
    },
    {
      "type": "crud",
      "api": "/amis/api/mock2/sample",
      "id": "mycrud4",
      "syncLocation": false,
      "columns": [
        {
          "name": "id",
          "label": "ID"
        },
        {
          "name": "engine",
          "label": "Rendering engine"
        },
        {
          "name": "browser",
          "label": "Browser"
        },
        {
          "name": "platform",
          "label": "Platform(s)"
        },
        {
          "name": "version",
          "label": "Engine version"
        },
        {
          "name": "grade",
          "label": "CSS grade"
        }
      ]
    },
    {
      "type": "crud",
      "api": "/amis/api/mock2/sample",
      "id": "mycrud5",
      "syncLocation": false,
      "columns": [
        {
          "name": "id",
          "label": "ID"
        },
        {
          "name": "engine",
          "label": "Rendering engine"
        },
        {
          "name": "browser",
          "label": "Browser"
        },
        {
          "name": "platform",
          "label": "Platform(s)"
        },
        {
          "name": "version",
          "label": "Engine version"
        },
        {
          "name": "grade",
          "label": "CSS grade"
        }
      ]
    }
  ]
}
image 在官网中显示如上图所示,编辑器中,或者在项目中如下图所示 image

@gaochaoGin
Copy link

官方设计器可以复现,渲染器可以正常打印,设计器就是白屏

同样的问题

@cutestyxy
Copy link

截图看看,编辑器里的预览模式应该是支持的吧,分页没法支持了,目前就是页面显示什么打印什么

官方设计器可以复现,渲染器可以正常打印,设计器就是白屏

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

4 participants