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
9e49add3
Commit
9e49add3
authored
Mar 10, 2022
by
wzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 弹窗修整
parent
7ff0590c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
78 deletions
+63
-78
api.config.js
api.config.js
+1
-1
index.tsx
src/pages/commodity/products/index.tsx
+2
-2
productModal.tsx
src/pages/commodity/products/productModal.tsx
+60
-75
No files found.
api.config.js
View file @
9e49add3
module
.
exports
=
[
{
name
:
'LogisticsV2'
,
token
:
'732fb8e33970ff5dee830423a630e8e85c3ef3293abba7581b16749dfce8608b'
,
categoryIds
:
[
0
],
},
// 物流能力v2
{
name
:
'ProductV2'
,
token
:
'
df37f2a0e3829c4288708ae211920bdbdee55e5e2f48b1e8cf7d1925ac618d9a
'
,
categoryIds
:
[
0
],
},
// 商品服务V2
{
name
:
'ProductV2'
,
token
:
'
fc83f33ea247145db5825729df1c0740f2cbb527ac763ed890629ad5896dba0d
'
,
categoryIds
:
[
0
],
},
// 商品服务V2
{
name
:
'TemplateV2'
,
token
:
'7bb5578bc50e4e7935cbc146a2192e978053d5380cc96fcfdc0a754cfe885ec5'
,
categoryIds
:
[
0
],
},
// 页面模板服务V2
{
name
:
'PayV2'
,
token
:
'4b5f2f2d42f0774b61074d69d5d756c725ba067d9dafe2c3785f592ae85d1696'
,
categoryIds
:
[
0
],
},
// 支付服务
{
name
:
'SearchV2'
,
token
:
'f3e6ec26764f54d06ba33f487ff42d7debeaef397e51dc395040447737eb2e66'
,
categoryIds
:
[
0
],
},
// 搜索服务V2
...
...
src/pages/commodity/products/index.tsx
View file @
9e49add3
...
...
@@ -935,8 +935,8 @@ const Products: React.FC<{}> = () => {
<
p
>
{
intl
.
formatMessage
({
id
:
'commodity.products.textfour'
})
}
</
p
>
</
Modal
>
<
ProductView
visible=
{
upModal
}
setVisible=
{
setUpModal
}
productId=
{
uppId
}
/>
<
ProductSel
visible=
{
upSelModal
}
setVisible=
{
setUpSelModal
}
title=
"upperMemberName"
/>
<
ProductSel
visible=
{
downSelModal
}
setVisible=
{
setDownSelModal
}
title=
"subMemberName"
/>
<
ProductSel
visible=
{
upSelModal
}
setVisible=
{
setUpSelModal
}
title
Key
=
"upperMemberName"
/>
<
ProductSel
visible=
{
downSelModal
}
setVisible=
{
setDownSelModal
}
title
Key
=
"subMemberName"
/>
{
/* 选择上游商品 */
}
<
UpperProductModalTable
currentRef=
{
upperRef
}
type=
"checkbox"
tableRef=
{
ref
}
/>
{
/* 商品上架引导 */
}
...
...
src/pages/commodity/products/productModal.tsx
View file @
9e49add3
...
...
@@ -4,12 +4,12 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
import
useSetSearchValueInTable
from
'@/hooks/useSetSearchValueInTable'
;
//
import {
//
getProductCommodityGetSubCommodityListS2B,
//
getProductCommodityGetUpperCommodityListS2B,
//
postProductCommodityChoiceSubCommodity,
//
postProductCommodityChoiceUpperCommodity,
//
} from '@/services/ProductV2Api';
import
{
getProductCommodityGetSubCommodityListS2B
,
getProductCommodityGetUpperCommodityListS2B
,
postProductCommodityChoiceSubCommodity
,
postProductCommodityChoiceUpperCommodity
,
}
from
'@/services/ProductV2Api'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
Button
,
Modal
,
Table
}
from
'antd'
;
...
...
@@ -75,38 +75,22 @@ export const newSchema = (key: string) => ({
id
:
'commodity.products.schema.productSchema.priceTypeList.placeholder'
,
}),
style
:
{
width
:
'174px'
},
},
},
brandName
:
{
type
:
'string'
,
'x-component'
:
'CustomInputSearch'
,
'x-component-props'
:
{
placeholder
:
getIntl
().
formatMessage
({
id
:
'commodity.products.schema.productSchema.brandId'
,
}),
showSearch
:
true
,
showArrow
:
true
,
defaultActiveFirstOption
:
false
,
filterOption
:
false
,
notFoundContent
:
null
,
style
:
{
width
:
'174px'
},
searchValue
:
null
,
dataoption
:
[],
},
},
customerCategoryName
:
{
type
:
'string'
,
'x-component'
:
'CustomCategorySearch'
,
'x-component-props'
:
{
placeholder
:
getIntl
().
formatMessage
({
id
:
'commodity.products.schema.productSchema.customerCategoryId'
,
}),
showSearch
:
true
,
notFoundContent
:
null
,
style
:
{
width
:
'174px'
},
dataoption
:
[],
fieldNames
:
{
label
:
'title'
,
value
:
'id'
,
children
:
'children'
},
},
},
memberName
:
{
...
...
@@ -211,7 +195,7 @@ export const ProductView = props => {
dataIndex
:
'min'
,
key
:
'min'
,
render
:
(
text
,
record
)
=>
{
return
`
¥
${
text
}
~¥
${
record
.
max
}
`
;
return
`
${
getIntl
().
formatMessage
({
id
:
'commodity.products.directChannel.columns.currency'
})}${
text
}
~
${
getIntl
().
formatMessage
({
id
:
'commodity.products.directChannel.columns.currency'
})}
${
record
.
max
}
`
;
},
},
];
...
...
@@ -234,16 +218,16 @@ export const ProductView = props => {
// };
useEffect
(()
=>
{
if
(
productId
)
{
//
const params = {
//
current: '1',
//
pageSize: '50',
//
productId,
//
};
//
getProductCommodityGetUpperCommodityListS2B(params).then(res => {
//
if (res.code === 1000) {
//
setDataSource(res.data.data);
//
}
//
});
const
params
=
{
current
:
'1'
,
pageSize
:
'50'
,
productId
,
};
getProductCommodityGetUpperCommodityListS2B
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setDataSource
(
res
.
data
.
data
);
}
});
}
},
[
productId
]);
return
(
...
...
@@ -274,13 +258,13 @@ export const ProductView = props => {
export
const
ProductSel
=
props
=>
{
// 选择商品
const
{
visible
,
setVisible
,
key
,
productId
}
=
props
;
const
{
visible
,
setVisible
,
titleKey
}
=
props
;
/** 带参数查询,给表单带默认值 */
// const { clear } = useSetSearchValueInTable();
const
ref
=
useRef
<
any
>
({});
const
[
rowSelection
,
RowCtl
]
=
useRowSelectionTable
({
customKey
:
'id'
});
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
const
columns
=
(
k
ey
:
string
)
=>
{
const
columns
=
(
tK
ey
:
string
)
=>
{
const
arr
=
[
{
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.shangpinID'
}),
...
...
@@ -336,7 +320,7 @@ export const ProductSel = props => {
},
{
title
:
`
${
k
ey
===
'upperMemberName'
tK
ey
===
'upperMemberName'
?
getIntl
().
formatMessage
({
id
:
'commodity.products.shangyougongyinghuiyuan'
,
})
...
...
@@ -344,24 +328,34 @@ export const ProductSel = props => {
id
:
'commodity.products.xiayouxiaoshouhuiyuan'
,
})
}
`
,
dataIndex
:
k
ey
,
key
:
k
ey
,
dataIndex
:
tK
ey
,
key
:
tK
ey
,
},
{
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.danjia'
}),
dataIndex
:
'min'
,
key
:
'min'
,
render
:
(
text
,
record
)
=>
{
return
`
¥
${
text
}
~¥
${
record
.
max
}
`
;
return
`
${
getIntl
().
formatMessage
({
id
:
'commodity.products.directChannel.columns.currency'
})}${
text
}
~
${
getIntl
().
formatMessage
({
id
:
'commodity.products.directChannel.columns.currency'
})}
${
record
.
max
}
`
;
},
},
{
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.zhuangtai'
}),
dataIndex
:
'status'
,
key
:
'status'
,
render
:
text
=>
{
switch
(
text
)
{
case
1
:
return
getIntl
().
formatMessage
({
id
:
'commodity.checkProduct.status.1'
})
case
2
:
return
getIntl
().
formatMessage
({
id
:
'commodity.checkProduct.status.2'
})
case
3
:
return
getIntl
().
formatMessage
({
id
:
'commodity.checkProduct.status.3'
})
case
4
:
return
getIntl
().
formatMessage
({
id
:
'commodity.checkProduct.status.4'
})
case
5
:
return
getIntl
().
formatMessage
({
id
:
'commodity.checkProduct.status.5'
})
case
6
:
return
getIntl
().
formatMessage
({
id
:
'commodity.checkProduct.status.6'
})
}
}
},
];
if
(
k
ey
===
'subMemberName'
)
{
if
(
tK
ey
===
'subMemberName'
)
{
arr
.
splice
(
7
,
1
);
}
return
arr
;
...
...
@@ -371,53 +365,44 @@ export const ProductSel = props => {
const
params
=
{
current
:
'1'
,
pageSize
:
'10'
,
productId
,
// name: '',
// priceType: '',
// customerCategoryName: '',
// memberName: '',
// brandName: '',
// productId: '',
...
item
,
};
// const fn =
// key === 'upperMemberName'
// ? getProductCommodityGetUpperCommodityListS2B
// : getProductCommodityGetSubCommodityListS2B;
// return new Promise(resolve => {
// fn(params).then(res => {
// resolve({
// totalCount: res.data.totalCount,
// data: res.data.data,
// });
// });
// });
return
Promise
.
resolve
({
totalCount
:
1
,
data
:
[
{
id
:
1
,
name
:
'234'
,
},
],
const
fn
=
titleKey
===
'upperMemberName'
?
getProductCommodityGetUpperCommodityListS2B
:
getProductCommodityGetSubCommodityListS2B
;
return
new
Promise
(
resolve
=>
{
fn
(
params
).
then
(
res
=>
{
resolve
({
totalCount
:
res
.
data
.
totalCount
,
data
:
res
.
data
.
data
,
});
});
});
};
const
handleOk
=
()
=>
{
//
setLoading(true)
//
const fn =
// k
ey === 'upperMemberName'
//
? postProductCommodityChoiceSubCommodity
//
: postProductCommodityChoiceUpperCommodity;
//
fn({ idList: RowCtl.selectedRowKeys }).then(res => {
//
if (res.code === 1000) {
//
setVisible(false);
//
}
//
setLoading(false)
//
});
setLoading
(
true
)
const
fn
=
titleK
ey
===
'upperMemberName'
?
postProductCommodityChoiceSubCommodity
:
postProductCommodityChoiceUpperCommodity
;
fn
({
idList
:
RowCtl
.
selectedRowKeys
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setVisible
(
false
);
}
setLoading
(
false
)
});
};
return
(
<
Modal
title=
{
k
ey
===
'upperMemberName'
titleK
ey
===
'upperMemberName'
?
getIntl
().
formatMessage
({
id
:
'commodity.products.xuanzeshangyougongyingshangpin'
,
})
...
...
@@ -432,7 +417,7 @@ export const ProductSel = props => {
confirmLoading=
{
loading
}
>
<
StandardTable
columns=
{
columns
(
k
ey
)
}
columns=
{
columns
(
titleK
ey
)
}
currentRef=
{
ref
}
rowSelection=
{
rowSelection
}
tableProps=
{
{
...
...
@@ -443,7 +428,7 @@ export const ProductSel = props => {
<
NiceForm
actions=
{
formActions
}
onSubmit=
{
values
=>
ref
.
current
.
reload
(
values
)
}
schema=
{
newSchema
(
k
ey
)
}
schema=
{
newSchema
(
titleK
ey
)
}
/>
}
/>
...
...
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