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
f4724461
Commit
f4724461
authored
Sep 20, 2022
by
李腾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增权限控制逻辑判断
parent
d80e9769
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
396 additions
and
174 deletions
+396
-174
permission.config.js
config/permission.config.js
+136
-18
index.jsx
src/pages/AfterSaleManage/PassAudit/index.jsx
+14
-3
index.jsx
src/pages/AfterSaleManage/Pending/index.jsx
+8
-2
index.jsx
src/pages/AfterSaleManage/index.jsx
+11
-3
index.jsx
src/pages/GoodsManage/index.jsx
+1
-1
data.js
src/pages/PaymentMange/data.js
+27
-18
index.jsx
src/pages/PaymentMange/index.jsx
+9
-2
data.js
src/pages/ReconciliationQuery/data.js
+8
-4
index.jsx
src/pages/ReconciliationQuery/index.jsx
+10
-2
data.js
src/pages/SettlementSheet/data.js
+8
-4
index.jsx
src/pages/SettlementSheet/index.jsx
+9
-3
index.jsx
src/pages/afterSaleAddress/index.jsx
+44
-29
Pending.jsx
src/pages/cancelBillManage/Pending.jsx
+19
-9
index.jsx
src/pages/cancelBillManage/index.jsx
+14
-3
data.js
src/pages/systemManage/Account/data.js
+34
-34
index.jsx
src/pages/systemManage/Account/index.jsx
+4
-9
index.jsx
src/pages/systemManage/Role/RoleInfo/index.jsx
+6
-0
data.js
src/pages/systemManage/Role/data.js
+29
-20
index.jsx
src/pages/systemManage/Role/index.jsx
+5
-10
No files found.
config/permission.config.js
View file @
f4724461
/** @name 商品管理 */
// 商品库
export
const
GOOD_MANAGE
=
{
LIST
:
{
name
:
'
商品列表
'
,
id
:
'
020101
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
020101
'
,
apis
:
[],
},
};
// 配送区域
export
const
DISTRIBUTION_AREA
=
{
LIST
:
{
name
:
'
配送区域列表
'
,
id
:
'
020201
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
020202
'
,
apis
:
[],
},
};
/** @name 订单管理 */
/** @name 售后地址设置 */
export
const
AFTER_SALE_ADDRESS
=
{
LIST
:
{
name
:
'
地址列表
'
,
id
:
'
030101
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
030102
'
,
apis
:
[],
},
};
/** @name 货款结算 */
/** @name 售后管理 */
export
const
AFTER_SALE_ORDER
=
{
LIST
:
{
name
:
'
售后订单列表
'
,
id
:
'
050101
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
050102
'
,
apis
:
[],
},
};
/** @name 取消订单审核管理 */
export
const
CANCEL_BILL_MANAGE
=
{
LIST
:
{
name
:
'
取消订单审核列表
'
,
id
:
'
060101
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
060102
'
,
apis
:
[],
},
};
/** @name 供应商对账结算管理 */
//对账单查询
export
const
RECONCILIATION_QUERY
=
{
LIST
:
{
name
:
'
对账单列表
'
,
id
:
'
070101
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
070102
'
,
apis
:
[],
},
};
// 结算单查询
export
const
SETTLEMENT_SHEET
=
{
LIST
:
{
name
:
'
结算单列表
'
,
id
:
'
070201
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
070202
'
,
apis
:
[],
},
};
// 付款单查询
export
const
PAYMENT_MANAGE
=
{
LIST
:
{
name
:
'
付款单列表
'
,
id
:
'
070301
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
070302
'
,
apis
:
[],
},
};
/** @name 系统管理 */
// 账号管理
export
const
ACCOUNT_MANAGE
=
{
LIST
:
{
name
:
'
账号列表
'
,
id
:
'
010101
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
010102
'
,
apis
:
[],
},
};
// 角色管理
...
...
@@ -15,36 +135,34 @@ export const ROLE_MANAGE = {
LIST
:
{
name
:
'
角色列表
'
,
id
:
'
010201
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
010202
'
,
apis
:
[],
},
};
// 日志管理
export
const
LOG_MANAGE
=
{};
/** @name
商品管理
*/
//
商品库
export
const
GOOD_MANAGE
=
{
LIST
:
{
name
:
'
商品列表
'
,
id
:
'
0
2
0101
'
,
/** @name
小程序
*/
//
核销功能
export
const
WRITE_OFF
=
{
SCAN_QR_CODE
:
{
name
:
'
点击扫描
'
,
id
:
'
0
8
0101
'
,
},
E
DITABL
E
:
{
name
:
'
新增/修改
'
,
id
:
'
0
20101
'
,
E
NTER_COD
E
:
{
name
:
'
手动输入核销码
'
,
id
:
'
0
80102
'
,
},
};
// 我的订单
// 配送区域
/** @name 订单管理 */
/** @name 售后地址设置 */
// 添加商品
// export const
/
** @name 售后管理 */
/
/ 售后功能
/** @name 供应商对账结算管理 */
/** @name 系统管理 */
// 查看合同
src/pages/AfterSaleManage/PassAudit/index.jsx
View file @
f4724461
...
...
@@ -11,7 +11,8 @@ import LogisticsCom from '../../orderManage/pendingDeliveryOrder/components/Logi
import
AppealDetail
from
'
../../afterSale/components/detail
'
;
import
AfterLog
from
'
../components/AfterLog
'
;
export
default
()
=>
{
export
default
props
=>
{
const
{
canEditable
}
=
props
;
const
table
=
useRef
();
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
detailVisible
,
setDetailVisible
]
=
useState
(
false
);
...
...
@@ -165,10 +166,20 @@ export default () => {
</
Button
>,
];
// 服务订单删除物流拦截
// 没权限返回详情、查看物流、查看记录
if
(
!
canEditable
)
{
// 服务订单返回订单详情和查看记录
if
(
!
[
'
vip
'
,
'
self
'
].
includes
(
r
.
supplierType
))
{
return
[
operations
[
2
],
operations
[
4
]];
}
return
[
operations
[
2
],
operations
[
3
],
operations
[
4
]];
}
// 有权限 服务订单 不反返回物流
if
(
!
[
'
vip
'
,
'
self
'
].
includes
(
r
.
supplierType
))
{
operations
.
splice
(
3
,
1
)
;
return
[
operations
[
0
],
operations
[
1
],
operations
[
2
],
operations
[
4
]]
;
}
// 有修改权限&&非服务订单 全部返回
return
operations
;
},
},
...
...
src/pages/AfterSaleManage/Pending/index.jsx
View file @
f4724461
...
...
@@ -16,7 +16,8 @@ import styles from '../styles.less';
const
{
Countdown
}
=
Statistic
;
const
{
confirm
}
=
Modal
;
export
default
()
=>
{
export
default
props
=>
{
const
{
canEditable
}
=
props
;
const
table
=
useRef
();
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
detailVisible
,
setDetailVisible
]
=
useState
(
false
);
...
...
@@ -167,9 +168,14 @@ export default () => {
</
Button
>,
];
// 不可编辑直接隐藏可操作按钮
if
(
!
canEditable
)
{
return
[
operations
[
2
],
operations
[
3
]];
}
// 服务订单删除物流拦截
if
(
!
[
'
vip
'
,
'
self
'
].
includes
(
r
.
supplierType
))
{
operations
.
splice
(
1
,
1
)
;
return
[
operations
[
0
],
operations
[
2
],
operations
[
3
]]
;
}
return
operations
;
},
...
...
src/pages/AfterSaleManage/index.jsx
View file @
f4724461
import
{
Tabs
}
from
'
antd
'
;
import
React
from
'
react
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
{
AFTER_SALE_ORDER
}
from
'
@/../config/permission.config
'
;
import
{
connect
}
from
'
dva
'
;
import
Pending
from
'
./Pending
'
;
import
PassAudit
from
'
./PassAudit
'
;
const
{
TabPane
}
=
Tabs
;
export
default
function
AfterSale
()
{
function
AfterSale
(
props
)
{
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
AFTER_SALE_ORDER
.
EDITABLE
.
id
];
return
(
<
PageHeaderWrapper
>
<
Tabs
defaultActiveKey=
"1"
>
<
TabPane
tab=
"未审核"
key=
"1"
>
<
Pending
/>
<
Pending
canEditable=
{
canEditable
}
/>
</
TabPane
>
<
TabPane
tab=
"已审核"
key=
"2"
>
<
PassAudit
/>
<
PassAudit
canEditable=
{
canEditable
}
/>
</
TabPane
>
</
Tabs
>
</
PageHeaderWrapper
>
);
}
export
default
connect
(({
menu
})
=>
({
permissions
:
menu
.
permissions
,
}))(
AfterSale
);
src/pages/GoodsManage/index.jsx
View file @
f4724461
...
...
@@ -70,7 +70,7 @@ class goodsManage extends Component {
componentDidMount
()
{
this
.
props
.
goodsManage
.
tableData
=
{};
this
.
canEditable
=
this
.
props
.
permissions
[
GOOD_MANAGE
.
EDITABLE
.
id
];
this
.
canEditable
=
t
rue
||
t
his
.
props
.
permissions
[
GOOD_MANAGE
.
EDITABLE
.
id
];
this
.
categoryList
();
this
.
getVirtualCategory
();
this
.
specList
();
...
...
src/pages/PaymentMange/data.js
View file @
f4724461
...
...
@@ -147,24 +147,33 @@ export function columns(res, pages) {
fixed
:
'
right
'
,
render
:
(
_
,
row
)
=>
(
<
div
>
<
Button
type
=
"
primary
"
disabled
=
{
row
.
payState
!==
1
}
className
=
{
styles
.
button
}
onClick
=
{()
=>
res
.
edit
(
0
,
row
)}
>
申请结算
<
/Button
>
<
Button
type
=
"
primary
"
disabled
=
{
!
((
row
.
blueInvoiceState
===
1
||
row
.
blueInvoiceState
===
3
)
&&
row
.
payState
===
3
)
}
className
=
{
styles
.
button
}
onClick
=
{()
=>
res
.
edit
(
1
,
row
)}
>
上传发票
<
/Button
>
{
res
.
canEditable
?
(
<>
<
Button
type
=
"
primary
"
disabled
=
{
row
.
payState
!==
1
}
className
=
{
styles
.
button
}
onClick
=
{()
=>
res
.
edit
(
0
,
row
)}
>
申请结算
<
/Button
>
<
Button
type
=
"
primary
"
disabled
=
{
!
(
(
row
.
blueInvoiceState
===
1
||
row
.
blueInvoiceState
===
3
)
&&
row
.
payState
===
3
)
}
className
=
{
styles
.
button
}
onClick
=
{()
=>
res
.
edit
(
1
,
row
)}
>
上传发票
<
/Button
>
<
/
>
)
:
(
''
)}
<
Button
type
=
"
primary
"
disabled
=
{
row
.
blueInvoiceState
===
1
}
...
...
src/pages/PaymentMange/index.jsx
View file @
f4724461
...
...
@@ -7,6 +7,8 @@ import ProTable from '@ant-design/pro-table';
import
{
saveAs
}
from
'
file-saver
'
;
import
{
format
}
from
'
date-fns
'
;
import
moment
from
'
moment
'
;
import
{
connect
}
from
'
dva
'
;
import
{
PAYMENT_MANAGE
}
from
'
@/../config/permission.config
'
;
import
ToExamineModal
from
'
./ToExamine
'
;
import
{
columns
,
toolBarRender
}
from
'
./data
'
;
import
{
...
...
@@ -19,7 +21,9 @@ import {
const
{
confirm
}
=
Modal
;
const
PaymentMange
=
()
=>
{
const
PaymentMange
=
props
=>
{
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
PAYMENT_MANAGE
.
EDITABLE
.
id
];
const
actionRef
=
useRef
();
const
formRef
=
useRef
();
const
[
toExamineData
,
settoExamineData
]
=
useState
({});
...
...
@@ -125,6 +129,7 @@ const PaymentMange = () => {
const
res
=
{
edit
,
canEditable
,
};
const
searchRender
=
({
searchText
,
resetText
},
{
form
})
=>
[
...
...
@@ -199,4 +204,6 @@ const PaymentMange = () => {
);
};
export
default
PaymentMange
;
export
default
connect
(({
menu
})
=>
({
permissions
:
menu
.
permissions
,
}))(
PaymentMange
);
src/pages/ReconciliationQuery/data.js
View file @
f4724461
...
...
@@ -88,13 +88,17 @@ export function columns(pages) {
}
export
const
toolBarRender
=
gather
=>
{
const
{
onDownload
,
confirmAction
}
=
gather
;
const
{
onDownload
,
confirmAction
,
canEditable
}
=
gather
;
return
()
=>
[
<
Button
type
=
"
primary
"
style
=
{{
marginRight
:
'
20px
'
}}
onClick
=
{
onDownload
}
>
下载
<
/Button>
,
<
Button
type
=
"
primary
"
onClick
=
{
confirmAction
}
>
确认
<
/Button>
,
canEditable
?
(
<
Button
type
=
"
primary
"
onClick
=
{
confirmAction
}
>
确认
<
/Button
>
)
:
(
''
),
];
};
src/pages/ReconciliationQuery/index.jsx
View file @
f4724461
...
...
@@ -5,10 +5,15 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
import
ProTable
from
'
@ant-design/pro-table
'
;
import
{
saveAs
}
from
'
file-saver
'
;
import
{
format
}
from
'
date-fns
'
;
import
{
connect
}
from
'
dva
'
;
import
{
RECONCILIATION_QUERY
}
from
'
@/../config/permission.config
'
;
import
{
columns
,
toolBarRender
}
from
'
./data
'
;
import
{
query
,
confirmSelfBill
,
downloadSelfBillDetail
}
from
'
./service
'
;
const
ReconciliationQuery
=
()
=>
{
const
ReconciliationQuery
=
props
=>
{
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
RECONCILIATION_QUERY
.
EDITABLE
.
id
];
const
actionRef
=
useRef
();
const
[
selectedRowKeys
,
setselectedRowKeys
]
=
useState
([]);
const
[
selectedRows
,
setselectedRows
]
=
useState
([]);
...
...
@@ -105,6 +110,7 @@ const ReconciliationQuery = () => {
const
gather
=
{
onDownload
,
confirmAction
,
canEditable
,
};
const
onToolBarRender
=
toolBarRender
(
gather
);
...
...
@@ -161,4 +167,6 @@ const ReconciliationQuery = () => {
);
};
export
default
ReconciliationQuery
;
export
default
connect
(({
menu
})
=>
({
permissions
:
menu
.
permissions
,
}))(
ReconciliationQuery
);
src/pages/SettlementSheet/data.js
View file @
f4724461
...
...
@@ -124,8 +124,12 @@ export function columns(pages) {
];
}
export
const
toolBarRender
=
paymentOrder
=>
()
=>
[
<
Button
type
=
"
primary
"
onClick
=
{
paymentOrder
}
>
生成付款单
<
/Button>
,
export
const
toolBarRender
=
({
paymentOrder
,
canEditable
})
=>
()
=>
[
canEditable
?
(
<
Button
type
=
"
primary
"
onClick
=
{
paymentOrder
}
>
生成付款单
<
/Button
>
)
:
(
<><
/
>
),
];
src/pages/SettlementSheet/index.jsx
View file @
f4724461
...
...
@@ -5,10 +5,14 @@ import { Button, Upload, notification, Spin } from 'antd';
import
React
,
{
useRef
,
useEffect
,
useState
}
from
'
react
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
ProTable
from
'
@ant-design/pro-table
'
;
import
{
connect
}
from
'
dva
'
;
import
{
columns
,
toolBarRender
,
dateStateEnum
}
from
'
./data
'
;
import
{
query
,
selfPaymentBill
}
from
'
./service
'
;
import
{
SETTLEMENT_SHEET
}
from
'
@/../config/permission.config
'
;
const
SettlementSheet
=
()
=>
{
const
SettlementSheet
=
props
=>
{
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
SETTLEMENT_SHEET
.
EDITABLE
.
id
];
const
actionRef
=
useRef
();
const
[
selectedRowKeys
,
setselectedRowKeys
]
=
useState
([]);
const
[
selectedRowsList
,
setselectedRowsList
]
=
useState
([]);
...
...
@@ -107,7 +111,7 @@ const SettlementSheet = () => {
return
data
;
};
const
onToolBarRender
=
toolBarRender
(
paymentOrder
);
const
onToolBarRender
=
toolBarRender
(
{
paymentOrder
,
canEditable
}
);
const
rowSelection
=
{
selectedRowKeys
,
...
...
@@ -164,4 +168,6 @@ const SettlementSheet = () => {
);
};
export
default
SettlementSheet
;
export
default
connect
(({
menu
})
=>
({
permissions
:
menu
.
permissions
,
}))(
SettlementSheet
);
src/pages/afterSaleAddress/index.jsx
View file @
f4724461
...
...
@@ -3,13 +3,17 @@ import React, { useRef, useEffect, useState } from 'react';
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
ProTable
from
'
@ant-design/pro-table
'
;
import
lodash
from
'
lodash
'
;
import
{
connect
}
from
'
dva
'
;
import
{
AFTER_SALE_ADDRESS
}
from
'
@/../config/permission.config
'
;
import
styles
from
'
./index.less
'
;
import
AddrForm
from
'
./form
'
;
import
{
del
,
query
,
supplier
}
from
'
./services
'
;
const
{
Option
}
=
Select
;
const
TableList
=
()
=>
{
const
TableList
=
props
=>
{
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
AFTER_SALE_ADDRESS
.
EDITABLE
.
id
];
const
[
supplierList
,
setSupplierList
]
=
useState
([]);
const
[
shopId
,
setShopId
]
=
useState
(
null
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
...
...
@@ -143,30 +147,35 @@ const TableList = () => {
dataIndex
:
'
option
'
,
key
:
'
option
'
,
valueType
:
'
option
'
,
render
:
(
_
,
row
)
=>
[
<
Button
key=
"edit"
type=
"primary"
onClick=
{
()
=>
{
editAction
(
row
);
}
}
>
修改
</
Button
>,
<
Popconfirm
placement=
"topLeft"
title=
"确定要删除吗?"
onConfirm=
{
()
=>
{
delAction
(
row
);
}
}
okText=
"删除"
cancelText=
"取消"
>
<
Button
key=
"del"
type=
"danger"
className=
{
styles
.
btn
}
>
删除
</
Button
>
</
Popconfirm
>,
],
render
:
(
_
,
row
)
=>
{
if
(
canEditable
)
{
return
[
<
Button
key=
"edit"
type=
"primary"
onClick=
{
()
=>
{
editAction
(
row
);
}
}
>
修改
</
Button
>,
<
Popconfirm
placement=
"topLeft"
title=
"确定要删除吗?"
onConfirm=
{
()
=>
{
delAction
(
row
);
}
}
okText=
"删除"
cancelText=
"取消"
>
<
Button
key=
"del"
type=
"danger"
className=
{
styles
.
btn
}
>
删除
</
Button
>
</
Popconfirm
>,
];
}
return
[];
},
},
];
return
(
...
...
@@ -181,9 +190,13 @@ const TableList = () => {
bordered
scroll=
{
{
x
:
1500
}
}
toolBarRender=
{
()
=>
[
<
Button
key=
"3"
type=
"primary"
onClick=
{
addAction
}
>
添加售后地址
</
Button
>,
canEditable
?
(
<
Button
key=
"3"
type=
"primary"
onClick=
{
addAction
}
>
添加售后地址
</
Button
>
)
:
(
<></>
),
]
}
onReset=
{
()
=>
reload
(
'
reset
'
)
}
/>
...
...
@@ -197,4 +210,6 @@ const TableList = () => {
);
};
export
default
TableList
;
export
default
connect
(({
menu
})
=>
({
permissions
:
menu
.
permissions
,
}))(
TableList
);
src/pages/cancelBillManage/Pending.jsx
View file @
f4724461
...
...
@@ -12,7 +12,8 @@ import AuditModal from './components/auditModal';
import
DetailTable
from
'
./components/detailTable
'
;
import
{
dateDiff
}
from
'
./common
'
;
export
default
()
=>
{
export
default
props
=>
{
const
{
canEditable
}
=
props
;
const
table
=
useRef
();
const
ref
=
useRef
();
const
[
visible
,
setVisible
]
=
useState
(
false
);
...
...
@@ -148,14 +149,23 @@ export default () => {
width
:
250
,
fixed
:
'
right
'
,
// eslint-disable-next-line no-shadow
render
:
(
_
,
r
)
=>
[
<
Button
key=
"link1"
onClick=
{
()
=>
openAudit
(
r
)
}
className=
"mr10"
type=
"primary"
>
审核
</
Button
>,
<
Button
key=
"link"
onClick=
{
()
=>
viewDetail
(
r
)
}
type=
"primary"
>
订单详情
</
Button
>,
],
render
:
(
_
,
r
)
=>
{
const
examine
=
(
<
Button
key=
"link1"
onClick=
{
()
=>
openAudit
(
r
)
}
className=
"mr10"
type=
"primary"
>
审核
</
Button
>
);
const
detail
=
(
<
Button
key=
"link"
onClick=
{
()
=>
viewDetail
(
r
)
}
type=
"primary"
>
订单详情
</
Button
>
);
if
(
!
canEditable
)
{
return
[
detail
];
}
return
[
examine
,
detail
];
},
},
];
return
(
...
...
src/pages/cancelBillManage/index.jsx
View file @
f4724461
import
{
Tabs
}
from
'
antd
'
;
import
React
from
'
react
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
{
connect
}
from
'
dva
'
;
import
{
CANCEL_BILL_MANAGE
}
from
'
@/../config/permission.config
'
;
import
Pending
from
'
./Pending
'
;
import
PassAudit
from
'
./PassAudit
'
;
const
{
TabPane
}
=
Tabs
;
export
default
function
CancelBillManage
()
{
function
CancelBillManage
(
props
)
{
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
CANCEL_BILL_MANAGE
.
EDITABLE
.
id
];
// const [tabKey, setTabKey] = useState({});
// const changeTab = () => {
// const key = tabKey + 1;
// setTabKey(key)
// }
console
.
log
(
'
permissions
'
,
canEditable
);
return
(
<
PageHeaderWrapper
>
<
Tabs
defaultActiveKey=
"1"
>
<
TabPane
tab=
"未审核"
key=
"1"
>
<
Pending
/>
<
Pending
canEditable=
{
canEditable
}
/>
</
TabPane
>
<
TabPane
tab=
"已审核"
key=
"2"
>
<
PassAudit
/>
<
PassAudit
canEditable=
{
canEditable
}
/>
</
TabPane
>
</
Tabs
>
</
PageHeaderWrapper
>
);
}
export
default
connect
(({
menu
})
=>
({
permissions
:
menu
.
permissions
,
}))(
CancelBillManage
);
src/pages/systemManage/Account/data.js
View file @
f4724461
...
...
@@ -7,7 +7,7 @@ export const getColumns = props => {
openRolePermissionsModal
,
openUpdateStatusModal
,
openResetPasswordModal
,
can
AddEdit
,
can
Editable
,
}
=
props
;
return
[
{
...
...
@@ -47,6 +47,7 @@ export const getColumns = props => {
dataIndex
:
'
status
'
,
width
:
150
,
initialValue
:
'
3
'
,
hideInFilter
:
true
,
valueEnum
:
{
all
:
{
text
:
'
全部
'
,
status
:
''
},
close
:
{
text
:
'
使用中
'
,
status
:
2
},
...
...
@@ -59,39 +60,38 @@ export const getColumns = props => {
key
:
'
action
'
,
width
:
220
,
hideInSearch
:
true
,
render
:
(
value
,
record
)
=>
(
<>
{
canAddEdit
?
(
<>
<
a
onClick
=
{()
=>
{
toUserInfo
(
record
);
}}
>
编辑
<
/a
>
<
Divider
type
=
"
vertical
"
/>
<
/
>
)
:
(
''
)}
<
a
onClick
=
{()
=>
{
openUpdateStatusModal
(
record
);
}}
>
修改状态
<
/a
>
<
Divider
type
=
"
vertical
"
/>
<
a
onClick
=
{()
=>
{
openResetPasswordModal
(
record
);
}}
>
重置密码
<
/a
>
<
/
>
),
render
:
(
value
,
record
)
=>
{
if
(
!
canEditable
)
{
return
<>-<
/>
;
}
return
(
<>
<
a
onClick
=
{()
=>
{
toUserInfo
(
record
);
}}
>
编辑
<
/a
>
<
Divider
type
=
"
vertical
"
/>
<
a
onClick
=
{()
=>
{
openUpdateStatusModal
(
record
);
}}
>
修改状态
<
/a
>
<
Divider
type
=
"
vertical
"
/>
<
a
onClick
=
{()
=>
{
openResetPasswordModal
(
record
);
}}
>
重置密码
<
/a
>
<
/
>
);
},
},
];
};
src/pages/systemManage/Account/index.jsx
View file @
f4724461
...
...
@@ -27,7 +27,7 @@ const Account = props => {
const
resetPasswordModal
=
useRef
();
// 权限控制-新增/修改
const
can
AddEdit
=
permissions
[
ACCOUNT_MANAGE
.
EDITABLE
.
id
];
const
can
Editable
=
permissions
[
ACCOUNT_MANAGE
.
EDITABLE
.
id
];
// 获取当前用户组织信息
const
userInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'
user
'
)
||
'
{}
'
);
...
...
@@ -66,7 +66,7 @@ const Account = props => {
openRolePermissionsModal
,
openUpdateStatusModal
,
openResetPasswordModal
,
can
AddEdit
,
can
Editable
,
});
// 表格属性
...
...
@@ -90,7 +90,7 @@ const Account = props => {
},
toolBarRender
:
()
=>
{
// TODO: 权限控制
if
(
can
AddEdit
)
{
if
(
can
Editable
)
{
return
[
<
Button
type=
"primary"
onClick=
{
()
=>
toUserInfo
()
}
>
新增用户
...
...
@@ -109,12 +109,7 @@ const Account = props => {
return
(
<
PageHeaderWrapper
>
<
ProTable
actionRef=
{
actionRef
}
formRef=
{
formRef
}
{
...
tableProps
}
search=
{
searchProps
}
></
ProTable
>
<
ProTable
actionRef=
{
actionRef
}
formRef=
{
formRef
}
{
...
tableProps
}
search=
{
false
}
></
ProTable
>
<
RolePermissionsModal
ref=
{
rolePermissionsModalRef
}
/>
<
UpdateStatusModal
reload=
{
reload
}
ref=
{
updateStatusModalRef
}
/>
...
...
src/pages/systemManage/Role/RoleInfo/index.jsx
View file @
f4724461
...
...
@@ -118,7 +118,13 @@ const RoleInfo = props => {
};
// 初始化权限数据
// TODO:分离接口
const
initPermissions
=
(
res
,
roleId
)
=>
{
if
(
res
.
code
!==
2000
)
{
notification
.
warning
({
message
:
res
.
msg
,
});
}
let
resource
=
[];
let
selected
=
[];
if
(
roleId
)
{
...
...
src/pages/systemManage/Role/data.js
View file @
f4724461
...
...
@@ -2,11 +2,12 @@ import React from 'react';
import
{
Divider
,
Popconfirm
}
from
'
antd
'
;
export
const
getColumns
=
props
=>
{
const
{
onDeleteRole
,
toRoleInfo
,
can
AddEdit
}
=
props
;
const
{
onDeleteRole
,
toRoleInfo
,
can
Editable
}
=
props
;
return
[
{
title
:
'
角色ID
'
,
dataIndex
:
'
id
'
,
hideInTable
:
true
,
},
{
title
:
'
角色名称
'
,
...
...
@@ -41,25 +42,33 @@ export const getColumns = props => {
{
title
:
'
操作
'
,
key
:
'
action
'
,
render
:
(
value
,
record
)
=>
(
<>
{
canAddEdit
?
<
a
onClick
=
{()
=>
toRoleInfo
(
record
)}
>
编辑
<
/a> : ''
}
{
canAddEdit
&&
record
.
userCount
!==
0
?
<
Divider
type
=
"
vertical
"
/>
:
''
}
{
record
.
userCount
===
0
?
(
<
Popconfirm
placement
=
"
top
"
title
=
"
确定删除该角色吗?
"
onConfirm
=
{()
=>
onDeleteRole
(
record
)}
okText
=
"
确定
"
cancelText
=
"
取消
"
>
<
a
>
删除
<
/a
>
<
/Popconfirm
>
)
:
(
''
)}
<
/
>
),
hideInSearch
:
true
,
render
:
(
value
,
record
)
=>
{
if
(
!
canEditable
)
{
return
'
-
'
;
}
return
(
<>
<
a
onClick
=
{()
=>
toRoleInfo
(
record
)}
>
编辑
<
/a
>
{
record
.
userCount
===
0
?
(
<>
<
Divider
type
=
"
vertical
"
/>
<
Popconfirm
placement
=
"
top
"
title
=
"
确定删除该角色吗?
"
onConfirm
=
{()
=>
onDeleteRole
(
record
)}
okText
=
"
确定
"
cancelText
=
"
取消
"
>
<
a
>
删除
<
/a
>
<
/Popconfirm
>
<
/
>
)
:
(
''
)}
<
/
>
);
},
},
];
};
src/pages/systemManage/Role/index.jsx
View file @
f4724461
...
...
@@ -17,7 +17,7 @@ const Role = props => {
const
history
=
useHistory
();
// 权限控制
const
can
AddEdit
=
permissions
[
ROLE_MANAGE
.
EDITABLE
.
id
];
const
can
Editable
=
permissions
[
ROLE_MANAGE
.
EDITABLE
.
id
];
const
toRoleInfo
=
({
id
=
null
}
=
{})
=>
{
const
query
=
id
?
{
id
}
:
{};
...
...
@@ -44,7 +44,7 @@ const Role = props => {
const
columns
=
getColumns
({
onDeleteRole
,
toRoleInfo
,
can
AddEdit
,
can
Editable
,
});
// 表格属性
...
...
@@ -57,13 +57,13 @@ const Role = props => {
const
res
=
await
getRoleList
({
page
,
size
,
...
params
});
const
{
content
,
totalElements
}
=
res
.
data
;
return
{
data
:
content
,
success
:
true
,
data
:
content
,
total
:
totalElements
,
};
},
toolBarRender
:
()
=>
[
can
AddEdit
?
(
can
Editable
?
(
<
Button
type=
"primary"
onClick=
{
()
=>
toRoleInfo
()
}
>
新增角色
</
Button
>
...
...
@@ -80,12 +80,7 @@ const Role = props => {
return
(
<
PageHeaderWrapper
>
<
ProTable
actionRef=
{
actionRef
}
formRef=
{
formRef
}
{
...
tableProps
}
search=
{
searchProps
}
></
ProTable
>
<
ProTable
actionRef=
{
actionRef
}
formRef=
{
formRef
}
{
...
tableProps
}
search=
{
false
}
></
ProTable
>
</
PageHeaderWrapper
>
);
};
...
...
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