File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
vue2/vue2-core/src/fields/combiningSchemas/SelectLinkageField
vue3/vue3-core/src/fields/combiningSchemas/SelectLinkageField Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import {
1515
1616import retrieveSchema from '@lljj/vjsf-utils/schema/retriev' ;
1717import getDefaultFormState from '@lljj/vjsf-utils/schema/getDefaultFormState' ;
18- import { getMatchingOption } from '@lljj/vjsf-utils/schema/validate' ;
18+ import { getMatchingOption , isValid } from '@lljj/vjsf-utils/schema/validate' ;
1919
2020import vueProps from '../../props' ;
2121import Widget from '../../../components/Widget' ;
@@ -165,7 +165,14 @@ export default {
165165 }
166166 } ) ;
167167 } else {
168- setPathVal ( this . rootFormData , this . curNodePath , newOptionData === undefined ? curFormData : newOptionData ) ;
168+ setPathVal (
169+ this . rootFormData ,
170+ this . curNodePath ,
171+ ( newOptionData === undefined && isValid ( retrieveSchema (
172+ this . selectList [ newVal ] ,
173+ this . rootSchema
174+ ) , curFormData ) ) ? curFormData : newOptionData
175+ ) ;
169176 }
170177
171178 // 可添加一个配置通知外部这里变更
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import {
1717
1818import retrieveSchema from '@lljj/vjsf-utils/schema/retriev' ;
1919import getDefaultFormState from '@lljj/vjsf-utils/schema/getDefaultFormState' ;
20- import { getMatchingOption } from '@lljj/vjsf-utils/schema/validate' ;
20+ import { getMatchingOption , isValid } from '@lljj/vjsf-utils/schema/validate' ;
2121
2222import vueProps from '../../props' ;
2323import Widget from '../../../components/Widget' ;
@@ -160,7 +160,14 @@ export default {
160160 }
161161 } ) ;
162162 } else {
163- setPathVal ( props . rootFormData , props . curNodePath , newOptionData === undefined ? curFormData : newOptionData ) ;
163+ setPathVal (
164+ props . rootFormData ,
165+ props . curNodePath ,
166+ ( newOptionData === undefined && isValid ( retrieveSchema (
167+ props . selectList [ newVal ] ,
168+ props . rootSchema
169+ ) , curFormData ) ) ? curFormData : newOptionData
170+ ) ;
164171 }
165172 } ) ;
166173
You can’t perform that action at this time.
0 commit comments