baidu/amis

开放jump事件配置

blankzust opened this issue · 1 comments

是否关联于某个问题吗:

旧版本开发了jump事件配置,在新版本中这块被干掉了,原先是一个app-page和app-page-args的模版,现在只能在example中看到这个自定义配置,且失效

预期的解决方案:

开放app-page模版,方便外部进行跳转页面配置

其他可接受方案:

教我一下如何自定义添加时间配置面板,新版本的事件配置面板代码有点难懂,万分感谢

解决了,可以用amis-editor中的actionTreeGetter方法

<Editor
    {...其他属性}
     actionOptions={{
              actionTreeGetter: (actionTree) => {
                const pageAction = actionTree.find((item) => item.actionType === 'page');
                pageAction?.children?.push({
                  actionLabel: '跳转页面',
                  actionType: 'link',
                  description: '跳转到本应用的页面',
                  schema: {
                    type: 'wrapper',
                    body: [
                      {
                        "type": "tree-select",
                        "name": "args.link",
                        "label": "页面选择",
                        "searchable": true,
                        "showIcon": false,
                        "options": pages,
                        "valueFieled": "pageKey",
                        mode: 'horizontal',
                      },
                      {
                        type: 'combo',
                        name: 'args.params',
                        label: '页面参数',
                        multiple: true,
                        mode: 'horizontal',
                        size: 'lg',
                        items: [
                          {
                            name: 'key',
                            placeholder: '参数名',
                            type: 'input-text'
                          },
                          getSchemaTpl('formulaControl', {
                            variables: '${variables}',
                            name: 'val',
                            placeholder: '参数值'
                          })
                        ]
                      },
                      {
                        type: 'switch',
                        name: 'args.targetType',
                        label: '新窗口打开',
                        onText: '是',
                        offText: '否',
                        mode: 'horizontal',
                        pipeIn: true
                      }
                    ]
                  }
                });
                return actionTree;
              }
            }}
>