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
f0554366
Commit
f0554366
authored
Aug 29, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:
parent
d45b058e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
102 additions
and
35 deletions
+102
-35
index.tsx
src/components/TabTree/index.tsx
+1
-1
index.tsx
src/pages/classAndProperty/categoryAttributes/index.tsx
+6
-7
index.tsx
src/pages/classAndProperty/class/index.tsx
+40
-6
addPropertyValue.tsx
...pages/classAndProperty/propertyValue/addPropertyValue.tsx
+2
-2
index.tsx
src/pages/classAndProperty/propertyValue/index.tsx
+22
-6
index.tsx
src/pages/commodity/goods/index.tsx
+15
-4
index.tsx
src/pages/commodity/products/index.tsx
+3
-3
viewProducts.tsx
src/pages/commodity/products/viewProducts.tsx
+5
-5
addBrand.tsx
src/pages/trademark/addBrand.tsx
+8
-1
No files found.
src/components/TabTree/index.tsx
View file @
f0554366
...
...
@@ -185,7 +185,7 @@ function transformSingleTitle(
// 使选中样式受控
data
[
item
].
className
=
cx
(
'god-tabtree-select'
,
Number
(
nowKey
)
===
Number
(
data
[
item
].
key
)
?
'show'
:
'hide'
,
String
(
nowKey
)
===
String
(
data
[
item
].
key
)
?
'show'
:
'hide'
,
);
if
(
disabled
)
{
data
[
item
].
disableCheckbox
=
disabled
;
...
...
src/pages/classAndProperty/categoryAttributes/index.tsx
View file @
f0554366
...
...
@@ -81,18 +81,16 @@ const CategoryAttributes: React.FC<{}> = () => {
const
handleSee
=
(
record
:
any
)
=>
{
history
.
push
(
`/memberCenter/commodityAbility/classAndProperty/categoryAttributes/viewAttributes?id=
${
record
.
id
}
`
)
console
.
log
(
record
)
}
const
handleSelectOk
=
()
=>
{
setRoleVisible
(
false
)
if
(
goodsRowCtl
.
selectRow
.
length
)
{
//
if (goodsRowCtl.selectRow.length) {
PublicApi
.
postProductCustomerSaveCustomerCategoryAttribute
({
customerCategoryId
:
selectKey
,
customerAttributeIds
:
goodsRowCtl
.
selectedRowKeys
}).
then
(
res
=>
{
//@ts-ignore
ref
.
current
.
reload
(
)
if
(
res
.
code
===
1000
)
setTimeout
(()
=>
ref
.
current
.
reload
(),
500
)
})
}
console
.
log
(
selectRow
)
// }
}
const
handleSelectCancel
=
()
=>
{
setRoleVisible
(
false
)
...
...
@@ -157,7 +155,7 @@ const CategoryAttributes: React.FC<{}> = () => {
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
<>
{
record
.
isEnable
?
<></>
:
<
Button
type=
'link'
onClick=
{
()
=>
clickRelief
(
record
.
id
)
}
>
解除关联
</
Button
>
}
<
Button
type=
'link'
onClick=
{
()
=>
clickRelief
(
record
.
id
)
}
>
解除关联
</
Button
>
</>
)
}
...
...
@@ -221,6 +219,7 @@ const CategoryAttributes: React.FC<{}> = () => {
const
clickRelief
=
(
paramsId
:
number
)
=>
{
PublicApi
.
postProductCustomerDeleteCustomerCategoryAttribute
({
customerCategoryId
:
+
currentCategoryRef
.
current
,
customerAttributeIds
:
[
paramsId
]
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
ref
.
current
.
reload
()
})
}
...
...
src/pages/classAndProperty/class/index.tsx
View file @
f0554366
...
...
@@ -22,7 +22,10 @@ enum FormState {
ADD
,
// 新增状态
}
let
flag
=
false
;
// 全局变量 用于控制表单编辑退出提示
const
formActions
=
createFormActions
()
const
treeActions
=
createTreeActions
()
const
fetchClassTreeData
=
async
(
params
?)
=>
{
// 商品品类树
const
res
=
await
PublicApi
.
getProductCustomerGetCustomerCategoryTree
()
...
...
@@ -52,8 +55,10 @@ const ClassProperty: React.FC<{}> = () => {
setTreeMaps
,
resetMenu
,
toolsRender
,
isEditForm
,
handleDeleteMenu
}
=
useTreeTabs
({
treeActions
,
deleteMenu
:
PublicApi
.
postProductCustomerDeleteCustomerCategory
,
fetchMenuData
:
fetchClassTreeData
,
fetchItemDetailData
:
PublicApi
.
getProductCustomerGetCustomerCategory
...
...
@@ -61,8 +66,16 @@ const ClassProperty: React.FC<{}> = () => {
const
formInitValue
=
(
nodeRecord
&&
treeStatus
===
FormState
.
EDIT
)
?
getTreeMaps
(
nodeRecord
.
key
)
:
{}
// useEffect(() => {
// if(treeActions.setExpandedKeys){
// console.log(treeActions.setExpandedKeys)
// treeActions.setSelectKey(85)
// treeActions.setExpandedKeys([85])
// }
// }, [])
/* 关联平台后台品类树 */
const
{
const
{
treeData
:
plateformTreeData
,
}
=
useTreeTabs
({
fetchMenuData
:
fetchPlatformTreeData
,
...
...
@@ -88,7 +101,6 @@ const ClassProperty: React.FC<{}> = () => {
const
handleSelectOk
=
()
=>
{
setPlateformVisible
(
false
)
console
.
log
(
plateformSelectNode
,
'plateformSelectNode'
)
if
(
plateformSelectNode
?.
id
){
formActions
.
setFieldValue
(
'category'
,
plateformSelectNode
)
}
...
...
@@ -114,6 +126,11 @@ const ClassProperty: React.FC<{}> = () => {
}
}
const
clickSelect
=
(
key
,
node
)
=>
{
handleSelect
(
key
,
node
)
flag
=
false
}
// 关联平台品类input
const
connectCategory
=
<
div
className=
'connectBtn'
onClick=
{
handleConnectCategroyBtn
}
><
LinkOutlined
style=
{
{
marginRight
:
4
}
}
/>
关联
</
div
>
...
...
@@ -131,7 +148,8 @@ const ClassProperty: React.FC<{}> = () => {
fetchData
=
{
params
=
>
fetchClassTreeData(params)}
treeData=
{
treeData
}
toolsRender=
{
toolsRender
}
handleSelect=
{
(
key
,
node
)
=>
handleSelect
(
key
,
node
)
}
actions=
{
treeActions
}
handleSelect=
{
(
key
,
node
)
=>
clickSelect
(
key
,
node
)
}
customKey="id"
/
>
:
...
...
@@ -151,6 +169,20 @@ const ClassProperty: React.FC<{}> = () => {
name=
'classForm'
onSubmit=
{
onFinish
}
actions=
{
formActions
}
effects=
{
(
$
,
action
)
=>
{
flag
=
false
$
(
ON_FORM_INPUT_CHANGE
).
subscribe
(()
=>
{
setIsEditForm
(
true
)
})
$
(
'onFieldValueChange'
,
'name, type, imageUrl, category'
).
subscribe
(
state
=>
{
if
(
flag
){
setIsEditForm
(
true
)
flag
=
false
}
else
flag
=
true
})
}
}
schema=
{
classSchema
}
expressionScope=
{
{
connectCategory
...
...
@@ -161,9 +193,11 @@ const ClassProperty: React.FC<{}> = () => {
保存
</
Button
>
<
Popconfirm
title=
"确定要删除吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
handleDeleteMenu
}
>
<
Button
style=
{
{
marginTop
:
32
,
marginBottom
:
16
}
}
>
删除
</
Button
>
{
treeStatus
!==
FormState
.
ADD
&&
<
Button
style=
{
{
marginTop
:
32
,
marginBottom
:
16
}
}
>
删除
</
Button
>
}
</
Popconfirm
>
</
FormButtonGroup
>
</
NiceForm
>
...
...
src/pages/classAndProperty/propertyValue/addPropertyValue.tsx
View file @
f0554366
...
...
@@ -74,7 +74,6 @@ const AddPropertyValue: React.FC<{}> = () => {
const
handleSubmitAllSetting
=
()
=>
{
attrValueForm
.
validateFields
().
then
(
values
=>
{
console
.
log
(
values
,
'menu values'
)
let
pararms
=
{...
values
}
delete
pararms
.
attributeName
if
(
JSON
.
stringify
(
pararms
.
attributeValue
)
===
'{}'
)
...
...
@@ -82,7 +81,8 @@ const AddPropertyValue: React.FC<{}> = () => {
//@ts-ignore
PublicApi
.
postProductCustomerSaveOrUpdateCustomerAttributeValue
(
pararms
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
history
.
goBack
()
// history.goBack()
history
.
push
(
`/memberCenter/commodityAbility/classAndProperty/propertyValue?before=
${
history
.
location
.
query
.
attrId
}
`
)
})
}).
catch
(
error
=>
{
...
...
src/pages/classAndProperty/propertyValue/index.tsx
View file @
f0554366
import
React
,
{
useState
,
useRef
,
ReactNode
,
useEffect
}
from
'react'
import
React
,
{
useState
,
useRef
,
ReactNode
,
useEffect
,
useMemo
}
from
'react'
import
{
Row
,
Col
,
message
,
Popconfirm
,
Button
,
Card
}
from
'antd'
;
import
{
DeleteOutlined
,
...
...
@@ -16,10 +16,11 @@ import { ColumnType } from 'antd/lib/table/interface';
import
{
PublicApi
}
from
'@/services/api'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
useTreeTabs
}
from
'@/hooks/useTreeTabs'
;
import
TabTree
from
'@/components/TabTree'
;
import
TabTree
,
{
createTreeActions
}
from
'@/components/TabTree'
;
import
{
GetProductCustomerGetCustomerAttributeResponse
}
from
'@/services'
;
const
formActions
=
createFormActions
()
const
treeActions
=
createTreeActions
()
const
fetchAttributeTreeData
=
async
(
params
?)
=>
{
const
res
=
await
PublicApi
.
getProductCustomerGetCustomerAttributeTree
({
filterInput
:
true
})
...
...
@@ -35,7 +36,7 @@ const PropertyValue: React.FC<{}> = () => {
treeStatus
,
setTreeStatus
,
treeData
,
setIsEditForm
,
//是否编辑状态
setIsEditForm
,
//
是否编辑状态
nodeRecord
,
setNodeRecord
,
handleSelect
,
...
...
@@ -43,12 +44,25 @@ const PropertyValue: React.FC<{}> = () => {
setTreeMaps
,
resetMenu
}
=
useTreeTabs
({
treeActions
,
fetchMenuData
:
fetchAttributeTreeData
,
})
useEffect
(()
=>
{
let
prefix
=
sessionStorage
.
getItem
(
'beforeKeyPrefix'
)
let
beforeKey
=
history
.
location
.
query
.
before
console
.
log
(
prefix
,
beforeKey
)
if
(
beforeKey
){
setSelectKey
(
beforeKey
)
treeActions
.
setExpandedKeys
([
`
${
prefix
}
_
${
beforeKey
}
`
])
// 拼接不正常的key
console
.
log
(
`
${
prefix
}
_
${
beforeKey
}
`
)
}
},
[])
useEffect
(()
=>
{
if
(
selectKey
)
if
(
selectKey
)
{
ref
.
current
.
reload
({
current
:
1
,
pageSize
:
10
,
name
:
''
,
customerAttributeId
:
selectKey
})
}
},
[
selectKey
])
const
onHandleSelect
=
(
key
,
node
)
=>
{
...
...
@@ -57,13 +71,14 @@ const PropertyValue: React.FC<{}> = () => {
}
if
(
key
){
let
arr
=
key
.
split
(
'_'
);
sessionStorage
.
setItem
(
'beforeKeyPrefix'
,
arr
[
0
])
console
.
log
(
arr
[
0
],
'prefix'
)
setSelectKey
(
arr
[
arr
.
length
-
1
])
setSelectNode
(
node
)
}
}
const
fetchData
=
(
params
:
any
)
=>
{
console
.
log
(
params
,
'params'
)
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getProductCustomerGetCustomerAttributeValueList
({
...
params
,
...
...
@@ -153,7 +168,7 @@ const PropertyValue: React.FC<{}> = () => {
const
confirm
=
(
record
:
any
)
=>
{
PublicApi
.
postProductCustomerUpdateCustomerAttributeValueStatus
({
id
:
record
.
id
,
isEnable
:
!
record
.
isEnable
}).
then
(
res
=>
{
ref
.
current
.
reload
()
ref
.
current
.
reload
()
})
}
...
...
@@ -177,6 +192,7 @@ const PropertyValue: React.FC<{}> = () => {
?
<
TabTree
fetchData
=
{
params
=
>
fetchAttributeTreeData(params)}
treeData=
{
treeData
}
actions=
{
treeActions
}
handleSelect=
{
(
key
,
node
)
=>
onHandleSelect
(
key
,
node
)
}
customKey="id"
/
>
...
...
src/pages/commodity/goods/index.tsx
View file @
f0554366
...
...
@@ -10,6 +10,7 @@ import {
DeleteOutlined
,
CaretUpOutlined
,
CaretDownOutlined
,
ExclamationCircleOutlined
,
}
from
'@ant-design/icons'
import
{
StandardTable
}
from
'god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
...
...
@@ -25,7 +26,7 @@ import { goodsSchema } from './schema'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
const
{
Option
}
=
Select
;
const
{
confirm
}
=
Modal
// 定义选择的行数据的类型
interface
Item
{
key
:
string
;
...
...
@@ -294,9 +295,19 @@ const Goods: React.FC<{}> = () => {
const
handleMenuClick
=
(
e
:
any
)
=>
{
// console.log('menu', e, selectedRowKeys); // 1 批量删除;2 删除导入批次
if
(
e
.
key
===
'1'
)
{
PublicApi
.
postProductGoodsDeleteBatchGoods
({
idList
:
goodsRowCtl
.
selectedRowKeys
}).
then
(
res
=>
{
//@ts-ignore
ref
.
current
.
reload
()
confirm
({
title
:
'确定要执行批量删除操作?'
,
icon
:
<
ExclamationCircleOutlined
/>,
onOk
()
{
PublicApi
.
postProductGoodsDeleteBatchGoods
({
idList
:
goodsRowCtl
.
selectedRowKeys
}).
then
(
res
=>
{
ref
.
current
.
reload
()
})
},
onCancel
()
{
console
.
log
(
'Cancel'
);
},
okText
:
'确定'
,
cancelText
:
'取消'
})
}
else
if
(
e
.
key
===
'2'
)
{
console
.
log
(
'删除导入批次'
)
...
...
src/pages/commodity/products/index.tsx
View file @
f0554366
...
...
@@ -78,7 +78,7 @@ const Products: React.FC<{}> = () => {
const
[
brandValue
,
setBrandValue
]
=
useState
(
undefined
)
const
[
classData
,
setClassData
]
=
useState
<
any
>
([])
const
[
classValue
,
setClassValue
]
=
useState
(
undefined
)
const
[
shopId
,
setShopId
]
=
useState
<
number
>
()
const
[
shopId
,
setShopId
]
=
useState
<
any
>
()
const
columns
:
ColumnType
<
any
>
[]
=
[
{
...
...
@@ -442,8 +442,8 @@ const Products: React.FC<{}> = () => {
const
onChangeUpShop
=
(
values
)
=>
{
// 判断上架之前是否有店铺 有即可以上下架
PublicApi
.
getTemplateShopFindShop
().
then
(
res
=>
{
if
(
res
.
data
.
shopI
d
){
setShopId
(
res
.
data
.
shopI
d
)
if
(
res
.
data
.
i
d
){
setShopId
(
res
.
data
.
i
d
)
setCheckedValues
(
values
)
}
else
{
message
.
error
(
'您还没有开通店铺,无法上下架商品!'
)
...
...
src/pages/commodity/products/viewProducts.tsx
View file @
f0554366
...
...
@@ -180,11 +180,11 @@ const viewProducts: React.FC<{}> = () => {
component
=
(<><
span
className=
"commonStatusValid"
></
span
>
审核通过
</>)
else
if
(
status
===
3
)
component
=
(<><
span
className=
"commonStatusInvalid"
></
span
>
审核不通过
</>)
}
if
(
status
===
5
)
component
=
(<
span
style=
{
{
color
:
'#00B37A'
,
padding
:
'2px 5px'
,
background
:
'rgba(235,247,242,1)'
,
borderRadius
:
'4px'
}
}
>
已上架
</
span
>)
else
if
(
status
===
6
)
component
=
(<
span
style=
{
{
padding
:
'2px 5px'
,
background
:
'rgba(244,245,247,1)'
,
borderRadius
:
'4px'
}
}
>
已下架
</
span
>)
}
else
if
(
status
===
5
)
component
=
(<
span
style=
{
{
color
:
'#00B37A'
,
padding
:
'2px 5px'
,
background
:
'rgba(235,247,242,1)'
,
borderRadius
:
'4px'
}
}
>
已上架
</
span
>)
else
if
(
status
===
6
)
component
=
(<
span
style=
{
{
padding
:
'2px 5px'
,
background
:
'rgba(244,245,247,1)'
,
borderRadius
:
'4px'
}
}
>
已下架
</
span
>)
return
component
}
...
...
src/pages/trademark/addBrand.tsx
View file @
f0554366
...
...
@@ -9,12 +9,14 @@ import {
LoadingOutlined
,
ArrowLeftOutlined
,
LikeFilled
,
RestTwoTone
RestTwoTone
,
DeleteOutlined
}
from
'@ant-design/icons'
import
{
UploadFile
,
UploadChangeParam
}
from
'antd/lib/upload/interface'
;
import
ReutrnEle
from
'@/components/ReturnEle'
import
{
PublicApi
}
from
'@/services/api'
import
{
UPLOAD_TYPE
}
from
'@/constants'
import
styles
from
'./index.less'
const
{
Step
}
=
Steps
;
...
...
@@ -197,6 +199,7 @@ const AddBrand: React.FC<{}> = () => {
{
...
layout
}
initialValues=
{
formValues
}
autoComplete=
"off"
className=
"addForm"
>
<
Space
direction=
"vertical"
style=
{
{
width
:
'100%'
}
}
>
<
Card
headStyle=
{
{
borderBottom
:
'none'
}
}
title=
"基本信息"
>
...
...
@@ -239,6 +242,7 @@ const AddBrand: React.FC<{}> = () => {
message
:
'上传图片!'
,
},
]
}
className=
{
styles
.
uploadForm
}
>
<
Upload
disabled=
{
banSomeField
}
...
...
@@ -252,6 +256,9 @@ const AddBrand: React.FC<{}> = () => {
data=
{
{
fileType
:
UPLOAD_TYPE
}
}
>
{
logoUrl
?
<
img
src=
{
logoUrl
}
alt=
"avatar"
style=
{
{
width
:
'100%'
}
}
/>
:
uploadLogoButton
}
<
div
className=
{
styles
.
hoverDelete
}
>
<
Button
type=
"text"
icon=
{
<
DeleteOutlined
/>
}
/>
</
div
>
</
Upload
>
</
Form
.
Item
>
</
Card
>
...
...
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