aliyun / data-mapping-component

A React Component which focus on Data-Mapping & Table-Field-Mapping.(基于React的数据/表字段映射组件)
MIT License
157 stars 37 forks source link

sourceData或者targetData重新赋值不生效? #60

Open authoritya opened 7 months ago

authoritya commented 7 months ago

//外部调用方法手动赋值 const fn = async() => { const [sourceData, targetData] = await Promise.all([ DataApi.listObjDataV3(originMeta ? originMeta.obj.obj.ns : sourceObjData.ns, mainData ? mainData.biz_data_obj_name : objMainData.biz_data_obj_name, {...payload, filters: sourceFilter}), DataApi.listObjDataV3(originMeta ? originMeta.obj.obj.ns : sourceObjData.ns, mainData ? mainData.standard_name : objMainData.standard_name, {...payload, filters: targetFilter}), ])

setDataSource(sourceData.obj.data ?? []) setDataTarget(targetData.obj.data ?? []) }

<ButterflyDataMapping width={'100%'} type={'single'} sourceColumns={columnsSource} targetColumns={columnsTarget} sourceData={{fields: dataSource}} targetData={{fields: dataTarget}} mappingData={mappingData} sourceClassName={'source-column'} targetClassName={'target-column'} onRowMouseOver={onRowMouseOver} onRowMouseOut={onRowMouseOut} onEdgeClick={onEdgeClick} config={{checkable: {source: true}}} onChange={onMapFieldsChange} />