From d8af77fa145cfcc62b48c4bd957167dd1294d317 Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Thu, 12 Mar 2026 10:33:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E8=BF=9D=E8=A7=84=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E3=80=81=E8=BD=A6=E8=BE=86=E9=BB=91=E5=90=8D=E5=8D=95?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/api/vehicleBlacklist/index.js | 8 +- src/api/vehiclesViolation/index.js | 10 +-- .../VehicleBlacklist/List/index.js | 88 ++++++++++++------ .../VehiclesViolation/List/index.js | 90 +++++++++++++------ .../ViolationRecords/index.js | 48 +++++----- .../RelatedVehicles/index.js | 9 +- 7 files changed, 165 insertions(+), 90 deletions(-) diff --git a/package.json b/package.json index d408f41..7c9e2a4 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-signature-canvas": "^1.1.0-alpha.2", - "zy-react-library": "^1.2.4" + "zy-react-library": "^1.2.5" }, "devDependencies": { "@antfu/eslint-config": "^5.4.1", diff --git a/src/api/vehicleBlacklist/index.js b/src/api/vehicleBlacklist/index.js index 24496bd..2abeb24 100644 --- a/src/api/vehicleBlacklist/index.js +++ b/src/api/vehicleBlacklist/index.js @@ -2,17 +2,17 @@ import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; export const vehicleBlacklistList = declareRequest( "vehicleBlacklistLoading", - `Post > @/primeport/`, + `Post > @/primeport/vehicleBlack/list`, ); export const vehicleBlacklistAdd = declareRequest( "vehicleBlacklistLoading", - `Post > @/primeport/`, + `Post > @/primeport/vehicleBlack/save`, ); export const vehicleBlacklistDelete = declareRequest( "vehicleBlacklistLoading", - `Post > @/primeport/`, + `Delete > @/primeport/vehicleBlack/{id}`, ); export const vehicleBlacklistInfo = declareRequest( "vehicleBlacklistLoading", - `Post > @/primeport/`, + `Get > /primeport/vehicleBlack/{id}`, ); diff --git a/src/api/vehiclesViolation/index.js b/src/api/vehiclesViolation/index.js index 4d48c68..2101135 100644 --- a/src/api/vehiclesViolation/index.js +++ b/src/api/vehiclesViolation/index.js @@ -2,21 +2,21 @@ import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; export const vehiclesViolationList = declareRequest( "vehiclesViolationLoading", - `Post > @/primeport/`, + `Post > @/primeport/vehicleViolations/list`, ); export const vehiclesViolationAdd = declareRequest( "vehiclesViolationLoading", - `Post > @/primeport/`, + `Post > @/primeport/vehicleViolations/save`, ); export const vehiclesViolationViolationRecordsList = declareRequest( "vehiclesViolationLoading", - `Post > @/primeport/`, + `Post > @/primeport/vehicleViolations/detailsRecordList`, ); export const vehiclesViolationViolationRecordsDelete = declareRequest( "vehiclesViolationLoading", - `Post > @/primeport/`, + `Delete > @/primeport/vehicleViolations/{id}`, ); export const vehiclesViolationViolationRecordsInfo = declareRequest( "vehiclesViolationLoading", - `Post > @/primeport/`, + `Get > /primeport/vehicleViolations/{id}`, ); diff --git a/src/pages/Container/Supervision/FirstLevelDoor/ImportAndExportPortInfo/VehiclesViolation/VehicleBlacklist/List/index.js b/src/pages/Container/Supervision/FirstLevelDoor/ImportAndExportPortInfo/VehiclesViolation/VehicleBlacklist/List/index.js index cdf19ea..4cf147e 100644 --- a/src/pages/Container/Supervision/FirstLevelDoor/ImportAndExportPortInfo/VehiclesViolation/VehicleBlacklist/List/index.js +++ b/src/pages/Container/Supervision/FirstLevelDoor/ImportAndExportPortInfo/VehiclesViolation/VehicleBlacklist/List/index.js @@ -1,6 +1,6 @@ import useUrlState from "@ahooksjs/use-url-state"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; -import { Button, Descriptions, Form, message, Modal, Space, Tabs } from "antd"; +import { Button, Descriptions, message, Modal, Space, Tabs } from "antd"; import { useEffect, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; import AddIcon from "zy-react-library/components/Icon/AddIcon"; @@ -10,6 +10,8 @@ import Search from "zy-react-library/components/Search"; import DictionarySelect from "zy-react-library/components/Select/Dictionary"; import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj"; import Table from "zy-react-library/components/Table"; +import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; +import useGetFile from "zy-react-library/hooks/useGetFile"; import useTable from "zy-react-library/hooks/useTable"; import { LICENSE_PLATE_NUMBER } from "zy-react-library/regular"; import { NS_VEHICLE_BLACKLIST } from "~/enumerate/namespace"; @@ -25,7 +27,7 @@ function List(props) { const [viewModalVisible, setViewModalVisible] = useState(false); const [currentId, setCurrentId] = useState(""); - const [form] = Form.useForm(); + const [form] = Search.useForm(); const [urlState, setUrlState] = useUrlState({ platform: props.platform || TABS_ENUM[0].key, }, { @@ -39,7 +41,7 @@ function List(props) { const onDelete = (record) => { Modal.confirm({ title: "移除确认", - content: `确定要将车牌号 ${record.todo1} 从黑名单中移除吗?`, + content: `确定要将车牌号 ${record.licenceNo} 从黑名单中移除吗?`, onOk: async () => { const { success } = await props["vehicleBlacklistDelete"]({ id: record.id }); if (success) { @@ -55,13 +57,13 @@ function List(props) { ), }, - { name: "todo3", label: "车辆所属人" }, - { name: "todo4", label: "车牌号" }, - { name: "todo5", label: "车辆类型", render: () }, + { name: "employeeVehicleUserName", label: "车辆所属人" }, + { name: "licenceNo", label: "车牌号" }, + { name: "vehicleType", label: "车辆类型", render: () }, ]} form={form} onFinish={getData} @@ -74,7 +76,7 @@ function List(props) { items={TABS_ENUM} onChange={(event) => { setUrlState({ platform: event }); - form.setFieldValue("todo2", ""); + form.setFieldValue("vehicleDepartmentId", ""); getData(); }} /> @@ -92,12 +94,12 @@ function List(props) { )} columns={[ - { title: "车辆所属单位", dataIndex: "todo1" }, - { title: "车辆所属部门", dataIndex: "todo2" }, - { title: "车辆归属人", dataIndex: "todo3" }, - { title: "车牌号", dataIndex: "todo4" }, - { title: "车牌类型", dataIndex: "todo5" }, - { title: "车辆类型", dataIndex: "todo6" }, + { title: "车辆所属单位", dataIndex: "vehicleCorpName" }, + { title: "车辆所属部门", dataIndex: "vehicleDepartmentName" }, + { title: "车辆归属人", dataIndex: "employeeVehicleUserName" }, + { title: "车牌号", dataIndex: "licenceNo" }, + { title: "车牌类型", dataIndex: "licenceTypeName" }, + { title: "车辆类型", dataIndex: "vehicleTypeName" }, { title: "操作", width: 120, @@ -153,7 +155,7 @@ function List(props) { } const AddModalComponent = (props) => { - const [form] = Form.useForm(); + const [form] = FormBuilder.useForm(); const onSubmit = async (values) => { const { success } = await props["vehicleBlacklistAdd"]({ ...values }); @@ -182,9 +184,29 @@ const AddModalComponent = (props) => { labelCol={{ span: 8 }} onFinish={onSubmit} options={[ - { name: "todo2", label: "车牌号", rules: [{ pattern: LICENSE_PLATE_NUMBER, message: "请输入正确的车牌号" }] }, - { name: "todo1", label: "车牌类型", render: () }, - { name: "todo3", label: "车辆类型", render: () }, + { name: "licenceNo", label: "车牌号", rules: [{ pattern: LICENSE_PLATE_NUMBER, message: "请输入正确的车牌号" }] }, + { + name: "licenceType", + label: "车牌类型", + render: ( + form.setFieldValue("licenceTypeName", label)} + /> + ), + }, + { name: "licenceTypeName", label: "车牌类型名称", onlyForLabel: true }, + { + name: "vehicleType", + label: "车辆类型", + render: ( + form.setFieldValue("vehicleTypeName", label)} + /> + ), + }, + { name: "vehicleTypeName", label: "车辆类型名称", onlyForLabel: true }, ]} /> @@ -194,9 +216,17 @@ const AddModalComponent = (props) => { const ViewModalComponent = (props) => { const [info, setInfo] = useState({}); + const { loading: getFileLoading, getFile } = useGetFile(); + const getData = async () => { const { data } = await props["vehicleBlacklistInfo"]({ id: props.id }); - setInfo(data); + const drivingLicenseFile = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[601], eqForeignKey: data.drivingLicenseId }); + const attachmentFile = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[602], eqForeignKey: data.attachmentId }); + setInfo({ + ...data, + drivingLicenseFile, + attachmentFile, + }); }; useEffect(() => { @@ -213,22 +243,22 @@ const ViewModalComponent = (props) => { footer={[ , ]} - loading={props.vehicleBlacklist.vehicleBlacklistLoading} + loading={props.vehicleBlacklist.vehicleBlacklistLoading || getFileLoading} > ) }, - { label: "行驶证照片", children: () }, + { label: "车辆所属企业", children: info.vehicleCorpName }, + { label: "车辆所属部门", children: info.vehicleDepartmentName }, + { label: "车辆所属人", children: info.employeeVehicleUserName }, + { label: "车牌号", children: info.licenceNo }, + { label: "车牌类型", children: info.licenceTypeName }, + { label: "车辆类型", children: info.vehicleTypeName }, + { label: "访问港区范围", children: JSON.parse(info.gateLevelAuthArea)?.area?.map(item => item.value)?.join("、") }, + { label: "车辆照片", children: () }, + { label: "行驶证照片", children: () }, ]} /> diff --git a/src/pages/Container/Supervision/FirstLevelDoor/ImportAndExportPortInfo/VehiclesViolation/VehiclesViolation/List/index.js b/src/pages/Container/Supervision/FirstLevelDoor/ImportAndExportPortInfo/VehiclesViolation/VehiclesViolation/List/index.js index b430428..3578a0b 100644 --- a/src/pages/Container/Supervision/FirstLevelDoor/ImportAndExportPortInfo/VehiclesViolation/VehiclesViolation/List/index.js +++ b/src/pages/Container/Supervision/FirstLevelDoor/ImportAndExportPortInfo/VehiclesViolation/VehiclesViolation/List/index.js @@ -1,6 +1,6 @@ import useUrlState from "@ahooksjs/use-url-state"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; -import { Button, Form, message, Modal, Tabs } from "antd"; +import { Button, message, Modal, Tabs } from "antd"; import { useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; import AddIcon from "zy-react-library/components/Icon/AddIcon"; @@ -11,7 +11,9 @@ import DepartmentSelectTree from "zy-react-library/components/SelectTree/Departm import Table from "zy-react-library/components/Table"; import Upload from "zy-react-library/components/Upload"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; import useTable from "zy-react-library/hooks/useTable"; +import useUploadFile from "zy-react-library/hooks/useUploadFile"; import { LICENSE_PLATE_NUMBER } from "zy-react-library/regular"; import { NS_VEHICLES_VIOLATION } from "~/enumerate/namespace"; @@ -24,7 +26,7 @@ const TABS_ENUM = [ function List(props) { const [addModalVisible, setAddModalVisible] = useState(false); - const [form] = Form.useForm(); + const [form] = Search.useForm(); const [urlState, setUrlState] = useUrlState({ platform: props.platform || TABS_ENUM[0].key, }, { @@ -40,13 +42,13 @@ function List(props) { ), }, - { name: "todo3", label: "车辆所属人" }, - { name: "todo4", label: "车牌号" }, - { name: "todo5", label: "车辆类型", render: () }, + { name: "employeeVehicleUserName", label: "车辆所属人" }, + { name: "licenceNo", label: "车牌号" }, + { name: "vehicleType", label: "车辆类型", render: () }, ]} form={form} onFinish={getData} @@ -59,7 +61,7 @@ function List(props) { items={TABS_ENUM} onChange={(event) => { setUrlState({ platform: event }); - form.setFieldValue("todo2", ""); + form.setFieldValue("vehicleDepartmentId", ""); getData(); }} /> @@ -77,13 +79,13 @@ function List(props) { )} columns={[ - { title: "车辆所属单位", dataIndex: "todo1" }, - { title: "车辆所属部门", dataIndex: "todo2" }, - { title: "车辆归属人", dataIndex: "todo3" }, - { title: "车牌号", dataIndex: "todo4" }, - { title: "车牌类型", dataIndex: "todo5" }, - { title: "车辆类型", dataIndex: "todo6" }, - { title: "违规次数", dataIndex: "todo7" }, + { title: "车辆所属单位", dataIndex: "vehicleCorpName" }, + { title: "车辆所属部门", dataIndex: "vehicleDepartmentName" }, + { title: "车辆归属人", dataIndex: "employeeVehicleUserName" }, + { title: "车牌号", dataIndex: "licenceNo" }, + { title: "车牌类型", dataIndex: "licenceTypeName" }, + { title: "车辆类型", dataIndex: "vehicleTypeName" }, + { title: "违规次数", dataIndex: "violationCount" }, { title: "操作", width: 120, @@ -117,10 +119,16 @@ function List(props) { } const AddModalComponent = (props) => { - const [form] = Form.useForm(); + const [form] = FormBuilder.useForm(); + const { loading: uploadFileLoading, uploadFile } = useUploadFile(); const onSubmit = async (values) => { - const { success } = await props["vehiclesViolationAdd"]({ ...values }); + const { id: illegalImagesId } = await uploadFile({ + single: false, + files: values.illegalImages, + params: { foreignKey: "", type: UPLOAD_FILE_TYPE_ENUM[607] }, + }); + const { success } = await props["vehiclesViolationAdd"]({ ...values, illegalImagesId }); if (success) { message.success("操作成功"); props.onCancel(); @@ -136,29 +144,59 @@ const AddModalComponent = (props) => { maskClosable={false} onCancel={props.onCancel} onOk={form.submit} - confirmLoading={props.vehiclesViolation.vehiclesViolationLoading} + confirmLoading={props.vehiclesViolation.vehiclesViolationLoading || uploadFileLoading} > ) }, - { name: "todo3", label: "车辆类型", render: () }, - { name: "todo4", label: "违规时间", render: FORM_ITEM_RENDER_ENUM.DATETIME }, - { name: "todo5", label: "违规类型", render: () }, + { name: "licenceNo", label: "车牌号", rules: [{ pattern: LICENSE_PLATE_NUMBER, message: "请输入正确的车牌号" }] }, { - name: "todo6", + name: "licenceType", + label: "车牌类型", + render: ( + form.setFieldValue("licenceTypeName", label)} + /> + ), + }, + { name: "licenceTypeName", label: "车牌类型名称", onlyForLabel: true }, + { + name: "vehicleType", + label: "车辆类型", + render: ( + form.setFieldValue("vehicleTypeName", label)} + /> + ), + }, + { name: "vehicleTypeName", label: "车辆类型名称", onlyForLabel: true }, + { name: "violationtime", label: "违规时间", render: FORM_ITEM_RENDER_ENUM.DATETIME }, + { + name: "violationType", + label: "违规类型", + render: ( + form.setFieldValue("violationTypeName", label)} + /> + ), + }, + { name: "violationTypeName", label: "违规类型名称", onlyForLabel: true }, + { + name: "location", label: "违规区域", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, placeholder: "违规区域需明确车辆在港口内的具体违规位置如某一口门附近、某一码头区域、某一仓库通道等..", }, - { name: "todo7", label: "违规照片", render: () }, - { name: "todo8", label: " 违规说明", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false }, + { name: "illegalImages", label: "违规照片", render: () }, + { name: "describeMessage", label: " 违规说明", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false }, ]} /> diff --git a/src/pages/Container/Supervision/FirstLevelDoor/ImportAndExportPortInfo/VehiclesViolation/VehiclesViolation/ViolationRecords/index.js b/src/pages/Container/Supervision/FirstLevelDoor/ImportAndExportPortInfo/VehiclesViolation/VehiclesViolation/ViolationRecords/index.js index d6f2cb6..1d928b7 100644 --- a/src/pages/Container/Supervision/FirstLevelDoor/ImportAndExportPortInfo/VehiclesViolation/VehiclesViolation/ViolationRecords/index.js +++ b/src/pages/Container/Supervision/FirstLevelDoor/ImportAndExportPortInfo/VehiclesViolation/VehiclesViolation/ViolationRecords/index.js @@ -1,11 +1,13 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; -import { Button, Descriptions, Form, message, Modal, Space } from "antd"; +import { Button, Descriptions, message, Modal, Space } from "antd"; import { useEffect, useState } from "react"; import Page from "zy-react-library/components/Page"; import PreviewImg from "zy-react-library/components/PreviewImg"; import Search from "zy-react-library/components/Search"; import DictionarySelect from "zy-react-library/components/Select/Dictionary"; import Table from "zy-react-library/components/Table"; +import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; +import useGetFile from "zy-react-library/hooks/useGetFile"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useTable from "zy-react-library/hooks/useTable"; import { NS_VEHICLES_VIOLATION } from "~/enumerate/namespace"; @@ -15,10 +17,10 @@ function ViolationRecords(props) { const [currentId, setCurrentId] = useState(""); const query = useGetUrlQuery(); - const [form] = Form.useForm(); + const [form] = Search.useForm(); const { tableProps, getData } = useTable(props["vehiclesViolationViolationRecordsList"], { form, - params: { id: query.id }, + params: { vehicleId: query.id }, }); const onDelete = (id) => { @@ -39,7 +41,7 @@ function ViolationRecords(props) { ) }, + { name: "violationType", label: "违规类型", render: () }, ]} labelCol={{ span: 4 }} form={form} @@ -47,11 +49,11 @@ function ViolationRecords(props) { /> { const [info, setInfo] = useState({}); + const { loading: getFileLoading, getFile } = useGetFile(); + const getData = async () => { const { data } = await props["vehiclesViolationViolationRecordsInfo"]({ id: props.id }); - setInfo(data); + const illegalImages = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[607], eqForeignKey: data.illegalImagesId }); + setInfo({ + ...data, + illegalImages, + }); }; useEffect(() => { @@ -110,7 +118,7 @@ const InfoModalComponent = (props) => { return ( { column={1} styles={{ label: { width: 200 } }} items={[ - { label: "车辆所属单位", children: info.todo1 }, - { label: "车辆所属部门", children: info.todo2 }, - { label: "车辆归属人", children: info.todo3 }, - { label: "车牌号", children: info.todo4 }, - { label: "违规类型", children: info.todo5 }, - { label: "违规时间", children: info.todo6 }, - { label: "违规区域", children: info.todo7 }, - { label: "违规照片", children: () }, - { label: "违规说明", children: info.todo9 }, + { label: "车辆所属单位", children: info.vehicleCorpName }, + { label: "车辆所属部门", children: info.vehicleDepartmentName }, + { label: "车辆归属人", children: info.employeeVehicleUserName }, + { label: "车牌号", children: info.licenceNo }, + { label: "违规类型", children: info.violationTypeName }, + { label: "违规时间", children: info.violationtime }, + { label: "违规区域", children: info.location }, + { label: "违规照片", children: () }, + { label: "违规说明", children: info.describeMessage }, ]} /> diff --git a/src/pages/Container/Supervision/FirstLevelDoor/PortEntryApproval/LongTermVehicleApproval/RelatedVehicles/index.js b/src/pages/Container/Supervision/FirstLevelDoor/PortEntryApproval/LongTermVehicleApproval/RelatedVehicles/index.js index 81847c0..783e5e5 100644 --- a/src/pages/Container/Supervision/FirstLevelDoor/PortEntryApproval/LongTermVehicleApproval/RelatedVehicles/index.js +++ b/src/pages/Container/Supervision/FirstLevelDoor/PortEntryApproval/LongTermVehicleApproval/RelatedVehicles/index.js @@ -248,15 +248,14 @@ const InfoModalComponent = (props) => { const getData = async () => { const { data } = await props["vehicleAuditInfo"]({ id: props.id }); - const drivingLicenseFile = await getFile({ - eqType: UPLOAD_FILE_TYPE_ENUM[601], - eqForeignKey: data.drivingLicenseId, - }); + const drivingLicenseFile = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[601], eqForeignKey: data.drivingLicenseId }); const attachmentFile = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[602], eqForeignKey: data.attachmentId }); + const informSignFile = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[606], eqForeignKey: data.informSignId }); setInfo({ ...data, drivingLicenseFile, attachmentFile, + informSignFile, }); }; @@ -284,7 +283,7 @@ const InfoModalComponent = (props) => { { label: "审核状态", children: getLabelName({ list: VEHICLE_AUDIT_STATUS_ENUM, status: info.auditStatus }) }, { label: "车辆照片", children: () }, { label: "车辆行驶证照片", children: () }, - { label: "申请人签字", children: () }, // todo + { label: "申请人签字", children: () }, ]} />