Commit e1e0d268 authored by GuanHua's avatar GuanHua

merge

parent 0441f56f
......@@ -17,8 +17,6 @@ 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
......@@ -29,12 +27,8 @@ export interface PriceSettingProps {
formSubmit?(values),
}
const fetchShopLists = async () => {
return await fectchShopListsSource({type: 1})
}
const PriceSetting:React.FC<PriceSettingProps> = (props) => {
const { addSchemaAction, schema, formSubmit, onFieldChange = () => {} } = props
const PriceSetting: React.FC<PriceSettingProps> = (props) => {
const { addSchemaAction, schema, formSubmit, onFieldChange = () => { } } = props
const priceRef = useRef<any>({})
const productRef = useRef<any>({})
const memberRef = useRef<any>({})
......@@ -190,7 +184,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
</>
// 批量设置价格按钮
const batchPriceButton = pageStatus !== PageStatus.PREVIEW && priceType !== 2 && <Button type="text" onClick={clickBatchSetPrice} style={{ marginBottom: 12, cssFloat: "right" }}><SettingOutlined /> 批量设置价格</Button>
const batchPriceButton = pageStatus !== PageStatus.PREVIEW && priceType !== 2 && <Button type="text" onClick={clickBatchSetPrice} style={{ marginBottom: 12, float: "right" }}><SettingOutlined /> 批量设置价格</Button>
// 选择商品
const connectProduct = pageStatus === PageStatus.ADD && <div className='connectBtn' onClick={handleAddProductBtn}><LinkOutlined style={{ marginRight: 4 }} />选择</div>
......@@ -231,14 +225,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