From d0a498d51d17be2238793d5ce68f60d75e581663 Mon Sep 17 00:00:00 2001 From: "853931625@qq.com" Date: Sat, 13 Jun 2026 15:22:43 +0800 Subject: [PATCH] =?UTF-8?q?6.5=E9=9C=80=E6=B1=82=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/evaluationTeamConfig/index.js | 10 +++ .../EvaluationTeamConfig/List/index.js | 38 +++++++++- .../HiddenEvaluation/List/index.js | 1 + .../PersonnelEvaluation/List/index.js | 3 +- .../UserExchangeList/index.js | 75 ++++++++++++++++++- 5 files changed, 121 insertions(+), 6 deletions(-) diff --git a/src/api/evaluationTeamConfig/index.js b/src/api/evaluationTeamConfig/index.js index d98276d..9c6c974 100644 --- a/src/api/evaluationTeamConfig/index.js +++ b/src/api/evaluationTeamConfig/index.js @@ -23,3 +23,13 @@ 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`, +); diff --git a/src/pages/Container/Supervision/EvaluationTeamConfig/List/index.js b/src/pages/Container/Supervision/EvaluationTeamConfig/List/index.js index 96032a7..40342e5 100644 --- a/src/pages/Container/Supervision/EvaluationTeamConfig/List/index.js +++ b/src/pages/Container/Supervision/EvaluationTeamConfig/List/index.js @@ -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 } from "antd"; +import { Button, Descriptions, message, Modal, Space, Switch } 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,10 +33,30 @@ 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 ( @@ -51,8 +71,20 @@ function List(props) { ( + { + props.permission("gfd-kpzpz-switch") + && ( +
+ +
+ ) + + } + 考评是否结束 + {props.permission("gfd-kpzpz-add") && ( )}
diff --git a/src/pages/Container/Supervision/PersonnelEvaluation/UserExchangeList/index.js b/src/pages/Container/Supervision/PersonnelEvaluation/UserExchangeList/index.js index 9dee22f..df02220 100644 --- a/src/pages/Container/Supervision/PersonnelEvaluation/UserExchangeList/index.js +++ b/src/pages/Container/Supervision/PersonnelEvaluation/UserExchangeList/index.js @@ -11,6 +11,8 @@ 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) { @@ -82,6 +84,26 @@ 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 ( @@ -141,10 +163,55 @@ function UserExchangeList(props) { ) )} columns={[ - { title: "用户名", dataIndex: "userName" }, - { title: "姓名", dataIndex: "name" }, - { title: "部门", dataIndex: "departmentName" }, - { title: "岗位", dataIndex: "postName" }, + { title: "用户名", dataIndex: "userName", render: (_, record, index) => { + const rowSpan = getRowSpan(tableProps.dataSource || [], index, "userName"); + if (!record) + return null; + return { + children: ( + {record.userName} + ), + props: { rowSpan }, + }; + } }, + { title: "姓名", dataIndex: "name", render: (_, record, index) => { + const rowSpan = getRowSpan(tableProps.dataSource || [], index, "name"); + if (!record) + return null; + return { + children: ( + {record.name} + ), + props: { rowSpan }, + }; + } }, + { title: "部门", dataIndex: "departmentName", render: (_, record, index) => { + const rowSpan = getRowSpan(tableProps.dataSource || [], index, "departmentName"); + if (!record) + return null; + return { + children: ( + {record.departmentName} + ), + props: { rowSpan }, + }; + } }, + { title: "岗位", dataIndex: "postName", render: (_, record, index) => { + const rowSpan = getRowSpan(tableProps.dataSource || [], index, "postName"); + if (!record) + return null; + return { + children: ( + {record.postName} + ), + props: { rowSpan }, + }; + } }, + { + title: "隐患考评组类型", + dataIndex: "evaluationType", + render: (_, record) => getLabelName({ list: EVALUATION_TYPE_ENUM, status: record.evaluationType }), + }, { title: "奖励总得分", dataIndex: "totalScore" }, { title: "已兑换分数", dataIndex: "exchangedScore" }, { title: "未兑换奖励数", dataIndex: "notExchangedScore" },