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
XieZhiXiong
jinfa-platform
Commits
46e67adf
Commit
46e67adf
authored
Dec 24, 2021
by
xiexiuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:仓位页面权限按钮控制
parent
5d7abf4e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
20 deletions
+42
-20
按钮状态.mad
src/components/AuthButton/按钮状态.mad
+8
-3
index.tsx
src/pages/repositories/index.tsx
+34
-17
No files found.
src/components/AuthButton/按钮状态.mad
View file @
46e67adf
btnCo
de 是pass 平台配置唯一表示
btnCo
de 是pass 平台配置唯一表示
btnCode 是pass 平台配置唯一表示
menuCode 是 pass平台菜单属性relationParentCode":"commodityAbility",
注意点 如果与后台按钮不匹配 则是没有权限按钮
// 价格策略
priceManage.add" 价格策略列表新曾
priceManage.del 价格策略列表删除
...
...
@@ -31,4 +32,8 @@ directChannel.state:渠道直采商品上架下架
//品牌管理
//仓位 pass 已经加上去 等待页面处理
\ No newline at end of file
//仓位 pass
repositories.add :'仓位新曾按钮'
repositories.batchadd :'仓位批量新曾按钮'
repositories.batchedit:仓位批量修改按钮
repositories.edit:仓位库存调拨按钮
\ No newline at end of file
src/pages/repositories/index.tsx
View file @
46e67adf
...
...
@@ -18,6 +18,8 @@ import ModalForm from '@/components/ModalForm';
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
import
{
getProductFreightSpaceList
,
postProductFreightSpaceStopStart
,
postProductFreightSpaceUpdateBatch
}
from
'@/services/ProductV2Api'
;
import
AuthButton
from
'@/components/AuthButton'
import
{
AuthUrl
}
from
'@/components/AuthButton/AuthUrl'
const
formActions
=
createFormActions
();
const
modalSchemaAction
=
createFormActions
()
...
...
@@ -58,6 +60,7 @@ const Repositories: React.FC<{}> = () => {
key
:
'name'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
EyePreview
type=
{
AuthUrl
(
'repositories.see'
,
'commodityAbility'
)
?
'link'
:
"button"
}
url=
{
`/memberCenter/commodityAbility/repositories/detail?id=${record.id}&preview=1`
}
>
{
text
}
...
...
@@ -123,9 +126,12 @@ const Repositories: React.FC<{}> = () => {
return
(
<>
{
record
.
state
===
1
?
(
<
Button
type=
"link"
onClick=
{
()
=>
handleAdjust
(
record
)
}
>
{
intl
.
formatMessage
({
id
:
'repositories.columns.option.button'
})
}
</
Button
>
<
AuthButton
btnCode=
'repositories.edit'
menuCode=
'commodityAbility'
>
<
Button
type=
"link"
onClick=
{
()
=>
handleAdjust
(
record
)
}
>
{
intl
.
formatMessage
({
id
:
'repositories.columns.option.button'
})
}
</
Button
>
</
AuthButton
>
)
:
(
''
)
}
...
...
@@ -226,11 +232,13 @@ const Repositories: React.FC<{}> = () => {
const
handleModify
=
async
(
record
)
=>
{
// 通过传入的params字符串判断是修改那种类型的数据
await
postProductFreightSpaceStopStart
({
id
:
record
.
id
,
state
:
record
.
state
===
1
?
0
:
1
})
ref
.
current
.
reload
()
if
(
AuthUrl
(
'repositories.state'
,
'commodityAbility'
))
{
await
postProductFreightSpaceStopStart
({
id
:
record
.
id
,
state
:
record
.
state
===
1
?
0
:
1
})
ref
.
current
.
reload
()
}
};
const
handleAdjust
=
(
record
:
any
)
=>
{
...
...
@@ -282,15 +290,24 @@ const Repositories: React.FC<{}> = () => {
}
const
controllerBtns
=
<
Space
>
<
Button
type=
"primary"
onClick=
{
handleToAdd
}
icon=
{
<
PlusOutlined
/>
}
>
{
intl
.
formatMessage
({
id
:
'repositories.controllerBtns.button.1'
})
}
</
Button
>
<
Button
onClick=
{
handleBatchAdd
}
>
{
intl
.
formatMessage
({
id
:
'repositories.controllerBtns.button.2'
})
}
</
Button
>
<
Button
onClick=
{
()
=>
modalRef
.
current
.
setVisible
(
true
)
}
>
{
intl
.
formatMessage
({
id
:
'repositories.controllerBtns.button.3'
})
}
</
Button
>
<
AuthButton
btnCode=
'repositories.add'
menuCode=
'commodityAbility'
>
<
Button
type=
"primary"
onClick=
{
handleToAdd
}
icon=
{
<
PlusOutlined
/>
}
>
{
intl
.
formatMessage
({
id
:
'repositories.controllerBtns.button.1'
})
}
</
Button
>
</
AuthButton
>
<
AuthButton
btnCode=
'repositories.batchadd'
menuCode=
'commodityAbility'
>
<
Button
onClick=
{
handleBatchAdd
}
>
{
intl
.
formatMessage
({
id
:
'repositories.controllerBtns.button.2'
})
}
</
Button
>
</
AuthButton
>
<
AuthButton
btnCode=
'repositories.batchedit'
menuCode=
'commodityAbility'
>
<
Button
onClick=
{
()
=>
modalRef
.
current
.
setVisible
(
true
)
}
>
{
intl
.
formatMessage
({
id
:
'repositories.controllerBtns.button.3'
})
}
</
Button
>
</
AuthButton
>
</
Space
>
return
(
...
...
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