Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
bc821a87
Commit
bc821a87
authored
Oct 11, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 新增商品图片描述添加厂商商品资质图片
parent
f27d1bee
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
6 deletions
+19
-6
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+3
-1
productAttributeForm.tsx
...mmodity/products/addProductsItem/productAttributeForm.tsx
+6
-5
productDescFormYang.tsx
...ommodity/products/addProductsItem/productDescFormYang.tsx
+0
-0
index.tsx
src/pages/commodity/products/constant/index.tsx
+10
-0
No files found.
src/pages/commodity/products/addProducts.tsx
View file @
bc821a87
...
...
@@ -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
=
()
=>
{
...
...
src/pages/commodity/products/addProductsItem/productAttributeForm.tsx
View file @
bc821a87
...
...
@@ -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
)
}
...
...
src/pages/commodity/products/addProductsItem/productDescFormYang.tsx
0 → 100644
View file @
bc821a87
This diff is collapsed.
Click to expand it.
src/pages/commodity/products/constant/index.tsx
View file @
bc821a87
...
...
@@ -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
=
[
''
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment