|
@@ -49,12 +49,13 @@ function A2Table1({ editFu, upTaleFu, type }: Props) {
|
|
|
|
|
|
// 职能-项目经理-商务经理的 按钮过滤
|
|
// 职能-项目经理-商务经理的 按钮过滤
|
|
const jobBtnFlag = useCallback(
|
|
const jobBtnFlag = useCallback(
|
|
- (name: string) => {
|
|
|
|
|
|
+ (name: string, index: number) => {
|
|
let flag = true; // true 为 显示按钮
|
|
let flag = true; // true 为 显示按钮
|
|
|
|
|
|
if (type === "job") {
|
|
if (type === "job") {
|
|
if (name === "项目经理" || name === "商务经理") flag = false;
|
|
if (name === "项目经理" || name === "商务经理") flag = false;
|
|
- }
|
|
|
|
|
|
+ if (index === 2) flag = false;
|
|
|
|
+ } else if (index === 0) flag = false;
|
|
|
|
|
|
return flag;
|
|
return flag;
|
|
},
|
|
},
|
|
@@ -92,7 +93,7 @@ function A2Table1({ editFu, upTaleFu, type }: Props) {
|
|
title: "操作",
|
|
title: "操作",
|
|
render: (item: A2Tab1_1, _: any, index: number) => (
|
|
render: (item: A2Tab1_1, _: any, index: number) => (
|
|
<>
|
|
<>
|
|
- {index !== 0 && item.name !== "未分类" && jobBtnFlag(item.name) ? (
|
|
|
|
|
|
+ {item.name !== "未分类" && jobBtnFlag(item.name, index) ? (
|
|
<Button
|
|
<Button
|
|
size="small"
|
|
size="small"
|
|
type="text"
|
|
type="text"
|
|
@@ -102,9 +103,9 @@ function A2Table1({ editFu, upTaleFu, type }: Props) {
|
|
</Button>
|
|
</Button>
|
|
) : null}
|
|
) : null}
|
|
|
|
|
|
- {index < tableArr.length - (type === "job" ? 4 : 2) &&
|
|
|
|
|
|
+ {index < tableArr.length - 2 &&
|
|
item.name !== "未分类" &&
|
|
item.name !== "未分类" &&
|
|
- jobBtnFlag(item.name) ? (
|
|
|
|
|
|
+ jobBtnFlag(item.name, -1) ? (
|
|
<Button
|
|
<Button
|
|
size="small"
|
|
size="small"
|
|
type="text"
|
|
type="text"
|
|
@@ -118,9 +119,7 @@ function A2Table1({ editFu, upTaleFu, type }: Props) {
|
|
编辑
|
|
编辑
|
|
</Button>
|
|
</Button>
|
|
|
|
|
|
- {item.name !== "未分类" &&
|
|
|
|
- item.name !== "项目经理" &&
|
|
|
|
- item.name !== "商务经理" ? (
|
|
|
|
|
|
+ {item.name !== "未分类" && jobBtnFlag(item.name, -1) ? (
|
|
<Popconfirm
|
|
<Popconfirm
|
|
title="删除后无法恢复,是否删除?"
|
|
title="删除后无法恢复,是否删除?"
|
|
okText="删除"
|
|
okText="删除"
|
|
@@ -137,7 +136,7 @@ function A2Table1({ editFu, upTaleFu, type }: Props) {
|
|
),
|
|
),
|
|
},
|
|
},
|
|
];
|
|
];
|
|
- }, [delById, editFu, jobBtnFlag, sortFu, tableArr.length, type]);
|
|
|
|
|
|
+ }, [delById, editFu, jobBtnFlag, sortFu, tableArr.length]);
|
|
|
|
|
|
return (
|
|
return (
|
|
<div className={styles.A2Table1}>
|
|
<div className={styles.A2Table1}>
|