Commit 0441f56f authored by GuanHua's avatar GuanHua

merge

parent b9d02e55
......@@ -17,6 +17,8 @@ import { constructTableData, transformDataForNiceForm } from '../../effect'
import PriceModal from './priceModal'
import ProductModal from './productModal'
import MemberModal from './memberModal'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
import { fectchShopListsSource } from '@/utils/type'
const { Search } = Input
......@@ -27,8 +29,12 @@ export interface PriceSettingProps {
formSubmit?(values),
}
const PriceSetting: React.FC<PriceSettingProps> = (props) => {
const { addSchemaAction, schema, formSubmit, onFieldChange = () => { } } = props
const fetchShopLists = async () => {
return await fectchShopListsSource({type: 1})
}
const PriceSetting:React.FC<PriceSettingProps> = (props) => {
const { addSchemaAction, schema, formSubmit, onFieldChange = () => {} } = props
const priceRef = useRef<any>({})
const productRef = useRef<any>({})
const memberRef = useRef<any>({})
......@@ -225,14 +231,14 @@ const PriceSetting: React.FC<PriceSettingProps> = (props) => {
FormEffectHooks.onFormInputChange$().subscribe(() => {
onFieldChange()
})
useAsyncSelect('shopId', fetchShopLists, ['name', 'id'])
$('onFieldValueChange', 'shopId').subscribe(parentState => {
if (parentState.value) {
ctx.setFieldState('shopId', state => {
// state.dataSource = pageStatus === PageStatus.PREVIEW ?
// GlobalConfig.web.shopInfo.filter(v => v.id === parentState.value && state.value.includes(v.id))
// :
state.dataSource = GlobalConfig.web.shopInfo.filter(v => v.id === parentState.value)
// state.dataSource = GlobalConfig.web.shopInfo.filter(v => v.id === parentState.value)
if (pageStatus === PageStatus.EDIT) {
state.props['x-component-props'].disabled = true;
......
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