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
linweijiong
jinfa-platform
Commits
5bfb3f58
Commit
5bfb3f58
authored
Mar 15, 2022
by
wzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 去除多余代码-productModal
parent
b8ca0b00
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
54 deletions
+44
-54
productModal.tsx
src/pages/commodity/products/productModal.tsx
+44
-54
No files found.
src/pages/commodity/products/productModal.tsx
View file @
5bfb3f58
import
NiceForm
from
'@/components/NiceForm'
;
import
StandardTable
from
'@/components/StandardTable'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
//
import {
//
getProductCommodityGetSubCommodityListS2B,
//
getProductCommodityGetUpperCommodityListS2B,
//
GetProductCommodityGetUpperCommodityListS2BRequest,
//
postProductCommodityChoiceSubCommodity,
//
postProductCommodityChoiceUpperCommodity,
//
} from '@/services/ProductV2Api';
import
{
getProductCommodityGetSubCommodityListS2B
,
getProductCommodityGetUpperCommodityListS2B
,
GetProductCommodityGetUpperCommodityListS2BRequest
,
postProductCommodityChoiceSubCommodity
,
postProductCommodityChoiceUpperCommodity
,
}
from
'@/services/ProductV2Api'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
Button
,
Modal
,
Table
}
from
'antd'
;
import
{
useEffect
,
useRef
,
useState
}
from
'react'
;
...
...
@@ -215,21 +215,21 @@ export const ProductView = props => {
// };
useEffect
(()
=>
{
if
(
productId
)
{
//
const params: GetProductCommodityGetUpperCommodityListS2BRequest = {
//
current: '1',
//
pageSize: '50',
//
productId,
//
name: '',
//
priceType: '',
//
customerCategoryName: '',
//
memberName: '',
//
brandName: ''
//
};
//
getProductCommodityGetUpperCommodityListS2B(params).then(res => {
//
if (res.code === 1000) {
//
setDataSource(res.data.data);
//
}
//
});
const
params
:
GetProductCommodityGetUpperCommodityListS2BRequest
=
{
current
:
'1'
,
pageSize
:
'50'
,
productId
,
name
:
''
,
priceType
:
''
,
customerCategoryName
:
''
,
memberName
:
''
,
brandName
:
''
};
getProductCommodityGetUpperCommodityListS2B
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setDataSource
(
res
.
data
.
data
);
}
});
}
},
[
productId
]);
return
(
...
...
@@ -253,7 +253,7 @@ export const ProductView = props => {
}}
fetchTableData={(params: any) => fetchData(params)}
/> */
}
<
Table
dataSource=
{
dataSource
}
columns=
{
columns
}
rowKey=
"id"
/>
<
Table
dataSource=
{
dataSource
}
columns=
{
columns
}
rowKey=
"id"
/>
</
Modal
>
);
};
...
...
@@ -363,8 +363,7 @@ export const ProductSel = props => {
return
arr
;
};
const
formActions
=
createFormActions
();
// const fetchData = (item: GetProductCommodityGetUpperCommodityListS2BRequest) => {
const
fetchData
=
(
item
:
any
)
=>
{
const
fetchData
=
(
item
:
GetProductCommodityGetUpperCommodityListS2BRequest
)
=>
{
const
params
=
{
current
:
'1'
,
pageSize
:
'10'
,
...
...
@@ -376,37 +375,28 @@ export const ProductSel = props => {
// productId: '',
...
item
,
};
// const fn =
// titleKey === 'upperMemberName'
// ? getProductCommodityGetUpperCommodityListS2B
// : getProductCommodityGetSubCommodityListS2B;
// return new Promise(resolve => {
// fn(params).then(res => {
// resolve({
// totalCount: res.data.totalCount,
// data: res.data.data,
// });
// });
// });
return
new
Promise
(
resolve
=>
{
resolve
({
totalCount
:
0
,
data
:[]
})
})
const
fn
=
titleKey
===
'upperMemberName'
?
getProductCommodityGetUpperCommodityListS2B
:
getProductCommodityGetSubCommodityListS2B
;
return
new
Promise
(
resolve
=>
{
fn
(
params
).
then
(
res
=>
{
resolve
(
res
.
data
);
});
});
};
const
handleOk
=
()
=>
{
//
setLoading(true)
//
const fn =
//
titleKey === 'upperMemberName'
//
? postProductCommodityChoiceSubCommodity
//
: postProductCommodityChoiceUpperCommodity;
//
fn({ idList: RowCtl.selectedRowKeys }).then(res => {
//
if (res.code === 1000) {
//
setVisible(false);
//
}
//
setLoading(false)
//
});
setLoading
(
true
)
const
fn
=
titleKey
===
'upperMemberName'
?
postProductCommodityChoiceSubCommodity
:
postProductCommodityChoiceUpperCommodity
;
fn
({
idList
:
RowCtl
.
selectedRowKeys
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setVisible
(
false
);
}
setLoading
(
false
)
});
};
return
(
<
Modal
...
...
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