Commit 26671d8e authored by 彭俊龙's avatar 彭俊龙

关联选择修改

parent 4cc9d74a
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "6.10.67", "version": "6.10.68",
"description": "6.10.67 电子手签画布范围调整,关联选择新增表数据联动", "description": "6.10.68 电子手签画布范围调整,关联选择新增表数据联动",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -4281,6 +4281,30 @@ const advancedWidgets = [ ...@@ -4281,6 +4281,30 @@ const advancedWidgets = [
hidden: "{{formData.sourceType != '数据字典'}}", hidden: "{{formData.sourceType != '数据字典'}}",
widget: 'Dictionary', widget: 'Dictionary',
}, },
tableName: {
title: '表名',
name: '表名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'TableName',
dependencies: ['sourceType'],
},
displayName: {
title: '展示字段名',
name: '展示字段名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'FieldName',
dependencies: ['tableName'],
},
fieldName: {
title: '存储字段名',
name: '存储字段名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'FieldName',
dependencies: ['tableName'],
},
fieldTableKey:{ fieldTableKey:{
title: '联动父级字段', title: '联动父级字段',
type: 'string', type: 'string',
...@@ -4308,30 +4332,6 @@ const advancedWidgets = [ ...@@ -4308,30 +4332,6 @@ const advancedWidgets = [
widget: 'FieldName', widget: 'FieldName',
dependencies: ['tableName'], dependencies: ['tableName'],
}, },
tableName: {
title: '表名',
name: '表名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'TableName',
dependencies: ['sourceType'],
},
displayName: {
title: '展示字段名',
name: '展示字段名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'FieldName',
dependencies: ['tableName'],
},
fieldName: {
title: '存储字段名',
name: '存储字段名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'FieldName',
dependencies: ['tableName'],
},
required: { required: {
title: '必填', title: '必填',
type: 'boolean', type: 'boolean',
......
...@@ -13,11 +13,16 @@ const RelevanceSelect = (props) => { ...@@ -13,11 +13,16 @@ const RelevanceSelect = (props) => {
//用于表数据的父子级控件之间联动 //用于表数据的父子级控件之间联动
useEffect(() => { useEffect(() => {
if(addons){
if(getTargetPath()){ if(getTargetPath()){
const path = getTargetPath() const path = getTargetPath()
eventEmitter.on(`${path}_event`, (val)=> dealParentData(val)) eventEmitter.on(`${path}_event`, (val)=> dealParentData(val))
} }
if(!fieldTableKey && getChildrenSchemaByKey(title) && presetValue){//表数据类型的父级控件联动子级加载数据
setTimeout(() => { eventEmitter.emit(`${addons?.dataPath}_event`, presetValue )}, 100)
}
}
return () => { return () => {
if(getTargetPath()){ if(getTargetPath()){
const path = getTargetPath(fieldTableKey) const path = getTargetPath(fieldTableKey)
...@@ -34,9 +39,7 @@ const RelevanceSelect = (props) => { ...@@ -34,9 +39,7 @@ const RelevanceSelect = (props) => {
} }
if (addons) { if (addons) {
addons.setValue(addons.dataPath, presetValue || '') addons.setValue(addons.dataPath, presetValue || '')
if(!fieldTableKey && getChildrenSchemaByKey(title)){//表数据类型的父级控件联动子级加载数据
eventEmitter.emit(`${addons?.dataPath}_event`, presetValue || '')
}
} else { } else {
onChange(presetValue) onChange(presetValue)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment