mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
fix: 修复 word 打印失效问题
This commit is contained in:
parent
8800cf4c6b
commit
08b04b418b
@ -8,7 +8,7 @@ import {
|
||||
} from './Action';
|
||||
|
||||
export interface IPrintAction extends ListenerAction {
|
||||
actionType: 'copy';
|
||||
actionType: 'print';
|
||||
args: {
|
||||
id?: string;
|
||||
ids?: string[];
|
||||
@ -28,6 +28,21 @@ export class PrintAction implements RendererAction {
|
||||
renderer: ListenerContext,
|
||||
event: RendererEvent<any>
|
||||
) {
|
||||
// 兼容之前的 word 打印
|
||||
if (action.componentId) {
|
||||
const targetComponent = event.context.scoped?.getComponentById(
|
||||
action.componentId
|
||||
);
|
||||
targetComponent?.doAction(
|
||||
{
|
||||
...action,
|
||||
target: undefined
|
||||
},
|
||||
renderer
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (action.args?.id) {
|
||||
const element = document.querySelector(`[data-id='${action.args.id}']`);
|
||||
if (element) {
|
||||
|
Loading…
Reference in New Issue
Block a user