mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
Merge pull request #10197 from nwind/fix-word-print
fix: 修复 word 打印失效问题
This commit is contained in:
commit
e143806de9
@ -8,7 +8,7 @@ import {
|
||||
} from './Action';
|
||||
|
||||
export interface IPrintAction extends ListenerAction {
|
||||
actionType: 'copy';
|
||||
actionType: 'print';
|
||||
args: {
|
||||
id?: string;
|
||||
ids?: string[];
|
||||
@ -28,6 +28,15 @@ 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, event.data, true, action.args);
|
||||
return;
|
||||
}
|
||||
|
||||
if (action.args?.id) {
|
||||
const element = document.querySelector(`[data-id='${action.args.id}']`);
|
||||
if (element) {
|
||||
|
Loading…
Reference in New Issue
Block a user