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
45228df7
Commit
45228df7
authored
Oct 22, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改品类导航页bug
parent
2c2e20cb
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
37 additions
and
20 deletions
+37
-20
useFilterSameOption.tsx
...e/categoryNavigation/common/hooks/useFilterSameOption.tsx
+2
-0
useGetLayout.tsx
...Template/categoryNavigation/common/hooks/useGetLayout.tsx
+0
-1
schema.ts
...e/categoryNavigation/components/CommodityDrawer/schema.ts
+1
-0
editPanel.tsx
...ate/categoryNavigation/components/EditPanel/editPanel.tsx
+10
-8
schema.tsx
...mplate/categoryNavigation/components/EditPanel/schema.tsx
+10
-2
effect.ts
.../categoryNavigation/components/FormilyCommodity/effect.ts
+2
-1
index.tsx
.../categoryNavigation/components/FormilyCommodity/index.tsx
+2
-3
index.tsx
src/pages/mobileTemplate/categoryNavigation/index.tsx
+4
-4
product.tsx
...t/activePage/fixtures/components/ProductPanel/product.tsx
+6
-1
No files found.
src/pages/mobileTemplate/categoryNavigation/common/hooks/useFilterSameOption.tsx
View file @
45228df7
...
...
@@ -37,6 +37,7 @@ export function useFilterSameOption() {
return
{};
}
const
result
=
{};
result
[
'tab'
]
=
[]
tabChildren
.
forEach
((
_nodeKey
)
=>
{
if
(
!
pageConfig
[
_nodeKey
])
{
return
;
...
...
@@ -47,6 +48,7 @@ export function useFilterSameOption() {
if
(
typeof
result
[
`
${
parentType
}
_
${
id
}
`
]
===
'undefined'
)
{
result
[
`
${
parentType
}
_
${
id
}
`
]
=
[];
}
result
[
'tab'
].
push
(
id
);
result
[
`
${
parentType
}
_
${
id
}
`
].
push
(
id
);
const
tabItemChild
=
pageConfig
[
_nodeKey
].
childNodes
;
...
...
src/pages/mobileTemplate/categoryNavigation/common/hooks/useGetLayout.tsx
View file @
45228df7
...
...
@@ -9,7 +9,6 @@ function useGetLayout() {
const
[
info
,
setInfo
]
=
useState
<
any
>
(
null
);
/** isSelf 判断自有商城 */
const
{
id
,
isSelf
}
=
usePageStatus
();
console
.
log
(
isSelf
);
const
[
dataSourceFromRequest
,
setDataSourceFromRequest
]
=
useState
<
any
>
(
null
);
useEffect
(()
=>
{
...
...
src/pages/mobileTemplate/categoryNavigation/components/CommodityDrawer/schema.ts
View file @
45228df7
...
...
@@ -53,6 +53,7 @@ const CommoditySchema: ISchema = {
style
:
{
width
:
'174px'
},
searchValue
:
null
,
dataoption
:
[],
allowClear
:
true
,
},
},
categoryId
:
{
...
...
src/pages/mobileTemplate/categoryNavigation/components/EditPanel/editPanel.tsx
View file @
45228df7
import
React
,
{
useContext
,
useEffect
,
useMemo
,
useState
}
from
'react'
;
import
{
changeProps
,
clearSelectedStatus
,
PageConfigType
,
SelectedInfoType
,
StateType
,
STATE_PROPS
,
}
from
'@lingxi-disign/
core
'
;
import
{
changeProps
,
clearSelectedStatus
,
PageConfigType
,
SelectedInfoType
,
StateType
,
STATE_PROPS
,
}
from
'@lingxi-disign/
react
'
;
import
{
useSelector
}
from
'@lingxi-disign/react'
;
import
cs
from
'classnames'
;
import
{
usePrevious
,
useToggle
}
from
'@umijs/hooks'
;
...
...
@@ -61,11 +61,12 @@ const EditPanel = () => {
* 当每次点击selectInfo 时,都把selectInfo.props 映射到formily 的value 上
* 但当一级类型没有被选择的时候,那么必须选择一级导航类型
*/
console
.
log
()
useEffect
(()
=>
{
if
(
activeKey
===
null
&&
previousActiveKey
!==
activeKey
)
{
if
(
activeKey
===
null
)
{
if
(
activeKey
===
null
&&
selectedInfo
!==
null
)
{
//
if(activeKey === null) {
message
.
info
(
"请先选择一级导航类型"
);
}
//
}
const
primaryTabProps
=
pageConfig
[
domKey
!
].
props
;
setFormValue
({
primary
:
primaryTabProps
?.
id
,
...
...
@@ -224,10 +225,11 @@ const EditPanel = () => {
if
(
componentType
.
includes
(
'suggestProduct'
)
&&
type
===
0
)
{
setType
(
values
.
type
);
}
console
.
log
(
values
);
changeProps
({
treeKey
:
key
,
props
:
currentProps
,
title
:
values
?.
title
||
values
?.
name
||
values
?.
rankProduct
?.
name
||
values
.
productName
||
values
?.
brand
?.
name
||
values
?.
blockTitl
e
,
title
:
values
?.
title
||
values
?.
name
||
values
?.
rankProduct
?.
name
||
values
?.
brand
?.
name
||
values
?.
blockTitle
||
values
?.
product
?.
productNam
e
,
});
setVisible
(
false
);
handleOnClose
();
...
...
@@ -259,10 +261,10 @@ const EditPanel = () => {
*/
useEffect
(()
=>
{
const
sameKeyStateKeys
=
Object
.
keys
(
sameKeyState
);
if
(
!
activeKey
||
sameKeyStateKeys
.
length
===
0
)
{
if
(
sameKeyStateKeys
.
length
===
0
)
{
return
;
}
const
hasSelectedTabKeys
=
Object
.
keys
(
sameKeyState
).
filter
((
_item
)
=>
/tabItem_
\d
+$/
.
test
(
_item
))
;
const
hasSelectedTabKeys
=
sameKeyState
[
'tab'
]
;
formActions
.
setFieldState
(
'layout.primary'
,
(
state
)
=>
{
const
tempData
=
state
.
originAsyncData
||
[];
FormPath
.
setIn
(
state
,
'props.enum'
,
tempData
.
map
((
_item
)
=>
{
...
...
@@ -270,7 +272,7 @@ const EditPanel = () => {
// ..._item,
label
:
_item
.
name
,
value
:
_item
.
id
,
disabled
:
hasSelectedTabKeys
.
includes
(
`tabItem_
${
_item
.
id
}
`
),
disabled
:
hasSelectedTabKeys
.
includes
(
_item
.
id
),
};
}));
});
...
...
src/pages/mobileTemplate/categoryNavigation/components/EditPanel/schema.tsx
View file @
45228df7
...
...
@@ -99,7 +99,11 @@ export const blockSchema: ISchema = {
{
required
:
true
,
message
:
'请填写标题'
}
},
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
32
,
},
]
},
}
...
...
@@ -158,7 +162,11 @@ export const saleRankSchema: ISchema = {
{
required
:
true
,
message
:
'请填写销量'
,
}
},
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
16
,
},
]
}
...
...
src/pages/mobileTemplate/categoryNavigation/components/FormilyCommodity/effect.ts
View file @
45228df7
...
...
@@ -15,9 +15,10 @@ export const searchBrandOptionEffect = (
name
:
state
.
props
[
'x-component-props'
].
searchValue
,
...
serachParams
,
}).
then
(
res
=>
{
console
.
log
(
"123io1u23io1u23iou12 3o"
,
res
);
context
.
setFieldState
(
fieldName
,
state
=>
{
state
.
props
[
'x-component-props'
].
dataoption
=
res
.
data
?.
data
?.
map
(
item
=>
{
return
{
label
:
item
.
name
,
value
:
item
.
id
};
return
{
name
:
item
.
name
,
id
:
item
.
id
};
})
||
[];
});
});
...
...
src/pages/mobileTemplate/categoryNavigation/components/FormilyCommodity/index.tsx
View file @
45228df7
...
...
@@ -48,7 +48,6 @@ const FormilyCommodity: React.FC<Iprops> & { isFieldComponent: boolean } = (prop
const
sameKeyState
=
useFilterSameOption
();
const
componentProps
=
props
.
props
?.[
'x-component-props'
]
||
{}
as
ComponentTypeProps
;
const
disabledSaleRankingKeys
=
useMemo
(()
=>
sameKeyState
[
`tabItem_
${
activeKey
}
_
${
componentProps
.
commodityKey
}
`
],
[
sameKeyState
,
activeKey
]);
console
.
log
(
sameKeyState
,
disabledSaleRankingKeys
);
const
{
state
:
productVisible
,
toggle
:
setProductVisible
}
=
useToggle
();
const
productProps
=
useMemo
(()
=>
({
...
...
@@ -77,11 +76,11 @@ const FormilyCommodity: React.FC<Iprops> & { isFieldComponent: boolean } = (prop
const
formatSearchParams
=
(
params
)
=>
{
const
idInList
=
typeof
params
.
id
!==
'undefined'
&&
params
.
id
?
{
idInList
:
[
params
.
id
]
}
:
{}
const
{
id
,
...
rest
}
=
params
;
const
{
id
,
categoryId
,
...
rest
}
=
params
;
const
idNotInList
=
Array
.
from
(
new
Set
([
productProps
?.
id
].
concat
(
disabledSaleRankingKeys
).
filter
(
Boolean
)));
const
common
=
{
shopId
:
fixtureContext
?.
shopId
.
toString
(),
customerCategoryId
:
activeKey
,
customerCategoryId
:
categoryId
||
activeKey
,
memberId
:
userAuth
.
memberId
,
memberRoleId
:
userAuth
.
memberRoleId
,
idNotInList
:
idNotInList
,
...
...
src/pages/mobileTemplate/categoryNavigation/index.tsx
View file @
45228df7
...
...
@@ -110,10 +110,10 @@ const CategoryNavigation = () => {
...
rest
,
children
:
childNodes
.
map
((
_son
)
=>
{
const
sonData
=
pageConfig
[
_son
];
return
keyFunc
[
type
]?.(
sonData
.
props
);
})
if
(
sonData
&&
sonData
.
props
)
{
return
keyFunc
[
type
]?.(
sonData
.
props
);
}
})
.
filter
(
Boolean
)
};
});
tabProps
[
'children'
]
=
tabItemData
;
...
...
src/pages/transaction/marketingAbility/marketingActivitiesManagement/activePage/fixtures/components/ProductPanel/product.tsx
View file @
45228df7
import
React
,
{
useEffect
,
useRef
,
useState
}
from
'react'
;
import
StatusTag
from
'@/components/StatusTag'
;
import
{
CloseOutlined
,
PlusOutlined
,
DeleteOutlined
,
EditOutlined
}
from
'@ant-design/icons'
;
import
{
Input
,
Tag
,
Space
}
from
'antd'
;
import
{
Input
,
Tag
,
Space
,
message
}
from
'antd'
;
// eslint-disable-next-line @typescript-eslint/camelcase
import
{
unstable_batchedUpdates
}
from
'react-dom'
;
import
{
priceFormat
}
from
'@/utils/numberFomat'
;
...
...
@@ -54,6 +54,11 @@ const Product: React.FC<Iprops> = (props: Iprops) => {
},
[
isWithLabels
,
label
]);
const
handleInputChange
=
(
e
)
=>
{
const
inputLabel
=
e
.
target
.
value
.
replace
(
/
[\u
4E00-
\u
9FA5
]
/g
,
"AA"
);
if
(
inputLabel
.
length
>
32
)
{
message
.
error
(
"输入字符长度不能大于32个字符或16个汉字"
);
return
}
setInputValue
(
e
.
target
.
value
);
};
...
...
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