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
bb31bde6
Commit
bb31bde6
authored
Sep 26, 2022
by
李腾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 优化权限代码&&修改修改密码接口
parent
f571275c
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
86 additions
and
166 deletions
+86
-166
permission.config.js
config/permission.config.js
+28
-140
index.jsx
src/pages/AfterSaleManage/index.jsx
+1
-1
index.jsx
src/pages/GoodsManage/SearchForm/index.jsx
+1
-1
index.jsx
src/pages/GoodsManage/index.jsx
+1
-1
index.jsx
src/pages/PaymentMange/index.jsx
+1
-1
index.jsx
src/pages/ReconciliationQuery/index.jsx
+1
-1
index.jsx
src/pages/SettlementSheet/index.jsx
+1
-1
index.jsx
src/pages/afterSaleAddress/index.jsx
+1
-1
index.jsx
src/pages/cancelBillManage/index.jsx
+1
-1
index.jsx
src/pages/distributionArea/index.jsx
+1
-1
index.jsx
src/pages/orderManage/batchDelivery/index.jsx
+1
-1
index.jsx
src/pages/orderManage/pendingDeliveryOrder/index.jsx
+1
-1
index.jsx
src/pages/orderManage/queryOrder/index.jsx
+1
-1
service.js
src/pages/password/service.js
+1
-1
index.jsx
src/pages/systemManage/Account/UserInfo/index.jsx
+13
-3
index.jsx
...stemManage/Account/components/UpdateStatusModal/index.jsx
+3
-6
data.js
src/pages/systemManage/Account/data.js
+7
-1
index.jsx
src/pages/systemManage/Account/index.jsx
+21
-2
index.jsx
src/pages/systemManage/Role/index.jsx
+1
-1
No files found.
config/permission.config.js
View file @
bb31bde6
/** @name 商品管理 */
/** @name 商品管理 */
// 商品库
// 商品库
export
const
GOOD_MANAGE
=
{
export
const
GOOD_MANAGE
=
{
LIST
:
{
LIST
:
'
020101
'
,
name
:
'
商品列表
'
,
EDITABLE
:
'
020102
'
,
id
:
'
020101
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
020102
'
,
apis
:
[],
},
};
};
// 配送区域
// 配送区域
export
const
DISTRIBUTION_AREA
=
{
export
const
DISTRIBUTION_AREA
=
{
LIST
:
{
LIST
:
'
020201
'
,
name
:
'
配送区域列表
'
,
EDITABLE
:
'
020202
'
,
id
:
'
020201
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
020202
'
,
apis
:
[],
},
};
};
/** @name 订单管理 */
/** @name 订单管理 */
//待发货订单
//待发货订单
export
const
PENDING_DELIVERY_ORDER
=
{
export
const
PENDING_DELIVERY_ORDER
=
{
LIST
:
{
LIST
:
'
020301
'
,
name
:
'
待发货订单列表
'
,
EDITABLE
:
'
020302
'
,
id
:
'
020301
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
020302
'
,
apis
:
[],
},
};
};
// 已发货订单
// 已发货订单
export
const
DELIVERY_ORDER
=
{
export
const
DELIVERY_ORDER
=
{
LIST
:
{
LIST
:
'
020401
'
,
name
:
'
已发货
'
,
EDITABLE
:
'
020402
'
,
id
:
'
020401
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
020402
'
,
apis
:
[],
},
};
};
// 批量发货
// 批量发货
export
const
BATCH_DELIVERY
=
{
export
const
BATCH_DELIVERY
=
{
LIST
:
{
LIST
:
'
020501
'
,
name
:
'
批量发货
'
,
EDITABLE
:
'
020502
'
,
// 新增/修改
id
:
'
020501
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
020502
'
,
apis
:
[],
},
};
};
// 订单查询
// 订单查询
export
const
QUERY_ORDER
=
{
export
const
QUERY_ORDER
=
{
LIST
:
{
LIST
:
'
020601
'
,
// 订单查询列表
name
:
'
订单查询列表
'
,
EDITABLE
:
'
020602
'
,
id
:
'
020601
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
020602
'
,
apis
:
[],
},
};
};
/** @name 售后地址设置 */
/** @name 售后地址设置 */
export
const
AFTER_SALE_ADDRESS
=
{
export
const
AFTER_SALE_ADDRESS
=
{
LIST
:
{
LIST
:
'
030101
'
,
// 地址列表
name
:
'
地址列表
'
,
EDITABLE
:
'
030102
'
,
// 新增/修改
id
:
'
030101
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
030102
'
,
apis
:
[],
},
};
};
/** @name 货款结算 */
/** @name 货款结算 */
/** @name 售后管理 */
/** @name 售后管理 */
export
const
AFTER_SALE_ORDER
=
{
export
const
AFTER_SALE_ORDER
=
{
LIST
:
{
LIST
:
'
050101
'
,
// 售后订单列表
name
:
'
售后订单列表
'
,
EDITABLE
:
'
050102
'
,
// 新增/修改
id
:
'
050101
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
050102
'
,
apis
:
[],
},
};
};
/** @name 取消订单审核管理 */
/** @name 取消订单审核管理 */
export
const
CANCEL_BILL_MANAGE
=
{
export
const
CANCEL_BILL_MANAGE
=
{
LIST
:
{
LIST
:
'
060101
'
,
// 取消订单审核列表
name
:
'
取消订单审核列表
'
,
EDITABLE
:
'
060102
'
,
id
:
'
060101
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
060102
'
,
apis
:
[],
},
};
};
/** @name 供应商对账结算管理 */
/** @name 供应商对账结算管理 */
//对账单查询
//对账单查询
export
const
RECONCILIATION_QUERY
=
{
export
const
RECONCILIATION_QUERY
=
{
LIST
:
{
LIST
:
'
070101
'
,
// 对账单列表
name
:
'
对账单列表
'
,
EDITABLE
:
'
070102
'
,
// 新增/修改
id
:
'
070101
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
070102
'
,
apis
:
[],
},
};
};
// 结算单查询
// 结算单查询
export
const
SETTLEMENT_SHEET
=
{
export
const
SETTLEMENT_SHEET
=
{
LIST
:
{
LIST
:
'
070201
'
,
// 结算单列表
name
:
'
结算单列表
'
,
EDITABLE
:
'
070202
'
,
// 新增/修改
id
:
'
070201
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
070202
'
,
apis
:
[],
},
};
};
// 付款单查询
// 付款单查询
export
const
PAYMENT_MANAGE
=
{
export
const
PAYMENT_MANAGE
=
{
LIST
:
{
LIST
:
'
070301
'
,
// 付款单列表
name
:
'
付款单列表
'
,
EDITABLE
:
'
070302
'
,
// 新增/修改
id
:
'
070301
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
070302
'
,
apis
:
[],
},
};
};
/** @name 系统管理 */
/** @name 系统管理 */
// 账号管理
// 账号管理
export
const
ACCOUNT_MANAGE
=
{
export
const
ACCOUNT_MANAGE
=
{
LIST
:
{
LIST
:
'
010101
'
,
// 账户列表
name
:
'
账号列表
'
,
EDITABLE
:
'
010102
'
,
// 新增/修改
id
:
'
010101
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
010102
'
,
apis
:
[],
},
};
};
// 角色管理
// 角色管理
export
const
ROLE_MANAGE
=
{
export
const
ROLE_MANAGE
=
{
LIST
:
{
LIST
:
'
010201
'
,
// 角色列表
name
:
'
角色列表
'
,
EDITABLE
:
'
010202
'
,
// 新增/修改
id
:
'
010201
'
,
apis
:
[],
},
EDITABLE
:
{
name
:
'
新增/修改
'
,
id
:
'
010202
'
,
apis
:
[],
},
};
};
src/pages/AfterSaleManage/index.jsx
View file @
bb31bde6
...
@@ -10,7 +10,7 @@ const { TabPane } = Tabs;
...
@@ -10,7 +10,7 @@ const { TabPane } = Tabs;
function
AfterSale
(
props
)
{
function
AfterSale
(
props
)
{
const
{
permissions
}
=
props
;
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
AFTER_SALE_ORDER
.
EDITABLE
.
id
];
const
canEditable
=
permissions
[
AFTER_SALE_ORDER
.
EDITABLE
];
return
(
return
(
<
PageHeaderWrapper
>
<
PageHeaderWrapper
>
<
Tabs
defaultActiveKey=
"1"
>
<
Tabs
defaultActiveKey=
"1"
>
...
...
src/pages/GoodsManage/SearchForm/index.jsx
View file @
bb31bde6
...
@@ -36,7 +36,7 @@ class goodsManage extends Component {
...
@@ -36,7 +36,7 @@ class goodsManage extends Component {
canEditable
=
false
;
canEditable
=
false
;
componentDidMount
()
{
componentDidMount
()
{
this
.
canEditable
=
this
.
props
.
permissions
[
GOOD_MANAGE
.
EDITABLE
.
id
];
this
.
canEditable
=
this
.
props
.
permissions
[
GOOD_MANAGE
.
EDITABLE
];
console
.
log
(
111
,
this
.
props
.
permissions
,
this
.
canEditable
);
console
.
log
(
111
,
this
.
props
.
permissions
,
this
.
canEditable
);
this
.
props
.
onRef
(
this
);
this
.
props
.
onRef
(
this
);
this
.
handleSearch
();
this
.
handleSearch
();
...
...
src/pages/GoodsManage/index.jsx
View file @
bb31bde6
...
@@ -70,7 +70,7 @@ class goodsManage extends Component {
...
@@ -70,7 +70,7 @@ class goodsManage extends Component {
componentDidMount
()
{
componentDidMount
()
{
this
.
props
.
goodsManage
.
tableData
=
{};
this
.
props
.
goodsManage
.
tableData
=
{};
this
.
canEditable
=
this
.
props
.
permissions
[
GOOD_MANAGE
.
EDITABLE
.
id
];
this
.
canEditable
=
this
.
props
.
permissions
[
GOOD_MANAGE
.
EDITABLE
];
this
.
categoryList
();
this
.
categoryList
();
this
.
getVirtualCategory
();
this
.
getVirtualCategory
();
this
.
specList
();
this
.
specList
();
...
...
src/pages/PaymentMange/index.jsx
View file @
bb31bde6
...
@@ -23,7 +23,7 @@ const { confirm } = Modal;
...
@@ -23,7 +23,7 @@ const { confirm } = Modal;
const
PaymentMange
=
props
=>
{
const
PaymentMange
=
props
=>
{
const
{
permissions
}
=
props
;
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
PAYMENT_MANAGE
.
EDITABLE
.
id
];
const
canEditable
=
permissions
[
PAYMENT_MANAGE
.
EDITABLE
];
const
actionRef
=
useRef
();
const
actionRef
=
useRef
();
const
formRef
=
useRef
();
const
formRef
=
useRef
();
const
[
toExamineData
,
settoExamineData
]
=
useState
({});
const
[
toExamineData
,
settoExamineData
]
=
useState
({});
...
...
src/pages/ReconciliationQuery/index.jsx
View file @
bb31bde6
...
@@ -12,7 +12,7 @@ import { query, confirmSelfBill, downloadSelfBillDetail } from './service';
...
@@ -12,7 +12,7 @@ import { query, confirmSelfBill, downloadSelfBillDetail } from './service';
const
ReconciliationQuery
=
props
=>
{
const
ReconciliationQuery
=
props
=>
{
const
{
permissions
}
=
props
;
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
RECONCILIATION_QUERY
.
EDITABLE
.
id
];
const
canEditable
=
permissions
[
RECONCILIATION_QUERY
.
EDITABLE
];
const
actionRef
=
useRef
();
const
actionRef
=
useRef
();
const
[
selectedRowKeys
,
setselectedRowKeys
]
=
useState
([]);
const
[
selectedRowKeys
,
setselectedRowKeys
]
=
useState
([]);
...
...
src/pages/SettlementSheet/index.jsx
View file @
bb31bde6
...
@@ -12,7 +12,7 @@ import { SETTLEMENT_SHEET } from '@/../config/permission.config';
...
@@ -12,7 +12,7 @@ import { SETTLEMENT_SHEET } from '@/../config/permission.config';
const
SettlementSheet
=
props
=>
{
const
SettlementSheet
=
props
=>
{
const
{
permissions
}
=
props
;
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
SETTLEMENT_SHEET
.
EDITABLE
.
id
];
const
canEditable
=
permissions
[
SETTLEMENT_SHEET
.
EDITABLE
];
const
actionRef
=
useRef
();
const
actionRef
=
useRef
();
const
[
selectedRowKeys
,
setselectedRowKeys
]
=
useState
([]);
const
[
selectedRowKeys
,
setselectedRowKeys
]
=
useState
([]);
const
[
selectedRowsList
,
setselectedRowsList
]
=
useState
([]);
const
[
selectedRowsList
,
setselectedRowsList
]
=
useState
([]);
...
...
src/pages/afterSaleAddress/index.jsx
View file @
bb31bde6
...
@@ -13,7 +13,7 @@ const { Option } = Select;
...
@@ -13,7 +13,7 @@ const { Option } = Select;
const
TableList
=
props
=>
{
const
TableList
=
props
=>
{
const
{
permissions
}
=
props
;
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
AFTER_SALE_ADDRESS
.
EDITABLE
.
id
];
const
canEditable
=
permissions
[
AFTER_SALE_ADDRESS
.
EDITABLE
];
const
[
supplierList
,
setSupplierList
]
=
useState
([]);
const
[
supplierList
,
setSupplierList
]
=
useState
([]);
const
[
shopId
,
setShopId
]
=
useState
(
null
);
const
[
shopId
,
setShopId
]
=
useState
(
null
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
...
...
src/pages/cancelBillManage/index.jsx
View file @
bb31bde6
...
@@ -11,7 +11,7 @@ const { TabPane } = Tabs;
...
@@ -11,7 +11,7 @@ const { TabPane } = Tabs;
function
CancelBillManage
(
props
)
{
function
CancelBillManage
(
props
)
{
const
{
permissions
}
=
props
;
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
CANCEL_BILL_MANAGE
.
EDITABLE
.
id
];
const
canEditable
=
permissions
[
CANCEL_BILL_MANAGE
.
EDITABLE
];
// const [tabKey, setTabKey] = useState({});
// const [tabKey, setTabKey] = useState({});
// const changeTab = () => {
// const changeTab = () => {
// const key = tabKey + 1;
// const key = tabKey + 1;
...
...
src/pages/distributionArea/index.jsx
View file @
bb31bde6
...
@@ -10,7 +10,7 @@ import { DISTRIBUTION_AREA } from '@/../config/permission.config';
...
@@ -10,7 +10,7 @@ import { DISTRIBUTION_AREA } from '@/../config/permission.config';
const
TableList
=
props
=>
{
const
TableList
=
props
=>
{
const
{
permissions
}
=
props
;
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
DISTRIBUTION_AREA
.
EDITABLE
.
id
];
const
canEditable
=
permissions
[
DISTRIBUTION_AREA
.
EDITABLE
];
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
templateData
,
settemplateData
]
=
useState
(
''
);
const
[
templateData
,
settemplateData
]
=
useState
(
''
);
const
actionRef
=
useRef
();
const
actionRef
=
useRef
();
...
...
src/pages/orderManage/batchDelivery/index.jsx
View file @
bb31bde6
...
@@ -14,7 +14,7 @@ import {
...
@@ -14,7 +14,7 @@ import {
const
TableList
=
props
=>
{
const
TableList
=
props
=>
{
const
actionRef
=
useRef
(
null
);
const
actionRef
=
useRef
(
null
);
const
{
permissions
}
=
props
;
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
BATCH_DELIVERY
.
EDITABLE
.
id
];
const
canEditable
=
permissions
[
BATCH_DELIVERY
.
EDITABLE
];
const
columns
=
[
const
columns
=
[
{
{
...
...
src/pages/orderManage/pendingDeliveryOrder/index.jsx
View file @
bb31bde6
...
@@ -27,7 +27,7 @@ const TableList = props => {
...
@@ -27,7 +27,7 @@ const TableList = props => {
const
{
permissions
}
=
props
;
const
{
permissions
}
=
props
;
// 因待发货 和 已发货都使用当前组件,功能且相同,所以只要授权其中一个均可获得发货物流权限
// 因待发货 和 已发货都使用当前组件,功能且相同,所以只要授权其中一个均可获得发货物流权限
const
canEditable
=
const
canEditable
=
permissions
[
PENDING_DELIVERY_ORDER
.
EDITABLE
.
id
]
||
permissions
[
DELIVERY_ORDER
.
EDITABLE
.
id
];
permissions
[
PENDING_DELIVERY_ORDER
.
EDITABLE
]
||
permissions
[
DELIVERY_ORDER
.
EDITABLE
];
const
[
companys
,
setCompanys
]
=
useState
([]);
const
[
companys
,
setCompanys
]
=
useState
([]);
const
[
LogisticsModalVisible
,
handleModalVisible
]
=
useState
(
false
);
const
[
LogisticsModalVisible
,
handleModalVisible
]
=
useState
(
false
);
const
[
skuList
,
setSkuList
]
=
useState
([]);
const
[
skuList
,
setSkuList
]
=
useState
([]);
...
...
src/pages/orderManage/queryOrder/index.jsx
View file @
bb31bde6
...
@@ -17,7 +17,7 @@ const { TabPane } = Tabs;
...
@@ -17,7 +17,7 @@ const { TabPane } = Tabs;
const
OrderList
=
props
=>
{
const
OrderList
=
props
=>
{
const
{
permissions
}
=
props
;
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
QUERY_ORDER
.
EDITABLE
.
id
];
const
canEditable
=
permissions
[
QUERY_ORDER
.
EDITABLE
];
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
detailModalRef
=
useRef
();
const
detailModalRef
=
useRef
();
...
...
src/pages/password/service.js
View file @
bb31bde6
...
@@ -5,7 +5,7 @@ const { api } = config;
...
@@ -5,7 +5,7 @@ const { api } = config;
// 商户后台密码修改-校验
// 商户后台密码修改-校验
export
async
function
passwordRule
(
params
)
{
export
async
function
passwordRule
(
params
)
{
const
data
=
await
request
.
post
(
'
/
user/ex/validate-password-rul
e
'
,
{
const
data
=
await
request
.
post
(
'
/
v2/user/password/validat
e
'
,
{
prefix
:
api
,
prefix
:
api
,
data
:
params
,
data
:
params
,
});
});
...
...
src/pages/systemManage/Account/UserInfo/index.jsx
View file @
bb31bde6
...
@@ -42,7 +42,10 @@ const AddUser = props => {
...
@@ -42,7 +42,10 @@ const AddUser = props => {
// 表单验证
// 表单验证
const
formRules
=
{
const
formRules
=
{
account
:
[{
required
:
true
,
message
:
'
请设置登录用户名
'
}],
account
:
[
{
required
:
true
,
message
:
'
请设置登录用户名
'
},
{
pattern
:
/^
[
a-zA-Z0-9@
\\
.
]{1,32}
$/g
,
message
:
'
用户名格式错误
'
},
],
name
:
[{
required
:
true
,
message
:
'
请输入姓名
'
}],
name
:
[{
required
:
true
,
message
:
'
请输入姓名
'
}],
password
:
[
password
:
[
{
required
:
true
,
message
:
'
请设置密码
'
},
{
required
:
true
,
message
:
'
请设置密码
'
},
...
@@ -85,6 +88,11 @@ const AddUser = props => {
...
@@ -85,6 +88,11 @@ const AddUser = props => {
setRoleList
(
content
);
setRoleList
(
content
);
};
};
// 获取当前选中的角色id
const
getSelectedRoleIds
=
()
=>
{
const
cacheIds
=
window
.
sessionStorage
.
getItem
(
'
_selectedRoleIds
'
);
return
cacheIds
?
JSON
.
parse
(
cacheIds
)
:
[];
};
// 获取账户详情
// 获取账户详情
const
getAccountDetail
=
res
=>
{
const
getAccountDetail
=
res
=>
{
setLoading
(
false
);
setLoading
(
false
);
...
@@ -94,7 +102,9 @@ const AddUser = props => {
...
@@ -94,7 +102,9 @@ const AddUser = props => {
}
}
console
.
log
(
res
);
console
.
log
(
res
);
setDetailInfo
(
res
.
data
);
setDetailInfo
(
res
.
data
);
const
{
account
,
name
,
roleId
,
organization
}
=
res
.
data
;
const
{
account
,
name
,
organization
}
=
res
.
data
;
const
roleId
=
getSelectedRoleIds
();
console
.
log
(
roleId
);
setFieldsValue
({
setFieldsValue
({
account
,
account
,
name
,
name
,
...
@@ -216,7 +226,7 @@ const AddUser = props => {
...
@@ -216,7 +226,7 @@ const AddUser = props => {
<
div
className=
{
style
[
'
user-info
'
]
}
>
<
div
className=
{
style
[
'
user-info
'
]
}
>
<
Spin
spinning=
{
loading
}
>
<
Spin
spinning=
{
loading
}
>
<
Form
className=
{
style
[
'
user-info--form
'
]
}
{
...
formLayout
}
>
<
Form
className=
{
style
[
'
user-info--form
'
]
}
{
...
formLayout
}
>
<
Form
.
Item
label=
"用户名"
extra=
"限3
5
字符以内,限英文/数字/“@”“ .”"
>
<
Form
.
Item
label=
"用户名"
extra=
"限3
2
字符以内,限英文/数字/“@”“ .”"
>
{
getFieldDecorator
(
'
account
'
,
rulesHandler
(
'
account
'
))(
{
getFieldDecorator
(
'
account
'
,
rulesHandler
(
'
account
'
))(
<
Input
disabled=
{
!!
id
}
placeholder=
"请输入用户名"
maxLength=
{
32
}
/>,
<
Input
disabled=
{
!!
id
}
placeholder=
"请输入用户名"
maxLength=
{
32
}
/>,
)
}
)
}
...
...
src/pages/systemManage/Account/components/UpdateStatusModal/index.jsx
View file @
bb31bde6
import
React
,
{
forwardRef
,
useImperativeHandle
,
useState
,
useRef
,
useEffect
}
from
'
react
'
;
import
React
,
{
forwardRef
,
useImperativeHandle
,
useState
,
useRef
,
useEffect
}
from
'
react
'
;
import
{
Modal
,
Select
,
notification
}
from
'
antd
'
;
import
{
Modal
,
Select
,
notification
}
from
'
antd
'
;
import
{
Form
}
from
'
@ant-design/compatible
'
;
import
{
Form
}
from
'
@ant-design/compatible
'
;
import
{
userEnabled
,
userDisabled
}
from
'
@/pages/systemManage/service
'
;
import
{
userEnabled
,
userDisabled
,
userDelete
}
from
'
@/pages/systemManage/service
'
;
const
FormComponent
=
props
=>
{
const
FormComponent
=
props
=>
{
const
{
record
=
{},
form
}
=
props
;
const
{
record
=
{},
form
}
=
props
;
...
@@ -26,10 +26,7 @@ const FormComponent = props => {
...
@@ -26,10 +26,7 @@ const FormComponent = props => {
<
Form
{
...
formLayout
}
>
<
Form
{
...
formLayout
}
>
<
Form
.
Item
label=
"用户名"
>
{
record
.
name
}
</
Form
.
Item
>
<
Form
.
Item
label=
"用户名"
>
{
record
.
name
}
</
Form
.
Item
>
<
Form
.
Item
label=
"状态"
>
<
Form
.
Item
label=
"状态"
>
{
getFieldDecorator
(
{
getFieldDecorator
(
'
status
'
,
rulesHandler
(
'
status
'
))(
'
status
'
,
rulesHandler
(
'
status
'
),
)(
<
Select
>
<
Select
>
<
Select
.
Option
value=
{
2
}
>
使用中
</
Select
.
Option
>
<
Select
.
Option
value=
{
2
}
>
使用中
</
Select
.
Option
>
<
Select
.
Option
value=
{
3
}
>
已禁用
</
Select
.
Option
>
<
Select
.
Option
value=
{
3
}
>
已禁用
</
Select
.
Option
>
...
@@ -80,7 +77,7 @@ const UpdateStatusModal = (props, ref) => {
...
@@ -80,7 +77,7 @@ const UpdateStatusModal = (props, ref) => {
}
}
const
apiName
=
{
const
apiName
=
{
//
1: userDelete,
1
:
userDelete
,
2
:
userEnabled
,
2
:
userEnabled
,
3
:
userDisabled
,
3
:
userDisabled
,
};
};
...
...
src/pages/systemManage/Account/data.js
View file @
bb31bde6
...
@@ -53,7 +53,13 @@ export const getColumns = props => {
...
@@ -53,7 +53,13 @@ export const getColumns = props => {
close
:
{
text
:
'
使用中
'
,
status
:
2
},
close
:
{
text
:
'
使用中
'
,
status
:
2
},
running
:
{
text
:
'
已禁用
'
,
status
:
3
},
running
:
{
text
:
'
已禁用
'
,
status
:
3
},
},
},
render
:
value
=>
value
.
name
,
render
:
value
=>
{
const
textMapping
=
{
2
:
'
已使用
'
,
3
:
'
已禁用
'
,
};
return
textMapping
[
value
.
value
]
||
'
-
'
;
},
},
},
{
{
title
:
'
操作
'
,
title
:
'
操作
'
,
...
...
src/pages/systemManage/Account/index.jsx
View file @
bb31bde6
...
@@ -27,14 +27,29 @@ const Account = props => {
...
@@ -27,14 +27,29 @@ const Account = props => {
const
resetPasswordModal
=
useRef
();
const
resetPasswordModal
=
useRef
();
// 权限控制-新增/修改
// 权限控制-新增/修改
const
canEditable
=
permissions
[
ACCOUNT_MANAGE
.
EDITABLE
.
id
];
const
canEditable
=
permissions
[
ACCOUNT_MANAGE
.
EDITABLE
];
// 获取当前用户组织信息
// 获取当前用户组织信息
const
userInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'
user
'
)
||
'
{}
'
);
const
userInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'
user
'
)
||
'
{}
'
);
// 临时缓存当前账户的角色id
const
setSelectedRoleIds
=
roleIds
=>
{
window
.
sessionStorage
.
setItem
(
'
_selectedRoleIds
'
,
JSON
.
stringify
(
roleIds
));
};
// 清空临时缓存的角色id
const
clearnSelectedRoleIds
=
()
=>
{
window
.
sessionStorage
.
removeItem
(
'
_selectedRoleIds
'
);
};
// 新增编辑
// 新增编辑
const
toUserInfo
=
({
id
}
=
{})
=>
{
const
toUserInfo
=
({
id
,
roles
=
[]
}
=
{})
=>
{
const
query
=
id
?
{
id
}
:
{};
const
query
=
id
?
{
id
}
:
{};
if
(
id
)
{
const
roleIds
=
roles
.
map
(
role
=>
role
.
id
);
setSelectedRoleIds
(
roleIds
);
}
history
.
push
({
history
.
push
({
pathname
:
'
/systemManage/account/userInfo
'
,
pathname
:
'
/systemManage/account/userInfo
'
,
query
,
query
,
...
@@ -107,6 +122,10 @@ const Account = props => {
...
@@ -107,6 +122,10 @@ const Account = props => {
collapseRender
:
()
=>
null
,
collapseRender
:
()
=>
null
,
};
};
useEffect
(()
=>
{
clearnSelectedRoleIds
();
},
[]);
return
(
return
(
<
PageHeaderWrapper
>
<
PageHeaderWrapper
>
<
ProTable
actionRef=
{
actionRef
}
formRef=
{
formRef
}
{
...
tableProps
}
search=
{
false
}
></
ProTable
>
<
ProTable
actionRef=
{
actionRef
}
formRef=
{
formRef
}
{
...
tableProps
}
search=
{
false
}
></
ProTable
>
...
...
src/pages/systemManage/Role/index.jsx
View file @
bb31bde6
...
@@ -17,7 +17,7 @@ const Role = props => {
...
@@ -17,7 +17,7 @@ const Role = props => {
const
history
=
useHistory
();
const
history
=
useHistory
();
// 权限控制
// 权限控制
const
canEditable
=
permissions
[
ROLE_MANAGE
.
EDITABLE
.
id
];
const
canEditable
=
permissions
[
ROLE_MANAGE
.
EDITABLE
];
const
toRoleInfo
=
({
id
=
null
}
=
{})
=>
{
const
toRoleInfo
=
({
id
=
null
}
=
{})
=>
{
const
query
=
id
?
{
id
}
:
{};
const
query
=
id
?
{
id
}
:
{};
...
...
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