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

fix:

parent 89549cd6
......@@ -98,7 +98,6 @@ const AddProducts: React.FC<{}> = (props) => {
}, [])
useEffect(() => {
console.log(111111, clearPartRef.current)
if(history.location.query?.id && clearPartRef.current === 3){
// 编辑商品切换品类 清空部分数据
clearPartData()
......@@ -142,7 +141,7 @@ const AddProducts: React.FC<{}> = (props) => {
})
Promise.all(data).then((values) => {
// 提交的数据进行处理
console.log(values, productSelectAttribute, productAttributeAndImageParams, '所有数据')
// console.log(values, productSelectAttribute, productAttributeAndImageParams, '所有数据')
productSelectAttribute.length > 0 && productSelectAttribute.map(_itme => {
_itme.customerAttribute = { id: _itme.customerAttributeId }
delete _itme.attributeName
......@@ -200,7 +199,7 @@ const AddProducts: React.FC<{}> = (props) => {
try {
if (_productAttributeAndImageParams.length > 0) {
_productAttributeAndImageParams.map(_item => {
console.log(_item, '_item')
// console.log(_item, '_item')
_item.goods = { id: _item.goodsId } // id为0表示无货品
delete _item.goodsId
......@@ -279,7 +278,7 @@ const AddProducts: React.FC<{}> = (props) => {
if (numberKeys.length > 0)
numberKeys.map(item => delete _params[item])
console.log(_params, 'params')
// console.log(_params, 'params')
PublicApi.postProductCommoditySaveOrUpdateCommodity(_params).then(res => {
if (res.code === 1000) {
setIsEnableCheck(false)
......
......@@ -105,7 +105,6 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
}, [])
useEffect(()=>{
console.log('basic')
const { id } = history.location.query
if(id && getBasicFormParamsByEdit?.name){
handleBrandSearch(getBasicFormParamsByEdit.brandName)
......
......@@ -191,7 +191,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
let { _attributeNameArr, _attributeValueArr, _temp_attributeObjArr, _temp_attributeValObjArr } = needObject
console.log(_priceAttribute, _attributeNameArr, _attributeValueArr, _temp_attributeObjArr, _temp_attributeValObjArr, selectedGoods, '---constructimg---') // 编辑直接进入价格设置 都为空数组
// console.log(_priceAttribute, _attributeNameArr, _attributeValueArr, _temp_attributeObjArr, _temp_attributeValObjArr, selectedGoods, '---constructimg---') // 编辑直接进入价格设置 都为空数组
if(selectedGoods.length>0){ // 编辑情况下 select货品列表可能会采用接口数据
_col.push({
......@@ -280,7 +280,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
setAttributeObjArr(_temp_attributeObjArr)
setAttributeValObjArr(_temp_attributeValObjArr)
console.log(combineArray, 'SKU组合数据')
// console.log(combineArray, 'SKU组合数据')
let _tableData: any[] = []
if(combineArray?.length>0){ // length存在 表示表格的行数(有价格属性组合)
combineArray.map((_rowArr: any[], i: any) => { // _rowArr 属性值数组
......
......@@ -52,7 +52,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
useEffect(() => {
// 属性变动 表明品类品牌变动 清空页面全局参数组合和store的选中属性 重置表单 (只对新增有效)
console.log('属性变动', isClearFormAndDataInEdit)
// console.log('属性变动', isClearFormAndDataInEdit)
if(history.location.query?.id){
// 编辑第一次执行不清空,之后的变动需要清空
if(isClearFormAndDataInEdit){
......@@ -70,10 +70,6 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
}
}, [attributeLists])
const onFinish = (values) => {
console.log(values, 'values')
}
/**
* @description 表单项改变转换数据格式,仅限“select单选、checkbox多选、输入”三类控件的改变
* @param {Number, Array, e} value type为1:数字id,type为2:数组id,type为3:事件对象
......@@ -128,7 +124,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
// 遍历 排空
let resultParams = _resultParams.filter((_item: any)=>_item.customerAttributeValueList.length!=0)
console.log(resultParams,'resultParams') // 最终传输数据
// console.log(resultParams,'resultParams') // 最终传输数据
setProductSelectAttribute(resultParams)
}
......@@ -143,7 +139,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
isPrice: attributeLists.filter(_item => _item.name === item.customerAttribute.name)[0]?.isPrice
}
})
console.log(_selectAttributeByEdit, '__selectAttributeByEdit__', attributeLists)
// console.log(_selectAttributeByEdit, '__selectAttributeByEdit__', attributeLists)
paramsArray = _selectAttributeByEdit
setProductSelectAttribute(_selectAttributeByEdit)
}
......@@ -252,7 +248,6 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
form={attributeForm}
name="attribute-form"
labelAlign="left"
onFinish={onFinish}
ref={productAttributeFormRef}
colon={false}
// initialValues={productInfoByEdit?.id ? getProductAttributeFormParamsByEdit : {}}
......
......@@ -56,12 +56,9 @@ const ProductDescFormDefualt: React.FC<{}> = (props) => {
showUploadList: false,
data: { fileType: UPLOAD_TYPE },
onChange(info) {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList, 'image files');
}
if (info.file.status === 'done') {
message.success(`${info.file.name} 文件上传成功`);
console.log(info.file.response)
// console.log(info.file.response)
if(Array.isArray(fileImageList)){
setFileImageList([...fileImageList, info.file.response.data])
// 设置传输数据
......@@ -99,9 +96,6 @@ const ProductDescFormDefualt: React.FC<{}> = (props) => {
// return isVideo
// },
onChange(info) {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList, 'video files');
}
if (info.file.status === 'done') {
message.success(`${info.file.name} 文件上传成功`);
if(Array.isArray(videoList)){
......@@ -128,12 +122,12 @@ const ProductDescFormDefualt: React.FC<{}> = (props) => {
}
const handleDeleteVideo = (_index: number) => {
console.log(_index, '删除的视频索引')
// console.log(_index, '删除的视频索引')
setVideoList([])
}
const handleDeleteImage = (_index: number) => {
console.log(_index, '删除的图片索引')
// console.log(_index, '删除的图片索引')
let imageArr = [...fileImageList]
imageArr.splice(_index, 1)
setFileImageList(imageArr)
......
......@@ -42,10 +42,10 @@ const ProductImageForm: React.FC<{}> = (props) => {
useEffect(()=>{
if(priceAttributeParams.length > 0){
console.log(priceAttributeParams, '对比')
// console.log(priceAttributeParams, '对比')
constructImageListByRender(priceAttributeParams)
}else if(history.location.query?.id){ // 不点击前面 直接进入图片tab
console.log(productInfoByEdit.unitPriceAndPicList, '对比')
// console.log(productInfoByEdit.unitPriceAndPicList, '对比')
constructImageListByRender(productInfoByEdit.unitPriceAndPicList)
}
},[priceAttributeParams])
......@@ -100,7 +100,7 @@ const ProductImageForm: React.FC<{}> = (props) => {
}
const clickItemTab = (_index: number) => {
console.log(_index, '点击项')
// console.log(_index, '点击项')
setDefaultChecked(_index)
}
......@@ -165,7 +165,7 @@ const ProductImageForm: React.FC<{}> = (props) => {
const handleChange = ({ file, fileList }, index) => {
let _priceAttributeParams = [...priceAttributeParamsByRender]
console.log(fileList, file?.response?.data, '响应')
// console.log(fileList, file?.response?.data, '响应')
setCommonImageList(fileList)
// if(file?.response?.data){ // 服务端是否响应正常url字符
_priceAttributeParams[index].commodityPic = fileList
......
......@@ -46,7 +46,7 @@ const SelectGoodsForm: React.FC<{}> = (props) => {
item[next.id] = next;
return item
},{}))
console.log(goodsArr, 'goods')
// console.log(goodsArr, 'goods')
if(goodsArr.length>0){
setIsChecked(true)
setIsSelectGoods(true)
......
......@@ -107,7 +107,7 @@ class ProductStore implements IProductModule {
@action.bound
public setProductSelectAttribute(list: any[]) {
console.log(list, 'mobx')
// console.log(list, 'mobx')
this.productSelectAttribute = list;
}
......
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