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

关联选择修改

parent 4cc9d74a
{
"name": "panda-xform",
"version": "6.10.67",
"description": "6.10.67 电子手签画布范围调整,关联选择新增表数据联动",
"version": "6.10.68",
"description": "6.10.68 电子手签画布范围调整,关联选择新增表数据联动",
"keywords": [
"panda-xform"
],
......
......@@ -4281,6 +4281,30 @@ const advancedWidgets = [
hidden: "{{formData.sourceType != '数据字典'}}",
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:{
title: '联动父级字段',
type: 'string',
......@@ -4308,30 +4332,6 @@ const advancedWidgets = [
widget: 'FieldName',
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: {
title: '必填',
type: 'boolean',
......
......@@ -13,11 +13,16 @@ const RelevanceSelect = (props) => {
//用于表数据的父子级控件之间联动
useEffect(() => {
if(getTargetPath()){
const path = getTargetPath()
eventEmitter.on(`${path}_event`, (val)=> dealParentData(val))
if(addons){
if(getTargetPath()){
const path = getTargetPath()
eventEmitter.on(`${path}_event`, (val)=> dealParentData(val))
}
if(!fieldTableKey && getChildrenSchemaByKey(title) && presetValue){//表数据类型的父级控件联动子级加载数据
setTimeout(() => { eventEmitter.emit(`${addons?.dataPath}_event`, presetValue )}, 100)
}
}
return () => {
if(getTargetPath()){
const path = getTargetPath(fieldTableKey)
......@@ -34,9 +39,7 @@ const RelevanceSelect = (props) => {
}
if (addons) {
addons.setValue(addons.dataPath, presetValue || '')
if(!fieldTableKey && getChildrenSchemaByKey(title)){//表数据类型的父级控件联动子级加载数据
eventEmitter.emit(`${addons?.dataPath}_event`, presetValue || '')
}
} else {
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