diff --git a/.api/qual-filing-expert-delete-post/spec.json b/.api/qual-filing-expert-delete-post/spec.json new file mode 100644 index 0000000..3378692 --- /dev/null +++ b/.api/qual-filing-expert-delete-post/spec.json @@ -0,0 +1,44 @@ +{ + "openapi": "3.0.1", + "info": { "title": "删除审核专家", "version": "1.0.0" }, + "paths": { + "/qual-filing-expert/delete": { + "post": { + "summary": "删除审核专家", + "tags": ["审核专家管理"], + "parameters": [ + { + "name": "id", + "in": "query", + "description": "主键ID", + "required": true, + "schema": { "type": "integer" } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/SingleResponseVoid" } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SingleResponseVoid": { + "type": "object", + "properties": { + "success": { "type": "boolean" }, + "code": { "type": "string" }, + "message": { "type": "string" }, + "data": { "type": "null" } + } + } + } + } +} \ No newline at end of file diff --git a/.api/qual-filing-expert-delete-post/type.d.ts b/.api/qual-filing-expert-delete-post/type.d.ts new file mode 100644 index 0000000..73e7d7b --- /dev/null +++ b/.api/qual-filing-expert-delete-post/type.d.ts @@ -0,0 +1 @@ +/** POST /qual-filing-expert/delete — 删除审核专家(id 为 query 参数) */ \ No newline at end of file diff --git a/.api/qual-filing-expert-get-get/spec.json b/.api/qual-filing-expert-get-get/spec.json new file mode 100644 index 0000000..d0e6d5c --- /dev/null +++ b/.api/qual-filing-expert-get-get/spec.json @@ -0,0 +1,57 @@ +{ + "openapi": "3.0.1", + "info": { "title": "查询审核专家详情", "version": "1.0.0" }, + "paths": { + "/qual-filing-expert/get": { + "get": { + "summary": "查询审核专家详情", + "tags": ["审核专家管理"], + "parameters": [ + { + "name": "id", + "in": "query", + "description": "主键ID", + "required": true, + "schema": { "type": "integer" } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/SingleResponseQualFilingExpertCO" } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "QualFilingExpertCO": { + "type": "object", + "properties": { + "id": { "type": "integer", "format": "int64", "description": "主键ID(后端Long)" }, + "userName": { "type": "string", "description": "用户名称/姓名" }, + "account": { "type": "string", "description": "账号" }, + "genderCode": { "type": "integer", "description": "性别编码(1男2女)" }, + "genderName": { "type": "string", "description": "性别名称" }, + "idCardNo": { "type": "string", "description": "身份证号" }, + "certificate": { "type": "string", "description": "证书" }, + "tenantId": { "type": "integer", "format": "int64", "description": "租户ID" } + } + }, + "SingleResponseQualFilingExpertCO": { + "type": "object", + "properties": { + "success": { "type": "boolean" }, + "code": { "type": "string" }, + "message": { "type": "string" }, + "data": { "$ref": "#/components/schemas/QualFilingExpertCO" } + } + } + } + } +} \ No newline at end of file diff --git a/.api/qual-filing-expert-get-get/type.d.ts b/.api/qual-filing-expert-get-get/type.d.ts new file mode 100644 index 0000000..7261bd3 --- /dev/null +++ b/.api/qual-filing-expert-get-get/type.d.ts @@ -0,0 +1,12 @@ +/** GET /qual-filing-expert/get — 查询审核专家详情 */ + +interface QualFilingExpertCO { + id?: string; // 主键ID(后端Long) + userName?: string; // 用户名称/姓名 + account?: string; // 账号 + genderCode?: number; // 性别编码(1男2女) + genderName?: string; // 性别名称 + idCardNo?: string; // 身份证号 + certificate?: string; // 证书 + tenantId?: string; // 租户ID(后端Long) +} \ No newline at end of file diff --git a/.api/qual-filing-expert-modify-post/spec.json b/.api/qual-filing-expert-modify-post/spec.json new file mode 100644 index 0000000..f18d7a8 --- /dev/null +++ b/.api/qual-filing-expert-modify-post/spec.json @@ -0,0 +1,67 @@ +{ + "openapi": "3.0.1", + "info": { "title": "修改审核专家", "version": "1.0.0" }, + "paths": { + "/qual-filing-expert/modify": { + "post": { + "summary": "修改审核专家", + "tags": ["审核专家管理"], + "requestBody": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/QualFilingExpertModifyCmd" } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/SingleResponseQualFilingExpertCO" } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "QualFilingExpertModifyCmd": { + "type": "object", + "properties": { + "id": { "type": "integer", "format": "int64", "description": "主键ID(后端Long)" }, + "userName": { "type": "string", "description": "用户名称/姓名" }, + "account": { "type": "string", "description": "账号" }, + "genderCode": { "type": "integer", "description": "性别编码(1男2女)" }, + "genderName": { "type": "string", "description": "性别名称" }, + "idCardNo": { "type": "string", "description": "身份证号" }, + "certificate": { "type": "string", "description": "证书" } + } + }, + "QualFilingExpertCO": { + "type": "object", + "properties": { + "id": { "type": "integer", "format": "int64", "description": "主键ID(后端Long)" }, + "userName": { "type": "string", "description": "用户名称/姓名" }, + "account": { "type": "string", "description": "账号" }, + "genderCode": { "type": "integer", "description": "性别编码(1男2女)" }, + "genderName": { "type": "string", "description": "性别名称" }, + "idCardNo": { "type": "string", "description": "身份证号" }, + "certificate": { "type": "string", "description": "证书" }, + "tenantId": { "type": "integer", "format": "int64", "description": "租户ID" } + } + }, + "SingleResponseQualFilingExpertCO": { + "type": "object", + "properties": { + "success": { "type": "boolean" }, + "code": { "type": "string" }, + "message": { "type": "string" }, + "data": { "$ref": "#/components/schemas/QualFilingExpertCO" } + } + } + } + } +} \ No newline at end of file diff --git a/.api/qual-filing-expert-modify-post/type.d.ts b/.api/qual-filing-expert-modify-post/type.d.ts new file mode 100644 index 0000000..942705a --- /dev/null +++ b/.api/qual-filing-expert-modify-post/type.d.ts @@ -0,0 +1,22 @@ +/** POST /qual-filing-expert/modify — 修改审核专家 */ + +interface QualFilingExpertModifyCmd { + id?: string; // 主键ID(后端Long) + userName?: string; // 用户名称/姓名 + account?: string; // 账号 + genderCode?: number; // 性别编码(1男2女) + genderName?: string; // 性别名称 + idCardNo?: string; // 身份证号 + certificate?: string; // 证书 +} + +interface QualFilingExpertCO { + id?: string; // 主键ID(后端Long) + userName?: string; // 用户名称/姓名 + account?: string; // 账号 + genderCode?: number; // 性别编码(1男2女) + genderName?: string; // 性别名称 + idCardNo?: string; // 身份证号 + certificate?: string; // 证书 + tenantId?: string; // 租户ID(后端Long) +} \ No newline at end of file diff --git a/.api/qual-filing-expert-page-get/spec.json b/.api/qual-filing-expert-page-get/spec.json new file mode 100644 index 0000000..1678595 --- /dev/null +++ b/.api/qual-filing-expert-page-get/spec.json @@ -0,0 +1,58 @@ +{ + "openapi": "3.0.1", + "info": { "title": "分页查询审核专家", "version": "1.0.0" }, + "paths": { + "/qual-filing-expert/page": { + "get": { + "summary": "分页查询审核专家", + "tags": ["审核专家管理"], + "parameters": [ + { "name": "current", "in": "query", "description": "当前页(默认1)", "required": false, "schema": { "type": "integer", "format": "int64", "default": 1 } }, + { "name": "size", "in": "query", "description": "每页条数(默认10)", "required": false, "schema": { "type": "integer", "format": "int64", "default": 10 } }, + { "name": "orders", "in": "query", "description": "排序(格式: column:asc|desc, 多个用逗号分隔)", "required": false, "schema": { "type": "string" } }, + { "name": "userName", "in": "query", "description": "用户名称/姓名", "required": false, "schema": { "type": "string" } }, + { "name": "account", "in": "query", "description": "账号", "required": false, "schema": { "type": "string" } }, + { "name": "genderCode", "in": "query", "description": "性别编码(1男2女)", "required": false, "schema": { "type": "integer" } }, + { "name": "idCardNo", "in": "query", "description": "身份证号", "required": false, "schema": { "type": "string" } } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/PageResponseQualFilingExpertCO" } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "QualFilingExpertCO": { + "type": "object", + "properties": { + "id": { "type": "integer", "format": "int64", "description": "主键ID(后端Long)" }, + "userName": { "type": "string", "description": "用户名称/姓名" }, + "account": { "type": "string", "description": "账号" }, + "genderCode": { "type": "integer", "description": "性别编码(1男2女)" }, + "genderName": { "type": "string", "description": "性别名称" }, + "idCardNo": { "type": "string", "description": "身份证号" }, + "certificate": { "type": "string", "description": "证书" }, + "tenantId": { "type": "integer", "format": "int64", "description": "租户ID" } + } + }, + "PageResponseQualFilingExpertCO": { + "type": "object", + "properties": { + "success": { "type": "boolean", "description": "是否成功" }, + "code": { "type": "string", "description": "响应码" }, + "message": { "type": "string", "description": "响应消息" }, + "data": { "type": "array", "items": { "$ref": "#/components/schemas/QualFilingExpertCO" }, "description": "响应数据" }, + "total": { "type": "integer", "format": "int64", "description": "总条数" } + } + } + } + } +} \ No newline at end of file diff --git a/.api/qual-filing-expert-page-get/type.d.ts b/.api/qual-filing-expert-page-get/type.d.ts new file mode 100644 index 0000000..293a9f3 --- /dev/null +++ b/.api/qual-filing-expert-page-get/type.d.ts @@ -0,0 +1,20 @@ +/** GET /qual-filing-expert/page — 分页查询审核专家 */ + +interface QualFilingExpertCO { + id?: string; // 主键ID(后端Long) + userName?: string; // 用户名称/姓名 + account?: string; // 账号 + genderCode?: number; // 性别编码(1男2女) + genderName?: string; // 性别名称 + idCardNo?: string; // 身份证号 + certificate?: string; // 证书 + tenantId?: string; // 租户ID(后端Long) +} + +interface PageResponseQualFilingExpertCO { + success?: boolean; + code?: string; + message?: string; + data?: QualFilingExpertCO[]; + total?: number; +} \ No newline at end of file diff --git a/.api/qual-filing-expert-save-post/spec.json b/.api/qual-filing-expert-save-post/spec.json new file mode 100644 index 0000000..78fc5fa --- /dev/null +++ b/.api/qual-filing-expert-save-post/spec.json @@ -0,0 +1,66 @@ +{ + "openapi": "3.0.1", + "info": { "title": "新增审核专家", "version": "1.0.0" }, + "paths": { + "/qual-filing-expert/save": { + "post": { + "summary": "新增审核专家", + "tags": ["审核专家管理"], + "requestBody": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/QualFilingExpertAddCmd" } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/SingleResponseQualFilingExpertCO" } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "QualFilingExpertAddCmd": { + "type": "object", + "properties": { + "userName": { "type": "string", "description": "用户名称/姓名" }, + "account": { "type": "string", "description": "账号" }, + "genderCode": { "type": "integer", "description": "性别编码(1男2女)" }, + "genderName": { "type": "string", "description": "性别名称" }, + "idCardNo": { "type": "string", "description": "身份证号" }, + "certificate": { "type": "string", "description": "证书" } + } + }, + "QualFilingExpertCO": { + "type": "object", + "properties": { + "id": { "type": "integer", "format": "int64", "description": "主键ID(后端Long, 前端按字符串保证精度)" }, + "userName": { "type": "string", "description": "用户名称/姓名" }, + "account": { "type": "string", "description": "账号" }, + "genderCode": { "type": "integer", "description": "性别编码(1男2女)" }, + "genderName": { "type": "string", "description": "性别名称" }, + "idCardNo": { "type": "string", "description": "身份证号" }, + "certificate": { "type": "string", "description": "证书" }, + "tenantId": { "type": "integer", "format": "int64", "description": "租户ID" } + } + }, + "SingleResponseQualFilingExpertCO": { + "type": "object", + "properties": { + "success": { "type": "boolean", "description": "是否成功" }, + "code": { "type": "string", "description": "响应码" }, + "message": { "type": "string", "description": "响应消息" }, + "data": { "$ref": "#/components/schemas/QualFilingExpertCO", "description": "响应数据" } + } + } + } + } +} \ No newline at end of file diff --git a/.api/qual-filing-expert-save-post/type.d.ts b/.api/qual-filing-expert-save-post/type.d.ts new file mode 100644 index 0000000..c945ac7 --- /dev/null +++ b/.api/qual-filing-expert-save-post/type.d.ts @@ -0,0 +1,21 @@ +/** POST /qual-filing-expert/save — 新增审核专家 */ + +interface QualFilingExpertAddCmd { + userName?: string; // 用户名称/姓名 + account?: string; // 账号 + genderCode?: number; // 性别编码(1男2女) + genderName?: string; // 性别名称 + idCardNo?: string; // 身份证号 + certificate?: string; // 证书 +} + +interface QualFilingExpertCO { + id?: string; // 主键ID(后端Long) + userName?: string; // 用户名称/姓名 + account?: string; // 账号 + genderCode?: number; // 性别编码(1男2女) + genderName?: string; // 性别名称 + idCardNo?: string; // 身份证号 + certificate?: string; // 证书 + tenantId?: string; // 租户ID(后端Long) +} \ No newline at end of file diff --git a/jjb.config.js b/jjb.config.js index 5d423b9..2edd237 100644 --- a/jjb.config.js +++ b/jjb.config.js @@ -10,7 +10,7 @@ module.exports = { javaGitBranch: "", // 本地联调 safetyEval-service(context-path: /safetyEval,默认端口 8095) // 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095 - API_HOST: "http://192.168.0.204", + API_HOST: "http://192.168.0.134", }, production: { // 应用后端分支名称,部署上线需要 diff --git a/src/api/qualExpert/index.js b/src/api/qualExpert/index.js new file mode 100644 index 0000000..961434f --- /dev/null +++ b/src/api/qualExpert/index.js @@ -0,0 +1,33 @@ +import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; + +// 分页查询 +export const queryExpertPage = declareRequest( + "qualExpertLoading", + "Get > /safetyEval/qual-filing-expert/page", + "qualExpertList: [] | res.data || [] & qualExpertTotal: 0 | res.total || 0", +); + +// 新增 +export const saveExpert = declareRequest( + "qualExpertSubmitLoading", + "Post > @/safetyEval/qual-filing-expert/save", +); + +// 查询详情 +export const getExpertDetail = declareRequest( + "qualExpertDetailLoading", + "Get > /safetyEval/qual-filing-expert/get", + "qualExpertDetail: {} | res.data || {}", +); + +// 修改 +export const modifyExpert = declareRequest( + "qualExpertSubmitLoading", + "Post > @/safetyEval/qual-filing-expert/modify", +); + +// 删除 +export const deleteExpert = declareRequest( + "qualExpertSubmitLoading", + "Post > @/safetyEval/qual-filing-expert/delete", +); \ No newline at end of file diff --git a/src/api/qualFiling/index.js b/src/api/qualFiling/index.js index 6b239c6..978e039 100644 --- a/src/api/qualFiling/index.js +++ b/src/api/qualFiling/index.js @@ -345,3 +345,5 @@ export const submitQualFiling = declareRequest( "qualFilingSubmitLoading", "Post > @/safetyEval/qual-filing/aggregationSaveOrEdit", ); + + diff --git a/src/enumerate/constant/index.js b/src/enumerate/constant/index.js index 7e154a9..5f6e9ae 100644 --- a/src/enumerate/constant/index.js +++ b/src/enumerate/constant/index.js @@ -44,6 +44,12 @@ export const CHANGE_STATUS_MAP = { approved: { label: "已审核", color: "success" }, }; +/** 性别 */ +export const GENDER_OPTIONS = [ + { label: "男", value: 1 }, + { label: "女", value: 2 }, +]; + /** 专家等级 */ export const EXPERT_LEVEL_MAP = { 1: "一级", diff --git a/src/enumerate/namespace/index.js b/src/enumerate/namespace/index.js index 6b4ec24..3233af6 100644 --- a/src/enumerate/namespace/index.js +++ b/src/enumerate/namespace/index.js @@ -19,3 +19,4 @@ export const NS_STAFF_RESIGNATION_APPLY = defineNamespace("staffResignationApply export const NS_EQUIP_INFO = defineNamespace("equipInfo"); export const NS_QUAL_FILING = defineNamespace("qualFiling"); export const NS_QUAL_REVIEW = defineNamespace("qualReview"); +export const NS_QUAL_EXPERT = defineNamespace("qualExpert"); diff --git a/src/pages/Container/Supervision/ExperManage/index.js b/src/pages/Container/Supervision/ExperManage/index.js new file mode 100644 index 0000000..69bb453 --- /dev/null +++ b/src/pages/Container/Supervision/ExperManage/index.js @@ -0,0 +1,257 @@ +import React, { useEffect, useState } from "react"; +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"; +import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper"; +import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd"; +import { tools } from "@cqsjjb/jjb-common-lib"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { NS_QUAL_EXPERT } from "~/enumerate/namespace"; +import { GENDER_OPTIONS } from "~/enumerate/constant"; + +const { router } = tools; + +const ExperManage = (props) => { + const [searchForm] = Form.useForm(); + const [editForm] = Form.useForm(); + const [detailVisible, setDetailVisible] = useState(false); + const [editVisible, setEditVisible] = useState(false); + 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 getData = () => { + queryExpertPage({ + ...router.query, + current: router.query.current || 1, + size: router.query.size || 10, + }); + }; + + const handleReset = (values) => { + router.query = { + ...router.query, + ...values, + current: 1, + size: 10, + }; + getData(); + }; + + useEffect(() => { + searchForm.setFieldsValue(router.query); + getData(); + }, []); + + // ─── 查看详情 ─── + + const openDetail = async (id) => { + setDetailVisible(true); + await getExpertDetail({ id }); + }; + + // ─── 新增 / 编辑 ─── + + const openAdd = () => { + editForm.resetFields(); + setEditingId(null); + setEditVisible(true); + }; + + const openEdit = async (id) => { + setEditingId(id); + setEditVisible(true); + const res = await getExpertDetail({ id }); + if (res?.success !== false) { + editForm.setFieldsValue(res.data || qualExpertDetail); + } + }; + + const handleEditSubmit = async () => { + const values = await editForm.validateFields(); + setSubmiting(true); + const action = editingId ? modifyExpert : saveExpert; + const params = editingId ? { ...values, id: editingId } : values; + const res = await action(params); + setSubmiting(false); + if (res?.success !== false) { + message.success(editingId ? "修改成功" : "新增成功"); + setEditVisible(false); + getData(); + } + }; + + // ─── 删除 ─── + + const handleDelete = (record) => { + Modal.confirm({ + title: "确认删除", + content: `确认删除专家「${record.userName}」?此操作不可恢复。`, + okText: "确认删除", + okButtonProps: { danger: true }, + cancelText: "取消", + onOk: async () => { + const res = await deleteExpert({ id: record.id }); + if (res?.success !== false) { + message.success("删除成功"); + getData(); + } + }, + }); + }; + + // ─── 表格列 ─── + + const columns = [ + { + title: "序号", + width: 60, + fixed: "left", + render: (_, __, index) => index + 1, + }, + { title: "姓名", dataIndex: "userName", width: 100 }, + { title: "账号", dataIndex: "account", width: 140 }, + { + title: "性别", + dataIndex: "genderName", + width: 70, + render: (text) => text || "--", + }, + { title: "身份证号", dataIndex: "idCardNo", width: 180 }, + { title: "证书", dataIndex: "certificate", width: 120, ellipsis: true }, + { + title: "操作", + width: 180, + fixed: "right", + render: (_, record) => ( + + + + + + ), + }, + ]; + + return ( + 新增专家 + } + > + + + , + + + , + + + {GENDER_OPTIONS.map((item) => ( + {item.label} + ))} + + , + + + , + ]} + onReset={handleReset} + onFinish={(values) => { + router.query = { + ...router.query, + ...values, + current: 1, + size: 10, + }; + getData(); + }} + /> + + `共 ${total} 条`, + current: router.query.current || 1, + pageSize: router.query.size || 10, + onChange: (page, pageSize) => { + router.query = { ...router.query, current: page, size: pageSize }; + getData(); + }, + }} + /> + + {/* 查看详情弹窗 */} + setDetailVisible(false)} + footer={} + width={560} + > + + {qualExpertDetail?.userName || "--"} + {qualExpertDetail?.account || "--"} + {qualExpertDetail?.genderName || "--"} + {qualExpertDetail?.idCardNo || "--"} + {qualExpertDetail?.certificate || "--"} + + + + {/* 新增/编辑弹窗 */} + setEditVisible(false)} + onOk={handleEditSubmit} + confirmLoading={submiting} + width={520} + > +
+ + + + + + + + + + + + + + + + +
+ + ); +}; + +export default Connect([NS_QUAL_EXPERT], true)(AntdTableFuncControl(ExperManage)); \ No newline at end of file