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

form-designer和form-create的事件注入不一致 #671

Open
lsm2208911 opened this issue Jan 22, 2024 · 1 comment
Open

form-designer和form-create的事件注入不一致 #671

lsm2208911 opened this issue Jan 22, 2024 · 1 comment

Comments

@lsm2208911
Copy link

@form-create/[email protected]"
@form-create/[email protected]

加载同样的一段json,同时开启了事件注入,在使用form-create-designer进行预览时,select的remoteMethod可以获取到事件注入的参数,而在form-create无法获取事件注入参数。
json代码如下:

const json = [
                    {
                        "type": "select",
                        "field": "schoolId",
                        "title": "请输入学校名称",
												"inject": true,
                        "info": "",
                        "effect": {
                            "fetch": {
                                "action": "getSchool",
                                "method": "GET",
                                "data": {},
                                "headers": {},
                                "_parse": "function (res){\n   return res.data;\n}",
                                "to": "options",
                                "parse": "[[FORM-CREATE-PREFIX-function (res){\n   return res.data;\n}-FORM-CREATE-SUFFIX]]"
                            }
                        },
                        "$required": true,
                        "props": {
                            "_optionType": 1,
                            "clearable": true,
                            "filterable": true,
                            "remote": true,
                            "remoteMethod": " function(inject, query) {\n debugger \n console.log(query)\n const api = formCreate.getApi('form')\n formCreate.fetch({\n action: 'http://localhost:18073/cjb/user/hospital/schools?currentPage=1&pageSize=10&name=' + query,\n onSuccess: function(resp){\n var list1 = resp.data\n const list = list1.map(item => {\n return {\n value: item.id,\n label: item.name\n }\n })\n api.updateRule('schoolId', {\n options: list\n })\n }\n })\n }"
                        },
                        "_fc_drag_tag": "select",
                        "hidden": false,
                        "display": true
                    }
                ],
                "_fc_drag_tag": "col",
                "hidden": false,
                "display": true
            }]

在使用form-create时的截图:
image

在designer的截图:
image

期望结果:应该在form-create中也可以获取事件注入参数,与desogner一致。

@xaboy
Copy link
Owner

xaboy commented Feb 21, 2024

有没有二开过, 是不是设计器中开启了全局注入, form-create中没有开启

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants