feature/2.15.1.2407.01-权限

This commit is contained in:
黎永顺 2024-09-26 17:56:41 +08:00
parent 666ec8f9be
commit f1183af3e2
2 changed files with 17 additions and 3 deletions

View File

@ -100,6 +100,10 @@ export const hasIconInTax = (params) => {
};
/**权限-角色相关*/
//同步业务线
export const syncAuth = (params) => {
return postFetch("/api/bs/hrmsalary/auth/sync", params);
};
//角色列表
export const getRoleList = (params) => {
return postFetch("/api/bs/hrmsalary/auth/role/list", params);

View File

@ -39,6 +39,16 @@ class Index extends Component {
this.getRoleList();
}
syncAuth = () => {
API.syncAuth().then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(111, "操作成功!"));
this.getRoleList();
} else {
message.error(errormsg);
}
});
};
getRoleList = () => {
const { taxAgentStore: { advanceForm } } = this.props, { pageInfo } = this.state;
const paylaod = {
@ -141,10 +151,11 @@ class Index extends Component {
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
content: getLabel(545781, "操作日志")
}];
const buttons = [
let buttons = [
<Button type="primary" onClick={() => this.setState({
addRoleDialog: { taxAgentId: "", visible: true }
})}>{getLabel(111, "新建")}</Button>,
<Button type="ghost" onClick={this.syncAuth}>{getLabel(111, "同步")}</Button>,
<Button type="ghost" disabled={_.isEmpty(selectedRowKeys)}
onClick={() => this.deleteAuthRole(selectedRowKeys)}>{getLabel(111, "批量删除")}</Button>,
<AdvanceInputBtn onOpenAdvanceSearch={() => this.setState({ showSearchAd: true })}
@ -167,8 +178,7 @@ class Index extends Component {
const rowSelection = {
selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
};
!admin && buttons.shift();
!admin && buttons.shift();
!admin && (buttons = buttons.slice(-1));
return (
<WeaTop title={getLabel(111, "业务线管理")} icon={<i className="icon-coms-Flow-setting"/>} iconBgcolor="#F14A2D"
buttons={buttons} className="rolemanagement-index" showDropIcon dropMenuDatas={dropMenuDatas}