Compare commits

..

No commits in common. "dev" and "master" have entirely different histories.
dev ... master

5 changed files with 6 additions and 121 deletions

View File

@ -23,13 +23,3 @@ export const evaluationTeamConfigChangeLog = declareRequest(
export const corpInfoList = declareRequest(
`Get > /basicInfo/corpInfo/listAll`,
);
// 获取隐患考评是否开启
export const getEvalClosedStatus = declareRequest(
"evaluationTeamConfigLoading",
`Get > /hiddenEvaluation/evaluationConfig/getEvalClosedStatus`,
);
// 隐患考评开关
export const toggleEvalClosed = declareRequest(
"evaluationTeamConfigLoading",
`Post > @/hiddenEvaluation/evaluationConfig/toggleEvalClosed`,
);

View File

@ -1,6 +1,6 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Descriptions, message, Modal, Space, Switch } from "antd";
import { Button, Descriptions, message, Modal, Space } from "antd";
import { useEffect, useState } from "react";
import FormBuilder from "zy-react-library/components/FormBuilder";
import AddIcon from "zy-react-library/components/Icon/AddIcon";
@ -33,30 +33,10 @@ function List(props) {
const [addModalOpen, setAddModalOpen] = useState(false);
const [viewModalOpen, setViewModalOpen] = useState(false);
const [changeLogModalOpen, setChangeLogModalOpen] = useState(false);
const [isEvaluationClosed, setIsEvaluationClosed] = useState("0");
const { tableProps, getData } = useTable(props["evaluationTeamConfigList"], {
form,
});
const getEvalClosedStatusFun = async () => {
const { data } = await props["getEvalClosedStatus"]();
setIsEvaluationClosed(data);
};
const onChange = async (checked) => {
const status = checked ? 1 : 0;
await props["toggleEvalClosed"]({ evaluationClosed: status });
setIsEvaluationClosed(status);
getEvalClosedStatusFun();
getData();
message.success("状态更新成功");
};
useEffect(() => {
getEvalClosedStatusFun();
}, []);
return (
<Page isShowAllAction={false}>
@ -71,20 +51,8 @@ function List(props) {
<Table
toolBarRender={() => (
<Space>
{
props.permission("gfd-kpzpz-switch")
&& (
<div>
</div>
)
}
<span>考评是否结束</span>
<Switch onChange={onChange} checked={isEvaluationClosed} />
{props.permission("gfd-kpzpz-add") && (
<Button
disabled={isEvaluationClosed}
type="primary"
icon={<AddIcon />}
onClick={() => {
@ -111,7 +79,6 @@ function List(props) {
{props.permission("gfd-kpzpz-info") && (
<Button
type="link"
disabled={record.evaluationClosed}
onClick={() => {
setViewModalOpen(true);
setCurrentData(record);
@ -123,7 +90,6 @@ function List(props) {
{props.permission("gfd-kpzpz-anquan") && (
<Button
type="link"
disabled={record.evaluationClosed}
onClick={() => {
setConfigModalOpen(true);
setEvaluationType(1);
@ -136,7 +102,6 @@ function List(props) {
{props.permission("gfd-kpzpz-huanbao") && (
<Button
type="link"
disabled={record.evaluationClosed}
onClick={() => {
setConfigModalOpen(true);
setEvaluationType(2);
@ -149,7 +114,6 @@ function List(props) {
{props.permission("gfd-kpzpz-record") && (
<Button
type="link"
disabled={record.evaluationClosed}
onClick={() => {
setChangeLogModalOpen(true);
setCurrentData(record);

View File

@ -75,7 +75,6 @@ function List(props) {
{props.permission(props.evaluationBtn || "gfd-fgsyhkp-eval") && (
<Button
type="link"
disabled={record.evaluationClosed}
onClick={() => {
props.history.push(`./hiddenList?corpinfoId=${record.corpinfoId}&evaluationType=${record.evaluationType}`);
}}

View File

@ -46,12 +46,11 @@ function List(props) {
{props.permission("gfd-rykpgl-info") && (
<Button
type="link"
disabled={record.evaluationClosed}
onClick={() => {
props.history.push(`./userExchangeList?corpinfoId=${record.corpinfoId}`);
}}
>
兑换
查看
</Button>
)}
</Space>

View File

@ -11,8 +11,6 @@ import Table from "zy-react-library/components/Table";
import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils";
import { EVALUATION_TYPE_ENUM } from "~/enumerate/constant";
import { NS_HIDDEN_EVALUATION, NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
function UserExchangeList(props) {
@ -84,26 +82,6 @@ function UserExchangeList(props) {
},
});
};
const getRowSpan = (data, index, dataIndex) => {
if (!data || data.length === 0)
return 1;
const currentRow = data[index];
if (!currentRow)
return 1;
if (index === 0 || currentRow[dataIndex] !== data[index - 1]?.[dataIndex]) {
let rowSpan = 1;
for (let i = index + 1; i < data.length; i++) {
if (data[i]?.[dataIndex] === currentRow[dataIndex]) {
rowSpan++;
}
else {
break;
}
}
return rowSpan;
}
return 0;
};
return (
<Page headerTitle="人员考评情况" isShowAllAction={props.isShowAllAction ?? true}>
@ -163,55 +141,10 @@ function UserExchangeList(props) {
)
)}
columns={[
{ title: "用户名", dataIndex: "userName", render: (_, record, index) => {
const rowSpan = getRowSpan(tableProps.dataSource || [], index, "userName");
if (!record)
return null;
return {
children: (
<span>{record.userName}</span>
),
props: { rowSpan },
};
} },
{ title: "姓名", dataIndex: "name", render: (_, record, index) => {
const rowSpan = getRowSpan(tableProps.dataSource || [], index, "name");
if (!record)
return null;
return {
children: (
<span>{record.name}</span>
),
props: { rowSpan },
};
} },
{ title: "部门", dataIndex: "departmentName", render: (_, record, index) => {
const rowSpan = getRowSpan(tableProps.dataSource || [], index, "departmentName");
if (!record)
return null;
return {
children: (
<span>{record.departmentName}</span>
),
props: { rowSpan },
};
} },
{ title: "岗位", dataIndex: "postName", render: (_, record, index) => {
const rowSpan = getRowSpan(tableProps.dataSource || [], index, "postName");
if (!record)
return null;
return {
children: (
<span>{record.postName}</span>
),
props: { rowSpan },
};
} },
{
title: "隐患考评组类型",
dataIndex: "evaluationType",
render: (_, record) => getLabelName({ list: EVALUATION_TYPE_ENUM, status: record.evaluationType }),
},
{ title: "用户名", dataIndex: "userName" },
{ title: "姓名", dataIndex: "name" },
{ title: "部门", dataIndex: "departmentName" },
{ title: "岗位", dataIndex: "postName" },
{ title: "奖励总得分", dataIndex: "totalScore" },
{ title: "已兑换分数", dataIndex: "exchangedScore" },
{ title: "未兑换奖励数", dataIndex: "notExchangedScore" },