From 2a737ef53f3c3a4d224fbddfae74ecb3e4e274b8 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Thu, 20 Aug 2026 11:23:54 +0800 Subject: [PATCH] feat --- src/api/safetyEvalBusiness/index.js | 5 +++ .../EvalProject/Create/index.js | 38 +++++++++++++++---- .../EvalProject/List/index.js | 17 +++++++-- .../ProjectFlow/SurveyContent.js | 24 ++++++++++-- 4 files changed, 69 insertions(+), 15 deletions(-) diff --git a/src/api/safetyEvalBusiness/index.js b/src/api/safetyEvalBusiness/index.js index 5b657e2..91e4093 100644 --- a/src/api/safetyEvalBusiness/index.js +++ b/src/api/safetyEvalBusiness/index.js @@ -76,6 +76,11 @@ export const evalProjectDetail = declareRequest( 'evalProjectDetailData: {} | res.data || {}', ); +export const evalProjectUpdate = declareRequest( + "evalProjectUpdateLoading", + "Post > @/safetyEval/institution/eval-project/update", +); + export const evalProjectDelete = declareRequest( "evalProjectDeleteLoading", "Post > @/safetyEval/institution/eval-project/delete", diff --git a/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js b/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js index 61f6441..426e3b4 100644 --- a/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js +++ b/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js @@ -40,10 +40,13 @@ const EvalProjectCreate = (props) => { const [detailLoading, setDetailLoading] = useState(false); const projectId = router.query?.id; - const isView = projectId; + // 编辑模式:仅可编辑项目参与人员,其余字段禁用 + const isEditParticipant = !!projectId && router.query?.edit === "participant"; + const isView = !!projectId && !isEditParticipant; const { evalProjectSaveLoading, + evalProjectUpdateLoading, evalProjectDetailLoading, customerPage: customerList, } = props.safetyEvalBusiness; @@ -112,12 +115,14 @@ const EvalProjectCreate = (props) => { : item.capacity, })), }; - if (isView) { + if (projectId) { params.id = projectId; } - const res = await props.evalProjectSave(params); + const res = isEditParticipant + ? await props.evalProjectUpdate(params) + : await props.evalProjectSave(params); if (res?.success) { - message.success(isView ? "修改成功" : "创建成功"); + message.success(isEditParticipant ? "编辑成功" : "创建成功"); props.history.goBack(); } }); @@ -130,7 +135,13 @@ const EvalProjectCreate = (props) => { return ( { ) } loading={detailLoading} > -
+ @@ -389,6 +409,7 @@ const EvalProjectCreate = (props) => { { setSelectedParticipants((prev) => prev.filter((r) => r.id !== item.id), diff --git a/src/pages/Container/SafetyEvalBusiness/EvalProject/List/index.js b/src/pages/Container/SafetyEvalBusiness/EvalProject/List/index.js index bae5855..aef6bc7 100644 --- a/src/pages/Container/SafetyEvalBusiness/EvalProject/List/index.js +++ b/src/pages/Container/SafetyEvalBusiness/EvalProject/List/index.js @@ -16,6 +16,7 @@ import { } from "@ant-design/icons"; import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout"; import SearchForm from "~/components/SearchForm"; +import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction"; import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper"; import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd"; import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace"; @@ -114,10 +115,10 @@ const EvalProject = (props) => { }, { title: "操作", - width: 160, + width: 200, fixed: "right", render: (_, record) => ( - + + - + ), }, ]; diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/SurveyContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/SurveyContent.js index 52b42d9..cb85323 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/SurveyContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/SurveyContent.js @@ -1,6 +1,6 @@ import React, { useState, useEffect } from "react"; import { Form, Button, Flex, Typography, Steps, Tag, Card, Table, message, Popover, Image, Checkbox } from "antd"; -import { CheckCircleFilled, DownloadOutlined, QuestionOutlined } from "@ant-design/icons"; +import { CheckCircleFilled, DownloadOutlined, QuestionOutlined, PictureOutlined } from "@ant-design/icons"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace"; import { tools } from "@cqsjjb/jjb-common-lib"; @@ -73,6 +73,24 @@ const NoticePanel = ({ readOnly }) => ( ); +/** 打卡时间后追加人脸照片图标:faceUrl 逗号分隔,第1张为签到、第2张为签退 */ +const renderTimeWithFace = (time, record, idx) => { + const url = record?.faceUrl?.split(",")[idx]; + if (!url) return time || "-"; + return ( + + {time} + } + title="人脸照片" + trigger="hover" + > + + + + ); +}; + const InspectionPanel = ({ dataSource = [], evalProjectDetailData = {}, readOnly }) => { const calcDuration = (signIn, signOut) => { if (!signIn || !signOut) return '-'; @@ -103,8 +121,8 @@ const InspectionPanel = ({ dataSource = [], evalProjectDetailData = {}, readOnly { title: "项目角色", dataIndex: "role", render: (v) => Array.isArray(v) ? v.map(item => ROLE_DEFINITIONS_MAP[item]).join('、') : v, ellipsis: true }, { title: "人脸识别", dataIndex: "faceState", render: (v) => {v === 1 ? "通过" : "未通过"} }, { title: "GPS定位", dataIndex: "gpsState", render: (v) => {v === 1 ? "正常" : "异常"} }, - { title: "签到时间", dataIndex: "singInTime" }, - { title: "签退时间", dataIndex: "signOutTime" }, + { title: "签到时间", dataIndex: "singInTime" , render: (time, record)=>{return renderTimeWithFace(time, record, 0);}}, + { title: "签退时间", dataIndex: "signOutTime" , render: (time, record)=>{return renderTimeWithFace(time, record, 1);}}, { title: "在场时长", render: (_, r) => calcDuration(r.singInTime, r.signOutTime) }, { title: "现场照片", dataIndex: "sceneUrl", render: (v) => {