Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
ed18b033
Commit
ed18b033
authored
Aug 29, 2023
by
guang.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改展示列表
parent
4eda831e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
47 deletions
+64
-47
BrandInfo.jsx
src/pages/BrandManage/components/BrandInfo.jsx
+40
-26
index.jsx
src/pages/BrandManage/index.jsx
+8
-12
services.js
src/pages/BrandManage/services.js
+1
-1
staticData.js
src/pages/BrandManage/staticData.js
+15
-8
No files found.
src/pages/BrandManage/components/BrandInfo.jsx
View file @
ed18b033
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
BetaSchemaForm
}
from
'
@ant-design/pro-components
'
;
import
{
BetaSchemaForm
}
from
'
@ant-design/pro-components
'
;
import
{
notification
}
from
'
antd
'
;
import
{
brandInfoColumn
}
from
'
../staticData.js
'
;
import
{
brandInfoColumn
}
from
'
../staticData.js
'
;
import
{
layout
}
from
'
@/utils/bll
'
;
import
{
layout
}
from
'
@/utils/bll
'
;
import
{
apiBrandDetail
,
apiCreateBrand
,
apiEditBrand
,
apiAppendQualifyBrand
}
from
'
../services
'
;
import
{
apiBrandDetail
,
apiCreateBrand
,
apiEditBrand
,
apiAppendQualifyBrand
}
from
'
../services
'
;
import
{
transformVOToFormData
,
transformFormDataToDTO
}
from
'
../bll.js
'
;
import
{
transformVOToFormData
,
transformFormDataToDTO
}
from
'
../bll.js
'
;
/**
* 品牌信息组件
*/
const
BrandInfo
=
props
=>
{
const
BrandInfo
=
props
=>
{
const
refForm
=
React
.
useRef
();
const
refForm
=
React
.
useRef
();
const
{
actionStatus
,
brandId
}
=
props
;
const
{
actionStatus
,
brandId
}
=
props
;
const
closeModal
=
v
=>
{
const
closeModal
=
v
=>
{
refForm
.
current
?.
resetFields
();
!
v
&&
props
.
onClose
(
false
);
!
v
&&
props
.
onClose
(
false
);
};
};
const
getAPI
=
()
=>
{
const
getAPI
=
()
=>
{
...
@@ -28,40 +33,49 @@ const BrandInfo = props => {
...
@@ -28,40 +33,49 @@ const BrandInfo = props => {
const
api
=
getAPI
();
const
api
=
getAPI
();
const
res
=
api
(
params
);
const
res
=
api
(
params
);
if
(
res
)
{
if
(
res
)
{
notification
.
success
({
message
:
'
提交成功
'
,
});
props
.
onClose
(
true
);
props
.
onClose
(
true
);
}
}
};
};
const
getInfo
=
async
()
=>
{
const
getInfo
=
()
=>
if
(
brandId
)
{
new
Promise
(
resolve
=>
{
const
res
=
await
apiBrandDetail
({
brandId
});
setTimeout
(
async
()
=>
{
if
(
res
?.
data
)
{
if
(
brandId
)
{
return
transformVOToFormData
(
res
.
data
);
const
res
=
await
apiBrandDetail
({
brandId
});
}
if
(
res
?.
data
)
{
}
const
data
=
transformVOToFormData
(
res
.
data
);
return
{};
resolve
(
data
);
};
}
}
resolve
({});
},
200
);
});
const
config
=
{
actionStatus
};
const
config
=
{
actionStatus
};
return
(
return
(
<
BetaSchemaForm
props
.
visible
&&
(
layoutType=
"ModalForm"
<
BetaSchemaForm
title=
"品牌信息"
layoutType=
"ModalForm"
open=
{
props
.
visible
}
title=
"品牌信息"
width=
"600px"
open=
{
props
.
visible
}
modalProps=
{
{
width=
"600px"
maskClosable
:
false
,
modalProps=
{
{
destroyOnClose
:
true
,
maskClosable
:
true
,
}
}
destroyOnClose
:
true
,
request=
{
getInfo
}
}
}
formRef=
{
refForm
}
request=
{
getInfo
}
onOpenChange=
{
closeModal
}
formRef=
{
refForm
}
layout=
"horizontal"
onOpenChange=
{
closeModal
}
{
...
layout
}
layout=
"horizontal"
onFinish=
{
submitForm
}
{
...
layout
}
columns=
{
brandInfoColumn
(
config
)
}
onFinish=
{
submitForm
}
/>
columns=
{
brandInfoColumn
(
config
)
}
/>
)
);
);
};
};
...
...
src/pages/BrandManage/index.jsx
View file @
ed18b033
...
@@ -3,16 +3,18 @@ import { ProTable } from '@ant-design/pro-components';
...
@@ -3,16 +3,18 @@ import { ProTable } from '@ant-design/pro-components';
import
{
Button
}
from
'
antd
'
;
import
{
Button
}
from
'
antd
'
;
import
{
PlusOutlined
}
from
'
@ant-design/icons
'
;
import
{
PlusOutlined
}
from
'
@ant-design/icons
'
;
import
{
apiBrandList
}
from
'
./services
'
;
import
{
apiBrandList
}
from
'
./services
'
;
import
{
brandColumn
}
from
'
./staticData.js
'
;
import
{
brandColumn
,
brandActionAdd
}
from
'
./staticData.js
'
;
import
utilStyle
from
'
@/utils/utils.less
'
;
import
utilStyle
from
'
@/utils/utils.less
'
;
import
BrandInfo
from
'
./components/BrandInfo.jsx
'
;
import
BrandInfo
from
'
./components/BrandInfo.jsx
'
;
// 品牌管理
/**
* 品牌管理列表
*/
const
BrandManage
=
()
=>
{
const
BrandManage
=
()
=>
{
const
refTable
=
useRef
();
const
refTable
=
useRef
();
const
[
id
,
setId
]
=
useState
(
''
);
const
[
id
,
setId
]
=
useState
(
''
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
actionStatus
,
setActionStatus
]
=
useState
(
'
add
'
);
const
[
actionStatus
,
setActionStatus
]
=
useState
(
brandActionAdd
);
// 编辑品牌
// 编辑品牌
const
onAction
=
(
record
,
status
)
=>
{
const
onAction
=
(
record
,
status
)
=>
{
...
@@ -23,7 +25,7 @@ const BrandManage = () => {
...
@@ -23,7 +25,7 @@ const BrandManage = () => {
const
onClose
=
refresh
=>
{
const
onClose
=
refresh
=>
{
setVisible
(
false
);
setVisible
(
false
);
refresh
&&
refTable
.
current
.
reload
();
refresh
&&
refTable
.
current
?
.
reload
();
};
};
return
(
return
(
...
@@ -48,7 +50,7 @@ const BrandManage = () => {
...
@@ -48,7 +50,7 @@ const BrandManage = () => {
type=
"primary"
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
setId
(
''
);
setId
(
''
);
setActionStatus
(
'
add
'
);
setActionStatus
(
brandActionAdd
);
setVisible
(
!
0
);
setVisible
(
!
0
);
}
}
}
}
>
>
...
@@ -59,13 +61,7 @@ const BrandManage = () => {
...
@@ -59,13 +61,7 @@ const BrandManage = () => {
bordered
bordered
options=
{
false
}
options=
{
false
}
/>
/>
<
BrandInfo
<
BrandInfo
visible=
{
visible
}
actionStatus=
{
actionStatus
}
brandId=
{
id
}
onClose=
{
onClose
}
/>
visible=
{
visible
}
actionStatus=
{
actionStatus
}
brandId=
{
id
}
onClose=
{
onClose
}
id=
{
id
}
/>
</>
</>
);
);
};
};
...
...
src/pages/BrandManage/services.js
View file @
ed18b033
...
@@ -2,7 +2,7 @@ import qs from 'qs';
...
@@ -2,7 +2,7 @@ import qs from 'qs';
import
request
from
'
@/utils/request
'
;
import
request
from
'
@/utils/request
'
;
import
config
from
'
@/../config/env.config
'
;
import
config
from
'
@/../config/env.config
'
;
const
{
kdspApi
,
goodsApi
}
=
config
;
const
{
kdspApi
}
=
config
;
/**
/**
* 分页查询所有品牌列表
* 分页查询所有品牌列表
...
...
src/pages/BrandManage/staticData.js
View file @
ed18b033
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Button
}
from
'
antd
'
;
import
{
Button
,
Popover
}
from
'
antd
'
;
import
UploadImage
from
'
@/components/UploadImg/index.jsx
'
;
import
UploadImage
from
'
@/components/UploadImg/index.jsx
'
;
// 品牌审核状态
// 品牌审核状态
...
@@ -20,7 +20,7 @@ export const auditStatusReject = 3;
...
@@ -20,7 +20,7 @@ export const auditStatusReject = 3;
* @description: 品牌审核状态枚举 0-无 1-待审核,2-审核通过,3-审核拒绝
* @description: 品牌审核状态枚举 0-无 1-待审核,2-审核通过,3-审核拒绝
*/
*/
export
const
brandStatusEnum
=
{
export
const
brandStatusEnum
=
{
0
:
'
-
'
,
//
0: '-',
[
auditStatusWait
]:
'
待审核
'
,
[
auditStatusWait
]:
'
待审核
'
,
[
auditStatusPass
]:
'
审核通过
'
,
[
auditStatusPass
]:
'
审核通过
'
,
[
auditStatusReject
]:
'
驳回
'
,
[
auditStatusReject
]:
'
驳回
'
,
...
@@ -58,6 +58,7 @@ export const brandBaseColumn = [
...
@@ -58,6 +58,7 @@ export const brandBaseColumn = [
title
:
'
品牌名称
'
,
title
:
'
品牌名称
'
,
dataIndex
:
'
name
'
,
dataIndex
:
'
name
'
,
key
:
'
name
'
,
key
:
'
name
'
,
align
:
'
center
'
,
},
},
{
{
title
:
'
中文名称
'
,
title
:
'
中文名称
'
,
...
@@ -93,12 +94,18 @@ export const brandColumn = config => {
...
@@ -93,12 +94,18 @@ export const brandColumn = config => {
dataIndex
:
'
status
'
,
dataIndex
:
'
status
'
,
align
:
'
center
'
,
align
:
'
center
'
,
valueEnum
:
brandStatusEnum
,
valueEnum
:
brandStatusEnum
,
},
render
:
(
_
,
r
)
=>
{
{
const
{
status
}
=
r
;
title
:
'
驳回原因
'
,
return
status
===
auditStatusReject
?
(
key
:
'
rejectReason
'
,
<
Popover
content
=
{
r
.
rejectReason
}
title
=
"
驳回原因
"
trigger
=
"
hover
"
>
dataIndex
:
'
rejectReason
'
,
<
Button
type
=
"
link
"
danger
>
align
:
'
center
'
,
驳回
<
/Button
>
<
/Popover
>
)
:
(
brandStatusEnum
[
status
]
);
},
},
},
{
{
title
:
'
操作
'
,
title
:
'
操作
'
,
...
...
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