Merge branch 'feature/业务线管理' into release/2.19.1.2503.01-业务线个税
This commit is contained in:
commit
5812022207
|
|
@ -24,9 +24,7 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
const [pageInfo, setPageInfo] = useState<Partial<PaginationData>>({});
|
const [pageInfo, setPageInfo] = useState<Partial<PaginationData>>({});
|
||||||
const [i18n, setI18n] = useState<any>({});
|
const [i18n, setI18n] = useState<any>({});
|
||||||
const [runStatuses, setRunStatuses] = useState<string>("");
|
const [runStatuses, setRunStatuses] = useState<string>("");
|
||||||
const [showOperateBtn, setShowOperateBtn] = useState<boolean>(false);
|
|
||||||
const [showDelSalaryFileBtn, setShowDelSalaryFileBtn] = useState<boolean>(false);//待定薪、停薪员工 是否允许删除薪资档案
|
const [showDelSalaryFileBtn, setShowDelSalaryFileBtn] = useState<boolean>(false);//待定薪、停薪员工 是否允许删除薪资档案
|
||||||
const [DCChiefPermission, setDCChiefPermission] = useState<undefined>(undefined);//二开权限(大成)
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.parent.postMessage({ type: "init" }, "*");
|
window.parent.postMessage({ type: "init" }, "*");
|
||||||
|
|
@ -40,10 +38,8 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
const data: any = exceptStr(event.data);
|
const data: any = exceptStr(event.data);
|
||||||
if (!_.isEmpty(data)) {
|
if (!_.isEmpty(data)) {
|
||||||
const {
|
const {
|
||||||
columns, dataSource, pageInfo, selectedRowKeys: rowKeys = [], i18n: i18nRes = {},
|
columns, dataSource, pageInfo, selectedRowKeys: rowKeys = [], i18n: i18nRes = {}, selectedKey, showDelSalaryFileBtn
|
||||||
selectedKey, showOperateBtn, showDelSalaryFileBtn, DCChiefPermission
|
|
||||||
} = data;
|
} = data;
|
||||||
setShowOperateBtn(showOperateBtn);
|
|
||||||
setRunStatuses(selectedKey);
|
setRunStatuses(selectedKey);
|
||||||
setI18n(i18nRes);
|
setI18n(i18nRes);
|
||||||
setPageInfo(pageInfo);
|
setPageInfo(pageInfo);
|
||||||
|
|
@ -51,7 +47,6 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
setSelectedRowKeys([...rowKeys, ...selectedRowKeys]);
|
setSelectedRowKeys([...rowKeys, ...selectedRowKeys]);
|
||||||
setColumns(columns);
|
setColumns(columns);
|
||||||
setShowDelSalaryFileBtn(showDelSalaryFileBtn);
|
setShowDelSalaryFileBtn(showDelSalaryFileBtn);
|
||||||
setDCChiefPermission(DCChiefPermission);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onChange = (current: number, pageSize: number) => {
|
const onChange = (current: number, pageSize: number) => {
|
||||||
|
|
@ -113,19 +108,30 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
!showDelSalaryFileBtn && (items = _.dropRight(items));
|
!showDelSalaryFileBtn && (items = _.dropRight(items));
|
||||||
return (<Space>
|
return (
|
||||||
{
|
record?.opts.includes("admin") ?
|
||||||
(_.isNil(DCChiefPermission) || DCChiefPermission) ?
|
<Space>
|
||||||
<Button type="link"
|
<Button type="link"
|
||||||
onClick={() => handleSalaryFileOperate("EDIT", record)}>{i18n["编辑"]}</Button> :
|
onClick={() => handleSalaryFileOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
||||||
<Button type="link" onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
<Button type="link"
|
||||||
}
|
onClick={() => handleSalaryFileOperate("ADD-TO-SALARYPAYMENT", record, [record?.id])}>{i18n["设为发薪人员"]}</Button>
|
||||||
<Button type="link"
|
<Dropdown menu={{ items }} placement="bottomRight">
|
||||||
onClick={() => handleSalaryFileOperate("ADD-TO-SALARYPAYMENT", record, [record?.id])}>{i18n["设为发薪人员"]}</Button>
|
<Button type="link" icon={<MoreOutlined/>}/>
|
||||||
<Dropdown menu={{ items }} placement="bottomRight">
|
</Dropdown>
|
||||||
<Button type="link" icon={<MoreOutlined/>}/>
|
</Space> : <Space>
|
||||||
</Dropdown>
|
<Button type="link"
|
||||||
</Space>);
|
onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
||||||
|
<Dropdown menu={{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
key: "Log", label: i18n["操作日志"], onClick: () => handleSalaryFileOperate("log", record)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}} placement="bottomRight">
|
||||||
|
<Button type="link" icon={<MoreOutlined/>}/>
|
||||||
|
</Dropdown>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
@ -142,18 +148,27 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<Space>
|
record?.opts.includes("admin") ?
|
||||||
{
|
<Space>
|
||||||
(((_.isNil(DCChiefPermission) || DCChiefPermission) && runStatuses === "fixed") || runStatuses === "ext") ?
|
<Button type="link"
|
||||||
<Button type="link"
|
onClick={() => handleSalaryFileOperate("CHANGE-SALARY", record)}>{i18n["调薪"]}</Button>
|
||||||
onClick={() => handleSalaryFileOperate("CHANGE-SALARY", record)}>{i18n["调薪"]}</Button> :
|
<Dropdown menu={{ items }} placement="bottomRight">
|
||||||
<Button type="link"
|
<Button type="link" icon={<MoreOutlined/>}/>
|
||||||
onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
</Dropdown>
|
||||||
}
|
</Space> :
|
||||||
<Dropdown menu={{ items }} placement="bottomRight">
|
<Space>
|
||||||
<Button type="link" icon={<MoreOutlined/>}/>
|
<Button type="link"
|
||||||
</Dropdown>
|
onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
||||||
</Space>
|
<Dropdown menu={{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
key: "Log", label: i18n["操作日志"], onClick: () => handleSalaryFileOperate("log", record)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}} placement="bottomRight">
|
||||||
|
<Button type="link" icon={<MoreOutlined/>}/>
|
||||||
|
</Dropdown>
|
||||||
|
</Space>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -174,14 +189,30 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
onClick: () => handleSalaryFileOperate("log", record)
|
onClick: () => handleSalaryFileOperate("log", record)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
return (<Space>
|
return (
|
||||||
<Button type="link" onClick={() => handleSalaryFileOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
record?.opts.includes("admin") ?
|
||||||
<Button type="link"
|
<Space>
|
||||||
onClick={() => handleSalaryFileOperate("SALARY-SUSPENSION", record, [record?.id])}>{i18n["停薪"]}</Button>
|
<Button type="link" onClick={() => handleSalaryFileOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
||||||
<Dropdown menu={{ items: downsizingItems }} placement="bottomRight">
|
<Button type="link"
|
||||||
<Button type="link" icon={<MoreOutlined/>}/>
|
onClick={() => handleSalaryFileOperate("SALARY-SUSPENSION", record, [record?.id])}>{i18n["停薪"]}</Button>
|
||||||
</Dropdown>
|
<Dropdown menu={{ items: downsizingItems }} placement="bottomRight">
|
||||||
</Space>);
|
<Button type="link" icon={<MoreOutlined/>}/>
|
||||||
|
</Dropdown>
|
||||||
|
</Space> :
|
||||||
|
<Space>
|
||||||
|
<Button type="link"
|
||||||
|
onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
||||||
|
<Dropdown menu={{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
key: "Log", label: i18n["操作日志"], onClick: () => handleSalaryFileOperate("log", record)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}} placement="bottomRight">
|
||||||
|
<Button type="link" icon={<MoreOutlined/>}/>
|
||||||
|
</Dropdown>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
@ -190,54 +221,56 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
...opts,
|
...opts,
|
||||||
render: (__: any, record: any) => {
|
render: (__: any, record: any) => {
|
||||||
let stopItems: MenuProps["items"] = [
|
let stopItems: MenuProps["items"] = [
|
||||||
{
|
|
||||||
key: "Log",
|
|
||||||
label: i18n["操作日志"],
|
|
||||||
onClick: () => handleSalaryFileOperate("log", record)
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
key: "CancelSuspension",
|
key: "CancelSuspension",
|
||||||
label: i18n["删除档案"],
|
label: i18n["删除档案"],
|
||||||
onClick: () => handleSalaryFileOperate("DEL-SALARY-FILES", record, [record?.id])
|
onClick: () => handleSalaryFileOperate("DEL-SALARY-FILES", record, [record?.id])
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "Log",
|
||||||
|
label: i18n["操作日志"],
|
||||||
|
onClick: () => handleSalaryFileOperate("log", record)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
!showDelSalaryFileBtn && (stopItems = _.dropRight(stopItems));
|
!showDelSalaryFileBtn && (stopItems = _.dropRight(stopItems));
|
||||||
return (<Space>
|
return (
|
||||||
<Button type="link" onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
record?.opts.includes("admin") ?
|
||||||
<Button type="link"
|
<Space>
|
||||||
onClick={() => handleSalaryFileOperate("CANCEL-SALARY-SUSPENSION", record, [record?.id])}>{i18n["取消停薪"]}</Button>
|
<Button type="link" onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
||||||
{
|
<Button type="link"
|
||||||
!_.isEmpty(stopItems) &&
|
onClick={() => handleSalaryFileOperate("CANCEL-SALARY-SUSPENSION", record, [record?.id])}>{i18n["取消停薪"]}</Button>
|
||||||
<Dropdown menu={{ items: stopItems }} placement="bottomRight">
|
{
|
||||||
<Button type="link" icon={<MoreOutlined/>}/>
|
!_.isEmpty(stopItems) &&
|
||||||
</Dropdown>
|
<Dropdown menu={{ items: stopItems }} placement="bottomRight">
|
||||||
}
|
<Button type="link" icon={<MoreOutlined/>}/>
|
||||||
</Space>);
|
</Dropdown>
|
||||||
|
}
|
||||||
|
</Space> :
|
||||||
|
<Space>
|
||||||
|
<Button type="link"
|
||||||
|
onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
||||||
|
<Dropdown menu={{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
key: "Log", label: i18n["操作日志"], onClick: () => handleSalaryFileOperate("log", record)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}} placement="bottomRight">
|
||||||
|
<Button type="link" icon={<MoreOutlined/>}/>
|
||||||
|
</Dropdown>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return showOperateBtn ? [..._.filter(columns, o => o.dataIndex !== "operate"), opts] :
|
return [..._.filter(columns, o => o.dataIndex !== "operate"), opts];
|
||||||
[..._.filter(columns, o => o.dataIndex !== "operate"), {
|
|
||||||
...opts,
|
|
||||||
render: (__: any, record: any) => (
|
|
||||||
<Space>
|
|
||||||
{
|
|
||||||
(DCChiefPermission && (runStatuses === "pending" || runStatuses === "fixed")) ?
|
|
||||||
<Button type="link"
|
|
||||||
onClick={() => handleSalaryFileOperate(runStatuses === "fixed" ? "CHANGE-SALARY" : "EDIT", record)}>{runStatuses === "fixed" ? i18n["调薪"] : i18n["编辑"]}</Button> :
|
|
||||||
<Button type="link" onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
|
||||||
}
|
|
||||||
<Button type="link" onClick={() => handleSalaryFileOperate("log", record)}>{i18n["操作日志"]}</Button>
|
|
||||||
</Space>
|
|
||||||
)
|
|
||||||
}];
|
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}, [columns, runStatuses, i18n, showOperateBtn, showDelSalaryFileBtn, DCChiefPermission]);
|
}, [columns, runStatuses, i18n, showDelSalaryFileBtn]);
|
||||||
return (<Table
|
return (<Table
|
||||||
rowKey="id" size="small" className={styles.tableWrapper}
|
rowKey="id" size="small" className={styles.tableWrapper}
|
||||||
columns={cols} dataSource={dataSource} rowSelection={rowSelection}
|
columns={cols} dataSource={dataSource} rowSelection={rowSelection}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export function renderCols(initialState: any[], type: string, i18n?: AnyObject,
|
||||||
render: (text: string, record: any) => {
|
render: (text: string, record: any) => {
|
||||||
const { billStatus } = record;
|
const { billStatus } = record;
|
||||||
return (
|
return (
|
||||||
<Button type="link" onClick={() => postMessageToParent(billStatus === "0" && extraParams?.permission ? "CALC" : "VIEW", record)}>
|
<Button type="link" onClick={() => postMessageToParent(billStatus === "0" && record?.opts.includes("admin") ? "CALC" : "VIEW", record)}>
|
||||||
{text}
|
{text}
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|
@ -84,7 +84,7 @@ export function renderCols(initialState: any[], type: string, i18n?: AnyObject,
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<Space>
|
<Space>
|
||||||
{!extraParams?.permission ? (
|
{!record?.opts.includes("admin") ? (
|
||||||
<Space>
|
<Space>
|
||||||
<Button type="link" onClick={() => postMessageToParent("VIEW", record)}>
|
<Button type="link" onClick={() => postMessageToParent("VIEW", record)}>
|
||||||
{i18n?.["查看"]}
|
{i18n?.["查看"]}
|
||||||
|
|
@ -359,12 +359,20 @@ export function renderCols(initialState: any[], type: string, i18n?: AnyObject,
|
||||||
render: (__: string, record: any) => {
|
render: (__: string, record: any) => {
|
||||||
return (
|
return (
|
||||||
<Space>
|
<Space>
|
||||||
<Button type="link" onClick={() => postMessageToParent("EDIT", record)}>
|
{record?.opts.includes("admin") ? (
|
||||||
{i18n?.["编辑"]}
|
<Space>
|
||||||
</Button>
|
<Button type="link" onClick={() => postMessageToParent("EDIT", record)}>
|
||||||
<Button type="link" onClick={() => postMessageToParent("DEL", record)}>
|
{i18n?.["编辑"]}
|
||||||
{i18n?.["删除"]}
|
</Button>
|
||||||
</Button>
|
<Button type="link" onClick={() => postMessageToParent("DEL", record)}>
|
||||||
|
{i18n?.["删除"]}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
) : (
|
||||||
|
<Button type="link" onClick={() => postMessageToParent("VIEW", record)}>
|
||||||
|
{i18n?.["查看"]}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</Space>
|
</Space>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -404,13 +412,15 @@ export function renderCols(initialState: any[], type: string, i18n?: AnyObject,
|
||||||
onClick: () => postMessageToParent("log", record)
|
onClick: () => postMessageToParent("log", record)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
isSpecial && items.shift();
|
(isSpecial || !record?.opts.includes("admin")) && items.shift();
|
||||||
return (
|
return (
|
||||||
<Space>
|
<Space>
|
||||||
<Button type="link" onClick={() => postMessageToParent("EDIT", record)}>
|
{record?.opts.includes("admin") && (
|
||||||
{i18n?.["编辑"]}
|
<Button type="link" onClick={() => postMessageToParent("EDIT", record)}>
|
||||||
</Button>
|
{i18n?.["编辑"]}
|
||||||
{isSpecial ? (
|
</Button>
|
||||||
|
)}
|
||||||
|
{isSpecial && record?.opts.includes("admin") ? (
|
||||||
<Button type="link" onClick={() => postMessageToParent("DEL", record)}>
|
<Button type="link" onClick={() => postMessageToParent("DEL", record)}>
|
||||||
{i18n?.["删除"]}
|
{i18n?.["删除"]}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
const [pageInfo, setPageInfo] = useState<Partial<PaginationData>>({});
|
const [pageInfo, setPageInfo] = useState<Partial<PaginationData>>({});
|
||||||
const [i18n, setI18n] = useState<any>({});
|
const [i18n, setI18n] = useState<any>({});
|
||||||
const [runStatuses, setRunStatuses] = useState<string>("");
|
const [runStatuses, setRunStatuses] = useState<string>("");
|
||||||
const [showOperateBtn, setShowOperateBtn] = useState<boolean>(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.parent.postMessage({ type: "init" }, "*");
|
window.parent.postMessage({ type: "init" }, "*");
|
||||||
|
|
@ -38,11 +37,7 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
const receiveMessageFromIndex = (event: any) => {
|
const receiveMessageFromIndex = (event: any) => {
|
||||||
const data: any = exceptStr(event.data);
|
const data: any = exceptStr(event.data);
|
||||||
if (!_.isEmpty(data)) {
|
if (!_.isEmpty(data)) {
|
||||||
const {
|
const { columns, dataSource, pageInfo, selectedRowKeys: rowKeys = [], i18n: i18nRes = {}, runStatuses } = data;
|
||||||
columns, dataSource, pageInfo, selectedRowKeys: rowKeys = [], i18n: i18nRes = {},
|
|
||||||
runStatuses, showOperateBtn
|
|
||||||
} = data;
|
|
||||||
setShowOperateBtn(showOperateBtn);
|
|
||||||
setRunStatuses(runStatuses);
|
setRunStatuses(runStatuses);
|
||||||
setI18n(i18nRes);
|
setI18n(i18nRes);
|
||||||
setPageInfo(pageInfo);
|
setPageInfo(pageInfo);
|
||||||
|
|
@ -87,6 +82,14 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
};
|
};
|
||||||
const cols: any = useMemo(() => {
|
const cols: any = useMemo(() => {
|
||||||
let opts: any = { title: i18n["操作"], dataIndex: "operate", fixed: "right", width: 185 };
|
let opts: any = { title: i18n["操作"], dataIndex: "operate", fixed: "right", width: 185 };
|
||||||
|
const UnAuthOpts = (record: any) => (<Space>
|
||||||
|
<Button type="link" onClick={() => handleWelfareOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
||||||
|
<Dropdown menu={{
|
||||||
|
items: [{ key: "Log", label: i18n["操作日志"], onClick: () => handleWelfareOperate("log", record) }]
|
||||||
|
}} placement="bottomRight">
|
||||||
|
<Button type="link" icon={<MoreOutlined/>}/>
|
||||||
|
</Dropdown>
|
||||||
|
</Space>);
|
||||||
switch (runStatuses) {
|
switch (runStatuses) {
|
||||||
case "1":
|
case "1":
|
||||||
opts = {
|
opts = {
|
||||||
|
|
@ -109,13 +112,13 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
onClick: () => handleWelfareOperate("log", record)
|
onClick: () => handleWelfareOperate("log", record)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
return (<Space>
|
return (record?.opts.includes("admin") ? <Space>
|
||||||
<Button type="link" onClick={() => handleWelfareOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
<Button type="link" onClick={() => handleWelfareOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
||||||
<Button type="link" onClick={() => handleWelfareOperate("ADD-TO-PAY", record)}>{i18n["增员"]}</Button>
|
<Button type="link" onClick={() => handleWelfareOperate("ADD-TO-PAY", record)}>{i18n["增员"]}</Button>
|
||||||
<Dropdown menu={{ items }} placement="bottomRight">
|
<Dropdown menu={{ items }} placement="bottomRight">
|
||||||
<Button type="link" icon={<MoreOutlined/>}/>
|
<Button type="link" icon={<MoreOutlined/>}/>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</Space>);
|
</Space> : UnAuthOpts(record));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
@ -131,13 +134,12 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
onClick: () => handleWelfareOperate("log", record)
|
onClick: () => handleWelfareOperate("log", record)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
return (
|
return (record?.opts.includes("admin") ? <Space>
|
||||||
<Space>
|
<Button type="link" onClick={() => handleWelfareOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
||||||
<Button type="link" onClick={() => handleWelfareOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
<Dropdown menu={{ items }} placement="bottomRight">
|
||||||
<Dropdown menu={{ items }} placement="bottomRight">
|
<Button type="link" icon={<MoreOutlined/>}/>
|
||||||
<Button type="link" icon={<MoreOutlined/>}/>
|
</Dropdown>
|
||||||
</Dropdown>
|
</Space> : UnAuthOpts(record));
|
||||||
</Space>);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
@ -157,14 +159,14 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
onClick: () => handleWelfareOperate("log", record)
|
onClick: () => handleWelfareOperate("log", record)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
return (<Space>
|
return (record?.opts.includes("admin") ? <Space>
|
||||||
<Button type="link" onClick={() => handleWelfareOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
<Button type="link" onClick={() => handleWelfareOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
||||||
<Button type="link"
|
<Button type="link"
|
||||||
onClick={() => handleWelfareOperate("STAY-DEL-TO-STOP", record)}>{i18n["减员"]}</Button>
|
onClick={() => handleWelfareOperate("STAY-DEL-TO-STOP", record)}>{i18n["减员"]}</Button>
|
||||||
<Dropdown menu={{ items: downsizingItems }} placement="bottomRight">
|
<Dropdown menu={{ items: downsizingItems }} placement="bottomRight">
|
||||||
<Button type="link" icon={<MoreOutlined/>}/>
|
<Button type="link" icon={<MoreOutlined/>}/>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</Space>);
|
</Space> : UnAuthOpts(record));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
@ -184,38 +186,27 @@ const Index: FunctionComponent<Props> = (props) => {
|
||||||
onClick: () => handleWelfareOperate("log", record)
|
onClick: () => handleWelfareOperate("log", record)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
return (<Space>
|
return (record?.opts.includes("admin") ? <Space>
|
||||||
<Button type="link" onClick={() => handleWelfareOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
<Button type="link" onClick={() => handleWelfareOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
||||||
<Button type="link"
|
<Button type="link"
|
||||||
onClick={() => handleWelfareOperate("DEL-ARCHIVE", record)}>{i18n["删除档案"]}</Button>
|
onClick={() => handleWelfareOperate("DEL-ARCHIVE", record)}>{i18n["删除档案"]}</Button>
|
||||||
<Dropdown menu={{ items: stopItems }} placement="bottomRight">
|
<Dropdown menu={{ items: stopItems }} placement="bottomRight">
|
||||||
<Button type="link" icon={<MoreOutlined/>}/>
|
<Button type="link" icon={<MoreOutlined/>}/>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</Space>);
|
</Space> : UnAuthOpts(record));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return showOperateBtn ? [...columns, opts] : [...columns, {
|
return [...columns, opts];
|
||||||
...opts,
|
}, [columns, runStatuses, i18n]);
|
||||||
render: (__: any, record: any) => (
|
|
||||||
<Space>
|
|
||||||
<Button type="link" onClick={() => handleWelfareOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
|
||||||
<Button type="link" onClick={() => handleWelfareOperate("log", record)}>{i18n["操作日志"]}</Button>
|
|
||||||
</Space>
|
|
||||||
)
|
|
||||||
}];
|
|
||||||
}, [columns, runStatuses, i18n, showOperateBtn]);
|
|
||||||
return (<Table
|
return (<Table
|
||||||
rowKey="baseInfo" size="small" className={styles.tableWrapper}
|
rowKey="baseInfoId" size="small" className={styles.tableWrapper}
|
||||||
columns={cols} dataSource={dataSource} rowSelection={rowSelection}
|
columns={cols} dataSource={dataSource} rowSelection={rowSelection}
|
||||||
scroll={{ x: 1200, y: `calc(100vh - 103px)` }}
|
scroll={{ x: 1200, y: `calc(100vh - 103px)` }}
|
||||||
pagination={{
|
pagination={{ ...paginationAction(pageInfo, i18n, onChange), size: "default" }}
|
||||||
...paginationAction(pageInfo, i18n, onChange),
|
|
||||||
size: "default"
|
|
||||||
}}
|
|
||||||
/>);
|
/>);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue