Commit cfaadf10 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理商品批量上架没有传参问题

parent 98099aea
......@@ -186,6 +186,7 @@ export default {
'classAndProperty.class.classSchema.type.value.4':'Points to redeem goods',
'classAndProperty.class.classSchema.imageUrl':'Category image',
'classAndProperty.class.classSchema.category.name':'Corresponding platform category',
'classAndProperty.class.classSchema.category.name.desc': 'If you need to screen products in the mall by category and attribute defined by the platform, you need to select the product category corresponding to the platform definition in the column of category defined by the platform.',
'classAndProperty.class.classSchema.sort':'Category Sort',
'classAndProperty.class.classSchema.sort.placeholder':'Please enter the category sort',
'classAndProperty.class.classSchema.sort.placeholder1':'Please enter the sort value',
......@@ -255,4 +256,4 @@ export default {
'classAndProperty.addPropertyValue.modal':'Associated platform property value',
'classAndProperty.addPropertyValue.modal.okText':'Confirm',
'classAndProperty.addPropertyValue.modal.cancelText':'Cancel',
};
\ No newline at end of file
};
......@@ -187,6 +187,7 @@ export default {
'classAndProperty.class.classSchema.type.value.4': '포인트 교환 상품',
'classAndProperty.class.classSchema.imageUrl': '품목 이미지',
'classAndProperty.class.classSchema.category.name': '대응 플랫폼 품목',
'classAndProperty.class.classSchema.category.name.desc': '만약 쇼핑몰에서 플랫폼이 정의한 품목과 속성을 통해 상품을 선별할 필요가 있다면 해당 플랫폼의 품목란에서 플랫폼 정의에 해당하는 품목을 선택해야 한다.',
'classAndProperty.class.classSchema.sort': '품목 순서',
'classAndProperty.class.classSchema.sort.placeholder': '품목 정렬을 입력하십시오.',
'classAndProperty.class.classSchema.sort.placeholder1': '정렬 값을 입력하십시오.',
......
......@@ -187,6 +187,7 @@ export default {
'classAndProperty.class.classSchema.type.value.4': '积分兑换商品',
'classAndProperty.class.classSchema.imageUrl': '品类图片',
'classAndProperty.class.classSchema.category.name': '对应平台品类',
'classAndProperty.class.classSchema.category.name.desc': '如果需要在商城中通过平台定义的品类及属性筛选商品,需要在对应平台品类一栏中选择对应到平台定义的商品品类。',
'classAndProperty.class.classSchema.sort': '品类排序',
'classAndProperty.class.classSchema.sort.placeholder': '请输入品类排序',
'classAndProperty.class.classSchema.sort.placeholder1': '请输入排序数值',
......
......@@ -12,6 +12,7 @@ import { classSchema } from './schema'
import { useTreeTabs } from '@/hooks/useTreeTabs';
import NiceForm from '@/components/NiceForm';
import { getProductCustomerGetCustomerCategory, getProductCustomerGetCustomerCategoryTree, getProductPlatformGetCategoryTree, postProductCustomerDeleteCustomerCategory, postProductCustomerSaveOrUpdateCustomerCategory, postProductCustomerSyncCategory } from '@/services/ProductV2Api';
import { help } from '@/pages/transaction/common';
const { ON_FORM_INPUT_CHANGE } = LifeCycleTypes
......@@ -179,7 +180,6 @@ const ClassProperty: React.FC<{}> = () => {
syncTreeActions.setSelectKeys([])
}
const connectCategory = <div className='connectBtn' onClick={handleConnectCategroyBtn}><LinkOutlined style={{ marginRight: 4 }} />{intl.formatMessage({ id: 'classAndProperty.class.connectCategory' })}</div>
return <PageHeaderWrapper
......@@ -240,7 +240,8 @@ const ClassProperty: React.FC<{}> = () => {
}}
schema={classSchema}
expressionScope={{
connectCategory
connectCategory,
help
}}
>
<FormButtonGroup>
......
......@@ -72,7 +72,7 @@ export const classSchema: ISchema = {
},
name: {
type: 'string',
title: getIntl().formatMessage({ id: 'classAndProperty.class.classSchema.category.name' }),
title: `{{help('${getIntl().formatMessage({ id: 'classAndProperty.class.classSchema.category.name' })}', '${getIntl().formatMessage({ id: 'classAndProperty.class.classSchema.category.name.desc'})}')}}`,
'x-component-props': {
disabled: true,
addonAfter: '{{connectCategory}}',
......
......@@ -25,7 +25,7 @@ import moment from 'moment'
import { productStatusColor, productStatusLabel } from './constant'
import { getProductChannelCommodityGetChannelCommodityList, getProductChannelCommodityGetShop, getProductChannelCommodityGetShopBatch, GetProductChannelCommodityGetShopResponse, postProductChannelCommodityBatchOffPublishCommodity, postProductChannelCommodityBatchPublishCommodity, postProductChannelCommodityDeleteBatchChannelCommodity, postProductChannelCommodityPublishCommodity } from '@/services/ProductV2Api'
import { getTemplateWebMemberChannelWebFindCurrMemberChannel } from '@/services/TemplateV2Api'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { useRowSelectionTable, useRowSelectionTableCtl } from '@/hooks/useRowSelectionTable'
const { confirm } = Modal;
const formActions = createFormActions();
......@@ -34,6 +34,7 @@ const DirectChannel: React.FC<{}> = () => {
const intl = useIntl();
const ref = useRef<any>({})
const currentRefRow = useRef<any>([])
const currentCtrlRef = useRef<useRowSelectionTableCtl>()
const [isUp, setIsUp] = useState(1) // 1上0下架状态
const [upDownModal, setUpDownModal] = useState(false)
const [shopsOption, setShopsOption] = useState<GetProductChannelCommodityGetShopResponse>([])
......@@ -46,6 +47,7 @@ const DirectChannel: React.FC<{}> = () => {
const [rowSelection, rowCtl] = useRowSelectionTable()
useEffect(() => {
currentCtrlRef.current = rowCtl
currentRefRow.current = rowCtl.selectRow
}, [rowCtl])
......@@ -298,6 +300,7 @@ const DirectChannel: React.FC<{}> = () => {
setUpDownModal(false)
ref.current.reload()
setIsDisabledOKbtn(false)
currentCtrlRef.current.setSelectedRowKeys([])
})
} else {
setIsDisabledOKbtn(false)
......@@ -308,6 +311,7 @@ const DirectChannel: React.FC<{}> = () => {
setUpDownModal(false)
ref.current.reload()
setIsDisabledOKbtn(false)
currentCtrlRef.current.setSelectedRowKeys([])
})
}
} else {
......@@ -317,6 +321,7 @@ const DirectChannel: React.FC<{}> = () => {
setUpDownModal(false)
ref.current.reload()
setIsDisabledOKbtn(false)
currentCtrlRef.current.setSelectedRowKeys([])
})
} else {
setIsDisabledOKbtn(false)
......@@ -327,6 +332,7 @@ const DirectChannel: React.FC<{}> = () => {
setUpDownModal(false)
ref.current.reload()
setIsDisabledOKbtn(false)
currentCtrlRef.current.setSelectedRowKeys([])
})
}
}
......
......@@ -72,7 +72,6 @@ const Products: React.FC<{}> = () => {
const { searchData, formatInitialValue, clear } = useSetSearchValueInTable()
useEffect(() => {
console.log(RowCtl.selectRow)
currentCtrlRef.current = RowCtl
currentRefRow.current = RowCtl.selectRow
}, [RowCtl])
......@@ -399,7 +398,8 @@ const Products: React.FC<{}> = () => {
const clickUp = (param: number, id: number) => { // param: 0 下架 1上架 id为null批量上架
setCurrentOptionId(id)
const fn = id ? getProductCommodityGetShop : postProductCommodityGetShopBatch
fn(id ? { id } : { idList: RowCtl.selectedRowKeys }, { ctlType: 'none' }).then(res => {
// @ts-ignore
fn(id ? { id } : { idList: currentCtrlRef.current.selectedRowKeys }, { ctlType: 'none' }).then(res => {
setShopsOption(res.data)
setCheckedValues(res.data.filter(_ => _.isCheck))
})
......@@ -416,6 +416,7 @@ const Products: React.FC<{}> = () => {
if (isUp) {
if (checkedValues.length > 0) {
const fn = isBatch ? postProductCommodityPublishCommodityBatch : postProductCommodityPublishCommodity
// @ts-ignore
fn(isBatch ? { storeId: shopId['id'], storeName: shopId['name'], storeLogo: shopId['logo'], shopList: checkedValues, idList: RowCtl.selectedRowKeys } : { storeId: shopId?.id || null, storeName: shopId?.name || null, storeLogo: shopId?.logo || null, ...params }).then(() => {
setUpDownModal(false)
ref.current.reload()
......
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