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

级联select,第二级的初始值被覆盖为空 #191

Open
floatman opened this issue Nov 19, 2020 · 3 comments
Open

级联select,第二级的初始值被覆盖为空 #191

floatman opened this issue Nov 19, 2020 · 3 comments

Comments

@floatman
Copy link

两个级联的select的enum都采用 enumSourceRemote的方式拉取。 当表单有初始值时, 第二级的值会被覆盖为空。
查看网络请求发现 第二级的enumSourceRemote会请求两次,一次的参数为空,一次为第一级的值

schema如下:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"ui": {
"widgetConfig": {
"layout": "h"
}
},
"properties": {
"tidySystem": {
"type": "string",
"ui": {
"label": "所属系统",
"widget": "select",
"rules": {
"required": true
},
"widgetConfig": {
"filterLocal": true,
"filterable": true,
"enumSourceRemote": {
"remoteUrl": "/base/getSystems",
"selectFirstItem": true,
"resField": "data"
}
}
}
},
"tidyDomain": {
"type": "string",
"ui": {
"label": "所属领域",
"widget": "select",
"rules": {
"required": true
},
"widgetConfig": {
"filterLocal": true,
"filterable": true,
"enumSourceRemote": {
"remoteUrl": "/base/getDomains",
"paramName": "keyword",
"otherParams": {
"system": "dx: {{$root.tidySystem}}"
},
"selectFirstItem": true,
"resField": "data"
}
}
}
}
}
}

@daniel-dx
Copy link
Collaborator

通过一级参数获取的二级的数据,应该需要包含初始值吧,如果包含了,就不会变空了

@floatman
Copy link
Author

通过一级参数获取的二级的数据,应该需要包含初始值吧,如果包含了,就不会变空了

没明白您的意思。 form绑定的数据中是有初始值的,一级二级的数据都有。
理论上拉取二级数据只是拉取枚举,不应该影响字段的值。
ps: 看请求发现会拉取两次二级数据,第一次拉取时的一级参数是空的

@luqiudi
Copy link

luqiudi commented Jul 22, 2021

通过一级参数获取的二级的数据,应该需要包含初始值吧,如果包含了,就不会变空了

恩,你好,我想问下,这种级联,一菜单选中的选项里面,包含第二个级联菜单需要加载的选项,该怎么操作呀,有没有这方面的设计机制呀,或者,选中的这个事件触发一下也可以

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

3 participants