From 7342b7643d7d6a5cb2c78eb0297f5efe7cc2b113 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Tue, 7 Jul 2026 17:45:27 +0800 Subject: [PATCH] feat --- src/api/regulatorOrgInfo/index.js | 10 +- .../Supervision/BasicInfo/OrgAccount/index.js | 21 +-- .../Supervision/ExperManage/index.js | 145 ++++++++++++++---- src/pages/Container/index.less | 1 + 4 files changed, 131 insertions(+), 46 deletions(-) diff --git a/src/api/regulatorOrgInfo/index.js b/src/api/regulatorOrgInfo/index.js index 590a5f7..c421f8d 100644 --- a/src/api/regulatorOrgInfo/index.js +++ b/src/api/regulatorOrgInfo/index.js @@ -39,17 +39,17 @@ export const orgAccountModify = declareRequest("orgInfoLoading", safeAction(asyn return fromSingleResponse(res, toOrgInfoForm); })); -export const orgAccountDelete = declareRequest("orgInfoLoading", safeAction(async ({ id }) => { - return apiPostDelete("/safetyEval/org-info/delete", id, NO_ORG_CONTEXT); +export const orgAccountDelete = declareRequest("orgInfoLoading", safeAction(async (data) => { + return apiPost("/safetyEval/org-info/delete", data, {}, NO_ORG_CONTEXT); })); export const orgAccountUpdateState = declareRequest("orgInfoLoading", safeAction(async ({ id, state }) => { return apiPost("/safetyEval/org-info/update-state", { id, state }, {}, NO_ORG_CONTEXT); })); -export const orgAccountResetPassword = declareRequest("orgInfoLoading", safeAction(async ({ id }) => { - const url = `/safetyEval/org-info/reset-password?id=${encodeURIComponent(id)}`; - return apiPost(url, {}, {}, NO_ORG_CONTEXT); +export const orgAccountResetPassword = declareRequest("orgInfoLoading", safeAction(async (data ) => { + const url = `/safetyEval/org-info/reset-password`; + return apiPost(url, data, {}, NO_ORG_CONTEXT); })); export const registeredOrgList = declareRequest("orgInfoLoading", safePageResult(async (params) => { diff --git a/src/pages/Container/Supervision/BasicInfo/OrgAccount/index.js b/src/pages/Container/Supervision/BasicInfo/OrgAccount/index.js index 28bde9d..146c71b 100644 --- a/src/pages/Container/Supervision/BasicInfo/OrgAccount/index.js +++ b/src/pages/Container/Supervision/BasicInfo/OrgAccount/index.js @@ -85,14 +85,13 @@ function OrgAccountPage(props) { message.success("操作成功"); await getData(); } - else { - message.error(res?.message || "操作失败"); - } + }, }); }; const onResetPassword = (record) => { + console.log(record); Modal.confirm({ title: "重置密码", content: ( @@ -108,13 +107,11 @@ function OrgAccountPage(props) { okText: "确认重置", cancelText: "取消", onOk: async () => { - const res = await props.orgAccountResetPassword({ id: record.id }); + const res = await props.orgAccountResetPassword({ data: record.id }); if (res?.success !== false) { message.success("密码已重置"); } - else { - message.error(res?.message || "重置失败"); - } + }, }); }; @@ -136,14 +133,12 @@ function OrgAccountPage(props) { okButtonProps: { danger: true }, cancelText: "取消", onOk: async () => { - const res = await props.orgAccountDelete({ id: record.id }); + const res = await props.orgAccountDelete({ data: record.id }); if (res?.success !== false) { message.success("删除成功"); await getData(); } - else { - message.error(res?.message || "删除失败"); - } + }, }); }; @@ -165,9 +160,7 @@ function OrgAccountPage(props) { editForm.resetFields(); await getData(); } - else { - message.error(res?.message || "保存失败"); - } + }; const columns = [ diff --git a/src/pages/Container/Supervision/ExperManage/index.js b/src/pages/Container/Supervision/ExperManage/index.js index 33b499b..846dee1 100644 --- a/src/pages/Container/Supervision/ExperManage/index.js +++ b/src/pages/Container/Supervision/ExperManage/index.js @@ -1,5 +1,14 @@ import React, { useEffect, useState } from "react"; -import { Button, Descriptions, Form, Input, message, Modal, Select, Table } from "antd"; +import { + Button, + Descriptions, + Form, + Input, + message, + Modal, + Select, + Table, +} from "antd"; import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction"; import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout"; import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm"; @@ -9,6 +18,7 @@ import { tools } from "@cqsjjb/jjb-common-lib"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { NS_QUAL_EXPERT } from "~/enumerate/namespace"; import { GENDER_OPTIONS, GENDER_MAP } from "~/enumerate/constant"; +import AttachmentUpload from "~/components/AttachmentUpload"; const { router } = tools; @@ -20,8 +30,21 @@ const ExperManage = (props) => { const [editingId, setEditingId] = useState(null); const [submiting, setSubmiting] = useState(false); - const { qualExpert, queryExpertPage, getExpertDetail, saveExpert, modifyExpert, deleteExpert } = props; - const { qualExpertList, qualExpertTotal, qualExpertLoading, qualExpertDetail, qualExpertDetailLoading } = qualExpert || {}; + const { + qualExpert, + queryExpertPage, + getExpertDetail, + saveExpert, + modifyExpert, + deleteExpert, + } = props; + const { + qualExpertList, + qualExpertTotal, + qualExpertLoading, + qualExpertDetail, + qualExpertDetailLoading, + } = qualExpert || {}; const getData = () => { queryExpertPage({ @@ -66,7 +89,11 @@ const ExperManage = (props) => { setEditVisible(true); const res = await getExpertDetail({ id }); if (res?.success !== false) { - editForm.setFieldsValue(res.data || qualExpertDetail); + const params = res.data; + if (params.certificate) { + params.certificate = JSON.parse(params.certificate); + } + editForm.setFieldsValue(params); } }; @@ -75,6 +102,9 @@ const ExperManage = (props) => { setSubmiting(true); const action = editingId ? modifyExpert : saveExpert; const params = editingId ? { ...values, id: editingId } : values; + if (values.certificate) { + params.certificate = JSON.stringify(values.certificate); + } const res = await action(params); setSubmiting(false); if (res?.success !== false) { @@ -94,7 +124,7 @@ const ExperManage = (props) => { okButtonProps: { danger: true }, cancelText: "取消", onOk: async () => { - const res = await deleteExpert({ id: record.id }); + const res = await deleteExpert({ data: record.id }); if (res?.success !== false) { message.success("删除成功"); getData(); @@ -121,16 +151,31 @@ const ExperManage = (props) => { render: (code) => GENDER_MAP[code] || "--", }, { title: "身份证号", dataIndex: "idCardNo", width: 180 }, - { title: "证书", dataIndex: "certificate", width: 120, ellipsis: true }, + { title: "操作", width: 180, fixed: "right", render: (_, record) => ( - - - + + + ), }, @@ -140,7 +185,9 @@ const ExperManage = (props) => { 新增专家 + } > { loading={qualExpertLoading} formLine={[ - + , - + , { style={{ width: "100%" }} > {GENDER_OPTIONS.map((item) => ( - {item.label} + + {item.label} + ))} , - + , ]} onReset={handleReset} @@ -210,12 +271,31 @@ const ExperManage = (props) => { footer={} width={560} > - - {qualExpertDetail?.userName || "--"} - {qualExpertDetail?.account || "--"} - {GENDER_MAP[qualExpertDetail?.genderCode] || "--"} - {qualExpertDetail?.idCardNo || "--"} - {qualExpertDetail?.certificate || "--"} + + + {qualExpertDetail?.userName || "--"} + + + {qualExpertDetail?.account || "--"} + + + {GENDER_MAP[qualExpertDetail?.genderCode] || "--"} + + + {qualExpertDetail?.idCardNo || "--"} + + + {(qualExpertDetail?.certificate? JSON.parse(qualExpertDetail?.certificate): [])?.map((item) => ( + + {item.name} + + ))} + @@ -229,29 +309,40 @@ const ExperManage = (props) => { width={520} >
- + - + - - - +
); }; -export default Connect([NS_QUAL_EXPERT], true)(AntdTableFuncControl(ExperManage)); \ No newline at end of file +export default Connect( + [NS_QUAL_EXPERT], + true, +)(AntdTableFuncControl(ExperManage)); diff --git a/src/pages/Container/index.less b/src/pages/Container/index.less index 9c445de..4600d2f 100644 --- a/src/pages/Container/index.less +++ b/src/pages/Container/index.less @@ -7,6 +7,7 @@ .micro-temp-modal-body { max-height: 630px; overflow-y: auto; + overflow-x: hidden; scrollbar-width: thin; } body {