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

fix: 积分类型商品编辑积分回显问题,商品描述移除剪切

parent 5ac98cd6
......@@ -24,7 +24,7 @@ const TableOperation:React.FC<TableOperationProps> = (props) => {
}else{
setOperationName(() => statusOperationMap[record.status])
}
}, [])
}, [record])
return ( <>
{
......
......@@ -52,6 +52,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
const [minOrderNumber, setMinOrderNumber] = useState<number>()
const [isBatchSetting, setIsBatchSetting] = useState<boolean>(false) //是否点击批量设置
const flagRef = useRef<boolean>(false)
const [isChangePriceType, setIsChangePriceType] = useState<boolean>(false) // 价格类型是否有变动
const [colums, setColumns] = useState<ColumnType<any>[]>()
const { ProductStore } = store
......@@ -309,12 +310,15 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
_tableDataSource = _tableData
// 有前面tab变动引起的二次构建 需要清空价格数据
if(updateFlag.current){
// ***** bug编辑积分商品(非现货价格)会导致价格类型变动引发重复渲染 *****
updateFlag.current = false
} else {
// ***** 编辑情况下且是积分商品 不做清空单价处理 *****
if(!(productInfoByEdit?.id && planPrice === 3))
// if(!(history.location.query?.id && planPrice === 3)){
// _tableDataSource.map(item => item['单价'] = {})
// }
if(isChangePriceType){ // 价格类型变动 清空价格
_tableDataSource.map(item => item['单价'] = {})
}
}
setTableDataSource(productName ? _tableDataSource : []) // 通过商品名称来判断是否显示表格数据
......@@ -418,6 +422,8 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
setPriceForm.resetFields()
setLadderPrice(false)
setPlanPrice(v.target.value)
setIsChangePriceType(true)
console.log('价格类型变动')
}
const setPriceOk = () => {
......
......@@ -168,7 +168,7 @@ const ProductDescFormDefualt: React.FC<{}> = (props) => {
}
<div className={styles.descriptBox}>
<div className={styles.middleAddBtn}>
<ImgCrop rotate>
{/* <ImgCrop rotate> */}
<Upload {...uploadImgProps}>
<Button size="small" type="text">
<PlusOutlined />
......@@ -176,7 +176,7 @@ const ProductDescFormDefualt: React.FC<{}> = (props) => {
<br/>
<span>添加图片</span>
</Upload>
</ImgCrop>
{/* </ImgCrop> */}
</div>
</div>
</Spin>
......
......@@ -20,7 +20,7 @@ import styles from "./index.less"
import { PublicApi } from '@/services/api'
import { GetProductCommodityGetShopResponse } from '@/services/ProductApi'
import TableOperation from './TableOperation'
import TableOperation from '@/components/TableOperation'
import { store } from '@/store'
......@@ -258,14 +258,12 @@ const Products: React.FC<{}> = () => {
}
return (
<>
<TableOperation
record={record}
statusOperationMap={statusAndOperationList}
operationHandler={operationHandler}
priorityOperationName="提交审核"
<TableOperation
record={record}
statusOperationMap={statusAndOperationList}
operationHandler={operationHandler}
priorityOperationName="提交审核"
/>
</>
)
}
......
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