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

fix: 新增商品图片描述添加厂商商品资质图片

parent f27d1bee
......@@ -14,6 +14,7 @@ import OtherForm from './addProductsItem/otherForm'
import ProductImageForm from './addProductsItem/productImageForm'
import ProductDescFormDefualt from './addProductsItem/productDescFormDefault'
import ProductDescFormCloud from './addProductsItem/productDescFormCloud'
import ProductDescFormYang from './addProductsItem/productDescFormYang'
import { useLocalStore, observer } from 'mobx-react'
import { store } from '@/store'
......@@ -139,9 +140,10 @@ const AddProducts: React.FC<{}> = (props) => {
// 切换模板
const renderTemplate = () => {
// if(currentTemplateName === 'science')
return <ProductDescFormDefualt />
// return <ProductDescFormDefualt />
// else if(currentTemplateName === 'cloud')
// return <ProductDescFormCloud />
return <ProductDescFormYang />
}
const onSave = () => {
......
......@@ -25,6 +25,8 @@ const { RangePicker } = DatePicker
let paramsArray = [];
const isEdit = history.location.query?.id
const ProductAttributeForm: React.FC<Iprops> = (props) => {
const { attributesData, onRef } = props
const [isClearFormAndDataInEdit, setIsClearFormAndDataInEdit] = useState<boolean>(false) // 编辑情况下 是否要清空商品属性表单数据和页面全局数据
......@@ -43,7 +45,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
useEffect(()=>{
onRef(productAttributeFormRef)
// 编辑情况下 构建选中属性数据 给paramsArray初始化数据用于编辑 设置表单数据
if(history.location.query?.id){
if(isEdit){
constructProductSelectAttribute()
attributeForm.setFieldsValue(getProductAttributeFormParamsByEdit)
}
......@@ -51,7 +53,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
useEffect(() => {
// 属性变动 表明品类品牌变动 清空页面全局参数组合和store的选中属性 重置表单 (只对新增有效)
if(history.location.query?.id){
if(isEdit){
// 编辑第一次执行不清空,之后的变动需要清空
if(isClearFormAndDataInEdit){
paramsArray = []
......@@ -148,7 +150,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
let _isPrice = null
let _isUpdateAttribute = null
let _isDisabled = false
if(history.location.query?.id){
if(isEdit){
_isPrice = attrItem.isPrice
_isUpdateAttribute = productInfoByEdit.isUpdateAttribute
_isDisabled = _isPrice && !_isUpdateAttribute
......@@ -156,7 +158,6 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
if(!_isUpdateAttribute && (attrItem.createTime > productInfoByEdit.createTime)) {
return null
}
console.log(attrItem, attributesData, productInfoByEdit, 'data')
}
return (
......@@ -267,7 +268,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
<Tabs defaultActiveKey="1" tabPosition="left">
{
attributesData?.length > 0 && attributesData.map(attributeItem =>
!productInfoByEdit.isUpdateAttribute && (attributeItem.createTime > productInfoByEdit.createTime) ? null : <TabPane tab={attributeItem.name} key={attributeItem.id}>
isEdit && !productInfoByEdit.isUpdateAttribute && (attributeItem.createTime > productInfoByEdit.createTime) ? null : <TabPane tab={attributeItem.name} key={attributeItem.id}>
{
renderTabPanchildren(attributeItem)
}
......
......@@ -75,6 +75,16 @@ export enum CommodityType {
AGENT_SALE_COMMODITY = 3,
}
/** 商品描述图片类型枚举 */
export enum CommodityImagesType {
/** 描述图片 */
DESCRIPTION_IMAGES = 1,
/** 厂商资质图片 */
CERTIFICATION_IMAGES = 2,
/** 商品检测报告 */
REPORT_IMAGES = 3,
}
/** 商品的操作文本 */
export const opeartionLabel = [
'',
......
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