Commit 0bf4468b authored by 田翔's avatar 田翔

fix: 传递值

parent bc53bf9c
{
"name": "panda-xform",
"version": "2.1.8",
"description": "2.1.8: 支持树形",
"version": "2.1.9",
"description": "2.1.9: 支持树形",
"keywords": [
"panda-xform"
],
......
import React, { useMemo, forwardRef, useContext, useImperativeHandle } from 'react'
import React, { useState, useMemo, forwardRef, useContext, useImperativeHandle } from 'react'
import { ConfigProvider } from 'antd'
import FormRender, { useForm } from 'form-render'
import widgets from './widgets'
import { isObject } from '../../../../../utils'
import getWatch from '../../../../FormRender/watch'
const BaseForm = (props, ref) => {
......@@ -17,6 +18,11 @@ const BaseForm = (props, ref) => {
const prefixCls = getPrefixCls('pandaXform')
const pandaXform = getPrefixCls()
const form = useForm()
const [startTime, setStartTime] = useState(new Date().getTime())
const watch = useMemo(() => {
return getWatch(schemaForm, form, startTime)
}, [schemaForm, form, startTime])
//表单需要显示的字段
const field = useMemo(() => {
......@@ -87,6 +93,7 @@ const BaseForm = (props, ref) => {
form={form}
schema={schema}
widgets={widgets}
watch={watch}
/>
</div>
)
......
......@@ -249,15 +249,19 @@ const RelationForm = (props) => {
}
})
})
let relationForm = addons.getValue('relationForm') || { configs: [], data: [] }
relationForm?.configs.forEach(v => {
v.queryWheres = queryWheres.map(v => { return { fieldName: v.field, fieldValue: v.value } })
})
addons.getValue('relationForm', relationForm)
return queryWheres
}
const getTableData = async (addFieldGroup) => {
console.log('addons', addons, addFieldGroup)
if (!addons) return
let queryWheres = getQueryWheres(addFieldGroup)
// setTimeout(() => {
// console.log('2', addons, addons.getValue('extraData'))
// }, 10000)
console.log('queryWheres', queryWheres)
if (!queryWheres.length) {
message.info('映射字段配置错误!')
}
......@@ -324,7 +328,7 @@ const RelationForm = (props) => {
const addClick = () => {
if (!localForm.length) {
return message.error(getMsg())
return message.error('配置出错!')
}
if (addons) {
if (JSON.stringify(schemaGroup) === '{}') {
......
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