增加按钮权限
parent
b9e2c94a80
commit
9b6de27939
|
|
@ -1,7 +1,7 @@
|
|||
import ListPage from "~/pages/Container/Supervision/HiddenEvaluation/List";
|
||||
|
||||
function List(props) {
|
||||
return (<ListPage {...props} />);
|
||||
return (<ListPage evaluationBtn="qyd-fgsyhkp-eval" {...props} />);
|
||||
}
|
||||
|
||||
export default List;
|
||||
|
|
|
|||
|
|
@ -51,15 +51,17 @@ function List(props) {
|
|||
<Table
|
||||
toolBarRender={() => (
|
||||
<Space>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
{props.permission("gfd-kpzpz-add") && (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
)}
|
||||
columns={[
|
||||
|
|
@ -74,44 +76,52 @@ function List(props) {
|
|||
fixed: "right",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setViewModalOpen(true);
|
||||
setCurrentData(record);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setConfigModalOpen(true);
|
||||
setEvaluationType(1);
|
||||
setCurrentData(record);
|
||||
}}
|
||||
>
|
||||
安全类组分配
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setConfigModalOpen(true);
|
||||
setEvaluationType(2);
|
||||
setCurrentData(record);
|
||||
}}
|
||||
>
|
||||
环保类组分配
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setChangeLogModalOpen(true);
|
||||
setCurrentData(record);
|
||||
}}
|
||||
>
|
||||
变更记录
|
||||
</Button>
|
||||
{props.permission("gfd-kpzpz-info") && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setViewModalOpen(true);
|
||||
setCurrentData(record);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)}
|
||||
{props.permission("gfd-kpzpz-anquan") && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setConfigModalOpen(true);
|
||||
setEvaluationType(1);
|
||||
setCurrentData(record);
|
||||
}}
|
||||
>
|
||||
安全类组分配
|
||||
</Button>
|
||||
)}
|
||||
{props.permission("gfd-kpzpz-huanbao") && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setConfigModalOpen(true);
|
||||
setEvaluationType(2);
|
||||
setCurrentData(record);
|
||||
}}
|
||||
>
|
||||
环保类组分配
|
||||
</Button>
|
||||
)}
|
||||
{props.permission("gfd-kpzpz-record") && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setChangeLogModalOpen(true);
|
||||
setCurrentData(record);
|
||||
}}
|
||||
>
|
||||
变更记录
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -72,14 +72,16 @@ function List(props) {
|
|||
fixed: "right",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./hiddenList?corpinfoId=${record.corpinfoId}&evaluationType=${record.evaluationType}`);
|
||||
}}
|
||||
>
|
||||
考评
|
||||
</Button>
|
||||
{props.permission(props.evaluationBtn || "gfd-fgsyhkp-eval") && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./hiddenList?corpinfoId=${record.corpinfoId}&evaluationType=${record.evaluationType}`);
|
||||
}}
|
||||
>
|
||||
考评
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -55,13 +55,17 @@ function List(props) {
|
|||
return null;
|
||||
return {
|
||||
children: (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() =>
|
||||
props.history.push(`./userExchangeList?corpinfoId=${record.corpinfoId}`)}
|
||||
>
|
||||
{record.corpinfoName}
|
||||
</Button>
|
||||
props.permission("gfd-fgsjxkp-corp")
|
||||
? (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() =>
|
||||
props.history.push(`./userExchangeList?corpinfoId=${record.corpinfoId}`)}
|
||||
>
|
||||
{record.corpinfoName}
|
||||
</Button>
|
||||
)
|
||||
: <span>{record.corpinfoName}</span>
|
||||
),
|
||||
props: { rowSpan },
|
||||
};
|
||||
|
|
|
|||
|
|
@ -43,14 +43,16 @@ function List(props) {
|
|||
fixed: "right",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./userExchangeList?corpinfoId=${record.corpinfoId}`);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
{props.permission("gfd-rykpgl-info") && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./userExchangeList?corpinfoId=${record.corpinfoId}`);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, message, Modal, Space, Spin } from "antd";
|
||||
import { useState } from "react";
|
||||
|
|
@ -150,22 +151,53 @@ function UserExchangeList(props) {
|
|||
fixed: "right",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./userExchangeRecordList?userId=${record.userId}`);
|
||||
}}
|
||||
>
|
||||
兑换记录
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./hiddenEvaluationList?userId=${record.userId}`);
|
||||
}}
|
||||
>
|
||||
考评详情
|
||||
</Button>
|
||||
{
|
||||
props.entrance === "enterprise"
|
||||
? (
|
||||
<>
|
||||
{props.permission("qyd-rykpgl-exchange-info") && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./userExchangeRecordList?userId=${record.userId}`);
|
||||
}}
|
||||
>
|
||||
兑换记录
|
||||
</Button>
|
||||
)}
|
||||
{props.permission("qyd-rykpgl-eval-record") && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./hiddenEvaluationList?userId=${record.userId}`);
|
||||
}}
|
||||
>
|
||||
考评详情
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
: (
|
||||
<>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./userExchangeRecordList?userId=${record.userId}`);
|
||||
}}
|
||||
>
|
||||
兑换记录
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./hiddenEvaluationList?userId=${record.userId}`);
|
||||
}}
|
||||
>
|
||||
考评详情
|
||||
</Button>
|
||||
</>
|
||||
)
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -177,4 +209,4 @@ function UserExchangeList(props) {
|
|||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_PERSONNEL_EVALUATION, NS_HIDDEN_EVALUATION], true)(UserExchangeList);
|
||||
export default Connect([NS_PERSONNEL_EVALUATION, NS_HIDDEN_EVALUATION], true)(Permission(UserExchangeList));
|
||||
|
|
|
|||
Loading…
Reference in New Issue